diff options
-rw-r--r-- | X11/openbox/rc.xml | 10 | ||||
-rw-r--r-- | alias | 74 |
2 files changed, 45 insertions, 39 deletions
diff --git a/X11/openbox/rc.xml b/X11/openbox/rc.xml index eb85522..d1bf693 100644 --- a/X11/openbox/rc.xml +++ b/X11/openbox/rc.xml | |||
@@ -474,11 +474,21 @@ | |||
474 | <command>brightness --inc</command> | 474 | <command>brightness --inc</command> |
475 | </action> | 475 | </action> |
476 | </keybind> | 476 | </keybind> |
477 | <keybind key="S-XF86MonBrightnessUp"> | ||
478 | <action name="Execute"> | ||
479 | <command>brightness --inc 1</command> | ||
480 | </action> | ||
481 | </keybind> | ||
477 | <keybind key="XF86MonBrightnessDown"> | 482 | <keybind key="XF86MonBrightnessDown"> |
478 | <action name="Execute"> | 483 | <action name="Execute"> |
479 | <command>brightness --dec</command> | 484 | <command>brightness --dec</command> |
480 | </action> | 485 | </action> |
481 | </keybind> | 486 | </keybind> |
487 | <keybind key="S-XF86MonBrightnessDown"> | ||
488 | <action name="Execute"> | ||
489 | <command>brightness --dec 1</command> | ||
490 | </action> | ||
491 | </keybind> | ||
482 | <!-- Screenshot Keys --> | 492 | <!-- Screenshot Keys --> |
483 | <keybind key="Print"> | 493 | <keybind key="Print"> |
484 | <action name="Execute"> | 494 | <action name="Execute"> |
@@ -180,7 +180,10 @@ date.reset() { | |||
180 | sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" | 180 | sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" |
181 | } | 181 | } |
182 | alias clock.reset='hwclock --systohc' | 182 | alias clock.reset='hwclock --systohc' |
183 | 183 | gr() { | |
184 | grep -IR $1 . | ||
185 | } | ||
186 | alias findn='find . -iname' | ||
184 | 187 | ||
185 | # pacman | 188 | # pacman |
186 | alias pac='sudo pacman -S' # pacman install | 189 | alias pac='sudo pacman -S' # pacman install |
@@ -222,9 +225,6 @@ alias cdP='cd ~/Pictures' | |||
222 | alias cdpu='cd ~/public' | 225 | alias cdpu='cd ~/public' |
223 | alias cdV='cd ~/Videos' | 226 | alias cdV='cd ~/Videos' |
224 | alias cdM='cd ~/Music' | 227 | alias cdM='cd ~/Music' |
225 | alias cdmn='cd ~/git/maplibre-native/' | ||
226 | alias cdmj='cd ~/git/maplibre-gl-js/' | ||
227 | alias cdmx='cd ~/git/mapbox-gl-js/' | ||
228 | 228 | ||
229 | # blog | 229 | # blog |
230 | alias cdb='cd ~/blog' | 230 | alias cdb='cd ~/blog' |
@@ -423,15 +423,29 @@ alias xii='`fc -ln -1` | head -1 | xsel -ib' | |||
423 | alias xo='xsel -ob' | 423 | alias xo='xsel -ob' |
424 | alias xl='history | tail -1 | grep -oP "^\s*[0-9]+\s\s\K.*" | xsel -ib && echo Copied to clipboard && xsel -ob' | 424 | alias xl='history | tail -1 | grep -oP "^\s*[0-9]+\s\s\K.*" | xsel -ib && echo Copied to clipboard && xsel -ob' |
425 | 425 | ||
426 | # Text Encode/Decode | ||
427 | big52utf8() { | ||
428 | iconv -f BIG-5 -t UTF-8 | ||
429 | } | ||
430 | utf82big5() { | ||
431 | iconv -t BIG-5 -f UTF-8 | ||
432 | } | ||
433 | urlencode() { | ||
434 | perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg' | ||
435 | # Alternative: | ||
436 | # curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | ||
437 | } | ||
438 | |||
439 | # Network | ||
440 | alias p8='ping -c 3 8.8.8.8' | ||
441 | alias curl.google='curl -v google.com' | ||
442 | alias curl.wifi='curl -I google.com | grep -E "^Location:" | cut -d" " -f2 | xsel -ib' | ||
443 | |||
426 | # misc | 444 | # misc |
427 | alias foo='echo bar > foo && echo File foo is created && ls -lh foo' | 445 | alias foo='echo bar > foo && echo File foo is created && ls -lh foo' |
428 | alias bar='echo foo > bar && echo File bar is created && ls -lh bar' | 446 | alias bar='echo foo > bar && echo File bar is created && ls -lh bar' |
429 | unalias gr &>/dev/null | 447 | unalias gr &>/dev/null |
430 | gr() { | ||
431 | grep -IR $1 . | ||
432 | } | ||
433 | alias wcl='wc -l' | 448 | alias wcl='wc -l' |
434 | alias findn='find . -iname' | ||
435 | alias x='xdg-open' | 449 | alias x='xdg-open' |
436 | alias yl='youtube-dl' | 450 | alias yl='youtube-dl' |
437 | alias yla='youtube-dl -x --audio-format mp3' | 451 | alias yla='youtube-dl -x --audio-format mp3' |
@@ -442,34 +456,18 @@ alias editor='select-editor' | |||
442 | alias hp='http-prompt' | 456 | alias hp='http-prompt' |
443 | alias clocg='cloc --vcs=git' | 457 | alias clocg='cloc --vcs=git' |
444 | alias tma='tmux a' | 458 | alias tma='tmux a' |
445 | alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' | ||
446 | alias we='weechat' | ||
447 | alias p8='ping -c 3 8.8.8.8' | ||
448 | alias curl.google='curl -v google.com' | ||
449 | alias curl.wifi='curl -I google.com | grep -E "^Location:" | cut -d" " -f2 | xsel -ib' | ||
450 | pbf() { | 459 | pbf() { |
451 | protoc --decode_raw | 460 | protoc --decode_raw |
452 | } | 461 | } |
453 | mvt.decode() { | 462 | mvt.decode() { |
454 | if [[ ! -t 0 ]]; then | 463 | if [[ ! -t 0 ]]; then |
455 | tmp=$(mktemp) | ||
456 | cat >$tmp | 464 | cat >$tmp |
465 | tmp=$(mktemp) | ||
457 | else | 466 | else |
458 | tmp=$1 | 467 | tmp=$1 |
459 | fi | 468 | fi |
460 | mvt_decode.py $tmp | tr \' \" | sed 's/True/true/g' | jq . | 469 | mvt_decode.py $tmp | tr \' \" | sed 's/True/true/g' | jq . |
461 | } | 470 | } |
462 | big52utf8() { | ||
463 | iconv -f BIG-5 -t UTF-8 | ||
464 | } | ||
465 | utf82big5() { | ||
466 | iconv -t BIG-5 -f UTF-8 | ||
467 | } | ||
468 | urlencode() { | ||
469 | perl -lpe 's/([^A-Za-z0-9.\/:])/sprintf("%%%02X", ord($1))/seg' | ||
470 | # Alternative: | ||
471 | # curl -Gso /dev/null -w %{url_effective} --data-urlencode @- "" | ||
472 | } | ||
473 | bak() { | 471 | bak() { |
474 | cp $1 $1.bak | 472 | cp $1 $1.bak |
475 | } | 473 | } |
@@ -480,8 +478,8 @@ alias ge='graph-easy --boxart' | |||
480 | 478 | ||
481 | # pass | 479 | # pass |
482 | alias chp='tig -C ~/.password-store' | 480 | alias chp='tig -C ~/.password-store' |
483 | alias cdpass='cd ~/.password-store' | ||
484 | alias chpass='tig -C ~/.password-store' | 481 | alias chpass='tig -C ~/.password-store' |
482 | alias cdpass='cd ~/.password-store' | ||
485 | alias p='pass' | 483 | alias p='pass' |
486 | alias pc='pass -c' | 484 | alias pc='pass -c' |
487 | alias pe='pass edit' | 485 | alias pe='pass edit' |
@@ -496,22 +494,10 @@ alias vgx='sudo vim /etc/nginx/sites-enabled/vps && sudo nginx -t && sudo system | |||
496 | alias cdngx='cd /etc/nginx' | 494 | alias cdngx='cd /etc/nginx' |
497 | 495 | ||
498 | # tmp | 496 | # tmp |
499 | alias cdS='cd ~/git/StreetComplete' | ||
500 | alias cdm='cd ~/git/mapclay' | ||
501 | alias cdma='cd ~/git/mapstew-android' | ||
502 | alias cdT='cd ~/git/tilemaker' | ||
503 | alias stew='cd ~/git/mapstew' | 497 | alias stew='cd ~/git/mapstew' |
504 | alias vc='vultr-cli' | 498 | alias vc='vultr-cli' |
505 | alias xkb='cd $SETTING_DIR && make xkb' | 499 | alias xkb='cd $SETTING_DIR && make xkb' |
506 | alias thsr='curl -L google.com >/tmp/foo.html && xdg-open /tmp/foo.html' | 500 | alias thsr='curl -L google.com >/tmp/foo.html && xdg-open /tmp/foo.html' |
507 | #hugo(){ | ||
508 | # docker run --rm \ | ||
509 | # -u `id -u`:`id -g` \ | ||
510 | # -v `pwd`:/src \ | ||
511 | # $EXTRA \ | ||
512 | # klakegg/hugo \ | ||
513 | # $@ | ||
514 | #} | ||
515 | todo() { cd ~/log && grep -R ' TODO ' --exclude-dir=logseq/; } | 501 | todo() { cd ~/log && grep -R ' TODO ' --exclude-dir=logseq/; } |
516 | fix() { which $1 && grep -Po 'FIXME.*' $(which $1); } | 502 | fix() { which $1 && grep -Po 'FIXME.*' $(which $1); } |
517 | alias ffmpeg='ffmpeg -hide_banner' | 503 | alias ffmpeg='ffmpeg -hide_banner' |
@@ -519,8 +505,18 @@ alias md='reveal' | |||
519 | alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}' | 505 | alias terminal.color='printf "\e[%dm%d dark\e[0m \e[%d;1m%d bold\e[0m\n" {30..37}{,,,}' |
520 | alias gpg.bye='gpg-connect-agent reloadagent /bye' | 506 | alias gpg.bye='gpg-connect-agent reloadagent /bye' |
521 | 507 | ||
522 | 508 | # GIS | |
523 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' | 509 | TAIWAN_BBOX='118.1036,20.72799,122.9312,26.60305' |
524 | TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312' | 510 | TAIWAN_BBOX_V='20.72799,118.1036,26.60305,122.9312' |
525 | TAIPEI_BBOX='121.346,24.926,121.676,25.209' | 511 | TAIPEI_BBOX='121.346,24.926,121.676,25.209' |
526 | TAIPEI_BBOX_V='24.926,121.346,25.209,121.676' | 512 | TAIPEI_BBOX_V='24.926,121.346,25.209,121.676' |
513 | |||
514 | # Comment out | ||
515 | #alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' | ||
516 | #alias we='weechat' | ||
517 | |||
518 | LOCAL_ALIAS=~/.config/local.alias | ||
519 | alias allo="$EDITOR $LOCAL_ALIAS && source $LOCAL_ALIAS" | ||
520 | if [ -e $LOCAL_ALIAS ]; then | ||
521 | source $LOCAL_ALIAS | ||
522 | fi | ||