1
0
Fork 0

styx: switch back to yabai and skhd

This commit is contained in:
Daniel Kempkens 2024-03-10 23:59:01 +01:00
parent 2f98ad17aa
commit 3d8c914d13
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 27 additions and 10 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, ... }:
let let
yabai-pkg = pkgs.yabai; yabai-pkg = pkgs.yabai;
@ -15,6 +15,12 @@ let
fi fi
done done
''; '';
native-tab-apps = [ "Finder" ];
native-tab-action = ''
(yabai -m display --focus next && yabai -m display --focus prev) || \
(yabai -m display --focus prev && yabai -m display --focus next)
'';
in in
{ {
services.yabai = { services.yabai = {
@ -44,7 +50,15 @@ in
yabai -m query --windows --window $YABAI_WINDOW_ID | ${jq-bin} -er ".\"can-resize\" or .\"is-floating\"" || \ yabai -m query --windows --window $YABAI_WINDOW_ID | ${jq-bin} -er ".\"can-resize\" or .\"is-floating\"" || \
yabai -m window $YABAI_WINDOW_ID --toggle float yabai -m window $YABAI_WINDOW_ID --toggle float
' '
''; '' + lib.strings.concatMapStrings
# Hacky workaround for https://github.com/koekeishiya/yabai/issues/68
(app: ''
yabai -m signal --add event=window_created app="^${app}$" action='${native-tab-action}'
yabai -m signal --add event=window_destroyed app="^${app}$" action='${native-tab-action}'
yabai -m signal --add event=window_moved app="^${app}$" action='${native-tab-action}'
yabai -m signal --add event=window_resized app="^${app}$" action='${native-tab-action}'
'')
native-tab-apps;
}; };
services.skhd.skhdConfig = '' services.skhd.skhdConfig = ''
@ -56,10 +70,10 @@ in
alt + shift - w : ${yabai-bin} -m display --focus west alt + shift - w : ${yabai-bin} -m display --focus west
alt + shift - e : ${yabai-bin} -m display --focus east alt + shift - e : ${yabai-bin} -m display --focus east
meh - h : ${yabai-bin} -m window --swap west meh - h : ${yabai-bin} -m window --warp west
meh - j : ${yabai-bin} -m window --swap south meh - j : ${yabai-bin} -m window --warp south
meh - k : ${yabai-bin} -m window --swap north meh - k : ${yabai-bin} -m window --warp north
meh - l : ${yabai-bin} -m window --swap east meh - l : ${yabai-bin} -m window --warp east
meh - c : ${script-cycle-clockwise} meh - c : ${script-cycle-clockwise}
meh - w : ${yabai-bin} -m window --display west; ${yabai-bin} -m display --focus west meh - w : ${yabai-bin} -m window --display west; ${yabai-bin} -m display --focus west
@ -79,10 +93,10 @@ in
meh - b : ${yabai-bin} -m space --balance meh - b : ${yabai-bin} -m space --balance
hyper - h : ${yabai-bin} -m window --warp west hyper - h : ${yabai-bin} -m window --swap west
hyper - j : ${yabai-bin} -m window --warp south hyper - j : ${yabai-bin} -m window --swap south
hyper - k : ${yabai-bin} -m window --warp north hyper - k : ${yabai-bin} -m window --swap north
hyper - l : ${yabai-bin} -m window --warp east hyper - l : ${yabai-bin} -m window --swap east
hyper - f : ${yabai-bin} -m window --toggle native-fullscreen hyper - f : ${yabai-bin} -m window --toggle native-fullscreen
''; '';

View file

@ -13,6 +13,9 @@ in
../darwin/fish.nix ../darwin/fish.nix
../darwin/attic.nix ../darwin/attic.nix
../darwin/skhd.nix
../darwin/yabai.nix
]; ];
nix = { nix = {