aboutsummaryrefslogtreecommitdiffstats
path: root/hm
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-12-31 12:12:04 +0100
committerSoispha <soispha@vhack.eu>2023-12-31 12:12:04 +0100
commit8ea57d8c0722284530898588453a2eba85a9b2ff (patch)
tree1b6843ca88e58ddd4f9a22b1c0591b156162e41b /hm
parentfix(hm/pkgs/con2pdf): Don't reassing `name` variable as it's global (diff)
downloadnixos-config-8ea57d8c0722284530898588453a2eba85a9b2ff.zip
feat(hm/pkgs/lock): Init
Diffstat (limited to 'hm')
-rw-r--r--hm/soispha/pkgs/scripts.nix12
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/lock19
-rw-r--r--hm/soispha/wms/river/res/keys.ron2
-rw-r--r--hm/soispha/wms/river/res/moonlander.ron2
4 files changed, 33 insertions, 2 deletions
diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix
index f366b138..d1a78c29 100644
--- a/hm/soispha/pkgs/scripts.nix
+++ b/hm/soispha/pkgs/scripts.nix
@@ -147,6 +147,17 @@
# path = "wrappers";
# dependencies = builtins.attrValues {inherit (pkgs) lf ueberzug;};
# };
+ lock-scr = write_script {
+ name = "lock";
+ path = "wrappers";
+ dependencies = builtins.attrValues {
+ inherit
+ (pkgs)
+ taskwarrior
+ swaylock
+ ;
+ };
+ };
lyrics-scr = write_script {
name = "lyrics";
path = "wrappers";
@@ -194,6 +205,7 @@ in [
fupdate-scr
hibernate-scr
ll-scr
+ lock-scr
lyrics-scr
mpc-rm-scr
neorg-scr
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
diff --git a/hm/soispha/wms/river/res/keys.ron b/hm/soispha/wms/river/res/keys.ron
index 12b456df..c2b61d7a 100644
--- a/hm/soispha/wms/river/res/keys.ron
+++ b/hm/soispha/wms/river/res/keys.ron
@@ -25,7 +25,7 @@ RiverctlCommandArray(
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F2", mods: "Super", command: "spawn", command_args: "keepassxc",),
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F3", mods: "Super", command: "spawn", command_args: "signal-desktop",),
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F4", mods: "Super", command: "spawn", command_args: "steam",),
- RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "swaylock -f",),
+ RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "lock",),
// Client
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "f", mods: "Super", command: "toggle-fullscreen", command_args: None,),
diff --git a/hm/soispha/wms/river/res/moonlander.ron b/hm/soispha/wms/river/res/moonlander.ron
index 7b6f5069..a59c6757 100644
--- a/hm/soispha/wms/river/res/moonlander.ron
+++ b/hm/soispha/wms/river/res/moonlander.ron
@@ -33,7 +33,7 @@ RiverctlCommandArray(
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Q", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "keepassxc",),
// RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "nheko",),
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "S", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "signal-desktop",),
- RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "swaylock -f",),
+ RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "lock",),
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "U", mods: "Alt+Control+Super+Shift", command: "focus-output", command_args: "next",),
RiverctlCommand( map_mode: Map, mode: ["normal"], key: "V", mods: "Alt+Control+Super+Shift", command: "focus-previous-tags", command_args: None,),