Monday, August 01, 2005

xmodmap thinger

Buttons with my laptop

I found a nice little config to get the volume control buttons working on my laptop. Note, this config file will probably only work on an HP zv5320, but the way to set up the config to automatically run after every reboot will probably be a help to you. The help came from this page particularly, so thanks a lot to the author.

Create a file called .Xmodmap in your home directory

> sudo emacs /home/user/.Xmodmap

and add these lines

---
keycode 174 = XF86AudioLowerVolume

keycode 160 = XF86AudioMute

keycode 176 = XF86AudioRaiseVolume

keycode 178 = XF86HomePage

keycode 223 = XF86Standby

keycode 162 = XF86AudioPlay

keycode 164 = XF86AudioStop

keycode 144 = XF86AudioPrev

keycode 153 = XF86AudioNext
---
Again, it's only going to work for an HP zv5320 laptop.

Problem was, I couldn't get the script to load up every time the computer rebooted. I would have to load the script via

> xmodmap ~/.Xmodmap

in order for the buttons to work again. You can imagine that it would suck to havae to do that every time. I don't know because I have it set to do it automatically. Here's what I did (and no other way worked for me, I tried quite a few). So now is where this works for anybody on any system, at least that's the aim. To run the command xmodmap ~/.Xmodmap at the beginning of every session, instead of manually typing it into a terminal yourself, add the following to the end of your .bash_profile from your home directory

if [ -f ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap
fi

save the .bash_profile and you should be good to go.

-bash_profile is good for everything! (at least lots of things)

No comments:

Followers