Added configs for dwm (yabai & skhdrc) in Mac

This commit is contained in:
Marcin Woźniak 2022-06-19 00:13:57 +02:00
parent c58ea889b2
commit 61c6c9ed1e
Signed by: y0rune
GPG Key ID: F204C385F57EB348
2 changed files with 150 additions and 0 deletions

77
.skhdrc Normal file
View File

@ -0,0 +1,77 @@
# focus window
alt - h : yabai -m window --focus west
alt - l : yabai -m window --focus east
alt - k : yabai -m window --focus north
alt - j : yabai -m window --focus south
# swap managed window
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east
shift + alt - k : yabai -m window --swap north
shift + alt - j : yabai -m window --swap south
# move managed window
# shift + cmd - h : yabai -m window --warp east
# Search
alt - d : open -a Alfred\ 4
# Close app
alt - q : yabai -m window --close
# balance size of windows
shift + alt - space : yabai -m space --balance
# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)
shift + cmd - n : yabai -m space --create && \
index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \
yabai -m window --space "${index}" && \
yabai -m space --focus "${index}"
shift + alt - 1 : yabai -m window --space 1
shift + alt - 2 : yabai -m window --space 2
shift + alt - 3 : yabai -m window --space 3
shift + alt - 4 : yabai -m window --space 4
shift + alt - 5 : yabai -m window --space 5
shift + alt - 6 : yabai -m window --space 6
shift + alt - 7 : yabai -m window --space 7
shift + alt - 8 : yabai -m window --space 8
shift + alt - 9 : yabai -m window --space 9
# focus monitor
ctrl + alt - z : yabai -m display --focus prev
# ctrl + alt - 3 : yabai -m display --focus 3
# send window to monitor and follow focus
# ctrl + cmd - c : yabai -m window --display next; yabai -m display --focus next
# ctrl + cmd - 1 : yabai -m window --display 1; yabai -m display --focus 1
# move floating window
# shift + ctrl - a : yabai -m window --move rel:-20:0
# shift + ctrl - s : yabai -m window --move rel:0:20
# increase window size
# shift + alt - a : yabai -m window --resize left:-20:0
# shift + alt - w : yabai -m window --resize top:0:-20
# decrease window size
# shift + cmd - s : yabai -m window --resize bottom:0:-20
# shift + cmd - w : yabai -m window --resize top:0:20
# set insertion point in focused container
# ctrl + alt - h : yabai -m window --insert west
# toggle window zoom
alt - f : yabai -m window --toggle zoom-fullscreen
# toggle window split type
# alt - e : yabai -m window --toggle split
# float / unfloat window and center on screen
alt - space : yabai -m window --toggle float;\
yabai -m window --grid 4:4:1:1:2:2
# toggle sticky(+float), topmost, picture-in-picture
# alt - p : yabai -m window --toggle sticky;\
# yabai -m window --toggle topmost;\
# yabai -m window --toggle pip

73
.yabairc Executable file
View File

@ -0,0 +1,73 @@
#!/usr/bin/env sh
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
yabai -m config external_bar all:20:20
# Without Ubersicht
#yabai -m config external_bar all:0:0
# global settings
yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse on
yabai -m config window_placement second_child
yabai -m config window_topmost off
yabai -m config window_shadow on
yabai -m config window_border off
yabai -m config window_border_placement exterior
yabai -m config window_border_width 1.0
yabai -m config window_border_radius 1.0
yabai -m config active_window_border_color 0xff008bff
yabai -m config normal_window_border_color 0x01000000
yabai -m config insert_window_border_color 0xB2EBDBB2
yabai -m config window_opacity off
yabai -m config split_ratio 0.50
yabai -m config auto_balance on
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
# general space settings
yabai -m config layout bsp
yabai -m config top_padding 10
yabai -m config bottom_padding 10
yabai -m config left_padding 10
yabai -m config right_padding 10
yabai -m config window_gap 10
yabai -m config window_topmost on
yabai -m config window_shadow float
# From DWM
yabai -m rule --add app="^System Preferences$" manage=off border=off
yabai -m rule --add app="^Alfred$" manage=off border=off
yabai -m rule --add app="choose" manage=off
yabai -m rule --add app="Calendar" manage=off
yabai -m rule --add app="JDownloader 2*" manage=off
yabai -m rule --add app="Terminal" space=^1 display=1
yabai -m rule --add app="iTerm2" space=^1 display=1
yabai -m rule --add app="Firefox" space=^2
yabai -m rule --add app="Opera" space=^2
yabai -m rule --add app="Safari" space=^2
yabai -m rule --add app="Mail" space=^3
# Communication
yabai -m rule --add app="Slack" space=^4
yabai -m rule --add app="Signal" space=^4
yabai -m rule --add app="Discord" space=^4
yabai -m rule --add app="WhatsApp" space=^4
yabai -m rule --add app="Microsoft Teams" space=^4
yabai -m rule --add app="Microsoft Outlook" space=^4
yabai -m rule --add app="Messages" space=^4
# Tools
yabai -m rule --add app="Music" space=^5
yabai -m rule --add app="QuickTime Player" space=^5
yabai -m rule --add app="VLC" space=^5
yabai -m rule --add app="Spotify" space=^5
# Floating
yabai -m rule --add app="DisplayLinkUserAgent" space=^7