mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:39:39 +00:00
nixos: use upstream xscreensaver module
This commit is contained in:
parent
ae8a563863
commit
c2e068dc48
2 changed files with 0 additions and 55 deletions
|
|
@ -113,7 +113,6 @@ in
|
||||||
../nixosModules/common/network.nix
|
../nixosModules/common/network.nix
|
||||||
../nixosModules/common/sudo-conf.nix
|
../nixosModules/common/sudo-conf.nix
|
||||||
../nixosModules/common/system-nixconf.nix
|
../nixosModules/common/system-nixconf.nix
|
||||||
../nixosModules/common/xscreensaver.nix
|
|
||||||
|
|
||||||
# QUIRK:
|
# QUIRK:
|
||||||
# Had issue when building the installer as it fails to bootstrap itself
|
# Had issue when building the installer as it fails to bootstrap itself
|
||||||
|
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
#
|
|
||||||
# This module provides a service react to xscreensaver events
|
|
||||||
#
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
cfg = config.services.xscreensaver;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.xscreensaver.hooks = lib.mkOption {
|
|
||||||
type = with lib.types; attrsOf str;
|
|
||||||
description = "An attrset of events mapped a block of shell command to be run";
|
|
||||||
default = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
systemd.user.services = {
|
|
||||||
"xscreensaver-hooks" = {
|
|
||||||
description = "Run commands on xscreensaver events";
|
|
||||||
after = [
|
|
||||||
"graphical-session.target"
|
|
||||||
"xscreensaver.service"
|
|
||||||
];
|
|
||||||
partOf = [ "graphical-session.target" ];
|
|
||||||
wantedBy = [ "graphical-session.target" ];
|
|
||||||
script =
|
|
||||||
let
|
|
||||||
handlers = lib.concatMapAttrsStringSep "\n" (event: action: ''
|
|
||||||
"${event}")
|
|
||||||
( ${action}
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
'') cfg.hooks;
|
|
||||||
in
|
|
||||||
''
|
|
||||||
xscreensaver-command -watch | while read event rest; do
|
|
||||||
echo "The handler script got \"$event\""
|
|
||||||
case $event in
|
|
||||||
${handlers}
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
path = [
|
|
||||||
cfg.package # contains xscreensaver-command
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue