Browse Source

Add yabai configs

ubuntu_ci
Ein Verne 4 years ago
parent
commit
8e284dcefc
No known key found for this signature in database
GPG Key ID: 926634D64ACAD792
  1. 56
      hammerspoon/init.lua
  2. 43
      kitty/base16-solarized-dark-256.conf
  3. 2
      kitty/kitty.conf
  4. 81
      skhd/skhdrc
  5. 4
      yabai/yabairc

56
hammerspoon/init.lua

@ -84,24 +84,24 @@ local reading_layout = {
{"Miwork", nil, right_monitor, hs.layout.top50, nil, nil}, {"Miwork", nil, right_monitor, hs.layout.top50, nil, nil},
} }
hs.hotkey.bind(hyper, "1", function() -- hs.hotkey.bind(hyper, "1", function()
hs.application.launchOrFocus('Google Chrome') -- hs.application.launchOrFocus('Google Chrome')
hs.application.launchOrFocus('iTerm') -- hs.application.launchOrFocus('iTerm')
hs.application.launchOrFocus('Miwork') -- hs.application.launchOrFocus('Miwork')
--
hs.layout.apply(reading_layout) -- hs.layout.apply(reading_layout)
end) -- end)
local coding_layout = { local coding_layout = {
{"IntelliJ IDEA Ultimate", nil, middle_monitor, hs.layout.maximized, nil, nil}, {"IntelliJ IDEA Ultimate", nil, middle_monitor, hs.layout.maximized, nil, nil},
{"iTerm", nil, left_monitor, hs.layout.maximized, nil, nil}, {"iTerm", nil, left_monitor, hs.layout.maximized, nil, nil},
} }
hs.hotkey.bind(hyper, "2", function() -- hs.hotkey.bind(hyper, "2", function()
hs.application.launchOrFocus('IntelliJ IDEA') -- hs.application.launchOrFocus('IntelliJ IDEA')
--
hs.layout.apply(coding_layout) -- hs.layout.apply(coding_layout)
end) -- end)
wifiWatcher = nil wifiWatcher = nil
@ -206,6 +206,8 @@ else
end end
end end
function reloadConfig() function reloadConfig()
hs.reload() hs.reload()
hs.execute("/bin/launchctl kickstart -k \"gui/${UID}/homebrew.mxcl.yabai\"") hs.execute("/bin/launchctl kickstart -k \"gui/${UID}/homebrew.mxcl.yabai\"")
@ -244,6 +246,24 @@ for _, v in pairs(hspoon_list) do
hs.loadSpoon(v) hs.loadSpoon(v)
end end
hs.hotkey.bind({}, "F12", function()
local app = hs.application.get("kitty")
if app then
if not app:mainWindow() then
app:selectMenuItem({"kitty", "New OS window"})
elseif app:isFrontmost() then
app:hide()
else
app:activate()
end
else
hs.application.launchOrFocus("kitty")
app = hs.application.get("kitty")
end
app:mainWindow():moveToUnit'[100, 80, 0, 0]'
end)
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
-- Then we create/register all kinds of modal keybindings environments. -- Then we create/register all kinds of modal keybindings environments.
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
@ -498,12 +518,12 @@ end
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
-- Register AClock -- Register AClock
if spoon.AClock then -- if spoon.AClock then
hsaclock_keys = hsaclock_keys or {"alt", "T"} -- hsaclock_keys = hsaclock_keys or {"alt", "T"}
if string.len(hsaclock_keys[2]) > 0 then -- if string.len(hsaclock_keys[2]) > 0 then
spoon.ModalMgr.supervisor:bind(hsaclock_keys[1], hsaclock_keys[2], "Toggle Floating Clock", function() spoon.AClock:toggleShow() end) -- spoon.ModalMgr.supervisor:bind(hsaclock_keys[1], hsaclock_keys[2], "Toggle Floating Clock", function() spoon.AClock:toggleShow() end)
end -- end
end -- end
-- Register WinRectangle -- Register WinRectangle
if spoon.WinRectangle then if spoon.WinRectangle then

43
kitty/base16-solarized-dark-256.conf

