4

I want these 2 commands to run on boot.

xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 4
xinput --set-prop "Razer Razer DeathAdder" "Device Accel Velocity Scaling" 1

I tried putting these 2 commands /etc/rc.local, .zshrc, also in /etc/xdg/lxsession/Lubuntu/autostart, but nothing seems to happen. Any help please?

Benjamin Loison
  • 180
  • 1
  • 5
trttrt
  • 41
  • 1
  • 2

3 Answers3

4

As Skippy said, you should add them to the ~/.xinitrc file. This is because:

  • /etc/rc.local executes at boot time, before the Xserver is up
  • .zshrc gets loaded only when you start a zsh shell.
  • /etc/xdg/lxsession/Lubuntu/autostart needs an special name and format: they should be named <something>.conf and has proper exec= values and be stored in /etc/xdg/autostart/.

The above will not work

You only need to source the scripts lines in the ~/.xinitrc or in /etc/X11/xinit/xinitrc for system wide proposes.

This should work:

sudo sh -c "echo 'xinput --set-prop \"Razer Razer DeathAdder\" \"Device Accel Constant Deceleration\" 4' >> /etc/X11/xinit/xinitrc"
sudo sh -c "echo 'xinput --set-prop \"Razer Razer DeathAdder\" \"Device Accel Velocity Scaling\" 1' >> /etc/X11/xinit/xinitrc"

Of course, the said commands should work if you use the terminal, otherwise your are doing nothing. Then reboot your system and ta-da.

Benjamin Loison
  • 180
  • 1
  • 5
Braiam
  • 35,380
  • 25
  • 108
  • 167
3

I don't really see how .xinitrc is relevant here. That file is read by xinit, an old way of starting an X session and one you are almost certainly not using. In most modern Linux systems, the X session is started by a login manager service, for example lightdm or gdm2 or whatever and not by xinit.

Anyway, according to the LXDE wiki, you need to add these lines to $HOME/.config/lxsession/<profile>/autostart. Change <profile> to whatever you have in $HOME/config/lxsession. Just edit (or create of it does not exist) the file and add the relevant lines to it:

xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 4                                 
xinput --set-prop "Razer Razer DeathAdder" "Device Accel Velocity Scaling" 1  
terdon
  • 234,489
  • 66
  • 447
  • 667
0

Putting xinput command into a shell script and adding that script to be executed via ~/.config/lxsession/LXDE/autostart worked for me.

Example:

$ cat ~/bin/set-touch
#!/bin/bash

xinput set-prop "ADS7846 Touchscreen" "Coordinate Transformation Matrix" 1.09588 0 -0.0565 0 -1.11 1.057 0 0 1
    
$ cat ~/.config/lxsession/LXDE/autostart 
@xset s off
@xset -dpms
@xset s noblank
@bin/set-touch
@midori -e Fullscreen -a https://start.duckduckgo.com/
AdminBee
  • 21,637
  • 21
  • 47
  • 71
Jozef
  • 1
  • 2