Switch to using wlogout instead of rofi-power-menu

This commit is contained in:
Evie Litherland-Smith 2023-09-24 13:05:26 +01:00
parent f0d6443f74
commit 10c541b59a
11 changed files with 81 additions and 23 deletions

View file

@ -2,6 +2,7 @@
test: test:
sudo nixos-rebuild test --flake . sudo nixos-rebuild test --flake .
-hyprctl reload
build: build:
sudo nixos-rebuild build --flake . sudo nixos-rebuild build --flake .

View file

@ -102,7 +102,7 @@ in ''
bind = SUPER SHIFT, M, fullscreen, 1 bind = SUPER SHIFT, M, fullscreen, 1
bind = SUPER SHIFT, Q, killactive, bind = SUPER SHIFT, Q, killactive,
bind = SUPER SHIFT, Space, togglefloating 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 # Common program shortcuts
bind = SUPER, E, exec, emacsclient -c bind = SUPER, E, exec, emacsclient -c
@ -155,6 +155,11 @@ in ''
windowrule = center,(thunar) windowrule = center,(thunar)
windowrule = nofullscreenrequest,(org.remmina.Remmina) windowrule = nofullscreenrequest,(org.remmina.Remmina)
windowrule = nomaximizerequest,(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 = float,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = pin,title:(File|Picture-in-Picture),class:(firefox) windowrulev2 = pin,title:(File|Picture-in-Picture),class:(firefox)
windowrulev2 = workspace special silent, title:^(Firefox Sharing Indicator)$ windowrulev2 = workspace special silent, title:^(Firefox Sharing Indicator)$

View file

@ -3,6 +3,7 @@
{ {
imports = [ imports = [
hyprland.homeManagerModules.default hyprland.homeManagerModules.default
./wlogout/default.nix
./waybar/default.nix ./waybar/default.nix
./swaync/default.nix ./swaync/default.nix
./rofi/default.nix ./rofi/default.nix

View file

@ -1,36 +1,18 @@
{ pkgs, config, ... }: { 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 = { programs.rofi = {
enable = true; enable = true;
location = "center"; location = "center";
pass.enable = true; pass.enable = true;
plugins = with pkgs; [ rofi-calc ];
extraConfig = { extraConfig = {
modi = "window,run,drun,ssh,filebrowser,calc,${power-menu},combi";
combi-modi = "window,drun,ssh,filebrowser";
sort = true; sort = true;
sorting-method = "fzf"; sorting-method = "fzf";
matching = "fuzzy"; matching = "fuzzy";
icon-theme = icon-theme; show-icons = false;
show-icons = true;
application-fallback-icon = "󰣆";
drun-display-format = "{icon} {name}";
disable-history = false; disable-history = false;
hide-scrollbar = true; 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;
;
}; };
} }

View file

@ -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}");
}
'';
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB