Ruminations from the Long Doctor

Copy and Paste Buttons in Linux with my Intellimouse Optical

April 28th, 2008

I cannot live without copy and paste buttons on my mouse.

When I’m working on Web Development, I find myself constantly copying and pasting text and being able to do it from my mouse is a convenience I have grown to depend on. Copy and Paste are also useful in general computing terms, when moving files around in a window manager. The mouse I use at home and at work is the Intellimouse Optical.

Intellimouse Optical

Intellimouse Optical:
Featuring five buttons,
including a mouse wheel button

I have had this mouse for about 5 years now and it is very solid and dependable. Microsoft may not even make it anymore, but I have one for home and one for work, and judging by the past 5 years, they aren’t going to break anytime soon.

I have the left-side button mapped to paste (which I can trigger with my thumb) and the mouse wheel button mapped to paste. Since it is all too easy to accidentally trigger the mouse wheel button, I opted to map it to paste, which is non-destructive. I keep the right-side button mapped to delete, which is also extremely useful.

In Windows, the driver CD that came with the mouse makes it a snap to bind copy, paste and delete to the mouse buttons. In Linux, the task is a little more difficult, but after several hours of mucking around, I have it down to a science. Here’s how I got it working, documented for posterity:

  1. Replace the code referencing your mouse in /etc/X11/xorg.conf with the following definition for the MS Intellimouse:
    Section "InputDevice"
            Identifier "Configured Mouse"
            Driver "mouse"
            Option "CorePointer"
            Option "Device" "/dev/input/mice"
            Option "Protocol" "ExplorerPS/2"
            Option "Buttons" "7"
            Option "ZAxisMapping" "4 5"
            Option "ButtonMapping" "1 2 3 6 7"
            Option "Resolution" "100"
    EndSection
  2. Install the program xvkbd, which is needed by xbindkeys
  3. Install the program xbindkeys and place the following in a file named .xbindkeysrc in your home directory:
    
    "xbindkeys_show"
    control+shift + q
    /usr/X11R6/bin/xvkbd -xsendevent -text "\[Control]c""
    b:2
    /usr/X11R6/bin/xvkbd -xsendevent -text "\[Control]v""
    b:6
    /usr/X11R6/bin/xvkbd -xsendevent -text "\[Delete]""
    b:7
  4. Reboot your computer or restart X windows to load the new xorg.conf file. Then run xbindkeys in the background (xbindkeys &) and you should be all set!

Happy copying and pasting!

Posted in Uncategorized | No Comments »

XBMC Rocks the Hizzy

April 12th, 2008

I spent last weekend tagging my mp3s so I could set up some custom playlists in Xbox Media Center. We have 2 Xboxes in the house (one in the living room and one in the exercise room in the basement), both of which are connected wirelessly to my Windows PC in the office where I have about 80 gigs of mp3s on a shared harddrive.

XBMC has quite a number of kick-ass features, one of which is the ability to set up smart playlists using the id3 tags on your mp3s. My plan was to tag my mp3s by genre and include a “party” genre so I could setup a playlist of all party-friendly, danceable stuff.

I ran into some issues when I was trying to get all my party songs to show up in the playlist, so I posted to the XBMC Forum asking for help. Within an hour, one of the XBMC developers had replied to my post. After a little digging, he verified that I had located a bug with XBMC’s support for multiple genres in smart playlists and he was able to commit a patch to the SVN trunk and offer me a couple suggestions for a temporary workaround.

Needless to say, I was pretty damn impressed with the response I’d gotten to my forum post. Xbox Media Center is the reason why I’d never trade my Xbox for an Xbox 360 and with the project still under active development, it’s only gonna keep getting better. I’m seriously considering buying a third Xbox for the bedroom, so I can watch my downloaded Alf xvids while laying in bed.

I’m just kidding about Alf.

Or am I?

Posted in Uncategorized | No Comments »

kruger