Re: How to shutdown when using Openbox

Anthony Thyssen <a.thyssen-YlX7AVbyhojX/[email protected]> Mon, 26 Mar 2018 11:05:38 +1000
Newsgroups gmane.comp.window-managers.openbox
Message-ID <CABOaSg1hP8SDESikSrnuvrgUiJ9Q6n0fQo44E_X-TxBL72QL=w@mail.gmail.com>
--===============0916552737408975353==
Content-Type: multipart/alternative; boundary="94eb2c06b43ea33e2b05684661db"

--94eb2c06b43ea33e2b05684661db
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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 <[email protected]>
wrote:

> > Trying to do that _within openbox_ is like cutting a branch on which yo=
u
> 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 aft=
er
> 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
> [email protected]
> http://icculus.org/mailman/listinfo/openbox
> domain=3Dicculus.org
>
>

--94eb2c06b43ea33e2b05684661db
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I actually don't hang my X windows session on the window m=
anager.<br>That way I can completely exit the window manager and restart or=
 try out a different one as and when I like.<div>The window manager is afte=
r all just another X window application!<br><div><br></div><div>Instead I h=
ave a button on the bottom-right of the screen (actually its a xmessage win=
dow).=C2=A0</div><div><br></div><div>When pressed it pops up a set of 5 but=
tons (another xmessage window actually) asking what action you want.</div><=
div><br></div><div>Poweroff=C2=A0 =C2=A0 =C2=A0-- shutdown computer complet=
ely</div><div>Reboot=C2=A0 =C2=A0 =C2=A0 =C2=A0 -- equivelent to a power cy=
cle=C2=A0</div><div>Restart=C2=A0 =C2=A0 =C2=A0 =C2=A0-- kill off ALL appli=
cations (including window manager), using xclosedown, and start them again<=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 I use this after changing start up scripts, or just get a clean star=
t without needing to login again</div><div>Logout=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 -- obvious</div><div>Cancel=C2=A0 =C2=A0 =C2=A0 =C2=A0 -- return to the=
 single 'logout' button.<br></div><div><br></div><div>There is also a timeo=
ut (built into xmessage) that can be configured to do ANY of the above acti=
ons</div><div>And the script tests the exit codes to see if the windows wer=
e killed by a xkill or xclosedown<br>and if they were just exit and logout =
as you would expect.<br><br>I created that script over 20 years ago=C2=A0 (=
date is=C2=A01 November 1994 but it started before that!)</div><div>And am =
still using it, basically unchanged since then.</div><div><br>I did need to=
 install the package &quot;xorg-x11-xinit-session&quot; to get logins to ca=
ll my &quot;.xsession&quot; script,</div></div><div>rather than a system pr=
ovided one, but I have always used my own session script!</div><div><br></d=
iv><div><br></div><div>A Basic xlogout button (using any application it can=
 find to generate the button), can be downloaded from...</div><div>=C2=A0 =
=C2=A0<a href=3D"http://www.ict.griffith.edu.au/anthony/software/#xlogout">=
http://www.ict.griffith.edu.au/anthony/software/#xlogout</a></div><div><br>=
</div><div><br></div><div><br></div><div><br></div></div><div class=3D"gmai=
l_extra"><br><div class=3D"gmail_quote">On Sun, Mar 25, 2018 at 1:02 PM, MJ=
 Fleming <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr">&gt; Trying to do that _within ope=
nbox_ is like cutting a branch on which you are sitting<div><br></div><div>=
I don't feel that's actually true. I haven't looked at the source so I'm no=
t totally sure what the function of openbox --exit is (I have read it tries=
 to kill any open processes but don't quote me).</div><div><br></div><div>H=
owever, systemd certainly does permit processes to persist after logout. An=
d under Debian, unless I have a very borked system, I'm able to execute som=
ething 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.</div><div><br></div><div>It'=
s also possible to run X and openbox as systemd services which would then b=
e 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.</div><div><br></div><div>Just some thoughts.</d=
iv></div>
<br>______________________________<wbr>_________________<br>
openbox mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a rel=3D"noreferrer" href=3D"http://icculus.org/mailman/listinfo/openbox" =
target=3D"_blank">https://protect-au.mimecast.<wbr>com/s/y7O3CBNZl8i7EWpAfz=
f6ix?<wbr>domain=3Dicculus.org</a><br>
<br></blockquote></div><br></div>

--94eb2c06b43ea33e2b05684661db--


--===============0916552737408975353==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kb3BlbmJveCBt
YWlsaW5nIGxpc3QKb3BlbmJveEBpY2N1bHVzLm9yZwpodHRwOi8vaWNjdWx1cy5vcmcvbWFpbG1h
bi9saXN0aW5mby9vcGVuYm94

--===============0916552737408975353==--