Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 17 Feb 2019, 06:36
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
xbindkeys - run programs with any keycombination
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Author Message
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sun 19 Mar 2006, 03:45    Post subject:  xbindkeys - run programs with any keycombination  

Screenshot:

http://dotpups.de/dotpups/Desktop-Tools/
xbindkeys_config.gif

Homepage:
http://hocwp.free.fr/xbindkeys/

Dotpup (34 kb):
http://dotpups.de/dotpups/Desktop-Tools/xbindkeys-1.7.2.pup

Mark

Last edited by MU on Tue 14 Oct 2008, 15:16; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13173
Location: Arizona USA

PostPosted: Sun 19 Mar 2006, 14:18    Post subject:  

All right, Mark! Thanks a lot. I'd like to use this to get my volume control keys to work but I don't quite know how to go about it yet.
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sun 19 Mar 2006, 14:41    Post subject:  

It is simple, though it looks a bit confusing at first sight.

Click on "new" to create a new keycombination.

Click on "Get Key", and a small window opens. Click the titlebar of that window to be shure it has the "focus".
Then hit the keycombination you want to add, like CTRL and B.
Then in the field "Action" enter the program to run - xterm or leafpad or whatever.

Then Save & Apply & Exit.
Now you can open leafpad with CTRL-B.

If you want to use the volumekeys to control the volume, it is not so easy.
You would need to know commands to control the volume via shell-commands.
I know from the Fvwm-Forum that it is possible, but I would have to search for that in the exampleconfigs.

Mark
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13173
Location: Arizona USA

PostPosted: Sun 19 Mar 2006, 14:55    Post subject:  

Thanks Mark. The xbindkeys and xev programs see my regular keys, but do not detect anything when I hit any of the hotkeys. The volume control and mute keys work in Windows and I've never installed any software for them. Oh well.
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sun 19 Mar 2006, 14:57    Post subject:  

ok, download "aumix" from the dotpups-wiki.

The command to decrease volume (enter that instead of "leafpad" in my former message):
aumix -v -10

increase volume:
aumix -v +10

more info:
aumix --help
This will tell you jow to adjust treble, bass and so on Smile

Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sun 19 Mar 2006, 14:59    Post subject:  

oh... then I have no idea at moment, sorry...
I have a logitech cordless desktop (use only keyboard, with a different cablemouse), and it works well with the volume-keys.
Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Sun 19 Mar 2006, 15:04    Post subject:  

I use Puppy 108r1 , I think earlier versions did not support the "xkb"-extension.
Do you still use 107?

Maybe it has to do with it, but I am not shure.
Maybe you must activate "plug'n'play-detection" in the Bios.

Mark
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13173
Location: Arizona USA

PostPosted: Sun 19 Mar 2006, 15:27    Post subject:  

I'm using 1.0.8r1 on a multisession DVD-RW. I'm think "plug-n-play" is enabled in the BIOS. I'll try to remember to check next time I boot.
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15241
Location: Paradox Realm

PostPosted: Mon 20 Mar 2006, 00:01    Post subject: Keyboard shortcuts  

This looks great Mark.
Is this the best way to give Puppy keyboard commands?
For example if pressing f1 the command dillo and the location of help.html is activated. Or would this be more efficient directly in script?

Keyboard shortcuts (such as alt + f4 to quit in Windows) are fast and efficient.

What is the best way to go about this?
Rather than download and install the key binding program and create a script that is lost, can we broaden this into a long term improvement for Puppy 1.0.9 /2.0.0? This key binding program might be the way to go about it too?

_________________
YinYana AI Buddhism
Back to top
View user's profile Send private message Visit poster's website 
Dougal


Joined: 19 Oct 2005
Posts: 2504
Location: Hell more grotesque than any medieval woodcut

PostPosted: Mon 20 Mar 2006, 08:07    Post subject:  

I once installed Debian and one of the X utilities was a little window that told you the keycode of any key you pressed (including the hotkeys).

Does this program do the same thing or do you actually need to know the keycode?
Back to top
View user's profile Send private message 
lior2b


Joined: 04 Feb 2006
Posts: 97
Location: The Holy Land

PostPosted: Mon 20 Mar 2006, 09:08    Post subject:  

Flash, IIRC some keyboard's media keys have to be awaken by the computer, by writing to a certain place in the memory (this is keyboard specific). Hence, you don't get any output from xev... I also have keyboard with media keys that Puppy can't recognize, but the latest Ubuntu knows how to handle. Anyways, you can try this: http://lineak.sourceforge.net/ .
_________________
Lior Tubi
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13647
Location: Karlsruhe, Germany

PostPosted: Mon 20 Mar 2006, 18:33    Post subject:  

Dougal, you talk of "xev" which is in Puppy too since 108.
Xbindkeys-config has the same mechanism, but in addition it adds the keycodes right in the field.
Mark
Back to top
View user's profile Send private message Visit poster's website 
dvw86


