aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-04-29 01:41:19 -0700
committerMark Nipper <nipsy@bitgnome.net>2024-04-29 01:41:19 -0700
commitda03a3df96bed561151e72e69eee3cd3397443c6 (patch)
treeb54f78cbe9cb852c7a503f3e4f7b8dfa6e613135
parent39c6e0bbf32b533a59aa3292151f53668fb0c573 (diff)
downloadnix-da03a3df96bed561151e72e69eee3cd3397443c6.tar
nix-da03a3df96bed561151e72e69eee3cd3397443c6.tar.gz
nix-da03a3df96bed561151e72e69eee3cd3397443c6.tar.bz2
nix-da03a3df96bed561151e72e69eee3cd3397443c6.tar.lz
nix-da03a3df96bed561151e72e69eee3cd3397443c6.tar.xz
nix-da03a3df96bed561151e72e69eee3cd3397443c6.tar.zst
nix-da03a3df96bed561151e72e69eee3cd3397443c6.zip
Apply working xscreensaver configuration
Diffstat (limited to '')
-rw-r--r--home/nipsy/common/optional/desktops/services/xscreensaver.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/home/nipsy/common/optional/desktops/services/xscreensaver.nix b/home/nipsy/common/optional/desktops/services/xscreensaver.nix
index 1d1dcb5..be9497d 100644
--- a/home/nipsy/common/optional/desktops/services/xscreensaver.nix
+++ b/home/nipsy/common/optional/desktops/services/xscreensaver.nix
@@ -1,5 +1,38 @@
+{ lib, ... }:
{
services.xscreensaver = {
enable = true;
};
+
+ home.activation.xscreensaver = lib.hm.dag.entryAfter ["writeBoundary"] ''
+ conf=$HOME/.xscreensaver
+
+ if grep -q '^fade:'$'\t' $conf; then
+ run sed -i -e 's/^fade:\t.*$/fade:\t\tFalse/' $conf
+ else
+ run echo -e 'fade:\t\tFalse' >> $conf
+ fi
+
+ if grep -q '^mode:'$'\t' $conf; then
+ run sed -i -e 's/^mode:\t.*$/mode:\t\trandom/' $conf
+ else
+ run echo -e 'mode:\t\trandom' >> $conf
+ fi
+
+ if grep -q '^splash:'$'\t' $conf; then
+ run sed -i -e 's/^splash:\t.*$/splash:\t\tFalse/' $conf
+ else
+ run echo -e 'splash:\t\tFalse' >> $conf
+ fi
+
+ if grep -q '^timeout:'$'\t' $conf; then
+ run sed -i -e 's/^timeout:\t.*$/timeout:\t0:10:00/' $conf
+ else
+ run echo -e 'timeout:\t0:10:00' >> $conf
+ fi
+
+ if /run/current-system/sw/bin/systemctl --user --quiet is-active xscreensaver.service; then
+ /run/current-system/sw/bin/systemctl --user restart xscreensaver.service
+ fi
+ '';
}