From 5eace49faee7f771396a4a155742db8d93340bd5 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 18 May 2024 08:34:22 -0400 Subject: [PATCH] sway: add close button in tablet mode --- homeManagerModules/apps/waybar/default.nix | 13 +++++++------ homeManagerModules/desktop/sway/default.nix | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/homeManagerModules/apps/waybar/default.nix b/homeManagerModules/apps/waybar/default.nix index e355f68b..9522b906 100644 --- a/homeManagerModules/apps/waybar/default.nix +++ b/homeManagerModules/apps/waybar/default.nix @@ -7,11 +7,6 @@ options = {alyraffauf.apps.waybar.enable = lib.mkEnableOption "Enables waybar.";}; config = lib.mkIf config.alyraffauf.apps.waybar.enable { - # Packages that should be installed to the user profile. - home.packages = with pkgs; [ - blueberry - pavucontrol - ]; xdg.configFile."waybar/style.css".text = '' * { @@ -65,6 +60,7 @@ #inhibitor, #custom-logout, #custom-menu, + #custom-sway-close, #tray { padding: 0 7.5px; margin: 0 5px; @@ -89,6 +85,7 @@ #tray, #clock, #custom-menu, + #custom-sway-close, #hardware { border-radius: 10; background: rgba ${ @@ -100,7 +97,7 @@ padding: 0px 10px 0px 10px; } - #clock, #custom-menu { + #clock, #custom-menu, #custom-sway-close { padding: 0px 20px 0px 20px; } @@ -165,6 +162,10 @@ "tooltip" = true; "tooltip-format" = "{app}: {title}"; }; + "custom/sway-close" = { + "on-click" = ''${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} kill''; + "format" = "󰅗"; + }; "river/window" = { "max-length" = 100; }; diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 9487be96..d54290bb 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -64,7 +64,7 @@ mainBar = { modules-left = if config.alyraffauf.desktop.sway.tabletMode.menuButton - then ["custom/menu" "sway/workspaces" "sway/scratchpad" "sway/mode"] + then ["custom/menu" "custom/sway-close" "sway/workspaces" "sway/scratchpad" "sway/mode"] else ["sway/workspaces" "sway/scratchpad" "sway/mode"]; }; };