diff --git a/home/home.nix b/home/home.nix index d9ef665..72d37a3 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,4 +1,4 @@ -{ self, pkgs, ... }: +{ self, pkgs, ... }@inputs: { programs.kitty = { @@ -8,13 +8,13 @@ size = 12; }; }; - + services.flameshot.enable = true; services.polybar = { enable = true; script = "polybar bar &"; }; xsession.windowManager.i3 = { enable = true; - config = import ./i3.nix; + config = import ./i3.nix inputs; }; } diff --git a/home/i3.nix b/home/i3.nix index 491ea9c..9a28ea0 100644 --- a/home/i3.nix +++ b/home/i3.nix @@ -1,8 +1,40 @@ +{ lib, pkgs, ...} : +let + modifier = "Mod4"; + lockText = "(e)xit, (r)estart, (s)hutdown"; +in { fonts = { names = [ "JetBrains Mono" ]; size = 12.0; }; - modifier = "Mod4"; + focus.mouseWarping = false; + modifier = modifier; + keybindings = lib.mkOptionDefault { + "${modifier}+d" = "kill"; + "${modifier}+t" = "exec ${pkgs.kitty}/bin/kitty"; + "${modifier}+o" = "exec ${pkgs.flameshot}/bin/flameshot gui"; + "${modifier}+p" = "exec ${pkgs.dmenu}/bin/dmenu_run"; + + "${modifier}+Shift+q" = ''mode "${lockText}"''; + + "${modifier}+h" = "focus left"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+l" = "focus right"; + "${modifier}+Shift+h" = "move left"; + "${modifier}+Shift+j" = "move down"; + "${modifier}+Shift+k" = "move up"; + "${modifier}+Shift+l" = "move right"; + }; + modes = lib.mkOptionDefault { + "(e)xit, (r)estart, (s)hutdown" = { + "e" = "exec ${pkgs.i3}/bin/i3-msg exit"; + "r" = "exec systemctl reboot"; + "s" = "exec systemctl poweroff -i"; + "Escape" = "mode default"; + "Return" = "mode default"; + }; + }; }