about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-22T10·43+0200
committerVincent Ambo <github@tazj.in>2018-04-22T10·49+0200
commit37c182cebbe78af78d31a7a0d6f2b0ac1cbc1213 (patch)
tree08e352fa6772b6c5cfbbac0b99e1793d40f7ab87
parent6b40b8af85efc1a95864892e7e88398e848c0eb4 (diff)
feat(desktop): Add "screen-lock with wallpapers" shell script
-rw-r--r--desktop.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/desktop.nix b/desktop.nix
index 836f980261ad..d03cf1244fed 100644
--- a/desktop.nix
+++ b/desktop.nix
@@ -3,6 +3,9 @@
 { config, lib, pkgs, ... }:
 
 let emacs = import ./emacs.nix { inherit pkgs; };
+screenLock = pkgs.writeShellScriptBin "screen-lock" ''
+  find ${pkgs.wallpapers} -name "*.png" | shuf -n1 | xargs i3lock -f -t -i
+'';
 in {
   # Configure basic X-server stuff:
   services.xserver = {
@@ -14,6 +17,8 @@ in {
     displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER";
   };
 
+  # Add a shell script with random screen lock wallpaper selection
+  environment.systemPackages = [ screenLock ];
 
   # Apparently when you have house guests they complain about your screen tearing!
   services.compton.enable = true;