Page 1 of 1

Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?

Posted: 16 Sep 2022, 14:36
by Rava
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.
ImageImage

Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?

Posted: 17 Sep 2022, 03:34
by ncmprhnsbl
hmmm, maybe.. very edge-casey area here..

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
i guess you want:

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
..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)

Port 4.0i586 - Info window instead of immediately Shutdown when pressing On/Off?

Posted: 17 Sep 2022, 06:37
by Rava
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)
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)

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
do I have to reboot first or do the change work immediately without reboot?

(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/)