[sclug] Fwd: Re: Program auto start

John Kennedy skebi69 at gmail.com
Thu Aug 14 10:58:43 UTC 2008


On Thursday 14 August 2008 10:12:48 Alex Butcher wrote:
> On Thu, 14 Aug 2008, John Kennedy wrote:
> >> I am newish to linux and running Fedora 9
>
> [snip]
>
> >> 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
>
>  	#!/bin/sh
>  	pidgin&
>  	gnome-session
>
> then set the execute bits:
>
>  	chmod a+x $HOME/.Xclients
>
> > John
>
> Best Regards,
> Alex.

Actually that would be correct if I suggested adding the line to .bashrc which 
is run every time a terminal session is opened. In this case, I 
suggested .bash_profile which is only run once when the user logs in. 
Granted, it does not take into account whether the user is using a pure 
terminal session or a windows environment but that can easily be solved.
John

-- 
Be who you are and say what you feel because those that matter don't mind and 
those that mind don't matter.
- Dr Seuss



More information about the Sclug mailing list