@ -0,0 +1,43 @@
# Base16 Solarized Dark - kitty color config
# Scheme by Ethan Schoonover (modified by aramisgithub)
background #002b36
foreground #93a1a1
selection_background #93a1a1
selection_foreground #002b36
url_color #839496
cursor #93a1a1
active_border_color #657b83
inactive_border_color #073642
active_tab_background #002b36
active_tab_foreground #93a1a1
inactive_tab_background #073642
inactive_tab_foreground #839496
tab_bar_background #073642
# normal
color0 #002b36
color1 #dc322f
color2 #859900
color3 #b58900
color4 #268bd2
color5 #6c71c4
color6 #2aa198
color7 #93a1a1
# bright
color8 #657b83
color9 #dc322f
color10 #859900
color11 #b58900
color12 #268bd2
color13 #6c71c4
color14 #2aa198
color15 #fdf6e3
# extended base16 colors
color16 #cb4b16
color17 #d33682
color18 #073642
color19 #586e75
color20 #839496
color21 #eee8d5

2
kitty/kitty.conf

@ -1038,7 +1038,7 @@ term xterm-kitty
#: hide_window_decorations. #: hide_window_decorations.
# macos_option_as_alt no # macos_option_as_alt no
macos_option_as_alt yes # macos_option_as_alt yes
#: Use the option key as an alt key. With this set to no, kitty will #: Use the option key as an alt key. With this set to no, kitty will
#: use the macOS native Option+Key = unicode character behavior. This #: use the macOS native Option+Key = unicode character behavior. This

81
skhd/skhdrc

