You are not logged in.
I am trying to make xinitrc load some apps, depending whether I run gnome or openbox.
If I am running gnome and type this in terminal, it works:
vaio@athunye, Thu Sep 02 12:23:10
~ $
bash >>> if [ $(pidof gnome-session) ]; then echo 'Running Gnome'; fi
Running Gnome
vaio@athunye, Thu Sep 02 12:27:10
~ $
bash >>>
However, If I put this in ~/.xinitrc it just does not do anything:
#!/bin/bash
#exec ck-launch-session dbus-launch openbox-session
exec ck-launch-session dbus-launch gnome-session
sleep 11
if [ $(pidof gnome-session) ]; then
xrdb ~/.Xdefaults
sleep 3 && conky &
sleep 3 && gnome-terminal --profile Irssi &
fi
I also tried putting that if block in another file and call that file form xinitrc but it
also just didn't nothing. However, if I run this other file ( ./run_apps.bash) it then works.
Any ideas ?
Last edited by Athunye (2010-09-23 10:46:34)
Offline
I have a guess before the BASH + X gurus find your question: Your conditional ("if...") will not run until the "exec" line finishes. In other words, your code won't run until you exit GNOME.
If that IS the case, I'm not sure what a solution would be... Don't GNOME and OpenBox both have their own methods of automatically starting applications?
Last edited by drcouzelis (2010-09-02 15:42:13)
Offline
If that IS the case, I'm not sure what a solution would be... Don't GNOME and OpenBox both have their own methods of automatically starting applications?
Yes, they do. I do let the file $HOME/.config/openbox/autostart.sh do its job.
About gnome, using "Startup Applications" does not work with conky.
I tried calling the other file before the exec command but I was not lucky.
Thanks for the reply.
Offline
Try something like:
#exec ck-launch-session dbus-launch openbox-session &
exec ck-launch-session dbus-launch gnome-session &
PID=$!
sleep 11
if [ $(pidof gnome-session) ]; then
xrdb ~/.Xdefaults
sleep 3 && conky &
sleep 3 && gnome-terminal --profile Irssi &
fi
wait $PID
Last edited by humanzoo (2010-09-02 16:09:11)
Offline
humanzoo
Your example worked like a charm. Thanks a lot.
Last edited by Athunye (2010-09-23 10:46:04)
Offline