0

After posting my question here, Add xinput to the start up secuence of LXDE

I got no answer so here it is. I have these 2 commands:

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

Which I want to run on start up. I am using zsh shell.

I tried putting these 2 commands /etc/rc.local, .zshrc, .zlogin, also in /etc/xdg/lxsession/Lubuntu/autostart , also in /.xinitrc and /etc/X11/xinit/xinitrc but nothing seems to happen. Could somebody let me know what is going on please, and why none of these is working?

Here is my current /etc/X11/xinit/xinitrc file (ignore the numbers (vim)):

  1 #!/bin/sh                                                                                                                                                                                                                                
  2                                                                                                                                                                                                                                          
  3 # /etc/X11/xinit/xinitrc                                                                                                                                                                                                                 
  4 #                                                                                                                                                                                                                                        
  5 # global xinitrc file, used by all X sessions started by xinit (startx)                                                                                                                                                                  
  6                                                                                                                                                                                                                                          
  7 # invoke global X session script                                                                                                                                                                                                         
  8 . /etc/X11/Xsession                                                                                                                                                                                                                      
  9                                                                                                                                                                                                                                       
  10 /usr/bin/xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 4          
  11 /usr/bin/xinput --set-prop "Razer Razer DeathAdder" "Device Accel Velocity Scaling" 1  

Could somebody explain to me what is goign on ? Why nothing is happening? I tried everything, rebooted, and the $%^&* commands will just not run.

Any help please?

trttrt
  • 41

1 Answers1

0

I tried putting these 2 commands /etc/rc.local, .zshrc, .zlogin,

Probably not a great idea since X may not be running at that point, and/or you may not actually get a login shell because of the GUI. I'd think .zshrc might work but I don't know anything about zsh.

also in /etc/xdg/lxsession/Lubuntu/autostart

Seems like a good place...but apparently it didn't work...the issue might be you have an autostart in $HOME that overrides that one.

also in /.xinitrc and /etc/X11/xinit/xinitrc but nothing seems to happen.

Was the first one supposed to be ~/.xinitrc? If so, keep in mind that one will be used and not the one in /etc -- never both (unless they are explicitly sourced in, which would be unusual).

I'm going to take a guess that you do have an ~/.xinitrc created by the system, but you did what you appear to have done with your current /etc/X11/xinit/xinitrc -- you put the commands at the end.

The problem with that is the old last line was probably something like:

lxde

Or lxde-session or whatever. That's the command that starts your DE, but guess what? It doesn't execute in the background, and it doesn't complete until you leave X. You want to run your xinput commands before anything else in the xinitrc file.

A good way to figure out which file is used is to put something like:

echo "This is ~/.xinitrc" >> $HOME/xinit.log"

at the very top of all of them (notice they are actually shell scripts), then check that log after you start X. Make sure to use >> and not >.

goldilocks
  • 87,661
  • 30
  • 204
  • 262