jD91mZM2 / xidlehook

GitLab: https://gitlab.com/jD91mZM2/xidlehook
MIT License
382 stars 33 forks source link

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

Closed blubber closed 3 years ago

blubber commented 3 years ago

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,
        },
    ],
)
jD91mZM2 commented 3 years ago

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 :)

blubber commented 3 years ago

Cool, thanks for the quick reply!