rework: more TUIs! (#62)

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-09-28 20:18:12 +02:00
committed by GitHub
parent 1a3f23f248
commit 07a60e91d2
98 changed files with 1280 additions and 1093 deletions
+32 -2
View File
@@ -1,6 +1,24 @@
# hypridle handles idle management: lock the screen, turn the display off, and
# suspend after periods of inactivity. The `caffeine-toggle` script pauses it.
{pkgs, ...}: {
{
pkgs,
scripts,
...
}: {
scripts.caffeine-toggle = pkgs.writeShellScriptBin "caffeine-toggle" ''
# Pause hypridle (stay awake) or resume it.
if systemctl --user is-active --quiet hypridle; then
systemctl --user stop hypridle
OSD_TEXT="󰅶 Keep Awake On"
else
systemctl --user start hypridle
OSD_TEXT="󰾫 Keep Awake Off"
fi
${scripts.waybar-osd}/bin/waybar-osd "$OSD_TEXT"
'';
home.packages = [scripts.caffeine-toggle];
services.hypridle = {
enable = true;
settings = {
@@ -17,7 +35,7 @@
on-timeout = "loginctl lock-session";
}
{
timeout = 360; # 6 min → screen off
timeout = 720; # 12 min → screen off
on-timeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
on-resume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
@@ -28,4 +46,16 @@
];
};
};
xdg.desktopEntries = {
caffeine-toggle = {
name = "Keep Awake";
exec = "${scripts.caffeine-toggle}/bin/caffeine-toggle";
icon = "my-caffeine-on-symbolic";
comment = "Pause or resume idle locking and suspend";
categories = ["System"];
terminal = false;
settings.Keywords = "caffeine;idle;awake;inhibit;suspend;";
};
};
}