You are not logged in.

#1 2008-02-02 22:04:20

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Xbindkeys + changevol [Solved]

Hello, I am trying to use xbindkeys with the changevol scripts in openbox.  When I start openbox the keys do nothing.  My .xbindkeysrc looks like this:

# Volume Mute
"changevol -t"
  m:0x0 + c:160
# Volume Up
"changevol -i 5"
  m:0x0 + c:176
# Volume down
"changevol -d 5"
  m:0x0 + c:174

When I run

killall xbindkeys
kbindkeys

from a terminal, they begin to work again.  My autostart.sh looks like this:

# Set wallpaper
eval `cat ~/.fehbg`&

cp ~/.gtkrc-2.0_conf ~/.gtkrc-2.0&

## Apps after openbox starts
conky & 
#xcompmgr &
#avant-window-navigator &
# call xbindkeys to set keys
xbindkeys &

(sleep 2 && pypanel)&

So I have to restart xbindkeys everytime I load my WM.  Any thoughts?

Last edited by semperfiguy (2008-02-06 01:16:30)

Offline

#2 2008-02-03 00:27:27

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Xbindkeys + changevol [Solved]

Sorry, I deleted my first response because I blatantly misread your post.  Ummm...this may sound dumb, but try moving the xbindkeys higher in your autostart.sh.  For example, try placing it above the conky execution line.

I have found that, for whatever reason, some applications are finicky about the order in which they are executed. If that doesn't work for ya, let me know.  I use the same setup for my dell hotkeys.


thayer williams ~ cinderwick.ca

Offline

#3 2008-02-03 01:13:35

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Xbindkeys + changevol [Solved]

No luck.  Still had to run killall xbindkeys, xbindkeys and it works.

Offline

#4 2008-02-03 23:42:28

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: Xbindkeys + changevol [Solved]

What are you using for a login/display manager (if any)? You could try putting xbindkeys at the top of your .xinitrc file instead. I use SLiM and this works for me, but I believe it won't work using GDM or KDM.

Last edited by fflarex (2008-02-03 23:43:02)

Offline

#5 2008-02-04 01:37:58

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Xbindkeys + changevol [Solved]

Yeah, I am using GDM.  I also have the power button activate pm-suspend and that works fine right off the bat.  It is just the changevol options that give me grief.

Offline

#6 2008-02-04 02:02:30

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: Xbindkeys + changevol [Solved]

Well, you could change the commands so that they are not openbox-specific. Install alsa-utils and then read the amixer man page. The commands will be something similar to:

amixer set -c 0 Master toggle
amixer set -c 0 Master +10%
amixer set -c 0 Master 10%-

These shortcuts should then work in any window manager. It might help, since you say your other shortcuts work fine.

EDIT: sorry, this little snippet here made me think you were using some openbox command, but apparently I was mistaken.

semperfiguy wrote:

Hello, I am trying to use xbindkeys with the changevol scripts in openbox.

Last edited by fflarex (2008-02-06 03:54:50)

Offline

#7 2008-02-06 01:13:49

semperfiguy
Member
Registered: 2007-12-03
Posts: 224

Re: Xbindkeys + changevol [Solved]

The commands I am using are not openbox specific.  changevol is a script in my ~/bin directory (which is added to my path in my .bashrc).  I can run the command from the command line with "changevol -i 5" to increase volume.

Edit:  Found the problem.  My ~/bin is added to my path in my .bashrc, which is not loaded till I open a terminal.  So I moved the script to /bin and it works fine now.  My bad.. roll

Last edited by semperfiguy (2008-02-06 01:15:28)

Offline

#8 2008-02-06 03:17:57

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Xbindkeys + changevol [Solved]

A "safer" alternative is to simply source the .bashrc file from .bash_profile, which is sourced during initial login, for example:

$ cat ~/.bash_profile
# Source the .bashrc
if [ -f .bashrc ]; then source .bashrc; fi

thayer williams ~ cinderwick.ca

Offline

#9 2008-02-06 14:24:27

noalwin
Member
From: Spain
Registered: 2007-06-08
Posts: 115

Re: Xbindkeys + changevol [Solved]

semperfiguy wrote:

Hello, I am trying to use xbindkeys with the changevol scripts in openbox.

As a workarround you should be able to do that configuring your .config/openbox/rc.xml

 
    <keybind key="W-Up">
      <action name="Execute">
        <startupnotify>
          <enabled>false</enabled>
        </startupnotify>
        <command>changevol -i 5</command>
      </action>
    </keybind>

Offline

Board footer

Powered by FluxBB