Screen locker:Disable inputs

Some screen lockers do not disable inputs like touchscreen or buttons. This page collects possibilites how to hande this.

Xfce4
Here is an example draft script that disables inputs when the screen is locked in Xfce4.

The approach of this script is parasitical usage of dbus signals or method calls of other programs.

Preparation:
 * Package  needs to be installed.
 * The power button is used for locking. Go to Settings -> Keyboard -> Application Shortcuts, select command xflock4, double-click the current shortcut and hit the power button. Additionally, edit the file, disable the line "HandlePowerKey=ignore", log out or reboot to apply the change. (You can also use another button but might need to adapt the script.)
 * You need to set up a virtual keyboard for the unlocking screen.  works well but availability is limited, alternatively you can use  . See Input_methods for installation and Screen_locker for implementation.
 * The script is waiting for a locking signal. To have it work properly, go to Settings -> Power Manager -> System and check "Lock screen when system is going to sleep.

The script needs to be adapted to your specific situation:
 * Check the id numbers of the inputs you want to disable with  (or e.g.   via ssh) and adapt the input function blocks of the script.
 * The script refers to . If you use another screen locker, you need to adapt the commands and probably also the dbus signals and method calls.
 * If you also want to handle the LEDs, make sure you have permission to do so (see LEDs), adapt the sysfs path in the script and uncomment the lines related to LEDs (the functions "disable_leds" and "enable_leds" at the top, their calls further down and one "else" line at the end).
 * Before using the script, check if the dbus-monitor commands of the script work for your setup by executing them via ssh and then lock/unlock your device. For the session bus, DISPLAY variable needs to be exported. The command via ssh looks like

If the dbus-commands seem to work, you can test the script via ssh. Create the script by e.g., paste your code, make it executable by. To test it via ssh, you need to uncomment the export DISPLAY at the beginning of the script and for better debugging also the echo commands spread over the script. Start the script by.

In case the dbus-monitor commands do not work for your setup, you can try to find others that might work for you:
 * shows signals on the session bus.
 * shows signals and method calls on the session bus.
 * shows only signals on the system bus.
 * shows signals and method calls on the system bus.

Usage of LEDs is recommended if possible. They are a good indication on the state of the inputs.

When the script looks good, it can be added to autostart in Settings -> Session and Startup -> Application Autostart ->.

Known issues if the script are:
 * When hitting the cancel button at the unlock screen fast and repeatedly, a situation can be produced where the screen is on but the inputs off. In this case, you have to wait until the screen blanks again, thereafter you can unlock the device.

MATE
The almost same script can be used for MATE. It needs some minor changes.

Following steps to set up the script:
 * Install package.
 * Assign the power key to screen lock by System -> Preferences -> Hardware -> Keyboard Shortcuts -> af the end of the "Desktop" section look for "Lock screen" and double-click the shortcut at the lefthand side -> hit the power key -> close.
 * Edit the file, disable the line "HandlePowerKey=ignore", log out or reboot to apply the change.
 * Create a new file
 * Copy-paste the script for Xfce4 in there.
 * Apply changes for MATE (see diff above).
 * Check  and adapt the input numbers you want to lock in script (all buttons and touchscreen except the power key).
 * If you have user permissions to change LEDs, uncomment the according parts of the script.
 * Make the script executable by.
 * Test by entering  in the terminal directly on the device, lock the screen, check if the touchscreen is disabled, wake up by hitting the power button, unlock the screen. Abort the terminal command by Ctrl+C.
 * If it works ok, create an autostart entry by System -> Preferences -> Personal -> Startup Applications -> Add. Log out or reboot to autostart the script.