setting mouse speed on startup
  • I'd appreciate help setting mouse speed on startup - it is too fast as it normally boots up.

    I made a small shell file named xinput_mouse, saved in [user]/.config/autostart and set to executable mode (chmod x+), which contains this code:
    #!/bin/sh
    sleep 60 # delays execution 60 seconds, til desktop is set up.
    xinput set-prop 10 260 5

    When I reboot the system, this xinput command is not executed- the mouse is too fast.
    However if after a reboot, I execute the xinput_mouse file manually (click on it in File Manager and select execute, and then I restart the X session (by clicking on the file Xsession in /etc/X11, and selecting execute) --- then the command IS executed.

    I'd appreciate help figuring out how to get this function successfully executed on a normal startup, without having to manually execute it.  Thanks in advance,
    Chris
  • lxlelxle
    PMPosts: 2,656
    i believe there are settings in the menu and system tools or preferences that will do it... look for keyboard or input/mouse
  • Thanks for coming back on it - but I already have the OS settings set at the slowest movement.  I researched + set up this shell file in order to slow it down further than the slowest OS setting. 

    Thanks for any help figuring out how to get the shell to run automatically on bootup.
  • lxlelxle
    PMPosts: 2,656
    visit the help file in the accessories menu
  • chrisschriss
    PMPosts: 8
    I figured this out:

    1. Copy the path to the file containing the shell script.  To do this, open the file browser and navigate to the folder in which your shell script file is saved. Click on the file you want to autostart, to select (highlight) it. Then in the Menu Bar at the top, click on "Edit -> Copy Path."

    2. Add it into the "Default applications for LXSession" configuration utility. To do this:
    Click on the LXLE start button (in your taskbar), then navigate to:
         Control Menu -> Preferences -> Default applications for LXSession

    In the bar on the left side of the LXSession configuration dialog box, click to select the "Autostart" tab.

    In the bigger window on the right side of that dialog box, find the list headed "Manual autostarted applications."  It has the list of stuff that is already started automatically, and at the bottom of the list, a box that says "+Add", and a blank box beside that.  

    Paste the path to the shell script file in that empty box, and click "+Add."

    Your new shell script shows up in the list of stuff that will autostart.  There's no save or anything else.  You just close that LXSession configuration box.  Next time you boot or login, that script runs automatically as a part of starting the desktop session.

    Voila.
  • chrisschriss
    PMPosts: 8
    To get all these instructions in one place:

    1. To figure out what to put in the shell script, open a terminal window (by typing alt+x), and at the $ prompt, type:
    "xinput list"
          This returns a list of all the input devices on the system, and their id numbers.
          Find the mouse, and make a note of the id=XX.  In my case, id=10.
    Then next, at the $ prompt:
    "xinput list-props XX"
          - - replace XX with the id=xx that you got from "xinput list" command above. 
          This returns a list of all the properties of that device, which is the mouse.

    Find the number of the property titled "Device Accel Constant Deceleration" - it's in parentheses, after the property title.  Make a note of it.

    2. Then make the shell script-
    Open a new text file with any text editor (pluma, leafpad, etc) and put this into it:
    #!/bin/sh
    xinput set-prop 10 260 5

    The 3 numbers are: device id --- property number --- value.
    The value is how much DEceleration - that is, "5" sets the mouse speed at 1/5th of what it was.

    Save the file into any folder, and set to executable mode (chmod x+).  

    Then go back to where the previous post starts - 
    3. Copy the path to the file containing the shell script.  To do this, open the file browser and navigate to the folder in which your shell script file is saved. Click on the file you want to autostart, to select (highlight) it. 
    Then in the Menu Bar at the top, click on "Edit -> Copy Path."

    4. Add it into the "Default applications for LXSession" configuration utility. To do this:
    4a. Click on the LXLE start button (in your taskbar), then navigate to:
         Control Menu -> Preferences -> Default applications for LXSession

    4b. In the bar on the left side of the LXSession configuration dialog box, click to select the "Autostart" tab.

    4c. In the bigger window on the right side of that dialog box, find the list headed "Manual autostarted applications."  It has the list of stuff that is already started automatically, and at the bottom of the list, a box that says "+Add", and a blank box beside that.  
    Paste the path to the shell script file in that empty box, and click "+Add."

    You're done. Just close that "LXSession configuration" box.
    Log out + log in to check that it works at startup.  

    Click on your file + select "execute" to tweak the values in your script til it's good.