Joined: 04 May 2005
Posts: 636
Location: Washington State

PostPosted: Sun 17 Dec 2006, 00:06    Post subject:  

OK, I know that it has been awhile but I finally decided to try Xbindkeys with my ApplePro keyboard. Since Puppy already has setvol I decided to try and use that instead of downloading aumix. I just wrote a little script that accepts three flags.

-u turns the volume up
-d turns the volume down
-m mutes an un-mutes the volume.

It remembers what the volume was when it is muted/un-muted, but if you turn the volume up or down while muted it will start at a volume setting of 10. It will also display the volume setting on the screen for one second. It works well on my 800MHz VIA running Puppy 2.12. I haven't tried it on anything else.

Just copy and paste this code into a blank text file and save it as setvolume. Place the file in /root/my-applications/bin, and make it executable.

In the Xbindkeys action field put the word setvolume plus one of the flags. Such as this.

setvolume -u

If people want I can wrap it into a .pup for easier installation. I know that aumix is only 36k but mine is less than 1.4k Wink
Code:

#!/bin/bash
gain=`setvol 0 | cut -d" " -f2`
[ -e /root/.volume.txt ] || echo $gain > /root/.volume.txt
if [ "$1" = "-u" ]
then
gain=`expr $gain + 10`
if [ "$gain" -ge "100" ]
then
gain=100
fi
setvol 0 $gain
MSG=`which gxmessage` || MSG=xmessage
$MSG -center -buttons "" -font 100 -title "volume" "$gain" & sleep 1
kill -0 $! && kill $!
elif [ "$1" = "-d" ]
then
gain=`expr $gain - 10`
if [ "$gain" -le "0" ]
then
gain=0
echo "10" > /root/.volume.txt
fi
setvol 0 $gain
MSG=`which gxmessage` || MSG=xmessage
$MSG -center -buttons "" -font 100 -title "volume" "$gain" & sleep 1
kill -0 $! && kill $!
elif [ "$1" = "-m" ]
then
if [ "$gain" -ne "0" ]
then
old_gain=`cat /root/.volume.txt`
gawk -v var1="$old_gain" var2="$gain"'{sub(var1, var2); print}' /root/.volume.txt > /root/.volume.txt1
mv  /root/.volume.txt1 /root/.volume.txt
setvol 0 0
MSG=`which gxmessage` || MSG=xmessage
$MSG -center -buttons "" -font 100 -title "volume" "MUTE" & sleep 1
kill -0 $! && kill $!
else
gain=`cat /root/.volume.txt`
setvol 0 $gain
MSG=`which gxmessage` || MSG=xmessage
$MSG -center -buttons "" -font 100 -title "volume" "$gain" & sleep 1
kill -0 $! && kill $!
fi
else
MSG=`which gxmessage` || MSG=xmessage
$MSG -center -title "volume" "Please include a supported flag.
-u
   Volume up.
   
-d
   Volume down.
   
-m
   Volume muted."

fi
Back to top
View user's profile Send private message 
Indy


Joined: 01 Feb 2006
Posts: 68
Location: Sydney, Australia

PostPosted: Sun 17 Dec 2006, 08:02    Post subject:  

Thanks dvw86! I followed your instructions and now I have volume control (up, down and mute) via my multimedia keyboard. Works great!

I'm using: Puppy109CE and a Compaq Model 9000A keyboard.

The mute button's getting a good workout already. Ah... bliss!

I started to ask how to set the REW and FWD buttons on my keyboard as well for XMMS and wxMusik, but I decided to look around first.

I found this thing on controlling XMMS:
(ref: http://www.steve.org.uk/Software/xmms/ )

Quote:

Controlling XMMS

The following are the buttons I have on my keyboard, along with the commands which I have set xbindkeys to execute when I press them:
Action = XMMS Command
prev = xmms -rew
next = xmms -fwd
play = xmms -play
pause = xmms -pause
stop = xmms -stop


(Note: I put the 'equals' sign to separate the columns. How does one put in simple tables in these forum entries?)

My keyboard's really flexing its muscles now. All the commands worked for me (except "xmms -stop" where the track would stop but then start playing again... so I substituted "xmms -pause" instead which did what I wanted it to do).

Hope this helps someone!

Indy
p.s. Now I just need to find out how to do the same for wxMusik!
Back to top
View user's profile Send private message 
dvw86


Joined: 04 May 2005
Posts: 636
Location: Washington State

PostPosted: Sun 17 Dec 2006, 13:48    Post subject:  

Indy,
I'm glad that you like it (and that it works). Just out of curiosity, what speed (MHz) is your computer? I was kind of curious if 1 second wouldn't be long enough to display the volume on slower computers.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0456s ][ Queries: 11 (0.0062s) ][ GZIP on ]