@ -101,7 +101,7 @@
# 0x2F = Fullstop / > # 0x2F = Fullstop / >
# 0x2C = Slash # 0x2C = Slash
# open terminal # open terminal
# cmd - return : /Applications/iTerm.app/Contents/MacOS/iTerm2 --single-instance -d ~ &> /dev/null cmd - return : /Applications/kitty.app/Contents/MacOS/kitty --single-instance -d ~ &> /dev/null
# close focused window # close focused window
# alt - w : yabai -m window --close # alt - w : yabai -m window --close
@ -137,10 +137,10 @@ alt + shift - k : yabai -m window --swap north
alt + shift - l : yabai -m window --swap east alt + shift - l : yabai -m window --swap east
# stack window # stack window
alt + ctrl + shift - h : yabai -m window --stack west # alt + ctrl + shift - h : yabai -m window --stack west
alt + ctrl + shift - j : yabai -m window --stack south # alt + ctrl + shift - j : yabai -m window --stack south
alt + ctrl + shift - k : yabai -m window --stack north # alt + ctrl + shift - k : yabai -m window --stack north
alt + ctrl + shift - l : yabai -m window --stack east # alt + ctrl + shift - l : yabai -m window --stack east
# make floating window fill screen, make it float if not already floating # make floating window fill screen, make it float if not already floating
ctrl + alt + cmd - t : yabai -m window --toggle float; \ ctrl + alt + cmd - t : yabai -m window --toggle float; \
@ -226,35 +226,34 @@ alt + cmd - w : yabai -m window --resize top:0:-80
alt + cmd - s : yabai -m window --resize right:80:0 alt + cmd - s : yabai -m window --resize right:80:0
# decrease region size # decrease region size
alt + cmd + ctrl - a : yabai -m window --resize left:80:0 # alt + cmd + ctrl - a : yabai -m window --resize left:80:0
alt + cmd + ctrl - r : yabai -m window --resize bottom:0:-80 # alt + cmd + ctrl - r : yabai -m window --resize bottom:0:-80
alt + cmd + ctrl - w : yabai -m window --resize top:0:80 # alt + cmd + ctrl - w : yabai -m window --resize top:0:80
alt + cmd + ctrl - s : yabai -m window --resize right:-80:0 # alt + cmd + ctrl - s : yabai -m window --resize right:-80:0
# set insertion point for focused container # set insertion point for focused container
ctrl + alt - h : yabai -m window --insert west ctrl + alt - h : yabai -m window --insert west
ctrl + alt - m : yabai -m window --insert west ctrl + alt - j : yabai -m window --insert south
ctrl + alt - n : yabai -m window --insert south ctrl + alt - k : yabai -m window --insert north
ctrl + alt - e : yabai -m window --insert north ctrl + alt - l : yabai -m window --insert east
ctrl + alt - i : yabai -m window --insert east
# rotate tree # rotate tree
alt - r : yabai -m space --rotate 90 # alt - r : yabai -m space --rotate 90
# mirror tree y-axis # mirror tree y-axis
alt + shift - x : yabai -m space --mirror vertical # alt + shift - x : yabai -m space --mirror vertical
# mirror tree x-axis # mirror tree x-axis
alt - x : yabai -m space --mirror horizontal # alt - x : yabai -m space --mirror horizontal
# toggle desktop padding # toggle desktop padding
alt - a : yabai -m space --toggle padding # alt - a : yabai -m space --toggle padding
# toggle window fullscreen # toggle window fullscreen
alt - f : yabai -m window --toggle fullscreen # alt - f : yabai -m window --toggle fullscreen
# toggle window native fullscreen # toggle window native fullscreen
shift + alt - f : yabai -m window --toggle native-fullscreen # shift + alt - f : yabai -m window --toggle native-fullscreen
# toggle window zoom # toggle window zoom
alt - z : yabai -m window --toggle zoom-fullscreen alt - z : yabai -m window --toggle zoom-fullscreen
@ -263,40 +262,33 @@ alt - z : yabai -m window --toggle zoom-fullscreen
alt - c : yabai -m window --toggle split alt - c : yabai -m window --toggle split
# toggle window fade # toggle window fade
alt - q : yabai -m window --toggle fade # alt - q : yabai -m window --toggle fade
# float / unfloat window and center on screen # float / unfloat window and center on screen
alt - t : yabai -m window --toggle float;\ alt - t : yabai -m window --toggle float;\
yabai -m window --grid 6:6:1:1:4:4 yabai -m window --grid 6:6:1:1:4:4
# toggle sticky # toggle sticky
alt - s : yabai -m window --toggle sticky # alt - s : yabai -m window --toggle sticky
# toggle border # toggle border
alt - b : yabai -m window --toggle border # alt - b : yabai -m window --toggle border
# classic pip # classic pip
alt - p : yabai -m window --toggle float;\ # alt - p : yabai -m window --toggle float;\
yabai -m window --toggle sticky;\ # yabai -m window --toggle sticky;\
yabai -m window --toggle topmost;\ # yabai -m window --toggle topmost;\
yabai -m window --grid 5:5:3:0:2:2 # yabai -m window --grid 5:5:3:0:2:2
# toggle sticky, float and resize to picture-in-picture size # toggle sticky, float and resize to picture-in-picture size
alt + shift - p : yabai -m window --toggle sticky;\ # alt + shift - p : yabai -m window --toggle sticky;\
yabai -m window --toggle topmost;\ # yabai -m window --toggle topmost;\
yabai -m window --toggle border;\ # yabai -m window --toggle border;\
yabai -m window --toggle pip # yabai -m window --toggle pip
# float next window to be tiled # float next window to be tiled
# shift + alt - t : chunkc set window_float_next 1 # shift + alt - t : chunkc set window_float_next 1
# change layout of desktop
ctrl + alt - a : yabai -m space --layout bsp; \
terminal-notifier -title Yabai -message "Bsp mode activated"
ctrl + alt - r: yabai -m space --layout float; \
terminal-notifier -title Yabai -message "Float mode activated"
ctrl + alt - s : yabai -m space --layout stack; \
terminal-notifier -title Yabai -message "Stack mode activated"
# ctrl + alt - l : yabai -m space --deserialize ~/.chunkwm_layout # ctrl + alt - l : yabai -m space --deserialize ~/.chunkwm_layout
# ctrl + alt + cmd - l : yabai -m space --serialize ~/.chunkwm_layout # ctrl + alt + cmd - l : yabai -m space --serialize ~/.chunkwm_layout
@ -306,9 +298,9 @@ cmd + shift - 4 -> : yabai -m window --toggle border; sleep 3; yabai -m window -
ctrl + cmd + shift - 4 -> : yabai -m window --toggle border; sleep 3; yabai -m window --toggle border; ctrl + cmd + shift - 4 -> : yabai -m window --toggle border; sleep 3; yabai -m window --toggle border;
# MPC commands # MPC commands
ctrl + alt + cmd + shift - 0x23 : mpc toggle # ctrl + alt + cmd + shift - 0x23 : mpc toggle
ctrl + alt + cmd - 0x2B : mpc prev # ctrl + alt + cmd - 0x2B : mpc prev
ctrl + alt + cmd - 0x2F : mpc next # ctrl + alt + cmd - 0x2F : mpc next
# Reload yabai # Reload yabai
ctrl + alt + cmd - z : osascript -e 'tell application "Keyboard Maestro Engine" to do script "Hide All Windows"' && \ ctrl + alt + cmd - z : osascript -e 'tell application "Keyboard Maestro Engine" to do script "Hide All Windows"' && \
@ -334,19 +326,18 @@ ctrl + alt + cmd - c : ids=$(yabai -m query --windows --space | jq -r ".[] | sel
alt - 0x2C : yabai -m space --balance alt - 0x2C : yabai -m space --balance
# Toggle space windows gap # Toggle space windows gap
alt - d : yabai -m space --toggle gap # alt - d : yabai -m space --toggle gap
# Toggle space windows padding # Toggle space windows padding
alt - g : yabai -m space --toggle padding # alt - g : yabai -m space --toggle padding
# Task randomizer # Task randomizer
ctrl + alt + cmd + shift - d : osascript ~/Library/Scripts/omnifocus-task-randomizer.applescript # ctrl + alt + cmd + shift - d : osascript ~/Library/Scripts/omnifocus-task-randomizer.applescript
# Hyper 1-0 # Hyper 1-0
ctrl + alt + cmd + shift - 1 : /Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge # ctrl + alt + cmd + shift - 1 : /Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge
# change layout of desktop # change layout of desktop
ctrl + alt - a : yabai -m space --layout bsp ctrl + alt - a : yabai -m space --layout bsp
ctrl + alt - d : yabai -m space --layout float ctrl + alt - d : yabai -m space --layout float
ctrl + alt - s : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end') ctrl + alt - s : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')

