diff --git a/settings/hyprland.nix b/settings/hyprland.nix index ba806c8..7ee4cfc 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -298,7 +298,7 @@ modules-left = [ "hyprland/workspaces" ]; modules-center = [ "clock" ]; - modules-right = [ "pulseaudio" "network" "tray" ]; + modules-right = [ "pulseaudio" "network" "tray" "custom/power" ]; "hyprland/workspaces" = { format = "{name}"; @@ -335,6 +335,21 @@ icon-size = 16; spacing = 8; }; + + "custom/power" = { + format = "⏻"; + tooltip = false; + on-click = "${pkgs.writeShellScript "power-menu" '' + choice=$(printf "Lock\nLogout\nReboot\nShutdown" \ + | ${pkgs.fuzzel}/bin/fuzzel --dmenu --prompt="Power: " --lines=4 --width=12) + case "$choice" in + Lock) ${pkgs.hyprlock}/bin/hyprlock ;; + Logout) hyprctl dispatch exit ;; + Reboot) systemctl reboot ;; + Shutdown) systemctl poweroff ;; + esac + ''}"; + }; }; # Colour tokens (@base00..@base0F) are injected by stylix's waybar @@ -382,7 +397,8 @@ #pulseaudio, #network, - #tray { + #tray, + #custom-power { padding: 0 10px; color: @base05; } @@ -392,9 +408,17 @@ color: @base03; } - #tray { + #custom-power:hover { + color: @base08; + } + + #custom-power { margin-right: 6px; } + + #tray { + margin-right: 0; + } ''; }; };