From 9bd36d54e4af55b1a316dc1c1efd84c1df73352a Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Fri, 16 Aug 2024 23:16:16 -0600 Subject: home/desktop: declare i3 config using home-manager options --- home/desktop.nix | 105 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 11 deletions(-) (limited to 'home/desktop.nix') diff --git a/home/desktop.nix b/home/desktop.nix index 0d19de0..f372a69 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -33,8 +33,6 @@ with lib; { }; }; - i3status-rust.enable = true; - rofi = { enable = true; theme = "DarkBlue"; @@ -73,17 +71,102 @@ with lib; { }; }; - xdg.configFile."i3/config".text = pkgs.callPackage ./i3-config.nix { - inherit (pkgs.local) st tmux-lift; - - i3status-rust = config.programs.i3status-rust.package; - rofi = config.programs.rofi.finalPackage; - }; - xsession = { enable = true; - # Cambiar por windowManager.i3.enable al migrar - windowManager.command = "${pkgs.i3-gaps}/bin/i3"; + + windowManager.i3 = { + enable = true; + package = pkgs.i3-gaps; + + config = { + modifier = "Mod4"; + focus.followMouse = false; + + bars = singleton { + mode = "dock"; + hiddenState = "hide"; + position = "top"; + workspaceButtons = true; + workspaceNumbers = true; + statusCommand = getExe pkgs.i3status; + trayOutput = "primary"; + colors = { + background = "#000000"; + statusline = "#ffffff"; + separator = "#666666"; + focusedWorkspace = { + border = "#4c7899"; + background = "#285577"; + text = "#ffffff"; + }; + activeWorkspace = { + border = "#333333"; + background = "#5f676a"; + text = "#ffffff"; + }; + inactiveWorkspace = { + border = "#333333"; + background = "#222222"; + text = "#888888"; + }; + urgentWorkspace = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + }; + bindingMode = { + border = "#2f343a"; + background = "#900000"; + text = "#ffffff"; + }; + }; + }; + + fonts = { + size = 11.0; + names = [ "DejaVu Sans Mono" ]; + style = "Bold Semi-Condensed"; + }; + + keybindings = + let + mod = config.xsession.windowManager.i3.config.modifier; + rofi = config.programs.rofi.finalPackage; + + inherit (pkgs.local) st tmux-lift; + in + mkOptionDefault { + "${mod}+a" = "focus parent"; + "${mod}+c" = "focus child"; + "${mod}+d" = "exec --no-startup-id ${getExe rofi} -show run"; + "${mod}+i" = "exec ${getExe pkgs.xcalib} -invert -alter"; + "${mod}+o" = "exec ${getExe pkgs.xautolock} -locknow"; + "${mod}+Return" = "exec ${getExe st} -e ${getExe tmux-lift}"; + "${mod}+Shift+e" = "exec ${getExe pkgs.xorg.setxkbmap} latam"; + "${mod}+Shift+u" = "exec ${getExe pkgs.xorg.setxkbmap} us"; + }; + + startup = [ + { + command = "${getExe pkgs.xautolock} -time 10 -locker '${pkgs.i3lock-color}/bin/i3lock-color -fe -c222222'"; + notification = false; + } + ]; + + window.commands = [ + # (No) Title Bars + { + command = "border pixel 5"; + criteria.class = "^.*"; + } + + { + command = "floating enabled"; + criteria.class = "floating"; + } + ]; + }; + }; }; }; -- cgit v1.2.3