I have a Topton L4 umpc running current Manjaro. For some reason, its left mouse button needs the script:
#!/bin/sh
xkbset m
to activate itself. Fine, but even if the script is auto-started at boot, it still needs refreshing throughout the session. I have the script successfully keystroked, but wonder if there’s a way to make this command persistent.
Ach. The combined commands did not result in persistence. An hour into the session, with successful left mouse button presence even after suspend and log-ins, the left button suddenly needed a rerun of the script.
Well, should all computer problems be so small since it’s easy to keystroke things in xfce.
With the disclaimer that I’m not running Xfce, I suspect that your problem would be caused by a misguided power savings setting, which puts the USB ports to sleep.
For a more permanent solution, it would be worth investigating that. I suspect that you might have the tlp package installed — I don’t know whether it still comes installed by default with the latest ISOs, but it definitely used to be back when I installed Manjaro — and if so, you may need to either tweak its settings or disable (and eventually uninstall) it altogether.
While TLP is installed, it didn’t appear to be running, but I took your advice and in /etc/tlp.conf, I uncommented the usb setting and set it to:
USB_AUTOSUSPEND=0
Testing now.
After tinkering with tlp setting, left mouse button capability disappeared almost immediately. Have now made tlp a manual start only and continue to test.
Progress. After repeated suspend and log-ins, the left mouse key remains persistent.
xkbset exp "=mousekeys"
This appears to be key, followed by exploring
xkbset q exp
to make certain that this is the mouse keys state:
Upon Expiry Mouse-Keys will be: Unchanged
Rather than “on” or “off”
A small oddity, the script of
xkbset exp "=mousekeys"
xkbset m
has to be run after attaining desktop or from terminal. Putting the script in autostart, no matter the amount of sleep delay, still produces
Upon Expiry Mouse-Keys will be: off
Any idea why such a simple script can be successfully run in terminal or from keystroke, but won’t work via auto-start?
Thank you, @Teo. I struggled with building a service but would’ve wrestled it further had I not found a typo in the script that stopped a command. For the record, this appears to make the left mouse button persistent throughout a session (and it will auto-start):
#!/bin/sh
xkbset exp "=mousekeys"
xkbset m
Also for the record, big thanks to those who posted in the thread. Since this issue was minor, tlp experimenting and a switch in emphasis to service-making were most welcome, allowing me to ponder approaches I hadn’t considered.