From e5776f55eec901d7d12afb31ea7903e054073d9a Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Thu, 24 Jan 2019 10:49:16 -0800 Subject: [PATCH] Add skhdrc --- .skhdrc | 416 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100644 .skhdrc diff --git a/.skhdrc b/.skhdrc new file mode 100644 index 0000000..735b9ff --- /dev/null +++ b/.skhdrc @@ -0,0 +1,416 @@ +#### Default contents preserved for future reading +#### # NOTE(koekeishiya): A list of all built-in modifier and literal keywords can +#### # be found at https://github.com/koekeishiya/skhd/issues/1 +#### # +#### # A hotkey is written according to the following rules: +#### # +#### # hotkey = '<' | +#### # +#### # mode = 'name of mode' | ',' +#### # +#### # action = '[' ']' | '->' '[' ']' +#### # ':' | '->' ':' +#### # ';' | '->' ';' +#### # +#### # keysym = '-' | +#### # +#### # mod = 'modifier keyword' | '+' +#### # +#### # key = | +#### # +#### # literal = 'single letter or built-in keyword' +#### # +#### # keycode = 'apple keyboard kVK_ values (0x3C)' +#### # +#### # proc_map_lst = * +#### # +#### # proc_map = ':' +#### # +#### # string = '"' 'sequence of characters' '"' +#### # +#### # command = command is executed through '$SHELL -c' and +#### # follows valid shell syntax. if the $SHELL environment +#### # variable is not set, it will default to '/bin/bash'. +#### # when bash is used, the ';' delimeter can be specified +#### # to chain commands. +#### # +#### # to allow a command to extend into multiple lines, +#### # prepend '\' at the end of the previous line. +#### # +#### # an EOL character signifies the end of the bind. +#### # +#### # -> = keypress is not consumed by skhd +#### # +#### # NOTE(koekeishiya): A mode is declared according to the following rules: +#### # +#### # mode_decl = '::' '@' ':' | '::' ':' | +#### # '::' '@' | '::' +#### # +#### # name = desired name for this mode, +#### # +#### # @ = capture keypresses regardless of being bound to an action +#### # +#### # command = command is executed through '$SHELL -c' and +#### # follows valid shell syntax. if the $SHELL environment +#### # variable is not set, it will default to '/bin/bash'. +#### # when bash is used, the ';' delimeter can be specified +#### # to chain commands. +#### # +#### # to allow a command to extend into multiple lines, +#### # prepend '\' at the end of the previous line. +#### # +#### # an EOL character signifies the end of the bind. +#### +#### # add an on_enter command to the default mode +#### # :: default : chunkc border::color 0xff775759 +#### # +#### # defines a new mode 'test' with an on_enter command, that captures keypresses +#### # :: test @ : chunkc border::color 0xff24ccaa +#### # +#### # from 'default' mode, activate mode 'test' +#### # cmd - x ; test +#### # +#### # from 'test' mode, activate mode 'default' +#### # test < cmd - x ; default +#### # +#### # launch a new terminal instance when in either 'default' or 'test' mode +#### # default, test < cmd - return : open -na /Applications/Terminal.app +#### +#### # application specific bindings +#### # +#### # cmd - n [ +#### # "kitty" : echo "hello kitty" +#### # "qutebrowser" : echo "hello qutebrowser" +#### # "finder" : false +#### # ] +#### +#### # open terminal, blazingly fast compared to iTerm/Hyper +#### cmd - return : /Applications/Kitty.app/Contents/MacOS/kitty --single-instance -d ~ +#### +#### # open qutebrowser +#### cmd + shift - return : ~/Scripts/qtb.sh +#### +#### # open mpv +#### cmd - m : open -na /Applications/mpv.app $(pbpaste) +#### +#### # close focused window +#### alt - w : chunkc tiling::window --close +#### +#### # focus window +#### alt - h : chunkc tiling::window --focus west +#### alt - j : chunkc tiling::window --focus south +#### alt - k : chunkc tiling::window --focus north +#### alt - l : chunkc tiling::window --focus east +#### +#### cmd - j : chunkc tiling::window --focus prev +#### cmd - k : chunkc tiling::window --focus next +#### +#### # equalize size of windows +#### shift + alt - 0 : chunkc tiling::desktop --equalize +#### +#### # swap window +#### shift + alt - h : chunkc tiling::window --swap west +#### shift + alt - j : chunkc tiling::window --swap south +#### shift + alt - k : chunkc tiling::window --swap north +#### shift + alt - l : chunkc tiling::window --swap east +#### +#### # move window +#### shift + cmd - h : chunkc tiling::window --warp west +#### shift + cmd - j : chunkc tiling::window --warp south +#### shift + cmd - k : chunkc tiling::window --warp north +#### shift + cmd - l : chunkc tiling::window --warp east +#### +#### # make floating window fill screen +#### shift + alt - up : chunkc tiling::window --grid-layout 1:1:0:0:1:1 +#### +#### # make floating window fill left-half of screen +#### shift + alt - left : chunkc tiling::window --grid-layout 1:2:0:0:1:1 +#### +#### # make floating window fill right-half of screen +#### shift + alt - right : chunkc tiling::window --grid-layout 1:2:1:0:1:1 +#### +#### # create desktop, move window and follow focus +#### shift + cmd - n : chunkc tiling::desktop --create;\ +#### id=$(chunkc tiling::query --desktops-for-monitor $(chunkc tiling::query --monitor-for-desktop $(chunkc tiling::query --desktop id)));\ +#### chunkc tiling::window --send-to-desktop $(echo ${id##* });\ +#### chunkc tiling::desktop --focus $(echo ${id##* }) +#### +#### # create desktop and follow focus +#### cmd + alt - n : chunkc tiling::desktop --create;\ +#### id=$(chunkc tiling::query --desktops-for-monitor $(chunkc tiling::query --monitor-for-desktop $(chunkc tiling::query --desktop id)));\ +#### chunkc tiling::desktop --focus $(echo ${id##* }) +#### # destroy desktop +#### cmd + alt - w : chunkc tiling::desktop --annihilate +#### +#### # fast focus desktop +#### cmd + alt - x : chunkc tiling::desktop --focus $(chunkc get _last_active_desktop) +#### cmd + alt - z : chunkc tiling::desktop --focus prev +#### cmd + alt - c : chunkc tiling::desktop --focus next +#### cmd + alt - 1 : chunkc tiling::desktop --focus 1 +#### cmd + alt - 2 : chunkc tiling::desktop --focus 2 +#### cmd + alt - 3 : chunkc tiling::desktop --focus 3 +#### cmd + alt - 4 : chunkc tiling::desktop --focus 4 +#### cmd + alt - 5 : chunkc tiling::desktop --focus 5 +#### cmd + alt - 6 : chunkc tiling::desktop --focus 6 +#### # cmd + alt - 7 : chunkc tiling::desktop --focus 7 +#### +#### # send window to desktop +#### shift + alt - x : chunkc tiling::window --send-to-desktop $(chunkc get _last_active_desktop) +#### shift + alt - z : chunkc tiling::window --send-to-desktop prev +#### shift + alt - c : chunkc tiling::window --send-to-desktop next +#### shift + alt - 1 : chunkc tiling::window --send-to-desktop 1 +#### shift + alt - 2 : chunkc tiling::window --send-to-desktop 2 +#### shift + alt - 3 : chunkc tiling::window --send-to-desktop 3 +#### shift + alt - 4 : chunkc tiling::window --send-to-desktop 4 +#### shift + alt - 5 : chunkc tiling::window --send-to-desktop 5 +#### shift + alt - 6 : chunkc tiling::window --send-to-desktop 6 +#### # shift + alt - 7 : chunkc tiling::window --send-to-desktop 7 +#### +#### # send window to desktop and follow focus +#### shift + cmd - x : chunkc tiling::window --send-to-desktop $(chunkc get _last_active_desktop); chunkc tiling::desktop --focus $(chunkc get _last_active_desktop) +#### shift + cmd - z : chunkc tiling::window --send-to-desktop prev; chunkc tiling::desktop --focus prev +#### shift + cmd - c : chunkc tiling::window --send-to-desktop next; chunkc tiling::desktop --focus next +#### shift + cmd - 1 : chunkc tiling::window --send-to-desktop 1; chunkc tiling::desktop --focus 1 +#### shift + cmd - 2 : chunkc tiling::window --send-to-desktop 2; chunkc tiling::desktop --focus 2 +#### shift + cmd - 3 : chunkc tiling::window --send-to-desktop 3; chunkc tiling::desktop --focus 3 +#### shift + cmd - 4 : chunkc tiling::window --send-to-desktop 4; chunkc tiling::desktop --focus 4 +#### shift + cmd - 5 : chunkc tiling::window --send-to-desktop 5; chunkc tiling::desktop --focus 5 +#### shift + cmd - 6 : chunkc tiling::window --send-to-desktop 6; chunkc tiling::desktop --focus 6 +#### # shift + cmd - 7 : chunkc tiling::window --send-to-desktop 7; chunkc tiling::desktop --focus 7 +#### +#### # focus monitor +#### ctrl + alt - z : chunkc tiling::monitor -f prev +#### ctrl + alt - c : chunkc tiling::monitor -f next +#### ctrl + alt - 1 : chunkc tiling::monitor -f 1 +#### ctrl + alt - 2 : chunkc tiling::monitor -f 2 +#### ctrl + alt - 3 : chunkc tiling::monitor -f 3 +#### +#### # send window to monitor and follow focus +#### ctrl + cmd - z : chunkc tiling::window --send-to-monitor prev; chunkc tiling::monitor -f prev +#### ctrl + cmd - c : chunkc tiling::window --send-to-monitor next; chunkc tiling::monitor -f next +#### ctrl + cmd - 1 : chunkc tiling::window --send-to-monitor 1; chunkc tiling::monitor -f 1 +#### ctrl + cmd - 2 : chunkc tiling::window --send-to-monitor 2; chunkc tiling::monitor -f 2 +#### ctrl + cmd - 3 : chunkc tiling::window --send-to-monitor 3; chunkc tiling::monitor -f 3 +#### +#### # increase region size +#### shift + alt - a : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge west +#### shift + alt - s : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge south +#### shift + alt - w : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge north +#### shift + alt - d : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge east +#### +#### # decrease region size +#### shift + cmd - a : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge west +#### shift + cmd - s : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge south +#### shift + cmd - w : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge north +#### shift + cmd - d : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge east +#### +#### # set insertion point for focused container +#### ctrl + alt - f : chunkc tiling::window --use-insertion-point cancel +#### ctrl + alt - h : chunkc tiling::window --use-insertion-point west +#### ctrl + alt - j : chunkc tiling::window --use-insertion-point south +#### ctrl + alt - k : chunkc tiling::window --use-insertion-point north +#### ctrl + alt - l : chunkc tiling::window --use-insertion-point east +#### +#### # rotate tree +#### alt - r : chunkc tiling::desktop --rotate 90 +#### +#### # mirror tree y-axis +#### alt - y : chunkc tiling::desktop --mirror vertical +#### +#### # mirror tree x-axis +#### alt - x : chunkc tiling::desktop --mirror horizontal +#### +#### # toggle desktop offset +#### alt - a : chunkc tiling::desktop --toggle offset +#### +#### # toggle window fullscreen +#### alt - f : chunkc tiling::window --toggle fullscreen +#### +#### # toggle window native fullscreen +#### shift + alt - f : chunkc tiling::window --toggle native-fullscreen +#### +#### # toggle window parent zoom +#### alt - d : chunkc tiling::window --toggle parent +#### +#### # toggle window split type +#### alt - e : chunkc tiling::window --toggle split +#### +#### # toggle window fade +#### alt - q : chunkc tiling::window --toggle fade +#### +#### # float / unfloat window and center on screen +#### alt - t : chunkc tiling::window --toggle float;\ +#### chunkc tiling::window --grid-layout 4:4:1:1:2:2 +#### +#### # toggle sticky +#### alt - s : chunkc tiling::window --toggle sticky +#### +#### # toggle sticky, float and resize to picture-in-picture size +#### alt - p : chunkc tiling::window --toggle sticky;\ +#### chunkc tiling::window --grid-layout 5:5:4:0:1:1 +#### +#### # float next window to be tiled +#### shift + alt - t : chunkc set window_float_next 1 +#### +#### # change layout of desktop +#### ctrl + alt - a : chunkc tiling::desktop --layout bsp +#### ctrl + alt - s : chunkc tiling::desktop --layout monocle +#### ctrl + alt - d : chunkc tiling::desktop --layout float +#### +#### ctrl + alt - w : chunkc tiling::desktop --deserialize ~/.chunkwm_layouts/dev_1 + +# set border color for different modes +:: default : chunkc border::color 0xddbdd322 +:: switcher @ : chunkc border::color 0xddd5c4a1 +:: ytd @ : chunkc border::color 0xddd75f5f +:: swap @ : chunkc border::color 0xdd458588 +:: tree @ : chunkc border::color 0xddfabd2f +:: spacey @ : chunkc border::color 0xddb16286 +:: info @ : chunkc border::color 0xddcd950c + + +# 0x2A is \ +# toggle between modes +ctrl - 0x2A ; switcher +switcher < ctrl - 0x2A ; default +ytd < ctrl - 0x2A ; default +swap < ctrl - 0x2A ; default +spacey < ctrl - 0x2A ; default +tree < ctrl - 0x2A ; default +info < ctrl - 0x2A ; default + +switcher < y ; ytd +switcher < m ; swap +switcher < s ; spacey +switcher < t ; tree +switcher < i ; info + +cmd - return : osascript /Users/hunner/local/bin/terminal.scpt +cmd + ctrl + alt - 9 : osascript /Users/hunner/local/bin/grayscale.scpt + +cmd + alt - h : chunkc tiling::window --focus west +cmd + alt - j : chunkc tiling::window --focus south +cmd + alt - k : chunkc tiling::window --focus north +cmd + alt - l : chunkc tiling::window --focus east + +ctrl + shift - 1 : chunkc tiling::window --send-to-desktop 1 +ctrl + shift - 2 : chunkc tiling::window --send-to-desktop 2 +ctrl + shift - 3 : chunkc tiling::window --send-to-desktop 3 +ctrl + shift - 4 : chunkc tiling::window --send-to-desktop 4 +ctrl + shift - 5 : chunkc tiling::window --send-to-desktop 5 +ctrl + shift - 6 : chunkc tiling::window --send-to-desktop 6 +ctrl + shift - 7 : chunkc tiling::window --send-to-desktop 7 +ctrl + shift - 8 : chunkc tiling::window --send-to-desktop 8 +ctrl + shift - 9 : chunkc tiling::window --send-to-desktop 9 +ctrl + shift - 0 : chunkc tiling::window --send-to-desktop 10 +ctrl + shift + alt - 1 : chunkc tiling::window --send-to-desktop 11 +ctrl + shift + alt - 2 : chunkc tiling::window --send-to-desktop 12 +ctrl + shift + alt - 3 : chunkc tiling::window --send-to-desktop 13 +ctrl + shift + alt - 4 : chunkc tiling::window --send-to-desktop 14 +ctrl + shift + alt - 5 : chunkc tiling::window --send-to-desktop 15 +ctrl + shift + alt - 6 : chunkc tiling::window --send-to-desktop 16 + +# Focus display +switcher < 1 : chunkc tiling::monitor -f 1 #; khd -e "mode activate default" +switcher < 2 : chunkc tiling::monitor -f 2 #; khd -e "mode activate default" +switcher < 3 : chunkc tiling::monitor -f 3 #; khd -e "mode activate default" + +# Move window to display +swap < shift - 1 : chunkc tiling::window --send-to-monitor 1 #; khd -e "mode activate default" +swap < shift - 2 : chunkc tiling::window --send-to-monitor 2 #; khd -e "mode activate default" +swap < shift - 3 : chunkc tiling::window --send-to-monitor 3 #; khd -e "mode activate default" + +## ytd mode +#ytd - x : ytc play;\ +# khd -e "mode activate default" +# +#ytd - s : ytc mkfav;\ +# khd -e "mode activate default" +# +## 0x32 == < +#ytd - 0x32 : ytc fav +#ytd - z : ytc prev +#ytd - c : ytc next +#ytd - v : ytc stop +#ytd - a : ytc volup +#ytd - d : ytc voldown +#ytd - right : ytc seekfw +#ytd - left : ytc seekbk + +# Swap windows around +swap < h : chunkc tiling::window --swap west +swap < j : chunkc tiling::window --swap south +swap < k : chunkc tiling::window --swap north +swap < l : chunkc tiling::window --swap east + +# Move windows around +swap < shift - h : chunkc tiling::window --warp west +swap < shift - j : chunkc tiling::window --warp south +swap < shift - k : chunkc tiling::window --warp north +swap < shift - l : chunkc tiling::window --warp east + +# toggle window float +swap < t : chunkc tiling::window --toggle float + +# toggle window native fullscreen +swap < f : chunkc tiling::window --toggle native-fullscreen + +# toggle sticky, float and resize to picture-in-picture size +swap < s : chunkc tiling::window --toggle sticky;\ + chunkc tiling::window --warp-floating pip-right + +# Change spacey mode +spacey < a : chunkc tiling::desktop --layout bsp +spacey < s : chunkc tiling::desktop --layout monocle +spacey < d : chunkc tiling::desktop --layout float + +# Change padding +spacey < p : chunkc tiling::desktop --padding inc +spacey < shift - p : chunkc tiling::desktop --padding dec + +# Change gap +spacey < g : chunkc tiling::desktop --gap inc +spacey < shift - g : chunkc tiling::desktop --gap dec + +spacey < shift - x : kwmc spacey -g decrease horizontal +spacey < shift - y : kwmc spacey -g decrease vertical + +# Increase window padding +spacey < h : chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge west +spacey < j : chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge south +spacey < k : chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge south +spacey < l : chunkc tiling::window --use-temporary-ratio 0.05 --adjust-window-edge south + +# Decrease window padding +spacey < shift - h : chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge west +spacey < shift - j : chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge south +spacey < shift - k : chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge south +spacey < shift - l : chunkc tiling::window --use-temporary-ratio -0.05 --adjust-window-edge south + + +# tree mode +tree < f : kwmc window -z fullscreen +tree < d : kwmc window -z parent +tree < w : kwmc window -t focused +tree < r : kwmc tree rotate 90 + +tree < s : kwmc window -c split - mode toggle;\ + khd -e "mode activate default" + +tree < c : kwmc window -c type toggle;\ + khd -e "mode activate default" + +tree < h : kwmc window -c expand 0.05 west +tree < j : kwmc window -c expand 0.05 south +tree < k : kwmc window -c expand 0.05 north +tree < l : kwmc window -c expand 0.05 east +tree < shift - h : kwmc window -c reduce 0.05 west +tree < shift - j : kwmc window -c reduce 0.05 south +tree < shift - k : kwmc window -c reduce 0.05 north +tree < shift - l : kwmc window -c reduce 0.05 east + +tree < p : kwmc tree -pseudo create +tree < shift - p : kwmc tree -pseudo destroy + +tree < o : kwmc window -s prev +tree < shift - o : kwmc window -s next