The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

Termination of running apps when i3 quits

asked 2012-09-01 12:37:32 +0000

mmi gravatar image

Is a signal send to each running application when i quit i3 (Mod+Shift+e)? Which signal is send?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2012-09-01 12:46:31 +0000

Michael gravatar image

When i3 quits, it just calls exit(0); which will cause X11 to terminate the session (since i3 was the first client). AFAIK, X11 does not send a signal to the applications when the session terminates. Instead, the X11 connection is closed and applications have to react accordingly.

edit flag offensive delete link more

Comments

Thanks Michael! So i think it's better to send a TERM signal to these apps when shutting down ?

mmi gravatar imagemmi ( 2012-09-01 12:51:54 +0000 )edit

@mmi: No, the window manager can’t do that. There is no guaranteed mapping between an X11 window and a UNIX process (there only is the optional `NET_WM_PID` atom). What one could do is follow the `WM_DELETE` protocol, I think the big desktop environments do it that way. OTOH, that’s a lot of code.

Michael gravatar imageMichael ( 2012-09-08 23:23:57 +0000 )edit

A reasonably close thing to killing all apps could be: `bindsym $mod+x [class="."] kill` (note that chaining that with exit is a bad idea since that might kill apps while they are saving data to disk or while they still display a popup dialog)

Michael gravatar imageMichael ( 2012-09-11 10:19:03 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2012-09-01 12:37:32 +0000

Seen: 1,350 times

Last updated: Sep 01 '12