From 5153b5581b2cde5ed96d4e6438d50c1ff7da228e Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 10 Oct 2022 17:47:19 -0700 Subject: [PATCH] Add lock command --- i3.nix | 4 ++-- lock/default.nix | 9 +++++++++ lock/lock.sh | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 lock/default.nix create mode 100644 lock/lock.sh diff --git a/i3.nix b/i3.nix index 4fe469c..04c654f 100644 --- a/i3.nix +++ b/i3.nix @@ -5,7 +5,7 @@ let in { # Dependencies home.packages = with pkgs; [ - i3lock # lockscreen + (pkgs.callPackage ./lock { }) playerctl # pactl comes with PulseAudio scrot # Screnshot keybindings xclip # Copying screenshots to clipboard @@ -23,7 +23,7 @@ in { }; startup = [ { - command = "(systemctl --user restart polybar &) && i3lock -i `readlink -f ~/.background-image`"; + command = "(systemctl --user restart polybar &) && lock"; always = true; notification = false; } diff --git a/lock/default.nix b/lock/default.nix new file mode 100644 index 0000000..5566a5e --- /dev/null +++ b/lock/default.nix @@ -0,0 +1,9 @@ +{ substituteAll, pkgs }: + +substituteAll { + name = "lock"; + src = ./lock.sh; + dir = "bin"; + isExecutable = true; + inherit (pkgs) i3lock; +} diff --git a/lock/lock.sh b/lock/lock.sh new file mode 100644 index 0000000..a9239c5 --- /dev/null +++ b/lock/lock.sh @@ -0,0 +1 @@ +i3lock -i `readlink -f ~/.background-image`