mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
40 lines
924 B
Nix
40 lines
924 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
suspendIfBored = false;
|
|
|
|
xlockModes = lib.concatStringsSep "\\n" [
|
|
# "braid"
|
|
"galaxy"
|
|
# "lightning"
|
|
# "matrix"
|
|
"pyro2"
|
|
"space"
|
|
];
|
|
my-xlock = pkgs.writers.writeDashBin "xlock" ''
|
|
MODE=$(printf "${xlockModes}" | shuf -n 1)
|
|
|
|
${pkgs.xlockmore}/bin/xlock \
|
|
-saturation 0.4 \
|
|
-erasemode no_fade \
|
|
+description \
|
|
-showdate \
|
|
-username " " \
|
|
-password " " \
|
|
-info " " \
|
|
-validate "..." \
|
|
-invalid "Computer says no." \
|
|
-mode "$MODE"
|
|
'';
|
|
in {
|
|
services.xserver.xautolock = rec {
|
|
enable = true;
|
|
killer =
|
|
if suspendIfBored then "${pkgs.systemd}/bin/systemctl suspend" else null;
|
|
locker = "${my-xlock}/bin/xlock";
|
|
nowlocker = locker;
|
|
enableNotifier = true;
|
|
notifier = ''
|
|
${pkgs.libnotify}/bin/notify-send -u normal -a xautolock "Locking" "in 10 seconds."'';
|
|
};
|
|
}
|