jD91mZM2/xidlehook

The xidlehook-client add command doesn't properly take all options into account

Closed this issue · 2 comments

As far as I can tell from the documentation the following command should result in a new timer, with a activation and a cancelation command:

$ xidlehook-client add --time 300 --activation activate --abortion abort

Instead, the resulting timer looks like this:

$ xidlehook-client query --timer 3
QueryResult(
    [
        QueryResult {
            timer: 3,
            time: 300s,
            activation: [
                "activate",
                "--abortion",
                "abort",
            ],
            abortion: [],
            deactivation: [],
            disabled: false,
        },
    ],
)

Ah! Unlike the main xidlehook application, the --activation command takes multiple arguments in order to avoid depending on /bin/sh (making xidlehook-client more powerful than xidlehook, at the cost of less convenience). The command is started with the first argument as command, and the rest as arguments. The trick is to use ; as terminator. Compare with find -exec command arg1 arg2 \; (\; needed to escape the ; in bash)

xidlehook-client add --time 300 --activation activate \; --abortion abort should do the trick :)

Cool, thanks for the quick reply!