skhd and yabai configs

This commit is contained in:
Brandon Cornejo 2026-05-12 14:35:54 -05:00
parent 4d6c43b4be
commit 3e311338ef
3 changed files with 215 additions and 4 deletions

110
.skhdrc Executable file
View File

@ -0,0 +1,110 @@
# Meh (right thumb) = Alt+Shift+Ctrl
# Hyper (left corner) = Alt+Shift+Ctrl+Cmd
# open terminal
cmd - return : /Users/br4n/bin/itermw.sh
# focus window
alt - x : yabai -m window --focus recent
alt - h : yabai -m window --focus west
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - l : yabai -m window --focus east
alt - z : yabai -m window --focus stack.prev
alt - c : yabai -m window --focus stack.next
# swap window
shift + cmd - x : yabai -m window --swap recent
shift + cmd - h : yabai -m window --swap west
shift + cmd - j : yabai -m window --swap south
shift + cmd - k : yabai -m window --swap north
shift + cmd - l : yabai -m window --swap east
# move window
shift + alt - h : yabai -m window --warp west
shift + alt - j : yabai -m window --warp south
shift + alt - k : yabai -m window --warp north
shift + alt - l : yabai -m window --warp east
# balance size of windows
shift + alt - 0 : yabai -m space --balance
# fast focus desktop
shift + ctrl + cmd + alt - 1 : yabai -m space --focus 1 || skhd -k "ctrl + alt + cmd - 1"
shift + ctrl + cmd + alt - 2 : yabai -m space --focus 2 || skhd -k "ctrl + alt + cmd - 2"
shift + ctrl + cmd + alt - 3 : yabai -m space --focus 3 || skhd -k "ctrl + alt + cmd - 3"
shift + ctrl + cmd + alt - 4 : yabai -m space --focus 4 || skhd -k "ctrl + alt + cmd - 4"
shift + ctrl + cmd + alt - 5 : yabai -m space --focus 5 || skhd -k "ctrl + alt + cmd - 5"
shift + ctrl + cmd + alt - 6 : yabai -m space --focus 6 || skhd -k "ctrl + alt + cmd - 6"
shift + ctrl + cmd + alt - 7 : yabai -m space --focus 7 || skhd -k "ctrl + alt + cmd - 7"
shift + ctrl + cmd + alt - 8 : yabai -m space --focus 8 || skhd -k "ctrl + alt + cmd - 8"
shift + ctrl + cmd + alt - 9 : yabai -m space --focus 9 || skhd -k "ctrl + alt + cmd - 9"
shift + ctrl + cmd + alt - 0 : yabai -m space --focus 10 || skhd -k "ctrl + alt + cmd - 0"
# send window to desktop and follow focus
shift + alt - 1 : yabai -m window --space 1 && yabai -m space --focus 1
shift + alt - 2 : yabai -m window --space 2 && yabai -m space --focus 2
shift + alt - 3 : yabai -m window --space 3 && yabai -m space --focus 3
shift + alt - 4 : yabai -m window --space 4 && yabai -m space --focus 4
shift + alt - 5 : yabai -m window --space 5 && yabai -m space --focus 5
shift + alt - 6 : yabai -m window --space 6 && yabai -m space --focus 6
shift + alt - 7 : yabai -m window --space 7 && yabai -m space --focus 7
shift + alt - 8 : yabai -m window --space 8 && yabai -m space --focus 8
shift + alt - 9 : yabai -m window --space 9 && yabai -m space --focus 9
shift + alt - 0 : yabai -m window --space 10 && yabai -m space --focus 10
# focus monitor
ctrl + alt - x : yabai -m display --focus recent
ctrl + alt - z : yabai -m display --focus prev
ctrl + alt - c : yabai -m display --focus next
ctrl + alt - 1 : yabai -m display --focus 1
ctrl + alt - 2 : yabai -m display --focus 2
ctrl + alt - 3 : yabai -m display --focus 3
# increase window size
#shift + alt - a : yabai -m window --resize left:-20:0
#shift + alt - s : yabai -m window --resize bottom:0:20
#shift + alt - w : yabai -m window --resize top:0:-20
#shift + alt - d : yabai -m window --resize right:20:0
#
# decrease window size
#shift + cmd - a : yabai -m window --resize left:20:0
#shift + cmd - s : yabai -m window --resize bottom:0:-20
#shift + cmd - w : yabai -m window --resize top:0:20
#shift + cmd - d : yabai -m window --resize right:-20:0
# toggle desktop offset
alt - a : yabai -m space --toggle padding && yabai -m space --toggle gap
# toggle window parent zoom
alt - f : yabai -m window --toggle zoom-parent
# toggle window fullscreen zoom
shift + alt - f : yabai -m window --toggle zoom-fullscreen
# toggle window native fullscreen
alt - d : yabai -m window --toggle native-fullscreen
# toggle window split type
shift + alt - e : yabai -m window --toggle split
# float / unfloat window and restore position
alt - t : yabai -m window --toggle float && yabai -m window --grid 4:4:1:1:2:2
# toggle sticky (show on all spaces) and topmost (keep above)
alt - s : yabai -m window --toggle sticky && yabai -m window --toggle topmost
# toggle picture-in-picture
alt - p : yabai -m window --toggle border && \
yabai -m window --toggle pip
# change layout of desktop
ctrl + alt - a : yabai -m space --layout bsp
ctrl + alt - d : yabai -m space --layout float
# stacking support
shift + ctrl - h : yabai -m window --stack west
shift + ctrl - j : yabai -m window --stack north
shift + ctrl - k : yabai -m window --stack south
shift + ctrl - l : yabai -m window --stack east
shift + ctrl - s : yabai -m window --insert stack

