2

I'm setting up X with TWM so that folks here can access one specific graphical application. I have it setup so one can VNC in, log-in using XDM and have said application automatically start up.

What I'd like to do is have it automatically log-out of the session once that application closes. Is there a trick I can do in the xinit script, or find some way to make TWM dependent on this particular application?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
azurepancake
  • 201
  • 2
  • 7
  • Not sure if this meets your needs exactly, but there is very little magic to logging out of a X11 session. You may want to have a look at for example the source code for `xfce4-session-logout` (it's ever so possible that you might even be able to press that into service directly). – user Nov 01 '16 at 15:28

1 Answers1

2

An X session ends when its “main” client process ends. Often that's the window manager; in setups it's a separate session manager process. In your setup, just kill the twm process when the application exits.

If your .xinitrc runs twm in the background then you can do

twm &
myapplication
kill $!

If you make twm start your application with f.exec then use f.exec "myapplication; kill $PPID" instead of f.exec "myapplication".

If you only ever want to display a single application and it only displays a single window then you could just start it full screen instead of the window manager. A window manager isn't much use when there's a single application. This is known as a “kiosk” configuration.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175