diff --git a/modules/home/programs/waybar/default.nix b/modules/home/programs/waybar/default.nix index 09024d8..a9d4c1d 100644 --- a/modules/home/programs/waybar/default.nix +++ b/modules/home/programs/waybar/default.nix @@ -17,7 +17,10 @@ in { }; config = lib.mkIf cfg.enable { - marleyos.services.swaync.enable = true; + marleyos = { + services.swaync.enable = true; + programs.wlogout.enable = true; + }; programs.waybar = let keybindings-script = @@ -156,7 +159,7 @@ in { "custom/exit" = { tooltip = false; format = ""; - on-click = "sleep 0.1 && ${lib.getExe pkgs.wlogout}"; + on-click = "sleep 0.1 && ${lib.getExe config.programs.wlogout.package}"; }; "custom/startmenu" = { diff --git a/modules/home/programs/wlogout/default.nix b/modules/home/programs/wlogout/default.nix new file mode 100644 index 0000000..5ed9434 --- /dev/null +++ b/modules/home/programs/wlogout/default.nix @@ -0,0 +1,139 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.marleyos.programs.wlogout; +in { + options.marleyos.programs.wlogout.enable = lib.mkEnableOption "wlogout"; + + config = lib.mkIf cfg.enable { + programs.wlogout = { + enable = true; + + layout = let + systemctl = lib.getExe' pkgs.systemd "systemctl"; + hyprctrl = + lib.getExe' config.wayland.windowManager.hyprland.package "hyprctrl"; + hyprlock = lib.getExe config.programs.hyprlock.package; + in [ + { + label = "lock"; + action = "sleep 1; ${hyprlock}"; + text = "lock"; + keybind = "l"; + } + { + label = "logout"; + action = "sleep 1; ${hyprctrl} dispatch exit"; + text = "exit"; + keybind = "e"; + } + { + label = "reboot"; + action = "sleep 1; ${systemctl} reboot"; + text = "reboot"; + keybind = "r"; + } + { + label = "shutdown"; + action = "sleep 1; ${systemctl} poweroff"; + text = "shutdown"; + keybind = "s"; + } + { + label = "suspend"; + action = "sleep 1; ${systemctl} suspend"; + text = "suspend"; + keybind = "u"; + } + { + label = "hibernate"; + action = "sleep 1; ${systemctl} hibernate"; + text = "hibernate"; + keybind = "h"; + } + ]; + + style = lib.concatStrings [ + (lib.optionalString config.rose-pine.enable + #css + '' + @define-color zero #191724; + @define-color one #1f1d2e; + @define-color two #26233a; + @define-color four #908caa; + @define-color five #e0def4; + @define-color seven #524f67; + @define-color eight #eb6f92; + @define-color b #31748f; + @define-color e #f6c177; + @define-color d #c4a7e7; + @define-color c #9ccf38; + '') + # css + '' + * { + font-family: ${config.marleyos.theme.fonts.monospace.name}; + background-image: none; + transition: 20ms; + } + + window { + background-color: rgba(12, 12, 12, 0.1); + } + + button { + color: @five; + font-size: 20px; + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + border-style: solid; + background-color: rgba(12, 12, 12, 0.3); + border: 3px solid @five; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + } + + button:focus, button:active, button:hover { + color: @b; + background-color: rgba(12, 12, 12, 0.5); + border: 3px solid @b; + } + + #lock { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./lock.png}")); + } + #logout { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./logout.png}")); + } + #reboot { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./reboot.png}")); + } + #shutdown { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./shutdown.png}")); + } + #suspend { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./suspend.png}")); + } + #hibernate { + margin: 10px; + border-radius: 20px; + background-image: image(url("${./hibernate.png}")); + } + '' + ]; + }; + }; +} diff --git a/modules/home/programs/wlogout/hibernate.png b/modules/home/programs/wlogout/hibernate.png new file mode 100644 index 0000000..bf2b001 Binary files /dev/null and b/modules/home/programs/wlogout/hibernate.png differ diff --git a/modules/home/programs/wlogout/lock.png b/modules/home/programs/wlogout/lock.png new file mode 100644 index 0000000..da59b10 Binary files /dev/null and b/modules/home/programs/wlogout/lock.png differ diff --git a/modules/home/programs/wlogout/logout.png b/modules/home/programs/wlogout/logout.png new file mode 100644 index 0000000..8a25922 Binary files /dev/null and b/modules/home/programs/wlogout/logout.png differ diff --git a/modules/home/programs/wlogout/reboot.png b/modules/home/programs/wlogout/reboot.png new file mode 100644 index 0000000..e5fd221 Binary files /dev/null and b/modules/home/programs/wlogout/reboot.png differ diff --git a/modules/home/programs/wlogout/shutdown.png b/modules/home/programs/wlogout/shutdown.png new file mode 100644 index 0000000..663ca03 Binary files /dev/null and b/modules/home/programs/wlogout/shutdown.png differ diff --git a/modules/home/programs/wlogout/suspend.png b/modules/home/programs/wlogout/suspend.png new file mode 100644 index 0000000..af099b9 Binary files /dev/null and b/modules/home/programs/wlogout/suspend.png differ diff --git a/modules/home/wayland/hyprland/default.nix b/modules/home/wayland/hyprland/default.nix index 36e1994..67730ad 100644 --- a/modules/home/wayland/hyprland/default.nix +++ b/modules/home/wayland/hyprland/default.nix @@ -38,6 +38,7 @@ in { marleyos = { programs = { waybar.enable = true; + wlogout.enable = true; wofi.enable = true; }; services = {