[openbox] How to shutdown when using Openbox

Anthony Thyssen a.thyssen at griffith.edu.au
Sun Mar 25 21:05:38 EDT 2018


I actually don't hang my X windows session on the window manager.
That way I can completely exit the window manager and restart or try out a
different one as and when I like.
The window manager is after all just another X window application!

Instead I have a button on the bottom-right of the screen (actually its a
xmessage window).

When pressed it pops up a set of 5 buttons (another xmessage window
actually) asking what action you want.

Poweroff     -- shutdown computer completely
Reboot        -- equivelent to a power cycle
Restart       -- kill off ALL applications (including window manager),
using xclosedown, and start them again
                      I use this after changing start up scripts, or just
get a clean start without needing to login again
Logout        -- obvious
Cancel        -- return to the single 'logout' button.

There is also a timeout (built into xmessage) that can be configured to do
ANY of the above actions
And the script tests the exit codes to see if the windows were killed by a
xkill or xclosedown
and if they were just exit and logout as you would expect.

I created that script over 20 years ago  (date is 1 November 1994 but it
started before that!)
And am still using it, basically unchanged since then.

I did need to install the package "xorg-x11-xinit-session" to get logins to
call my ".xsession" script,
rather than a system provided one, but I have always used my own session
script!


A Basic xlogout button (using any application it can find to generate the
button), can be downloaded from...
   http://www.ict.griffith.edu.au/anthony/software/#xlogout





On Sun, Mar 25, 2018 at 1:02 PM, MJ Fleming <marstonfleming at gmail.com>
wrote:

> > Trying to do that _within openbox_ is like cutting a branch on which you
> are sitting
>
> I don't feel that's actually true. I haven't looked at the source so I'm
> not totally sure what the function of openbox --exit is (I have read it
> tries to kill any open processes but don't quote me).
>
> However, systemd certainly does permit processes to persist after logout.
> And under Debian, unless I have a very borked system, I'm able to execute
> something like openbox --exit && systemctl poweroff, I'm assuming it
> wouldn't be much to sleep the poweroff 10 seconds and pkill -u myuser after
> openbox --exit if you want to be really anal about it.
>
> It's also possible to run X and openbox as systemd services which would
> then be conflicted by the poweroff or reboot targets in systemd, but I
> think that method has some caveats in itself. There are some instructions
> on Archwiki under the systemd article.
>
> Just some thoughts.
>
> _______________________________________________
> openbox mailing list
> openbox at icculus.org
> http://icculus.org/mailman/listinfo/openbox
> domain=icculus.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/openbox/attachments/20180326/13cba339/attachment.html>


More information about the openbox mailing list