8 xlock - Lock X11 screen by disable (enable) input devices
10 xunlock - Unlock X11 screen by disable (enable) input devices
17 if expr "$0" : .
*unlock
>/dev
/null
20 xsetroot
=(-cursor_name left_ptr
)
23 #xsetroot=(-cursor_name bogosity)
26 xinput_enable_disable
()
28 local xinputs_enable
=$1
32 xinput set-int-prop
"$device_id" "Device Enabled" 8 $xinputs_enable 2>/dev
/null
33 xinput list-props
"$device_id" |
sed -ne "1p;/Device Enabled/p"
39 echo "$0: DISPLAY=$DISPLAY" >&2
41 if [ $xinputs_enable = 1 ]
43 device_ids
=`xinput list --id-only`
44 xinput_enable_disable
"$xinputs_enable" "$device_ids"
46 run-parts ~
/.local
/share
/xunlock.d
48 export -f xinput_enable_disable
50 device_ids
=`xinput list | grep -vw core | sed -ne "s/.*id=\([0-9]\+\).*/\1/p"`
51 set-xcursor-lock-and-run bash
-c "xinput_enable_disable $xinputs_enable '$device_ids'"
53 run-parts ~
/.local
/share
/xlock.d
58 xsetroot
"${xsetroot[@]}"
64 echo "$0: all Xorg displays ..." >&2
65 for DISPLAY
in `xdpys`