feat(hooks): add $1 lock/unlock parameter to screen lock and unlock hooks

Closes: #2142
This commit is contained in:
Lysec
2026-03-10 23:02:08 +01:00
parent e5677f9cef
commit aa0059851f
18 changed files with 38 additions and 19 deletions
+4 -2
View File
@@ -159,7 +159,8 @@ Singleton {
}
try {
Quickshell.execDetached(["sh", "-lc", script]);
// Pass "lock" as $1 via shell arguments so the script receives it
Quickshell.execDetached(["sh", "-lc", script, "lock-hook", "lock"]);
Logger.d("HooksService", `Executed screen lock hook: ${script}`);
} catch (e) {
Logger.e("HooksService", `Failed to execute screen lock hook: ${e}`);
@@ -178,7 +179,8 @@ Singleton {
}
try {
Quickshell.execDetached(["sh", "-lc", script]);
// Pass "unlock" as $1 via shell arguments so the script receives it
Quickshell.execDetached(["sh", "-lc", script, "unlock-hook", "unlock"]);
Logger.d("HooksService", `Executed screen unlock hook: ${script}`);
} catch (e) {
Logger.e("HooksService", `Failed to execute screen unlock hook: ${e}`);