Power button jumpscare

(Bruce Blore) #1

My brother also uses my computer, and when he does, he always powers it off by holding the power button for five seconds. I am getting very annoyed at this and he won’t stop, so I am thinking that I will set up a jump scare that happens whenever the power button is pressed. I plan for it to be a simple shell script started by my desktop environment when a user logs in. I just have a few questions before I start:

What is the easiest way to detect when the power button is pressed?

How would I display a large image on the screen?

How would I play a sound effect?

I am using Debian GNU/Linux 9.3 with the LXDE desktop environment. I plan to implement this as a Bash script.

(Filip Samuel) #2

I don’t know how you can detect when the power button is pressed but maybe this will help you.

Ok, so you want to display a large image on screen, first install feh(an image viewer) which you can use from the terminal, something like feh name_of_image, feh is very flexible there are ways so make it open an image as large as you want.
Hope this helped.