You are not logged in.

#1 2009-11-21 05:38:27

matthewbauer
Member
From: /usa/ks
Registered: 2009-07-20
Posts: 86

Running Programs after Window Manager starts in Xinitrc

How can I run programs after the Window Manager starts? Just adding an & to the end of $DEFAULT_SESSION will make it so you can't log out properly. Also X will exit if you add an & to all of the commands because it has nothing to run. Does anyone have tricks around this?


matthew@laptop> cat ~/.xinitrc
DEFAULT_SESSION=openbox
EXEC=exec

case $1 in
    '') $EXEC $DEFAULT_SESSION;;
    *) $EXEC $1;;
esac

#xscreensaver -no-splash &
#xsetroot -solid black
#xsetroot -cursor_name left_ptr

#xbindkeys &

#xwinwrap -ni -argb -fs -s -st -sp -a -nf -- mplayer ~/Videos/background -loop 0 -wid WID &

#xcompmgr &
 
#avant-window-navigator

Libertarian Arch Linux User

Offline

#2 2009-11-21 05:50:08

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: Running Programs after Window Manager starts in Xinitrc

Why do you need to run these after the WM?  Run anything you want (started in the background if needed), then start the WM afterwards.

Offline

#3 2009-11-21 06:02:05

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: Running Programs after Window Manager starts in Xinitrc

I use:

xmonad &
pid=$!

SSH_ASKPASS='/usr/lib/openssh/x11-ssh-askpass' ssh-add < /dev/null

status-bars.py &

wait $pid

I start my wm before I run x11-ssh-askpass as if I don't, the x11-ssh-askpass window spans my dual monitors and looks untidy. By loading the wm first it appears on screen 1 only. I found this technique on the fluxbox webpage.

Offline

#4 2009-11-21 10:04:17

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Running Programs after Window Manager starts in Xinitrc

you can use a sleep command:

(sleep 2 && COMMAND) &

Last edited by Rasi (2009-11-21 10:04:34)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#5 2009-11-21 12:17:16

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Running Programs after Window Manager starts in Xinitrc

Openbox has ~/.config/openbox/autostart.sh script for stuff that has to start after the WM. This is covered in the wiki's Openbox page.

Offline

#6 2009-11-21 19:18:16

matthewbauer
Member
From: /usa/ks
Registered: 2009-07-20
Posts: 86

Re: Running Programs after Window Manager starts in Xinitrc

tomk wrote:

Openbox has ~/.config/openbox/autostart.sh script for stuff that has to start after the WM. This is covered in the wiki's Openbox page.

I could use that, the only problem is that I like to switch WMs every once and a while. So I'd like it done through the xinitrc.

mikesd's solution seems to have worked, thanks.


Libertarian Arch Linux User

Offline

Board footer

Powered by FluxBB