Giter Site home page Giter Site logo

lxinput's People

Contributors

avag-sayan avatar emanueleg avatar peterryan avatar plonk avatar spl237 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lxinput's Issues

Why not read in the mouse speed directly

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.)

lxinput doesn't work with e.g. German language setting (locale)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.