nixos-config/hosts/worf/yabai.nix

70 lines
2.1 KiB
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.services.yabai;
in {
services.yabai = {
enable = true;
enableScriptingAddition = true;
config = {
layout = "bsp";
debug_output = "on";
focus_follows_mouse = "autoraise";
mouse_follows_focus = "off";
window_placement = "second_child";
window_opacity = "off";
# top_padding = 10;
# bottom_padding = 10;
# left_padding = 10;
# right_padding = 10;
window_gap = 10;
};
};
services.skhd = {
enable = true;
skhdConfig = let
mod = "alt";
mod2 = "alt + ctrl";
mod3 = "alt + shift";
in ''
# Move window focus
${mod} - j : yabai -m window --focus south
${mod} - k : yabai -m window --focus north
${mod} - h : yabai -m window --focus west
${mod} - l : yabai -m window --focus east
${mod} - down : yabai -m window --focus south
${mod} - up : yabai -m window --focus north
${mod} - left : yabai -m window --focus west
${mod} - right : yabai -m window --focus east
# Move windows
${mod3} - j : yabai -m window --warp south
${mod3} - k : yabai -m window --warp north
${mod3} - h : yabai -m window --warp west
${mod3} - l : yabai -m window --warp east
${mod3} - down : yabai -m window --warp south
${mod3} - up : yabai -m window --warp north
${mod3} - left : yabai -m window --warp west
${mod3} - right : yabai -m window --warp east
# Move windows to different spaces
${mod2} - 1 : yabai -m window --space 1
${mod2} - 2 : yabai -m window --space 2
${mod2} - 3 : yabai -m window --space 3
${mod2} - 4 : yabai -m window --space 4
${mod2} - 5 : yabai -m window --space 5
${mod2} - 6 : yabai -m window --space 6
${mod2} - 7 : yabai -m window --space 7
# Misc
${mod2} - f : yabai -m window --toggle zoom-fullscreen
${mod2} - b : yabai -m space --balance
${mod3} - space : yabai -m window --toggle float --grid 4:4:1:1:2:2
'';
};
}