How to have one-key "poweroff"?

Moderator: Forum moderators

Post Reply
Martinus
Posts: 19
Joined: Sun Nov 22, 2020 11:08 pm
Been thanked: 1 time

How to have one-key "poweroff"?

Post by Martinus »

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

User avatar
8Geee
Posts: 376
Joined: Wed Jul 29, 2020 10:52 pm
Location: N.E. USA
Has thanked: 17 times
Been thanked: 55 times

Re: terminal commands

Post by 8Geee »

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

Money talks... no, it shouts, so that it doesn't have to hear common sense.

User avatar
gychang
Posts: 591
Joined: Fri Aug 28, 2020 4:51 pm
Location: San Diego, CA
Has thanked: 206 times
Been thanked: 64 times

Re: terminal commands

Post 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"

======

Puppy Bytes, utube videos
https://www.youtube.com/channel/UCg-DUU ... u62_iqR-MA

======

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

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

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

Martinus
Posts: 19
Joined: Sun Nov 22, 2020 11:08 pm
Been thanked: 1 time

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

Post 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

User avatar
wizard
Posts: 1984
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2648 times
Been thanked: 692 times

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

Post by wizard »

@Martinus

What version of slacko are you using?

Thanks
wizard

Big pile of OLD computers

User avatar
wizard
Posts: 1984
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2648 times
Been thanked: 692 times

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

Post 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 1373 times

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

wizard

Big pile of OLD computers

User avatar
bigpup
Moderator
Posts: 6993
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 911 times
Been thanked: 1528 times

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

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

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

Martinus
Posts: 19
Joined: Sun Nov 22, 2020 11:08 pm
Been thanked: 1 time

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

Post 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

Post Reply

Return to “Slacko”