My last post didn't get a correct answer, so I decided to refine/narrow my question in another post. If you want to refer to the other question, go:

Run script when power button pressed

So I am trying to execute a bash file upon power key press. According to the documentation for ACPID, I created a file named power with the following address: /etc/apci/events/power. In that file, I have the following script:

event=button/power action=/etc/acpi/script.sh

So when I push the power key, power should be executed, which in turn fires script.sh, but nothing happens.

What am I doing wrong? (BTW, i'm running Ubuntu 19.04)

  • What does your script do? There's a big difference between "nothing happens because script doesn't get started" and "nothing happens because script's effects are invisible". – user1686 Feb 10 at 8:24
  • script.sh in this case is a test script. It is a simple script that creates a file on the desktop called file.txt . This is not the final script I will use, just to test the functionality. – ragnvaldr.js Feb 10 at 15:42
  • Is the script executable and with a proper shebang? This edit of yours makes me suspect you may tend to run scripts by running Bash with an argument: bash script.sh. Even if bash /etc/acpi/script.sh succeeds, /etc/acpi/script.sh may not. – Kamil Maciorowski Feb 11 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.