nixos/home/wlogout/default.nix
2024-03-13 11:31:15 +01:00

121 lines
2.9 KiB
Nix

{ config, ... }: {
programs.wlogout = {
enable = true;
layout = [
{
label = "lock";
action = "sleep 1; hyprlock";
text = "Lock";
keybind = "l";
}
{
label = "hibernate";
action = "sleep 1; systemctl hibernate";
text = "Hibernate";
keybind = "h";
}
{
label = "logout";
action = "sleep 1; killall -9 Hyprland sleep 2";
text = "Exit";
keybind = "e";
}
{
label = "shutdown";
action = "sleep 1; systemctl poweroff";
text = "Shutdown";
keybind = "s";
}
{
label = "suspend";
action = "sleep 1; systemctl suspend";
text = "Suspend";
keybind = "u";
}
{
label = "reboot";
action = "sleep 1; systemctl reboot";
text = "Reboot";
keybind = "r";
}
];
style = ''
* {
font-family: "${config.theme.font}";
background-image: none;
transition: 20ms;
}
window {
background-color: rgba(12,12,12,0.5);
}
button {
color: #${config.theme.colors.fg};
font-size:20px;
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
border-style: solid;
background-color: #${config.theme.colors.bg};
border: ${
toString config.theme.border-size
}px solid #${config.theme.colors.fg};
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 {
color: #${config.theme.colors.primary-fg};
background-color: #${config.theme.colors.primary-bg};
border: 3px solid #${config.theme.colors.primary-bg};
}
/*
-----------------------------------------------------
Buttons
-----------------------------------------------------
*/
#lock,#logout,#suspend,#hibernate,#shutdown,#reboot {
margin: 10px;
border-radius: ${toString config.theme.rounding}px;
}
#lock {
background-image: image(url("icons/lock.png"));
}
#logout {
background-image: image(url("icons/logout.png"));
}
#suspend {
background-image: image(url("icons/suspend.png"));
}
#hibernate {
background-image: image(url("icons/hibernate.png"));
}
#shutdown {
background-image: image(url("icons/shutdown.png"));
}
#reboot {
background-image: image(url("icons/reboot.png"));
}
'';
};
xdg.configFile."wlogout/icons" = {
recursive = false;
source = ./icons;
};
}