[UPDATE][I3] Move Xautolock toggle to script
To allow notifications when toggling the state of Xautolock, the logic has been moved to its own script.
This commit is contained in:
parent
aeef0b0ca8
commit
b5eb803f9d
|
@ -280,8 +280,8 @@ bindsym $mod+b mode "$mode_background"
|
||||||
set $mode_xautolock (e)nable (d)isable Xautolock
|
set $mode_xautolock (e)nable (d)isable Xautolock
|
||||||
|
|
||||||
mode "$mode_xautolock" {
|
mode "$mode_xautolock" {
|
||||||
bindsym e exec --no-startup-id xautolock -enable, mode "default"
|
bindsym e exec --no-startup-id toggle-xautolock enable, mode "default"
|
||||||
bindsym d exec --no-startup-id xautolock -disable, mode "default"
|
bindsym d exec --no-startup-id toggle-xautolock disable, mode "default"
|
||||||
|
|
||||||
# Exit xautolock mode: "Enter" or "Escape" or $mod+x
|
# Exit xautolock mode: "Enter" or "Escape" or $mod+x
|
||||||
bindsym Return mode "default"
|
bindsym Return mode "default"
|
||||||
|
|
16
scripts/toggle-xautolock
Executable file
16
scripts/toggle-xautolock
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
enable|disable)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unkown command '$1'" >&2
|
||||||
|
echo "Usage: '$0 <enable|disable>'" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
xautolock "-$1"
|
||||||
|
|
||||||
|
notify-send -u low "Toggled Xautolock (${1}d)" \
|
||||||
|
-h string:x-canonical-private-synchronous:xautolock-toggle # Override previous one
|
Loading…
Reference in a new issue