I wanted to know if someone could provide scripts or script-examples that get executed when the power-button gets pressed (as found in the system energy-safer mode in settings)?
Since I found nothing online I wanted to ask here and create a new topic, if it's unfitting just delete this post.
(garuda-inxi is not needed here I guess since it's a universal question, if I'm wrong correct me).
What specifically do you want to happen when the power button is pressed?
If the desired event is any of these: poweroff, reboot, halt, suspend, hibernate, hybrid-sleep, suspend-then-hibernate, lock, or kexec, then no script is needed--you can simply uncomment the HandlePowerKey line in /etc/systemd/logind.conf (or add a drop-in config in /etc/systemd/logind.conf.d/) and specify the desired event like so:
Yeah that's the question I had forgot to add: Which scripts would make sense? And/Or which scripts does the community use? (If they even use a script for the power-button) - I had no idea which script would make sense so I thought I'd ask the community
For any common use of the power button, I do not think using a script makes sense.
A script would be needed if you wanted your power button to do something the power button is not typically used for, like launch an application or something. For the options that can be found in the power management settings, a script is unnecessary–you can simply make an edit to /etc/systemd/logind.conf like I mentioned above.
if you already have an Iphone, better not replace it (for now). This linux on mobile thing is still very much in beta and you really need to get used to the problems that arise.
Oh ok, well I played with the thought of buying it but I heard exactly what you said from anybody else and I don't want to crash a device and then lose my two-factor-authenticator with it - I have my complaints about apple and their privacy but at least the iPhone is really stable and secure and that's what I need my phone for