4
yabai/yabairc

@ -48,14 +48,17 @@ yabai -m rule --add label="App Store" app="^App Store$" manage=off
yabai -m rule --add label="Calculator" app="^Calculator$" manage=off yabai -m rule --add label="Calculator" app="^Calculator$" manage=off
yabai -m rule --add label="Dash" app="Dash" manage=off yabai -m rule --add label="Dash" app="Dash" manage=off
yabai -m rule --add label="DataGrip" app="DataGrip" manage=off yabai -m rule --add label="DataGrip" app="DataGrip" manage=off
yabai -m rule --add label="Dictionary" app="^Dictionary$" manage=off
yabai -m rule --add app="^Discord$" space=7 grid=1:1:0:0:1:1 manage=off yabai -m rule --add app="^Discord$" space=7 grid=1:1:0:0:1:1 manage=off
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
yabai -m rule --add label="GoldenDict" app="GoldenDict" manage=off yabai -m rule --add label="GoldenDict" app="GoldenDict" manage=off
yabai -m rule --add label="kitty" app="kitty" manage=off
yabai -m rule --add label="IntelliJ IDEA" app="IntelliJ IDEA" manage=off space=code yabai -m rule --add label="IntelliJ IDEA" app="IntelliJ IDEA" manage=off space=code
yabai -m rule --add label="Preview" app="Preview" manage=off yabai -m rule --add label="Preview" app="Preview" manage=off
yabai -m rule --add label="System Preferences" app="^System Preferences$" manage=off yabai -m rule --add label="System Preferences" app="^System Preferences$" manage=off
yabai -m rule --add label="SmartGit" app="SmartGit" manage=off space=git yabai -m rule --add label="SmartGit" app="SmartGit" manage=off space=git
yabai -m rule --add label="VirtualBox" app="^VirtualBox$" manage=off yabai -m rule --add label="VirtualBox" app="^VirtualBox$" manage=off
yabai -m rule --add label="Zotero" app="^Zotero$" manage=off
@ -65,5 +68,4 @@ yabai -m signal --add event=window_destroyed action="yabai -m query --windows --
yabai -m signal --add event=window_minimized action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse" yabai -m signal --add event=window_minimized action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse" yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
echo "yabai configuration loaded.." echo "yabai configuration loaded.."

Loading…
Cancel
Save