raspberrypi-ui / lxinput Goto Github PK
View Code? Open in Web Editor NEWMods to the LXinput keyboard and mouse settings app.
License: GNU General Public License v3.0
Mods to the LXinput keyboard and mouse settings app.
License: GNU General Public License v3.0
In read_mouse_speed (void) the mouse speed is read from the desktop configuration file written by the last run of lxinput.
But why not read it from the mouse directly? It may have been changed from elsewhere in the meantime...
In the shell it could be done like this, for example:
xinput --list-props "PixArt USB Optical Mouse" | grep "libinput Accel Speed (" | sed -e 's/^.*:\s*//'
(The usage of that config file ~/.config/autostart/LXinput-setup.desktop is indeed a bit strange, IMHO.)
If the system is configured to use a language with decimal comma instead of decimal point (eg. German) lxinput creates a desktop file formatted with the locale in mind but fails reading it in again here:
void read_mouse_speed (void)
...
FILE *fp = popen ("grep -Po \"Accel Speed\\\" [-.0-9]*\" ~/.config/autostart/LXinput-setup.desktop | head -1 | cut -f 3 -d ' '", "r");
In that line the decimal point is hard coded. Adding a comma in [-.0-9] makes it work:
FILE *fp = popen ("grep -Po \"Accel Speed\\\" [-.,0-9]*\" ~/.config/autostart/LXinput-setup.desktop | head -1 | cut -f 3 -d ' '", "r");
So the mouse speed is reset to default on every call of lxinput.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.