diff --git a/Makefile b/Makefile index ace602b8..9d5aa8d4 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ test: sudo nixos-rebuild test --flake . + -hyprctl reload build: sudo nixos-rebuild build --flake . diff --git a/home/hyprland/config.nix b/home/hyprland/config.nix index e5676638..fba7b92e 100644 --- a/home/hyprland/config.nix +++ b/home/hyprland/config.nix @@ -102,7 +102,7 @@ in '' bind = SUPER SHIFT, M, fullscreen, 1 bind = SUPER SHIFT, Q, killactive, bind = SUPER SHIFT, Space, togglefloating - bind = SUPER SHIFT, P, exec, pkill rofi || rofi -show power-menu + bind = SUPER SHIFT, P, exec, wlogout # Common program shortcuts bind = SUPER, E, exec, emacsclient -c @@ -155,6 +155,11 @@ in '' windowrule = center,(thunar) windowrule = nofullscreenrequest,(org.remmina.Remmina) windowrule = nomaximizerequest,(org.remmina.Remmina) + windowrule = float,(wlogout) + windowrule = size 80% 80%,(wlogout) + windowrule = center,(wlogout) + windowrule = nofullscreenrequest,(wlogout) + windowrule = nomaximizerequest,(wlogout) windowrulev2 = float,title:(File|Picture-in-Picture),class:(firefox) windowrulev2 = pin,title:(File|Picture-in-Picture),class:(firefox) windowrulev2 = workspace special silent, title:^(Firefox — Sharing Indicator)$ diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 5510efb0..fe33586c 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -3,6 +3,7 @@ { imports = [ hyprland.homeManagerModules.default + ./wlogout/default.nix ./waybar/default.nix ./swaync/default.nix ./rofi/default.nix diff --git a/home/hyprland/rofi/default.nix b/home/hyprland/rofi/default.nix index 7e4309bc..1e3e8f61 100644 --- a/home/hyprland/rofi/default.nix +++ b/home/hyprland/rofi/default.nix @@ -1,36 +1,18 @@ { pkgs, config, ... }: -let - icon-theme = config.gtk.iconTheme.name; - power-menu = "power-menu:${pkgs.rofi-power-menu}/bin/rofi-power-menu"; -in { - home.packages = with pkgs; [ rofi-power-menu libqalculate ]; + +{ programs.rofi = { enable = true; location = "center"; pass.enable = true; - plugins = with pkgs; [ rofi-calc ]; extraConfig = { - modi = "window,run,drun,ssh,filebrowser,calc,${power-menu},combi"; - combi-modi = "window,drun,ssh,filebrowser"; sort = true; sorting-method = "fzf"; matching = "fuzzy"; - icon-theme = icon-theme; - show-icons = true; - application-fallback-icon = "󰣆"; - drun-display-format = "{icon} {name}"; + show-icons = false; disable-history = false; hide-scrollbar = true; - display-window = " 󰧨 Move "; - display-run = " 󰅴 Run "; - display-drun = " 󱓞 Launch "; - display-ssh = " 󰢹 SSH "; - display-filebrowser = " 󰝰 Files "; - display-calc = " 󰪚 Calculator "; - display-combi = " 󱗿 Combi "; }; - theme = ./theme.rasi - - ; + theme = ./theme.rasi; }; } diff --git a/home/hyprland/wlogout/default.nix b/home/hyprland/wlogout/default.nix new file mode 100644 index 00000000..f2f690ad --- /dev/null +++ b/home/hyprland/wlogout/default.nix @@ -0,0 +1,69 @@ +{ config, lib, pkgs, ... }: + +{ + programs.wlogout = { + enable = true; + layout = [ + { + label = "reboot"; + action = "systemctl reboot"; + text = "Reboot"; + keybind = "r"; + } + { + label = "shutdown"; + action = "systemctl poweroff"; + text = "Shutdown"; + keybind = "s"; + } + { + label = "logout"; + action = "hyprctl dispatch exit"; + text = "Logout"; + keybind = "l"; + } + ]; + style = let + shutdownIcon = ./icons/shutdown.png; + rebootIcon = ./icons/reboot.png; + logoutIcon = ./icons/logout.png; + in '' + window { + background: transparent; + } + + button { + background-repeat: no-repeat; + background-position: center; + background-size: 25%; + border: none; + background-color: rgba(36, 39, 58, .5); + box-shadow: none; + margin: 5px; + font-size: 20px; + color: #6e738d; + } + + button:hover { + background-color: rgba(183, 189, 248, .05); + } + + button:focus { + background-color: rgba(202, 211, 245, .1); + color: #cad3f5; + } + + #shutdown { + background-image: url("${shutdownIcon}"); + } + + #reboot { + background-image: url("${rebootIcon}"); + } + + #logout { + background-image: url("${logoutIcon}"); + } + ''; + }; +} diff --git a/home/hyprland/wlogout/icons/hibernate.png b/home/hyprland/wlogout/icons/hibernate.png new file mode 100644 index 00000000..a6322aa2 Binary files /dev/null and b/home/hyprland/wlogout/icons/hibernate.png differ diff --git a/home/hyprland/wlogout/icons/lock.png b/home/hyprland/wlogout/icons/lock.png new file mode 100644 index 00000000..f0b1eaf9 Binary files /dev/null and b/home/hyprland/wlogout/icons/lock.png differ diff --git a/home/hyprland/wlogout/icons/logout.png b/home/hyprland/wlogout/icons/logout.png new file mode 100644 index 00000000..345a8aa8 Binary files /dev/null and b/home/hyprland/wlogout/icons/logout.png differ diff --git a/home/hyprland/wlogout/icons/reboot.png b/home/hyprland/wlogout/icons/reboot.png new file mode 100644 index 00000000..29cfa2ff Binary files /dev/null and b/home/hyprland/wlogout/icons/reboot.png differ diff --git a/home/hyprland/wlogout/icons/shutdown.png b/home/hyprland/wlogout/icons/shutdown.png new file mode 100644 index 00000000..4d7d4995 Binary files /dev/null and b/home/hyprland/wlogout/icons/shutdown.png differ diff --git a/home/hyprland/wlogout/icons/suspend.png b/home/hyprland/wlogout/icons/suspend.png new file mode 100644 index 00000000..647bd663 Binary files /dev/null and b/home/hyprland/wlogout/icons/suspend.png differ