the-cavalry / light-locker

A simple session-locker for lightdm
GNU General Public License v2.0
221 stars 22 forks source link

light-locker-command: document that --inhibit allows to run external command #165

Open maxnikulin opened 1 year ago

maxnikulin commented 1 year ago

Please, describe possibility to run a command passing it as additional arguments to

light-locker-command --inhibit

I expect that such feature should be clear from

For me it was not obvious that I can run

light-locker-command --inhibit \
    --application-name "inhibit-dialog" --reason "User action" \
    -- env WINDOWID= \
    zenity --warning --title "Screen lock inhibited" \
        --text "Activation of screen lock is suppressed"

to display a reminder that I manually suppressed screen lock and to ensure that light-locker-command will be terminated on logout. (Caveat: with such simple example dialog window may outlive light-locker-command process killed directly by SIGTERM or SIGINT.)

I consider exec feature of light-locker-command as rather important because using dbus-send (or busctl, qdbus) from shell script to call org.freedesktop.ScreenSaver Inhibit does not work since inhibit is cleared on disconnect. Managing of two independent processes in shell script (light-locker-command and dialog) is tricky when termination of any process should reliably kill its sibling.