[SOLVED] Autostart a script

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
Payoon
Black ninja
Black ninja
Posts: 61
Joined: 01 Mar 2013, 19:16
Distribution: Porteus 3.2 32 bit XFCE
Location: Duisburg, Germany

[SOLVED] Autostart a script

Post#1 by Payoon » 21 Aug 2015, 06:07

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
Last edited by Payoon on 21 Aug 2015, 12:38, edited 1 time in total.

KnallKopf
Samurai
Samurai
Posts: 134
Joined: 18 Sep 2012, 20:56
Distribution: Porteus 64bit KDE4
Location: Absurdistan

Re: Autostart a script

Post#2 by KnallKopf » 21 Aug 2015, 07:39

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

beny
Full of knowledge
Full of knowledge
Posts: 720
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Autostart a script

Post#3 by beny » 21 Aug 2015, 09:53

hi you run xfce4 so try this go to setting, system, session start, automatic start, add the script path to the list and reboot.

Payoon
Black ninja
Black ninja
Posts: 61
Joined: 01 Mar 2013, 19:16
Distribution: Porteus 3.2 32 bit XFCE
Location: Duisburg, Germany

Re: Autostart a script [Solved]

Post#4 by Payoon » 21 Aug 2015, 11:06

@ 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

Post Reply