Page 1 of 1

How to have one-key "poweroff"?

Posted: Mon Jul 04, 2022 4:47 pm
by Martinus

4.7.22
how to install a hotkey to press with finger one click on keyboard: "poweroff"?
Martinus


Re: terminal commands

Posted: Mon Jul 11, 2022 3:57 pm
by 8Geee

Use and hold down the computer's power switch ( emergency-off).


Re: terminal commands

Posted: Mon Jul 11, 2022 5:38 pm
by gychang
Martinus wrote: Mon Jul 04, 2022 4:47 pm

4.7.22
how to install a hotkey to press with finger one click on keyboard: "poweroff"?
Martinus

not quite one finger press, but add alias po='wmpoweroff && exit' to /root/.bashrc, then run "source /root/.bashrc" and to poweroff open terminal and enter "po"


Re: How to have one-key "poweroff"?

Posted: Mon Jul 11, 2022 7:13 pm
by williams2

In BionicPup64, I can press the power button to poweroff
(just a quick normal press, do not hold the power button for 5 or 10 seconds.)

You can create a script in maybe /root/

Code: Select all

#!/bin/sh
exec poweroff

then drag the script to the desktop (pinboard)
then right click the icon, select Edit item
then click click to set
then press the keys you want,
for example, Super+F2
or any other key or keys you want
(the Super key is the Win key)

If it works well, you could set a shortcut key using jwmdesk
instead of the rox pinboard.

I just press the power button to poweroff.


Re: How to have one-key "poweroff"?

Posted: Mon Jul 11, 2022 10:51 pm
by Martinus

How to have one-key poweroff
Thank you all, who answered to this Question.
July.11. 22
Here I must extend with some more information.
I use different puppies since about 16 years,
Many years ago i found "poweroff" in user/bin.
I dragged it to the screen .
There I can switch off the computer with one Left-mouseclick on it.
Mouseclicks are never as comfortable and as quick as keyboard-klicks.
In desktop settings I could install "close" for finger once on F8.
It has been really more comfortable than with searching and click with mouse.

I know. nearly each programs can be realized with puppy. But I am now a grandpa user, who has nearly all his Linux knowledge forgotten. So I come back to the Question on top to improve my every day duties with your help.
cheers
Martinus


Re: How to have one-key "poweroff"?

Posted: Tue Jul 12, 2022 1:45 am
by wizard

@Martinus

What version of slacko are you using?

Thanks
wizard


Re: How to have one-key "poweroff"?

Posted: Tue Jul 12, 2022 1:05 pm
by wizard

@Martinus

This works in slacko 6.3 and 7.0

Set up F8 key as single key shutdown.

Menu>Desktop>Desktop Settings>Shortcuts>Add new shortcut
-in the Key line type: F8
-in the Action line type: exec: poweroff
(Note: no spaces in the action line)

shortcut.jpg
shortcut.jpg (24.05 KiB) Viewed 1300 times

-click Apply
-click Cancel
-click OK in the JWM shortcuts window

wizard


Re: How to have one-key "poweroff"?

Posted: Tue Jul 12, 2022 1:34 pm
by bigpup

For other Puppy versions that have JWMDesk

menu -> Desktop -> JWMDesk -> JWM hotkey -> Add new shortcut

Most newer Puppies it is this command that does the shutdown:

wmpoweroff

It will make sure it is a normal shutdown.


Re: How to have one-key "poweroff"?

Posted: Wed Jul 13, 2022 12:17 am
by Martinus

12.7.22
Hello, to all.who answered to: How to have one-key "poweroff"
Special thanks to wizard, who introduced the magic word "exec:"!
Now I can use the one-key fingers on F8 for close and F7 for exec:poweroff.
I tried it today successfully with five Puppy versions. In all cases it needed a few seconds to save data from open processes, as I expect it. Maybe so it works on all Puppies.
"wmpoweroff" works with mouse, is for keyboard not required.

best wishes to all friends

Martinus