Jump to content

Running dockapps in .xinitrc script


Guest SDMF
 Share

Recommended Posts

I'm trying out fluxbox, and I can get dockapps to run if I run them manually. However, I want to have them start up when I log into fluxbox. I looked at the documentation, and it recommended putting the commands in my .xinitrc script. I put them there, but it still does not load up when I log in.

 

To tell you the truth, I don't really understand .xinitrc. I know its an initialization script for X, but I don't know when it runs. Right now I am using GDM to log in to my different window managers, I don't know if that would impact .xinitrc at all, I kinda doubt it. I just want the dockapps to run as background processes automatically when I log in to fluxbox.

Link to comment
Share on other sites

OK, I got the dockapps to come up on login by putting it in the startfluxbox script. However, they are not appearing in the location specified by my .fluxbox/init file. How can I get them to?

Link to comment
Share on other sites

if your script is in /usr/share/fluxbox or /usr/local/fluxbox it will be global. To make the script user specific it needs to be in /home/user_name/.fluxbox. Flux will look here first for an init and if it finds one will use it. Copy init from /usr/share or /usr/local/share/fluxbox to the /home/user_name/.fluxbox and edit *everything* ini it as necessary.

Link to comment
Share on other sites

Well, right now I have it in the /usr/bin/startfluxbox script that is called by the entry in /etc/X11/wmsession.d/ It's not in the init file. Are you saying to put it in as an entry in .fluxbox/init in the format

session.rootCommand: wmusic &

?

 

I'll give that a try right now, haven't tried that yet.

Link to comment
Share on other sites

I personally have never run a dockapp but yes that should work. What most do is create a script with everything in it like a ~/.xinitrc (can put them there also) called autostart.sh (or anything) then put that as your root command.

 

session.rootCommand: sh ~/.fluxbox/autostart.sh

Link to comment
Share on other sites

Basically, you've got two problems:

1- start applications at startup of window manager

2- start dockapps specifically

 

Here's my solution (I'm currently using Fluxbox):

 

1- For the first problem, I did not find a ready solution, because, as someone already said, .xinitrc is only read when X is started from the command line.

If you use GDM, you can follow my advice:

http://www.mandrakeusers.org/viewtopic.php...p?p=11808#11808

It's easy, really.

Then you can execute anything you want from the executable .Xclients so that they execute in the background).

 

2- Now dockapps. The problem is that some won't run if they are started before the window manager. The solution is to write that in the .Xclients(

# no & at the end of next line!

sleep 15s

/path/to/dockapp1 &

/path/to/dockapp2 &

# and so on...

) &[/code]If 15s is too much time before startup of the dockapps, you can try to shorten it, eg to 10s...

 

I hope this helps.

 

Yves.

Link to comment
Share on other sites

Well, I added that stuff to the Default script in /etc/X11/gdm/PreSession/, and then created a .Xclients file in my home directory in the format you suggested. However, the dockapps never loaded. I can, once I am logged into fluxbox, execute the script manually, and it will load the dockapps. That kinda defeats the purpose though. I even did a chmod +x on my .Xclients file to see if that was the problem, and it still did not work. I tried rebooting, still no luck. Is there something else that I may be missing? I start fluxbox through a one-line script (executed from the file in the wmsession.d directory) located at /usr/bin/startfluxbox. The line is:

exec fluxbox

 

Could it be the fact that I am using exec that is causing the .Xclients script not to be executed?

Link to comment
Share on other sites

Well, I got it to work, though not exactly the way that you suggested. What I did was I took the if statement from that I had previously put in /etc/X11/gdm/PreSession/Default, and put it in the /usr/bin/startfluxbox script, taking the su off of it. My startfluxbox script now looks something like this:

fluxbox & wmpid=$!



if [ -x /home/$USER/.Xclients ]; then

 sh /home/$USER/.Xclients

fi



wait $wmpid

Link to comment
Share on other sites

Guest joehill

there is a thread here on the pclinuxonline site, there is a link half way down to an rpm of fluxbox with the remember patch already applied. the advantage is that it should also create an entry in your gdm or kdm.

 

the remember patch will allow you to have apps (say, dockapps) to run when flux starts by putting them in a startup entry in the menu.

Link to comment
Share on other sites

That's strange. The only explanation I see is that your fluxbox script is not started by GDM in the standard GDM way...

 

Yves.

 

Well, it is possible that I have not configured GDM 100% correctly. All I did was to create a file for fluxbox in /etc/X11/wmsession.d. Is there some other component somewhere in one of the X11 or X11R6 directories that needs to be added, or is the wmsession.d entry the only one necessary to correctly launch a WM from GDM?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...