Mario77 : downloaded the zip and tried to install it, but unable to.
Which zip?
I didn't mean you just download that zip and install it...
but on previous post I made you a small modified script that will work..
You ll need to create a system.d service that start the script or use autostart.sh to start it..
This you can play around how you want ex changing the when released function to something like
def rls():
global held_for
if (held_for > 3.0):
check_call(['/sbin/poweroff'])
else:
check_call(['/sbin/reboot'])
this will exec shutdown if held more then 3 seconds or reboot if less...
You got plenty of options to playwith...ex my switch has an led built into it and it can blink or fade or whatever you want it to do but for that you ll need an npn transistor.