Skip to content

Instantly share code, notes, and snippets.

@mickaelperrin
Created March 27, 2023 11:02
Show Gist options
  • Save mickaelperrin/3f8ec2af93bbc88b7d9fc279ea3aaae7 to your computer and use it in GitHub Desktop.
Save mickaelperrin/3f8ec2af93bbc88b7d9fc279ea3aaae7 to your computer and use it in GitHub Desktop.
SKHD configuration, mainly to manage yabai
#!/usr/bin/env sh
# _ _ _
# | | | | | |
# ___| | _| |__ __| |_ __ ___
# / __| |/ / '_ \ / _` | '__/ __|
# \__ \ <| | | | (_| | | | (__
# |___/_|\_\_| |_|\__,_|_| \___|
#
:: default : yabai -m config active_window_border_color 0x99DD0000
:: prefix @: yabai -m config active_window_border_color 0xFF00FF00
ctrl - s ; prefix
prefix < ctrl - s ; default
prefix < f : yabai -m window --toggle zoom-fullscreen; skhd --key 'ctrl - s'
prefix < s : yabai -m space --focus next; skhd --key 'ctrl - s'
prefix < d : yabai -m space --focus prev; skhd --key 'ctrl - s'
prefix < z : toggle_central_app
prefix < l : yabai -m window --resize right:100:0
prefix < h : yabai -m window --resize left:-100:0
prefix < j : yabai -m window --resize bottom:0:100
prefix < k : yabai -m window --resize top:0:-100
prefix < shift - l : yabai -m window --resize right:100:0
prefix < shift - h : yabai -m window --resize left:100:0
prefix < shift - j : yabai -m window --resize bottom:0:-100
prefix < shift - k : yabai -m window --resize top:0:100
ctrl + alt + cmd - r : launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"
alt - r : yabai -m space --rotate 90
# End of common section
# -----------------------------------------------------------------------------
#ctrl + alt - 0x0A : yabai -m window --space "web"
ctrl + alt - 0x12 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal 1" || test $(yabai -m query --windows --window | jq '.display') -eq ${RIGHT_MONITOR} && yabai -m window --space "Side-Projet 1" || yabai -m window --space "Projet 1"
ctrl + alt - 0x13 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal 2" || test $(yabai -m query --windows --window | jq '.display') -eq ${RIGHT_MONITOR} && yabai -m window --space "Side-Projet 2" || yabai -m window --space "Projet 2"
ctrl + alt - 0x14 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal 3" || test $(yabai -m query --windows --window | jq '.display') -eq ${RIGHT_MONITOR} && yabai -m window --space "Side-Projet 3" || yabai -m window --space "Projet 3"
ctrl + alt - 0x15 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal 4" || test $(yabai -m query --windows --window | jq '.display') -eq ${RIGHT_MONITOR} && yabai -m window --space "Side-Projet 4" || yabai -m window --space "Projet 4"
ctrl + alt - 0x17 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal 5" || test $(yabai -m query --windows --window | jq '.display') -eq ${RIGHT_MONITOR} && yabai -m window --space "Side-Projet 5" || yabai -m window --space "Projet 5"
#ctrl + alt - 0x16 : yabai -m window --space 7
#ctrl + alt - 0x1A : yabai -m window --space 8
ctrl + alt - 0x1C : yabai -m window --space "Messages"
ctrl + alt - 0x19 : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal ansible" || yabai -m window --space "ansible"
ctrl + alt - 0x1D : test $(yabai -m query --windows --window | jq '.display') -eq ${LAPTOP_MONITOR} && yabai -m window --space "Terminal docker" || yabai -m window --space "docker"
ctrl + alt - 0x1B : yabai -m window --space "yeoman"
ctrl + alt - 0x18 : yabai -m window --space "dotfiles"
ctrl + alt - 0x33 : yabai -m window --space "git"
# variables are defined in ~/.zprofile.custom
ctrl + alt - z : yabai -m window --display ${CENTRAL_MONITOR}
ctrl + alt - a : yabai -m window --display ${LAPTOP_MONITOR}
ctrl + alt - 0x30 : yabai -m window --display ${LEFT_MONITOR}
ctrl + alt - e : yabai -m window --display ${RIGHT_MONITOR}
ctrl + alt - r : yabai -m window --display ${RIGHT_TOP_MONITOR}
cmd + alt - 0x0A : next_space_on_monitor $LEFT_MONITOR
cmd + alt - 0x12 : yabai -m space --focus "Projet 1" && yabai -m space --focus "Terminal 1" && yabai -m space --focus "Side-Projet 1"
cmd + alt - 0x13 : yabai -m space --focus "Projet 2" && yabai -m space --focus "Terminal 2" && yabai -m space --focus "Side-Projet 2"
cmd + alt - 0x14 : yabai -m space --focus "Projet 3" && yabai -m space --focus "Terminal 3" && yabai -m space --focus "Side-Projet 3"
cmd + alt - 0x15 : yabai -m space --focus "Projet 4" && yabai -m space --focus "Terminal 4" && yabai -m space --focus "Side-Projet 4"
cmd + alt - 0x17 : yabai -m space --focus "Projet 5" && yabai -m space --focus "Terminal 5" && yabai -m space --focus "Side-Projet 5"
#cmd + alt - 0x16 : yabai -m space --focus 7
#cmd + alt - 0x1A : yabai -m space --focus 8
cmd + alt - 0x16 : yabai -m space --focus "Messages" && yabai -m space --focus "GamingLaptop" && yabai -m space --focus "GamingCentral" && yabai -m space --focus "web"
cmd + alt - 0x1C : yabai -m space --focus "Messages"
cmd + alt - 0x19 : yabai -m space --focus "ansible" && yabai -m space --focus "Terminal ansible"
cmd + alt - 0x1D : yabai -m space --focus "docker" && yabai -m space --focus "Terminal docker"
cmd + alt - 0x1B : yabai -m space --focus "yeoman"
cmd + alt - 0x18 : yabai -m space --focus "dotfiles"
cmd + alt - 0x33 : yabai -m space --focus "git"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment