0

I placed it in .xinitrc which I think was wrong to do.

#!/bin/bash
LOCKER=$(slock)
if [ $LOCKER -eq 1 ]; then
    exec xinput --set-prop 8 "Device Enabled" 0
else
    exec xinput --set-prop 8 "Device Enabled" 1
fi

where should I placed it and is it written correctly. thanks in advance

shv
  • 3

1 Answers1

0

At this time, according to the manpage slock can only run a command when it locks the screen. So, there is no way to get the mouse reenabled (using just slock).

You can listen to events though, and that depends on your graphics environment. Check this question: Run script on screen lock/unlock, it should point to the right direction.

Note that just disabling the mouse with xinput can be trivially overriden by unplugging and reconnecting the mouse.

  • Thanks a lot. didn't noticed that when I read the man page. If provided, cmd [arg ...] is executed after the screen has been locked. – shv Jun 09 '20 at 02:33