cannot make ubuntu autostart my script
I need to force my KDE Plasma installed on ubuntu 18.04 to run the following script on startup (after login):
xinput --map-to-output "Wacom HID 48DE Finger touch" eDP-1-1
xinput --map-to-output "Wacom HID 48DE Pen stylus" eDP-1-1
xinput --map-to-output "Wacom HID 48DE Pen eraser" eDP-1-1So I've put it in
/etc/X11/xinit/xinitrc
crontab -e
~/.bashrc
~/.profile
maybe some other places that I forgotI've also created a *.sh with these 3 lines and put it in the settings->autostart in the "desktop file" section and in the "script file" section. In the latter one I put it twice: under "startup" option and under "before session start-up" option. I put it in the settings->login screen (sddm) "advanced" tab -> commands -> "reboot command" section. I have also tried to create a *.desktop file in 'cd ~/.config/autostart/' and put the following content in it:
[Desktop Entry]
Type=Application
Exec="/usr/bin/xinput_autostart.sh"
Name=XinputI put it with and without the "root" and "sudo" prescriptions, I put it everywhere I could where I could only find on the internet and it does not work. But when I execute exactly the same lines in the terminal manually or if I simply double click the *.sh file then it works!!! I am out of ideas, please help!
22 Answers
Thanks @bac0n in helping me tracking the issue. As it turned out, the script was executed all along, but due to some reason, default xinput settings were overwriting it every time on startup. The solution might be not the most elegant, but it is the only solution I was able to come up with and it works for me:
sleep 1; xinput --map-to-output "Wacom HID 48DE Finger touch" eDP-1-1
xinput --map-to-output "Wacom HID 48DE Pen stylus" eDP-1-1
xinput --map-to-output "Wacom HID 48DE Pen eraser" eDP-1-1 1 You can put shell scripts in:
~/.config/plasma-workspace/env/(these will execute at login before launching Plasma, make sure they have execute bit and ends with *.sh)
5