Getting additional mouse buttons to be useful in linux

Posted by Chris Tue, 29 Jan 2008 16:20:00 GMT

Quick follow up to the previous post. I have a Microsoft Laser Mouse 6000, which happens to have two side buttons, which in Windows correspond to the Back and Forward actions in things like web browsers and Explorer. In linux, these buttons don’t do anything by default, but I finally got them working.

All I had to do was install xbindkeys, which for OpenSuSE 10.3 can be found via the OpenSuSE Build Service. After that is installed, you create the file $HOME/.xbindkeysrc and put something like the following into it:

    "xvkbd  -text "\[Alt]\[Left]""
          m:0x0 + b:8
    "xvkbd  -text "\[Alt]\[Right]""
          m:0x0 + b:9

The b:8 and b:9 parts are the mouse buttons you want to listen for, which can be found by using xev.

After that file is set up, you just need to make sure that xbindkeys is started when you start X, which can be done in a script in $HOME/.kde/Autostart, maybe just added to the script I mentioned in the previous post about how to get multimedia keys working in linux. For the time being, you can just run xbindkeys from a commandline in your current session.

Once all this is done, xbindkeys will listen for the mouse buttons you set up and send the specified keyboard commands, in this case Alt+Left and Alt+Right, which should get you Back and Forward actions in your browsers.

Configuring the Logitech diNovo Edge in Linux 6

Posted by Chris Tue, 29 Jan 2008 15:39:00 GMT

I love my Logitech diNovo Edge keyboard, and I only recently got some of it’s special keys mapped and working in Linux. Doing this required using xev to gather the keycodes for the various special keys and functions on they keyboard and then setting up an Xmodmap file mapping these keycodes to various XF86 actions.

The keys that I couldn’t get codes for are:

  • “Phone” Key (Fn + F1)
  • Magnifying glass keys (along the left edge)
  • A B C D keys (Fn + F9-F12)

Otherwise, here’s the contents of my $HOME/.Xmodmap file:

keycode 160 = XF86AudioMute
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume
keycode 122 = XF86Search
keycode 144 = XF86AudioPrev
keycode 164 = XF86AudioStop
keycode 162 = XF86AudioPlay
keycode 153 = XF86AudioNext
keycode 236 = XF86Mail
keycode 130 = XF86HomePage
keycode 129 = XF86MenuPB
keycode 115 = XF86MenuKB

Then, if you’re using KDE, you can the KDE Control Center -> Regional & Accessibility menu’s Keyboard Shortcuts or the Input Actions sections to map these new keys to events.

One important part is to make sure your .Xmodmap file is loaded when you log in, you can do this via a bash script in $HOME/.kde/Autostart that looks something like this:

#!/bin/bash
xmodmap ~/.Xmodmap

Also, I followed some instructions found here for general XModmap usage and help: Multimediakeys with .Xmodmap HOWTO

I need to write software

Posted by Chris Mon, 28 Jan 2008 18:54:00 GMT

I used to be really involved in open source software, it was easier back in college when I had more time to focus on that kind of stuff. Not that I don’t have much free time now, I just find myself spending it in other ways that really aren’t productive at all. It’s not even that I’m burned out on programming from my day job, it’s just that when you’re not getting paid to write the software it has to have some intrinsic value to motivate you to work on it.

Every once in a while I get what I think is a great idea and do about two days or work on it. Then one of a couple things starts happening:

  1. I find out that someone, somewhere, has already written my idea and that, even if it’s not better than my idea, they’re way ahead of me in terms of development
  2. I quickly realize that my goals were big and after a few days of free time working on it I’m not really seeing anything useful shaping up

For the first item, I’m not really sure what to do to combat that, except to realize that it’s very rare to come up with an idea that someone else hasn’t already come up with. I think that maybe unique overall ideas may be hard to come up with, but that it’s easier to come up with small changes to an idea that lots of people have done already.

For number two the solution is really simple: start out with implementing smaller projects. I think I need to sit down and brainstorm for a little while and just come up with a long list of really small projects, ones that I know won’t take more than 1-2 days of a couple of hours at a time to implement. Anything much longer than that and I face the chance of burning myself out.

So, to summarize: I need to come up with small, quickly implementable projects and then just ignore stories on Lifehacker about the “great new project X” that does exactly what I thought of (those stories always seem to come out a day after I start implementing something…)

Server monitoring with Munin and Monit

Posted by Chris Fri, 18 Jan 2008 19:48:00 GMT

I was looking for a good way to find out about my server stats, which are kind of low with slicehost’s most basic offering, and finally came across two pieces of software, Munin and Monit.

Munin generates tons of graphs of system statistics from CPU and Memory usage to load averages, open files and lots more and generates web content that lets you quickly see the health/performance of your system.

Monit is for more automated monitoring and runs as a daemon on your server. You can configure it to watch lots of different things including CPU and Memory usage and whether or not various services are running. It then alerts you when your specified conditions are tripped, such as if memory usage goes over a certain percentage, or if CPU utilization stays high for a given amount of time. It can also watch processes and if they die it will restart them.

The best guide (it also has helpful links to more details) I could find is called Server Monitoring With munin And monit found on a site I’m going to have to check out more, HowToForge.

Finally up

Posted by Chris Fri, 11 Jan 2008 02:59:00 GMT

Wow, finally got a Rails app up and running with minimal pain. It’s amazing how much of a difference dedicated hosting can make on things. Previously I was using shared hosting and having no luck with getting rails apps running reliably. Switched to Slicehost and I’m pretty impressed.

Older posts: 1 2