From b3f1d95634098dd1b1b37df6a9a0400c01b7a5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Sat, 9 Mar 2024 19:09:30 +0100 Subject: [PATCH] lock: More goodness --- hm/common.nix | 10 ++++++++++ hm/desktop/lock/default.nix | 9 +++------ 2 files changed, 13 insertions(+), 6 deletions(-) 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...) ]; }; };