ZMWQGRYZTQ5YMSD3ISK6WFLYOAP2ARXYRVNH2HGUV2AYPISI6NZQC
3OAFCHK7EIRUD3ZLAGZ3MAXVYOGFAJVDOF63ZIGNU7I3RWIPMAOQC
VXESMJDKIRYTNWV6PVDZUSECSP7ESMK5LZPEE72DFBUU5MH7GWLAC
DCJDPW7CQ5OR75ECIVESHYVC5JSXZ5CKV6E3EWLRFHHKAKE7JGKAC
5HLAP6OIMUSEZK2JBMEG7LUHNZZIBWPJBPZBB4S6FUBHD5L43VAQC
4A5J4ZQ3HM2ZK6OO7N3RZ2WX3YHNGA3X5WJIB4UQJPQGUG4O3AYQC
ENRHXIAOXEVZGED76KL4CZJ5SPZDX5IRS3WICJ22WRKSCCU6IC2QC
57YU55IK55Q4QDV45LD3ILNQDQV46NKLYK3HS6VWR2SDTOFSYXKAC
MA2CFUK6WX65WKLQ7RYEESOQ7HH3PFKW3FIPJCH7HASONV52PB7QC
E36GTAU6NINTBOFW5S5FHDGTDMUIEFH23JSRBOW4IRSFHQAMKZFAC
QYSR4PDNVTQOISVLQMO5M7MYBEG37SV6Y7JGM6QPC3CA2BJAYPYQC
#########################################
# yabai is a macos tiling window manager
# https://github.com/koekeishiya/yabai
#########################################
yabai = {
config = {
window_placement = "second_child";
window_topmost = true;
window_shadow = "float";
window_border = false;
window_opacity = false;
insert_feedback_color = "0xffd75f5f";
split_ratio = "0.50";
auto_balance = true;
mouse_drop_action = "swap";
layout = "bsp";
top_padding = 6;
bottom_padding = 6;
left_padding = 6;
right_padding = 6;
window_gap = 6;
};
managed_apps = {
# apps are usually managed by default
"System Information" = false;
"System Preferences" = false;
"Karabiner-Elements" = false;
"Disk Utility" = false;
"Flux" = false;
"Messages" = false;
"sure-zooms" = false;
};
};
yabaiify = utils.stringify {
mkKey = k: "yabai -m config ${k}";
mkValue = v:
};
yabaiifyRules = utils.stringify {
mkKey = k: "yabai -m rule --add app='^${k}$'";
};
xdg.configFile."yabai/yabairc".text = ''
#!/usr/bin/env sh
#############################################################
# Generated by home-manager from nixpkgs.yabai in ~/dotfiles
# For yabai info see: https://github.com/koekeishiya/yabai
#############################################################
${yabaiify yabai.config}
${yabaiifyRules yabai.managed_apps}
# float iterm window that emulate guake (floats from bottom)
yabai -m rule --add app='^iTerm2$' title="^Hotkey Window$" manage=off
echo "$(date "+%Y-%m-%d %H:%M:%s") - yabai configuration loaded..."
'';
}
in {
home.packages = [pkgs.yabai];
mkValue = v: "manage=${
if v
then "on"
else "off"
}";
if lib.isBool v
then
(
if v
then "on"
else "off"
)
else lib.generators.mkValueStringDefault {} v;
utils = import ../utils pkgs;
{
pkgs,
lib,
...
}: let
#!/usr/local/bin/zsh
# moves a yabai-managed window to a display leftward, wrapping around to the rightmost display
# if need be.
q_yabai() {
yabai $@ > /dev/null 2>&1
}
q_yabai -m window --display prev || q_yabai -m window --display last > /dev/null 2>&1
q_yabai -m window --focus $(yabai -m query --windows --window | jq -re '.id')
#########################################
# yabai is a macos tiling window manager
# https://github.com/koekeishiya/yabai
#########################################
utils = import ../utils pkgs;
yabaiifyRules = utils.stringify {
mkKey = k: "yabai -m rule --add app='^${k}$'";
};
unmanaged_apps = {
# apps are usually managed by default
"System Information" = false;
"System Preferences" = false;
"Karabiner-Elements" = false;
"Disk Utility" = false;
"Flux" = false;
"Messages" = false;
"sure-zooms" = false;
};
config.services.yabai = {
enable = true;
package = pkgs.yabai;
config = {
window_placement = "second_child";
window_topmost = "on";
window_shadow = "float";
window_border = "off";
window_opacity = "off";
insert_feedback_color = "0xffd75f5f";
split_ratio = "0.50";
auto_balance = "on";
mouse_drop_action = "swap";
layout = "bsp";
top_padding = 6;
bottom_padding = 6;
left_padding = 6;
right_padding = 6;
window_gap = 6;
};
extraConfig = ''
${yabaiifyRules unmanaged_apps}
# float iterm window that emulate guake (floats from bottom)
yabai -m rule --add app='^iTerm2$' title="^Hotkey Window$" manage=off
echo "$(date "+%Y-%m-%d %H:%M:%s") - yabai configuration loaded..."
'';
};
}
in {
mkValue = v: "manage=${
if v
then "on"
else "off"
}";
{
config,
pkgs,
...
}: let