You are not logged in.

#1 2021-10-17 14:41:09

desperado
Member
Registered: 2018-10-12
Posts: 59

[Solved] xinit - Kill the window manager without killing Xorg

I've noticed that kiling (killall) the window manager (tested with bspwm and openbox) always killed Xorg, when starting the session using startx/xinit.

Is there a way to prevent that? I want only the window manager to terminate. The X session, the dock, the system tray applets etc must stay intact.

Last edited by desperado (2021-10-17 17:59:48)

Offline

#2 2021-10-17 14:45:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,442

Re: [Solved] xinit - Kill the window manager without killing Xorg

Don't make the WM the session keeping process (ie. the last thing in your xinitrc resp. the thing that starts w/ "exec")
The line you "exec" in xinitrc could eg. be a script that loops a dmenu/rofi query for the WM to start and then start that WM.

Alternatively you could make the dock the session keeping process.

Offline

#3 2021-10-17 15:04:23

desperado
Member
Registered: 2018-10-12
Posts: 59

Re: [Solved] xinit - Kill the window manager without killing Xorg

I'd like to fall back to tty on exiting the session, which is why I'm not putting an exec anywhere. (Okay come to think of it I was thinking about exec startx and not exec <wm>)

Here's my xinitrc

# start companion programs
wm-startup

# start the window manager
bspwm
# xfwm4
# openbox

wm-startup starts the dock (tint2), the system tray, the notification daemon, hotkey daemon (sxhkd) etc.

I used lxqt-session and xfce4-session to manage these programs before, but this is more convenient.

Last edited by desperado (2021-10-18 15:50:09)

Offline

#4 2021-10-17 15:14:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,442

Re: [Solved] xinit - Kill the window manager without killing Xorg

Doesn't change anything.
Right now bspwm is the blocking process in xinit, the moment it terminates, xinit terminates and you X11 server dies.
So if you want to be able to terminate bspwm it cannot be in that position, you can either fork it and make something else the xinit blocking process or block xinit w/ a loop that asks you for a WM to start (or exit, shutdown, reboot - that kind of stuff)

Offline

#5 2021-10-17 15:56:43

desperado
Member
Registered: 2018-10-12
Posts: 59

Re: [Solved] xinit - Kill the window manager without killing Xorg

I didn't know xorg terminates when xinitrc exits.

Anyways, I'll do this then.

# start companion programs
wm-startup

# start the window manager
bspwm &
# xfwm4 &
# openbox &

sleep infinity

Last edited by desperado (2021-10-17 16:49:17)

Offline

Board footer

Powered by FluxBB