System Porteus 4.0 i586 XFCE 4.12
What must be changed so that when pressing the "On/Off" button at a notebook, instead of immediately shutting down displaying a confirmation if Shutdown should be indeed executed after a certain wait time or be cancelled.
The length of that message should be definably, e.g. 30 seconds or 60 seconds - when nothing is done by the user the shutdown should happen.
The reason why I want this is that I just now accidental shut down the machine. I was of the impression it was in suspend mode, and with that machine pressing any key of the keyboard doesn't make it return from suspend, you have to press the "on/off" button instead.
And since I shield the bright status icons (battery / AC adapter plugged in / sleep/suspend/on / harddisc writing) and the display was switched off I did not realize the machine was on with switched off display instead of being in suspend. Until the display switched on only to display me the shutdown procedure.
Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?
- ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?
hmmm, maybe.. very edge-casey area here..
take a look at: /etc/acpi/powerbtn:
i guess you want:
..could be an issue if the reason to use the power button is because of some major system fubar and running said script is impossible..(but /sbin/poweroff might just still work)
take a look at: /etc/acpi/powerbtn:
Code: Select all
# /etc/acpi/events/power
# This is called when the user presses the power button
event=button/power (PWR.||PBTN)
action=/sbin/poweroff
Code: Select all
action=/path/to/some/script_that_asks_me_if_i_really_want_to_shutdown_and_does_so_if_i_don't_respond_after_n_seconds
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
- Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?
You are correct on that but if it were the case, then it would be my fault for messing with the system. (Or any user that read this thread and did tweak his system as well)ncmprhnsbl wrote: ↑17 Sep 2022, 03:34..could be an issue if the reason to use the power button is because of some major system fubar and running said script is impossible..(but /sbin/poweroff might just still work)
Also, when /sbin/poweroff might just still work - REISUB should also still work, yes?
Added in 11 hours 8 minutes 8 seconds:
I forgot to ask, if I do the changes in /etc/acpi/powerbtn
Code: Select all
action=/usr/local/bin/ask-shutdown-script
(To make it permanent I will have to put the /usr/local/bin/ask-shutdown-script and the changed /etc/acpi/powerbtn into my rootcopy/)
Cheers!
Yours Rava
Yours Rava