Commit 3400ca792b
Unregistered key
Layout: unified · split
.config/skhd/skhdrc +150 −1
| @@ -1,5 +1,154 @@ | ||
| 1 | # open terminal | |
| 1 | # ################################################################ # | |
| 2 | # THE FOLLOWING IS AN EXPLANATION OF THE GRAMMAR THAT SKHD PARSES. # | |
| 3 | # FOR SIMPLE EXAMPLE MAPPINGS LOOK FURTHER DOWN THIS FILE.. # | |
| 4 | # ################################################################ # | |
| 5 | ||
| 6 | # A list of all built-in modifier and literal keywords can | |
| 7 | # be found at https://github.com/koekeishiya/skhd/issues/1 | |
| 8 | # | |
| 9 | # A hotkey is written according to the following rules: | |
| 10 | # | |
| 11 | # hotkey = <mode> '<' <action> | <action> | |
| 12 | # | |
| 13 | # mode = 'name of mode' | <mode> ',' <mode> | |
| 14 | # | |
| 15 | # action = <keysym> '[' <proc_map_lst> ']' | <keysym> '->' '[' <proc_map_lst> ']' | |
| 16 | # <keysym> ':' <command> | <keysym> '->' ':' <command> | |
| 17 | # <keysym> ';' <mode> | <keysym> '->' ';' <mode> | |
| 18 | # | |
| 19 | # keysym = <mod> '-' <key> | <key> | |
| 20 | # | |
| 21 | # mod = 'modifier keyword' | <mod> '+' <mod> | |
| 22 | # | |
| 23 | # key = <literal> | <keycode> | |
| 24 | # | |
| 25 | # literal = 'single letter or built-in keyword' | |
| 26 | # | |
| 27 | # keycode = 'apple keyboard kVK_<Key> values (0x3C)' | |
| 28 | # | |
| 29 | # proc_map_lst = * <proc_map> | |
| 30 | # | |
| 31 | # proc_map = <string> ':' <command> | <string> '~' | | |
| 32 | # '*' ':' <command> | '*' '~' | |
| 33 | # | |
| 34 | # string = '"' 'sequence of characters' '"' | |
| 35 | # | |
| 36 | # command = command is executed through '$SHELL -c' and | |
| 37 | # follows valid shell syntax. if the $SHELL environment | |
| 38 | # variable is not set, it will default to '/bin/bash'. | |
| 39 | # when bash is used, the ';' delimeter can be specified | |
| 40 | # to chain commands. | |
| 41 | # | |
| 42 | # to allow a command to extend into multiple lines, | |
| 43 | # prepend '\' at the end of the previous line. | |
| 44 | # | |
| 45 | # an EOL character signifies the end of the bind. | |
| 46 | # | |
| 47 | # -> = keypress is not consumed by skhd | |
| 48 | # | |
| 49 | # * = matches every application not specified in <proc_map_lst> | |
| 50 | # | |
| 51 | # ~ = application is unbound and keypress is forwarded per usual, when specified in a <proc_map> | |
| 52 | # | |
| 53 | # A mode is declared according to the following rules: | |
| 54 | # | |
| 55 | # mode_decl = '::' <name> '@' ':' <command> | '::' <name> ':' <command> | | |
| 56 | # '::' <name> '@' | '::' <name> | |
| 57 | # | |
| 58 | # name = desired name for this mode, | |
| 59 | # | |
| 60 | # @ = capture keypresses regardless of being bound to an action | |
| 61 | # | |
| 62 | # command = command is executed through '$SHELL -c' and | |
| 63 | # follows valid shell syntax. if the $SHELL environment | |
| 64 | # variable is not set, it will default to '/bin/bash'. | |
| 65 | # when bash is used, the ';' delimeter can be specified | |
| 66 | # to chain commands. | |
| 67 | # | |
| 68 | # to allow a command to extend into multiple lines, | |
| 69 | # prepend '\' at the end of the previous line. | |
| 70 | # | |
| 71 | # an EOL character signifies the end of the bind. | |
| 72 | ||
| 73 | # ############################################################### # | |
| 74 | # THE FOLLOWING SECTION CONTAIN SIMPLE MAPPINGS DEMONSTRATING HOW # | |
| 75 | # TO INTERACT WITH THE YABAI WM. THESE ARE SUPPOSED TO BE USED AS # | |
| 76 | # A REFERENCE ONLY, WHEN MAKING YOUR OWN CONFIGURATION.. # | |
| 77 | # ############################################################### # | |
| 78 | ||
| 79 | # focus window | |
| 80 | # alt - h : yabai -m window --focus west | |
| 81 | ||
| 82 | # swap managed window | |
| 83 | # shift + alt - h : yabai -m window --swap north | |
| 84 | ||
| 85 | # move managed window | |
| 86 | # shift + cmd - h : yabai -m window --warp east | |
| 87 | ||
| 88 | # balance size of windows | |
| 89 | # shift + alt - 0 : yabai -m space --balance | |
| 90 | ||
| 91 | # make floating window fill screen | |
| 92 | # shift + alt - up : yabai -m window --grid 1:1:0:0:1:1 | |
| 93 | ||
| 94 | # make floating window fill left-half of screen | |
| 95 | # shift + alt - left : yabai -m window --grid 1:2:0:0:1:1 | |
| 96 | ||
| 97 | # create desktop, move window and follow focus - uses jq for parsing json (brew install jq) | |
| 98 | # shift + cmd - n : yabai -m space --create && \ | |
| 99 | # index="$(yabai -m query --spaces --display | jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \ | |
| 100 | # yabai -m window --space "${index}" && \ | |
| 101 | # yabai -m space --focus "${index}" | |
| 102 | ||
| 103 | # fast focus desktop | |
| 104 | # cmd + alt - x : yabai -m space --focus recent | |
| 105 | # cmd + alt - 1 : yabai -m space --focus 1 | |
| 106 | ||
| 107 | # send window to desktop and follow focus | |
| 108 | # shift + cmd - z : yabai -m window --space next; yabai -m space --focus next | |
| 109 | # shift + cmd - 2 : yabai -m window --space 2; yabai -m space --focus 2 | |
| 110 | ||
| 111 | # focus monitor | |
| 112 | # ctrl + alt - z : yabai -m display --focus prev | |
| 113 | # ctrl + alt - 3 : yabai -m display --focus 3 | |
| 114 | ||
| 115 | # send window to monitor and follow focus | |
| 116 | # ctrl + cmd - c : yabai -m window --display next; yabai -m display --focus next | |
| 117 | # ctrl + cmd - 1 : yabai -m window --display 1; yabai -m display --focus 1 | |
| 118 | ||
| 119 | # move floating window | |
| 120 | # shift + ctrl - a : yabai -m window --move rel:-20:0 | |
| 121 | # shift + ctrl - s : yabai -m window --move rel:0:20 | |
| 122 | ||
| 123 | # increase window size | |
| 124 | # shift + alt - a : yabai -m window --resize left:-20:0 | |
| 125 | # shift + alt - w : yabai -m window --resize top:0:-20 | |
| 126 | ||
| 127 | # decrease window size | |
| 128 | # shift + cmd - s : yabai -m window --resize bottom:0:-20 | |
| 129 | # shift + cmd - w : yabai -m window --resize top:0:20 | |
| 130 | ||
| 131 | # set insertion point in focused container | |
| 132 | # ctrl + alt - h : yabai -m window --insert west | |
| 133 | ||
| 134 | # toggle window zoom | |
| 135 | # alt - d : yabai -m window --toggle zoom-parent | |
| 136 | # alt - f : yabai -m window --toggle zoom-fullscreen | |
| 137 | ||
| 138 | # toggle window split type | |
| 139 | # alt - e : yabai -m window --toggle split | |
| 140 | ||
| 141 | # float / unfloat window and center on screen | |
| 142 | # alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2 | |
| 143 | ||
| 144 | # toggle sticky(+float), picture-in-picture | |
| 145 | # alt - p : yabai -m window --toggle sticky --toggle pip | |
| 146 | ||
| 147 | # open terminal, blazingly fast compared to iTerm/Hyper | |
| 2 | 148 | cmd - return : /Applications/iTerm.app/Contents/MacOS/iTerm2 |
| 3 | 149 | |
| 4 | 150 | # open browser |
| 5 | 151 | cmd + shift - return : /Applications/LibreWolf.app/Contents/MacOS/librewolf |
| 152 | ||
| 153 | # toggle dark mode | |
| 154 | cmd + shift - d : osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to not dark mode' | |