NixOS/home/modules/hyprland/wlogout.nix

140 lines
3.5 KiB
Nix
Raw Normal View History

2024-06-12 09:54:11 +07:00
{ lib, config, ... }:
let
cfg = config.profile.hyprland;
in
{
config = lib.mkIf cfg.enable {
home.file.".config/wlogout/icons" = {
source = ./wlogout-icons;
recursive = true;
};
programs.wlogout = {
2024-10-21 15:38:59 +07:00
style =
# css
''
/* -----------------------------------------------------
* Import Pywal colors
* ----------------------------------------------------- */
@import "${config.home.homeDirectory}/.cache/wallust/wlogout.css";
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
/* -----------------------------------------------------
* General
* ----------------------------------------------------- */
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
* {
font-family: "Fira Sans Semibold", FontAwesome, Roboto, Helvetica, Arial, sans-serif;
background-image: none;
transition: 20ms;
box-shadow: none;
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
button {
color: #ffffff;
font-size: 20px;
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
background-repeat: no-repeat;
background-position: center;
background-size: 25%;
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
border-style: solid;
background-color: rgba(12, 12, 12, 0.3);
border: 3px solid #ffffff;
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
box-shadow:
0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
button:focus,
button:active,
button:hover {
color: @color11;
background-color: rgba(12, 12, 12, 0.5);
border: 3px solid @color11;
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
/*
-----------------------------------------------------
Buttons
-----------------------------------------------------
*/
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#lock {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/lock.png"));
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#logout {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/logout.png"));
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#suspend {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/suspend.png"));
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#hibernate {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/hibernate.png"));
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#shutdown {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/shutdown.png"));
}
2024-06-12 09:54:11 +07:00
2024-10-21 15:38:59 +07:00
#reboot {
margin: 10px;
border-radius: 20px;
background-image: image(url("icons/reboot.png"));
}
'';
2024-06-12 09:54:11 +07:00
enable = true;
layout = [
{
label = "lock";
2024-10-21 15:38:59 +07:00
action = "loginctl lock-session";
2024-06-12 09:54:11 +07:00
text = "Lock";
keybind = "l";
}
{
label = "hibernate";
action = "sleep 1; systemctl hibernate";
text = "Hibernate";
keybind = "h";
}
{
label = "logout";
action = "hyprctl dispatch exit";
text = "Exit";
keybind = "e";
}
{
label = "shutdown";
action = "systemctl poweroff";
text = "Shutdown";
keybind = "s";
}
{
label = "suspend";
action = "systemctl suspend";
text = "Suspend";
keybind = "u";
}
{
label = "reboot";
action = "systemctl reboot";
text = "Reboot";
keybind = "r";
}
];
};
};
}