dotfiles/common/desktop_environment/i3/home_manager/i3.nix
RingOfStorms (Joshua Bell) 9a7fa1be4d eh it is not working
2025-09-20 10:18:30 -05:00

47 lines
1.1 KiB
Nix

{
config,
osConfig,
lib,
...
}:
let
ccfg = import ../../../config.nix;
cfg_path = [
ccfg.custom_config_key
"desktopEnvironment"
"i3"
];
cfg = lib.attrsets.getAttrFromPath cfg_path osConfig;
in
{
xsession.windowManager.i3 = {
enable = true;
config = lib.attrsets.recursiveUpdate {
startup = [
{ command = "setxkbmap -layout us -option caps:escape"; }
];
modifier = "Mod4";
terminal = cfg.terminalCommand;
keybindings =
let
mod = config.xsession.windowManager.i3.config.modifier;
in
{
# Focus
"${mod}+h" = "focus left";
"${mod}+l" = "focus right";
"${mod}+k" = "focus up";
"${mod}+j" = "focus down";
# Apps
"${mod}+Return" = "exec ${cfg.terminalCommand}";
# "${mod}+space" = "exec ${cfg.menu}"; TODO
"${mod}+q" = "kill";
"${mod}+Shift+Escape" = "exit";
"${mod}+Shift+q" = "exec i3lock";
"${mod}+f" = "floating toggle";
};
# See home-manager documentation for everything you can add here.
} cfg.extraOptions;
};
}