From 07b00d3e3f763e08a4f59f0fc69eb4a87dc0319f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Fri, 17 Jun 2022 20:50:12 -0400 Subject: [PATCH] automatically create lock screen cache if needed --- modules/graphical/i3.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/graphical/i3.nix b/modules/graphical/i3.nix index 7876b52..91e79d3 100644 --- a/modules/graphical/i3.nix +++ b/modules/graphical/i3.nix @@ -244,6 +244,16 @@ in { }; }; + # Update lock screen cache only if cache is empty + home.activation.updateLockScreenCache = + let cacheDir = "/home/${config.user}/.cache/betterlockscreen/current"; + in config.home-manager.users.${config.user}.lib.dag.entryAfter + [ "writeBoundary" ] '' + if [ ! -d ${cacheDir} ] || [ -z "$(ls ${cacheDir})" ]; then + $DRY_RUN_CMD ${lockUpdate} + fi + ''; + }; # Ref: https://github.com/betterlockscreen/betterlockscreen/blob/next/system/betterlockscreen%40.service