Page 1 of 1

[SOLVED] Autostart a script

Posted: 21 Aug 2015, 06:07
by Payoon
Hi folks,
because on my Notebook I want to turn off the touchpad permanently, I have made the following script:

Code: Select all

!/bin/bash
synclient TouchpadOff=1
This script I want to run late during boot or after boot, but automatically.

It is executable and I have put it in rc.local and also in init.d, but in both cases the touchpad is still on after boot.

Any idea for a better place to autostart it?

Payoon

Re: Autostart a script

Posted: 21 Aug 2015, 07:39
by KnallKopf
I have understand you have done the following steps:

Code: Select all

cat << EOF > /etc/rc.d/rc.local
#!/bin/bash
synclient TouchpadOff=1
EOF
chmod 0755 /etc/rc.d/rc.local
and you have working changes=.. parameter at boot, so your changes are permanent.
(or you are using other ways that your changes are permanent.)
first look at /etc/rc.d/rc.local after booting, that your changes are permanent and
executes of /etc/rc.d/rc.local are work.

If yes, then is the reason why it does not work presumably that your code are running too early in the bootprocess.
/etc/rc.d/rc.local start from rc.M and after them came rc.services.
At the end of rc.services are rc.gpm execute.
This restart the mouse server. can this be the problem ?


here are some ways for autostart:
- via /etc/rc.d/rc.local
- via boot parameter see <LIVECD>/boot/docs/cheatcodes.txt
cliexec=my_script
Execute specified command(s) in runlevel 3 (before logging in to a graphical interface).
guiexec=my_script
Execute specified command(s) in runlevel 4, when the graphical interface is loaded
- i do not know, but i thing autostart via a desktop file under /usr/share/autostart should possible.
(if somewhere are know more, i am interesting too)


try in bootparameter:

Code: Select all

guiexec=synclient~TouchpadOff=1

Re: Autostart a script

Posted: 21 Aug 2015, 09:53
by beny
hi you run xfce4 so try this go to setting, system, session start, automatic start, add the script path to the list and reboot.

Re: Autostart a script [Solved]

Posted: 21 Aug 2015, 11:06
by Payoon
@ beny and Knallkopf
it is solved. The trick was that there is a desktopfile
xfce-mouse-settings.desktop
where you can configure both mouse and touchpad, but only the mouse configuration is visible at first. Behind that is the touchpad configuration,which was set to Touchpad=active. So in whatever folder I have put my synclient command it was overridden at the end by that setting.
Thanks to both of You.
Payoon