85
.yabairc Executable file
View File

@ -0,0 +1,85 @@
#!/usr/bin/env sh
# startup - load scripting addition
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# global settings
yabai -m config mouse_follows_focus off
yabai -m config focus_follows_mouse off
yabai -m config window_placement second_child
yabai -m config window_topmost off
yabai -m config window_shadow float
yabai -m config window_opacity off
yabai -m config window_opacity_duration 0.0
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.90
yabai -m config window_border off
yabai -m config window_border_width 6
yabai -m config active_window_border_color 0xff775759
yabai -m config normal_window_border_color 0xff555555
yabai -m config insert_feedback_color 0xffd75f5f
yabai -m config split_ratio 0.50
yabai -m config auto_balance off
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
yabai -m config mouse_drop_action swap
# general space settings
yabai -m config layout bsp
yabai -m config top_padding 12
yabai -m config bottom_padding 12
yabai -m config left_padding 12
yabai -m config right_padding 12
yabai -m config window_gap 06
# Spacebar Integration
#SPACEBAR_HEIGHT=$(spacebar -m config height)
#yabai -m config external_bar all:$SPACEBAR_HEIGHT:0
# stacking support
# yabai -m window --focus $(yabai -m query --windows --space | jq -r 'map(select(."stack-index" == 2)) | .[0].id')
# base examples
# # stack target_window_sel onto source_window_sel
# yabai -m window [<source_window_sel>] --stack <target_window_sel>
#
# # next window is inserted onto source_window_sel
# yabai -m window [<source_window_sel>] --insert stack
#
# # focus the prev window in a stack
# yabai -m window --focus stack.prev
#
# # focus the next window in a stack
# yabai -m window --focus stack.next
#
# # focus the first window in a stack
# yabai -m window --focus stack.first
#
# # focus the last window in a stack
# yabai -m window --focus stack.last
#
# # focus the most recently focused window in a stack
# yabai -m window --focus stack.recent
# for swapping from stack or space regardless
# forward
# yabai -m query --spaces --space \
# | jq -re ".index" \
# | xargs -I{} yabai -m query --windows --space {} \
# | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.x, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \
# | xargs -I{} yabai -m window --focus {}
#
# # backward
# yabai -m query --spaces --space \
# | jq -re ".index" \
# | xargs -I{} yabai -m query --windows --space {} \
# | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.y, .id) | nth(index(map(select(.focused == 1))) - 1).id" \
# | xargs -I{} yabai -m window --focus {}
# finished
echo "yabai configuration loaded.."

24
bashrc
View File

@ -47,6 +47,7 @@ alias atr0phy='ssh -D 3333 -C br4n@atr0phy.net'
alias at0rphy='ssh -L 9050:127.0.0.1:9050 br4n@atr0phy.net' alias at0rphy='ssh -L 9050:127.0.0.1:9050 br4n@atr0phy.net'
alias evoluent='xinput --set-button-map 14 3 1 1 4 5 7 8 9 0 10 11' alias evoluent='xinput --set-button-map 14 3 1 1 4 5 7 8 9 0 10 11'
alias cls='clear && ls' alias cls='clear && ls'
alias cgs='clear && git status'
alias notes="vim +VimwikiIndex" alias notes="vim +VimwikiIndex"
alias tmpvim="vim /tmp/$(uuid)" alias tmpvim="vim /tmp/$(uuid)"
alias snip="scrot -s ~/Documents/screenshots/%b%d-%H:%M.png" alias snip="scrot -s ~/Documents/screenshots/%b%d-%H:%M.png"
@ -66,10 +67,6 @@ export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # mem/file s
# if this is interactive shell, then bind hh to Ctrl-r # if this is interactive shell, then bind hh to Ctrl-r
bind '"\C-r": "hh\n"' bind '"\C-r": "hh\n"'
export NVM_DIR="/home/brandon.cornejo/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Clipboard jazz # Clipboard jazz
# A shortcut function that simplifies usage of xclip. # A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params. # - Accepts input from either stdin (pipe), or params.
@ -119,6 +116,25 @@ alias cbhs="cat $HISTFILE | tail -n 1 | cb"
# ASCII ART GOODNESS # ASCII ART GOODNESS
echo -e "$(<~/.motd)" echo -e "$(<~/.motd)"
# Always open `ed` with a prompt
ed() { command ed -p\* "$@" ; }
# Search command history # Search command history
bind '"\e[A": history-search-backward' bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward' bind '"\e[B": history-search-forward'
# SFDX Aliases
alias sfdxfsd="sfdx force:source:deploy"
alias sfdxfsr="sfdx force:source:retrieve"
alias sfdxfol="sfdx force:org:list"
# NF AWS Aliases
alias slackec2="ssh -i \"~/.ssh/brandon-nf-laptop.pem\" admin@ec2-3-238-248-245.compute-1.amazonaws.com"
alias aws="aws --profile AWSAdministratorAccess-122155909475"
alias dcss="/Applications/Dungeon\ Crawl\ Stone\ Soup\ -\ Console.app/Contents/Resources/crawl; exit;"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PATH="$HOME/.local/bin:$PATH"