Terminal command with button
Terminal command with button
How to run a terminal command with a button?
I want to run the command for suspend (acpitool -s) with a button.
I want to run the command for suspend (acpitool -s) with a button.
If you're using OpenBox there are plenty of tutorials that explain how to bind an action to a combination of keys (or just one).
"Action" can easily be your script.
This is an example.
You can create a custom script.desktop file to make a desktop icon and lauch the script by double click.
I know there are apps for doing those files and creating your own, but you can just copy & edit one from /usr/share/applications.
"Action" can easily be your script.
This is an example.
You can create a custom script.desktop file to make a desktop icon and lauch the script by double click.
I know there are apps for doing those files and creating your own, but you can just copy & edit one from /usr/share/applications.
OpenBox is another window manager? I guess you have suggested that because in this default lightweight one it is not easy to make an shortcut for a command in the terminal.GustavoYz wrote:If you're using OpenBox there are plenty of tutorials that explain how to bind an action to a combination of keys (or just one).
"Action" can easily be your script.
This is an example.
Can you describe this a little bit more? I opened one as txt but I do not know what and how to change it.You can create a custom script.desktop file to make a desktop icon and lauch the script by double click.
I know there are apps for doing those files and creating your own, but you can just copy & edit one from /usr/share/applications.
Code: Select all
[Desktop Entry]
Encoding=UTF-8
Name=SHUTDOWN into RAM Sleep
Icon=wizard16.xpm
Comment=ACPI G1 S3
Exec=acpitool -s
Terminal=false
Type=Application
Categories=X-DesktopApplets
GenericName=acpitool -s
fixmenus
jwm -reload || jwm -restart
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P
Then look into the
/sbin/pup_event_frontend_d
file .
Somewhere near the end there should be some line like
change that wmpoweroff & to whatever code you want ie acpitool -s &
Of course you need to putin the POWERTIMEOUT into the /etc/eventmanager file ie :
To check it run
in the console.
Note > Needs restartwm aka restart X server after making these changes to relaunch the pup_event_frontend_d .
/sbin/pup_event_frontend_d
file .
Somewhere near the end there should be some line like
Code: Select all
[ $MOUSECNT -gt $POWERTIMEOUT ] && wmpoweroff &
Of course you need to putin the POWERTIMEOUT into the /etc/eventmanager file ie :
Note : am not sure if the pup_event_frontend_d keeps running after wake up .#this parameter is read by /sbin/pup_event_frontend_d...
#power-off PC if mouse inactive for this many minutes (0 means never)...
POWERTIMEOUT=60
To check it run
Code: Select all
pidof pup_event_frontend_d
Note > Needs restartwm aka restart X server after making these changes to relaunch the pup_event_frontend_d .