[sclug] Fwd: Re: Program auto start

Alex Butcher lug at assursys.co.uk
Thu Aug 14 09:12:48 UTC 2008

On Thu, 14 Aug 2008, John Kennedy wrote:

>> I am newish to linux and running Fedora 9


>> My problem is that I am trying to auto start pidgin on a computer base in
>> Reading whilst I am away. I can ssh into the system and su to root. I was
>> advised to do the below
>> Add a bash script, e.g. ~/bin/gnomesetup
>> #!/bin/bash
>> xset m 1 1
>> pidgin &
>> xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"
>> xbindkeys -f ~/.xbindkeysrc
>> I created a file /bin/gnomesetup and added the rest to the file, when I
>> rebooted it still did not show up in my messenger list

Just creating a script won't mean it runs.

Also, as pidgin is an X client, X will need to be started (and if you're
using a display manager like gdm, logged in too. If you don't *know* that you
*aren't* using a display manager, you probably are).

Also /bin really isn't the place for things like that. The right place is
/usr/local/bin if you anticipate it being useful to all users on the system,
or $HOME/bin otherwise.

> Not sure if it is a typo in your email but you were advised to add a
> script to the bin directory in your home directory (~/bin/gnomesetup) but
> you added it to the systems bin directory (/bin/gnomesetup). The second
> thing is that you have not called the script at startup. You need to add
> the following to your ~/.bash_profile (/home/<username>/.bash_profile):

Yuck! That'll attempt to start another instance every time a new shell is
started (e.g. for every terminal/xterm window opened). It'll also take no
heed of whether the shell is running within an X session, or whether X is
even running, and so will probably spew errors in those circumstances.

If one wants an X client (e.g. pidgin) to run for every user on a system,
then create a script for it under /etc/X11/xinit/xinitrc.d. If it's just for
one user, it might be easier to put it in $HOME/.Xclients (remember to end
the .Xclients script with the command to start your window manager or
desktop environment, e.g. gnome-session or similar).

Finally, if one is using a desktop environment such as GNOME (the Fedora
default) or KDE, one should really use that desktop environment's session
manager to configure programs that should be started at login. That might be
a bit difficult in this case as the OP only has remote access and it seems
running gnome-session-properties will attempt to connect to the session
manager on the host *displaying* it rather than the host *running* it (and I
don't know if it has any magic foo to override that behaviour). I guess he
could use VNC, potentially, but configuring it if it isn't already
configured sounds a bit too much like hard work.

I'd go with editing $HOME/.Xclients for the user concerned, such that it
reads something like


then set the execute bits:

 	chmod a+x $HOME/.Xclients

> John

Best Regards,
Alex Butcher, Bristol UK.                           PGP/GnuPG ID:0x5010dbff

"[T]he whole point about the reason why I think it is important we go for
identity cards and an identity database today is that identity fraud and
abuse is a major, major problem. Now the civil liberties aspect of it, look
it is a view, I don't personally think it matters very much."
  - Tony Blair, 6 June 2006 <http://www.number-10.gov.uk/output/Page9566.asp>

More information about the Sclug mailing list