commit ab368473b3cba82a124852d6e5a25186aadb2c87
parent 4526eb3ab50cf1837585a1effdb227730e384d4f
Author: vin <vin@vineetk.net>
Date: Fri, 25 Apr 2025 23:33:58 -0400
demiurge, hastur: start using sway again
Diffstat:
| M | home.nix | | | 178 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 176 insertions(+), 2 deletions(-)
diff --git a/home.nix b/home.nix
@@ -87,6 +87,10 @@ in {
xsel
xwallpaper
+ # wayland and desktop-related
+ swaybg
+ wmenu
+
# 3d printing
prusa-slicer
uvtools
@@ -948,7 +952,7 @@ interceptor.register(int_fn)
};
xsession = {
- enable = true;
+ enable = false;
windowManager.i3 = {
enable = true;
config = {
@@ -1082,7 +1086,7 @@ interceptor.register(int_fn)
"${modifier}+r" = "mode resize";
};
- menu = "dmenu_run";
+ menu = "${pkgs.wmenu}/bin/wmenu";
modes.resize =
let
@@ -1116,4 +1120,174 @@ interceptor.register(int_fn)
};
};
};
+
+ wayland.windowManager.sway = {
+ enable = true;
+ package = pkgs.swayfx;
+
+ # https://github.com/nix-community/home-manager/issues/5379#issuecomment-2096066969
+ checkConfig = false;
+
+ config = {
+ # TODO import nix file that defines colorscheme
+ bars = [ {
+ colors = {
+ # background = colors.current.primary.background;
+ background = "#000000";
+ statusline = colors.current.primary.foreground;
+ focusedWorkspace = {
+ background = colors.current.normal.black;
+ border = colors.current.normal.black;
+ text = colors.current.normal.green;
+ };
+ activeWorkspace = {
+ background = colors.current.normal.black;
+ border = colors.current.normal.black;
+ text = colors.current.primary.foreground;
+ };
+ inactiveWorkspace = {
+ background = colors.current.primary.background;
+ border = colors.current.primary.background;
+ text = colors.current.normal.white;
+ };
+ };
+ command = "${pkgs.sway}/bin/swaybar";
+ position = "top";
+ statusCommand = "while date +'%Y-%m-%d %X'; do sleep 1; done";
+ } ];
+
+ colors = {
+ focused = {
+ background = colors.current.primary.background;
+ border = colors.current.primary.background;
+ childBorder = colors.current.primary.background;
+ indicator = colors.current.normal.black;
+ text = colors.current.normal.green;
+ };
+ focusedInactive = {
+ background = colors.current.primary.background;
+ border = colors.current.primary.background;
+ childBorder = colors.current.primary.background;
+ indicator = colors.current.normal.black;
+ text = colors.current.primary.foreground;
+ };
+ unfocused = {
+ background = colors.current.normal.black;
+ border = colors.current.normal.black;
+ childBorder = colors.current.normal.black;
+ indicator = colors.current.primary.background;
+ text = colors.current.normal.white;
+ };
+ };
+
+ focus.mouseWarping = true;
+
+ fonts = {
+ names = [ "monospace" ];
+ size = 11.0;
+ };
+
+ gaps = {
+ inner = 15;
+ smartGaps = true;
+ };
+
+ keybindings =
+ let
+ left = "n";
+ down = "e";
+ up = "o";
+ right = "i";
+ modifier = config.wayland.windowManager.sway.config.modifier;
+ menu = config.wayland.windowManager.sway.config.menu;
+ terminal = config.wayland.windowManager.sway.config.terminal;
+ in lib.mkOptionDefault {
+ "${modifier}+Return" = "exec ${terminal}";
+ "${modifier}+p" = "exec ${menu}";
+ "${modifier}+b" = "exec bm t";
+ "${modifier}+Shift+b" = "exec kasimenu";
+ "${modifier}+u" = "exec kasimenu user";
+ "${modifier}+Shift+u" = "exec kasimenu email";
+ "${modifier}+Shift+t" = "exec kasimenu_totp";
+
+ "${modifier}+Shift+q" = "kill";
+ "${modifier}+Shift+c" = "reload";
+ "Mod1+Mod4+Ctrl+Shift+e" = "exit";
+
+ "${modifier}+${left}" = "focus left;";
+ "${modifier}+${down}" = "focus down;";
+ "${modifier}+${up}" = "focus up;";
+ "${modifier}+${right}" = "focus right;";
+ "${modifier}+Shift+${left}" = "move left";
+ "${modifier}+Shift+${down}" = "move down";
+ "${modifier}+Shift+${up}" = "move up";
+ "${modifier}+Shift+${right}" = "move right";
+
+ # TODO do this programatically
+ "${modifier}+1" = "workspace number 1";
+ "${modifier}+2" = "workspace number 2";
+ "${modifier}+3" = "workspace number 3";
+ "${modifier}+4" = "workspace number 4";
+ "${modifier}+5" = "workspace number 5";
+ "${modifier}+6" = "workspace number 6";
+ "${modifier}+7" = "workspace number 7";
+ "${modifier}+8" = "workspace number 8";
+ "${modifier}+9" = "workspace number 9";
+ "${modifier}+0" = "workspace number 10";
+ "${modifier}+Shift+1" = "move container to workspace number 1";
+ "${modifier}+Shift+2" = "move container to workspace number 2";
+ "${modifier}+Shift+3" = "move container to workspace number 3";
+ "${modifier}+Shift+4" = "move container to workspace number 4";
+ "${modifier}+Shift+5" = "move container to workspace number 5";
+ "${modifier}+Shift+6" = "move container to workspace number 6";
+ "${modifier}+Shift+7" = "move container to workspace number 7";
+ "${modifier}+Shift+8" = "move container to workspace number 8";
+ "${modifier}+Shift+9" = "move container to workspace number 9";
+ "${modifier}+Shift+0" = "move container to workspace number 10";
+
+ "${modifier}+Ctrl+Shift+b" = "splith";
+ "${modifier}+Ctrl+Shift+v" = "splitv";
+ "${modifier}+s" = "layout stacking";
+ "${modifier}+t" = "layout tabbed";
+ "${modifier}+Ctrl+Shift+t" = "layout toggle split";
+ "${modifier}+Shift+f" = "fullscreen";
+ "${modifier}+Shift+space" = "floating toggle";
+ "${modifier}+space" = "focus mode_toggle";
+ "${modifier}+a" = "focus parent";
+
+ "${modifier}+r" = "mode resize";
+ };
+
+ menu = "dmenu_run";
+
+ modes.resize =
+ let
+ left = "n";
+ down = "e";
+ up = "o";
+ right = "i";
+ in lib.mkOptionDefault {
+ ${left} = "resize shrink width 10px";
+ ${down} = "resize grow height 10px";
+ ${up} = "resize shrink width 10px";
+ ${right} = "resize grow width 10px";
+ Escape = "mode default";
+ };
+
+ modifier = "Mod4";
+
+ startup = [
+ { command = "${pkgs.swaybg}/bin/swaybg --center pics/wp/elite_milky_way_below.png"; }
+ ];
+
+ terminal = "alacritty";
+
+ window = {
+ border = 0;
+ titlebar = false;
+ };
+
+ workspaceAutoBackAndForth = true;
+ };
+ };
}