diff --git a/hm/common.nix b/hm/common.nix index 3bc7557..2437ef2 100644 --- a/hm/common.nix +++ b/hm/common.nix @@ -190,6 +190,16 @@ # toolbox imagemagick numbat + + # Locker + (pkgs.writeShellApplication { + name = "lock"; + text = '' + ${config.frogeye.hooks.lock} + + ${pkgs.vlock}/bin/vlock --all + ''; + }) ]; sessionVariables = { # Favourite commands diff --git a/hm/desktop/lock/default.nix b/hm/desktop/lock/default.nix index ee4d9ff..f6d7029 100644 --- a/hm/desktop/lock/default.nix +++ b/hm/desktop/lock/default.nix @@ -19,10 +19,7 @@ in name = "xlock"; text = '' ${config.frogeye.hooks.lock} - # TODO Maybe we could have a terminal lock? With vlock. - - # TODO Does that work for all DMs? - # TODO Might want to use i3lock on NixOS configs still? + # TODO Reevaluate whether we want this or not if ! ${pkgs.lightdm}/bin/dm-tool lock then if [ -d ${config.xdg.cacheHome}/lockpatterns ] @@ -50,9 +47,9 @@ in "${mod}+F5" = "exec --no-startup-id ${pkgs.xautolock}/bin/xautolock -enable"; }; startup = [ - # Lock screen after 10 minutes + # Stop screen after 10 minutes, 1 minutes after lock it { notification = false; command = "${pkgs.xautolock}/bin/xautolock -time 10 -locker '${pkgs.xorg.xset}/bin/xset dpms force standby' -killtime 1 -killer xlock"; } - # TODO There's a services.screen-locker.xautolock but not sure it can match the above command + # services.screen-locker.xautolock is hardcoded to use systemd for -locker (doesn't even work...) ]; }; };