cage: optionally return exitcode of primary client

Some applications indicate different shutdown conditions by returning
specific exit codes. One of these is e.g. Kodi, which returns 64 in case
the user chose "Power off" and 66 in case the user chose "Reboot".
In order to act on these exit codes, it thus makes sense in some
situations to pass them on from the primary client to the caller of
Cage.

Add a new flag "-e". If it's set and Cage shutso down because of an
orderly exit of its primary client, then it causes Cage to return the
primary client's exit code instead of its own one.
This commit is contained in:
Patrick Steinhardt 2020-09-16 20:26:39 +02:00
parent 0d85c1652e
commit b904d15290
3 changed files with 20 additions and 6 deletions

View file

@ -6,7 +6,7 @@ cage - a Wayland kiosk compositor
# SYNOPSIS
*cage* [-dhmrsv] [--] _application_ [application argument ...]
*cage* [-dehmrsv] [--] _application_ [application argument ...]
# DESCRIPTION
@ -19,6 +19,10 @@ activities outside the scope of the running application are prevented.
*-d*
Don't draw client side decorations when possible.
*-e*
Return the primary client's exit code if Cage shuts down because of the
client exiting.
*-h*
Show the help message.