diff options
author | Soispha <soispha@vhack.eu> | 2023-12-31 12:12:04 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-12-31 12:12:04 +0100 |
commit | 8ea57d8c0722284530898588453a2eba85a9b2ff (patch) | |
tree | 1b6843ca88e58ddd4f9a22b1c0591b156162e41b /hm/soispha/pkgs/scripts/wrappers/lock | |
parent | fix(hm/pkgs/con2pdf): Don't reassing `name` variable as it's global (diff) | |
download | nixos-config-8ea57d8c0722284530898588453a2eba85a9b2ff.zip |
feat(hm/pkgs/lock): Init
Diffstat (limited to 'hm/soispha/pkgs/scripts/wrappers/lock')
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/lock | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/lock b/hm/soispha/pkgs/scripts/wrappers/lock new file mode 100755 index 00000000..ecc8c1a3 --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/lock @@ -0,0 +1,19 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH + + +context="$(task _get rc.context)"; +[ "$context" ] && task context none + +# We have ensured that only one task is active +active="$(task +ACTIVE _ids)"; +[ "$active" ] && task stop "$active" + +swaylock + +[ "$active" ] && task start "$active" + +[ "$context" ] && task context "$context" +# vim: ft=sh |