deragon / autopoweroff

Manage automatic poweroff and other actions (suspend / custom) when specific conditions are reunited.
GNU General Public License v2.0
52 stars 7 forks source link

Custom command does not work #15

Closed mgutt closed 3 years ago

mgutt commented 3 years ago

I tried this custom command in autopoweroff to logout and shutdown my machine:

pkill -SIGTERM -f lxsession && shutdown -h 1

Sadly it does not work. If I choose the usual shutdown feature, it works. So it must be the command feature and not an other setting.

deragon commented 3 years ago

Mmm... This is not one command but two, separated with &&. I have not tested it, but I am not surprised that this does not work; Autopoweroff calls one single executable and that is it. Bash constructs like && are not supported. Autopoweroff does not call Bash to execute the commands.

The workaround is simple. Create a Bash script with pkill -SIGTERM -f lxsession && shutdown -h 1 as the content and have Autopoweroff call the script.

Let me know if that works and if I can close this issue. Thanks.

deragon commented 3 years ago

Since I got no feedback, I believe that I have given you the proper answer to your issue. Closing.