feat(homeModules/cli): add screensaver timeout

This commit is contained in:
Mohammad Rafiq 2025-05-21 19:01:45 +08:00
parent cedba9c4f6
commit 92d7ab9b29
No known key found for this signature in database
3 changed files with 7 additions and 4 deletions

View file

@ -5,7 +5,8 @@
}: }:
{ {
cli.shell = "zsh"; cli.shell = "zsh";
cli.enableScreensaver = true; cli.screensaver.enable = true;
cli.screensaver.timeout = "10";
cli.editor = "nvf"; cli.editor = "nvf";
cli.file-browser = "yazi"; cli.file-browser = "yazi";
cli.multiplexer = "zellij"; cli.multiplexer = "zellij";

View file

@ -7,7 +7,8 @@
{ {
options.cli = { options.cli = {
shell = lib.pantheon.mkStrOption; shell = lib.pantheon.mkStrOption;
enableScreensaver = lib.mkEnableOption ""; screensaver.enable = lib.mkEnableOption "";
screensaver.timeout = lib.pantheon.mkStrOption;
editor = lib.pantheon.mkStrOption; editor = lib.pantheon.mkStrOption;
file-browser = lib.pantheon.mkStrOption; file-browser = lib.pantheon.mkStrOption;
multiplexer = lib.pantheon.mkStrOption; multiplexer = lib.pantheon.mkStrOption;

View file

@ -17,7 +17,7 @@
size = 10000; size = 10000;
}; };
}; };
programs.zsh.initContent = lib.mkIf config.cli.enableScreensaver ( programs.zsh.initContent = lib.mkIf config.cli.screensaver.enable (
lib.mkOrder 1200 lib.mkOrder 1200
# zsh # zsh
'' ''
@ -25,9 +25,10 @@
PROMPT='> ' PROMPT='> '
RPROMPT='[%D{%L:%M:%S %p}]' RPROMPT='[%D{%L:%M:%S %p}]'
TMOUT=10 TMOUT=${config.cli.screensaver.timeout}
TRAPALRM() { TRAPALRM() {
PROMPT='IDLE > '
zle reset-prompt zle reset-prompt
} }
'' ''