mirror of
https://github.com/kmein/niveum
synced 2026-03-19 03:21:10 +01:00
xautolock: use xlockmore
This commit is contained in:
@@ -1,16 +1,37 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
{
|
let
|
||||||
services.xserver.displayManager.sessionCommands = ''
|
xlockModes = lib.concatStringsSep "\\n" [
|
||||||
${pkgs.systemd}/bin/systemctl --user import-environment XDG_SESSION_PATH
|
"braid"
|
||||||
${pkgs.lightlocker}/bin/light-locker &
|
"galaxy"
|
||||||
'';
|
"lightning"
|
||||||
|
"matrix"
|
||||||
|
"pyro2"
|
||||||
|
"space"
|
||||||
|
"star"
|
||||||
|
];
|
||||||
|
my-xlock = pkgs.unstable.writers.writeDash "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 {
|
services.xserver.xautolock = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
killer = "${pkgs.systemd}/bin/systemctl suspend";
|
killer = "${pkgs.systemd}/bin/systemctl suspend";
|
||||||
locker = "${pkgs.i3lock}/bin/i3lock";
|
locker = "${my-xlock}/bin/xlock";
|
||||||
nowlocker = locker;
|
nowlocker = locker;
|
||||||
enableNotifier = true;
|
enableNotifier = true;
|
||||||
notifier = ''${pkgs.libnotify}/bin/notify-send -u normal -a xautolock "Locking soon" "The screen will lock in 10 seconds."'';
|
notifier = ''${pkgs.libnotify}/bin/notify-send -u normal -a xautolock "Locking" "in 10 seconds."'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user