↓ Twitter is updated more often, so read it! ↓

HOWTO Install btnx for better mouse control in Ubuntu Hardy

When I installed Hardy, I forgot to copy my awesome xorg.conf which held the configuration to enable all 12 buttons of my Logitech MX1000.

Lo and behold, a new method of configuring it has come about, albeit it was around prior to Gutsy.

btnx is the work of Olli Salonen. The program runs as a daemon, catching mouse events and turning them into either key presses or proper mouse events which the system can interpret. This eases the configuration one must do in order to enjoy the full potential of the high-end Logitech mice—a potential which, in my opinion, Windows cannot reach.

The installation process for btnx is pretty easy.

First, I replaced the mouse section of my /etc/X11/xorg.conf with this section. This may not be necessary, but I did it before discovering btnx.

Section "InputDevice"
        Identifier      "Logitech MX1000"
        Driver          "evdev"
        Option          "Name"          "Logitech USB RECEIVER"
        Option          "HWHEELRelativeAxisButtons" "7 6"
EndSection

Next, open a terminal and cd to the location where you keep your sources. I keep mine in ~/Source. This next section prepares the libraries required to build btnx and its support program, btnx-config, as well as subversion if you don’t already have it installed. I prefer to use subversion and checkout tags if they are available. It makes switching to a new version just a svn sw away. Last, it checks out the source for the two programs.

sudo apt-get install subversion libgtk2.0-dev libglade2-dev libdaemon-dev
svn co http://svn.ollisalonen.com/btnx/tags/btnx-0.4.9/
svn co http://svn.ollisalonen.com/btnx-config/tags/btnx-config-0.4.8/

Next, do a simple cm&smi for each program.

cd btnx-0.4.9
./configure && make && sudo make install
cd ../btnx-config-0.4.8
./configure && make && sudo make install

Now that both programs are installed, you must first configure btnx using btnx-config. Start it as root using the command below or go to Applications > System Tools > btnx. Click “Detect Mouse and Buttons”. You’ll probably be able to figure it out from there.

gksu btnx-config

I have the middle thumb button on my MX1000 configured to activate the Rotate Cube plugin of Compiz. I have it configured as Button10 in Compiz and BUTTON_9 in btnx. Remeber: Compiz and many other programs start counting buttons at 1, but btnx starts at 0.

Update: There is a post on Ubuntu Forums about building btnx, too.

Update 2008-04-29 01:18: I’ve posted an update. New versions of btnx and btnx-config are available and so are debs for both 32-bit and 64-bit Ubuntu.

Update 2008-11-05 20:56: As Christopher pointed out, Btnx is useless in Intrepid. Olli, the author of btnx, remarks that the way btnx interacted with the kernel is no longer available, so all development on btnx has ceased. However, he says, evdev is able to recognize all of the buttons on the Logitech MX Revolution. Folks who might be willing to decode the cryptic xevents system and figure out how to assign mouse events to other keypresses and such should contact him.

HOWTO Run a game or other program on another display

For some reason probably related to Compiz-Fusion, I could not get Warsow working just now. When I started it, my mouse would be locked in the center of the screen. I had four virtual desktops going within Compiz, so I figured that it was somewhat related.

Rather than figure out the bug or close everything I had open, I decided to simply start another X server to handle Warsow.

I did this with startx ./warsow -- :1. I had to modify /etc/X11/Xwrapper.config and change where it says “console” to “anyone” before it would work, though.

This can be done for any program or game, but it’s best suited for those that occupy the whole screen.

In order to switch back to the regular desktop, hit CTRL+ALT+F7. To go back to your game, hit CTRL+ALT+F8. This is useful for switching between a game and work when it’s not your turn or you’re waiting for a long respawn. In fact, I wrote this post switching between Firefox on :0 (F7) and Warsow on :1 (F8).

Oh how I love the things I can do on Ubuntu that I could never do on Windows.

HOWTO: Astronomy Picture of the Day for GNOME

Astronomy Picture of the Day is a really neat page which is generated daily by NASA. It shows a single picture captured by some NASA-affiliated person and some text to describe it.

These pictures are perfect for desktop backgrounds. There’s a program to automatically set it as the background for Windows, but we Linux, or more specifically, GNOME, users can do it in a simple script.

Drop this script somewhere on your system and create a cron schedule with crontab -e for it. The cron lines are in the script. I’d recommend the four hour intervals if you don’t keep your computer on all the time, or the twelve or once-a-day intervals if you do.

Oh, and you might need to install cron. Gutsy doesn’t have it by default, so you can do it through Synaptic or using sudo apt-get install cron at a command line.


#!/bin/bash
#Filename: apodwallpaper
#Location: ${HOME}/.bin
#Purposes: Downloads NASA Astronomy Picture of the Day and displays it as the
#          GNOME background 
#Author(s): acvwJosh of Ubuntu Forums, modified by Colin Dean <http://cad.cx>

#add the following line to your crontab if you want to run this hourly
#10   *  *   *   *     apodwallpaper

#add this line if you want to run it every four hours
#10 0,4,8,12,16,20 * * * apodwallpaper

#add this line if you want to run it every twelve hours
#10 0,12 * * * apodwallpaper

#add this line if you want to run it daily 
#10 0 * * * apodwallpaper

#don't forget to put this script in your $PATH.
#I usually add ${HOME}/.bin to my path in .bash_profile and put my scripts there

#change this if you want the image to be in a different directory
FILENAME=apodwallpaper
APODWALLPAPER=${HOME}/.${FILENAME}

mkdir -p ${APODWALLPAPER} && cd ${APODWALLPAPER}

# download image from apod site
wget -A.jpg -R.txt -r -l1 --no-parent -nH http://antwrp.gsfc.nasa.gov/apod/astropix.html

# move image from obscure folder to main folder, rename image
find ./apod -name "*.jpg" | while read line ; do
mv "$line" "${FILENAME}.jpg"
done

# set image to wallpaper
gconftool-2 -t string -s /desktop/gnome/background/picture_filename "blank.jpg"
gconftool-2 -t string -s /desktop/gnome/background/picture_filename \
                         "${APODWALLPAPER}/${FILENAME}.jpg"
gconftool-2 -t string -s /desktop/gnome/background/picture_options "zoom"

#get rid of cruft
rm -rf apod robots.txt

There’s a thread about this functionality at Ubuntu Forums entitled, APOD? anyone.

HOWTO: Creative X-Fi sound card on Ubuntu Gutsy

I know Hardy is due out in less than a month’s time, but I got a Creative Sound Blaster X-fi XtremeGamer on super rebate a few weeks ago and, dammit, I want sound on Linux!

Unfortunately, Creative only recently released specifications to OSS and ALSA. OSS has a driver already in its newest release, but OSS and Ubuntu have never played well together. Most of Ubuntu’s applications prefer ALSA or ESD. Creative did release an ALSA driver a while ago, but only for 64-bit distros.

Fortunately, I’m running Ubuntu Gutsy amd64, so I can use the driver. Fear not, though, one user on Ubuntu Forums has tried it on 32-bit and reported success. He’s refining the process, though, and figuring out how exactly he did it.

NullHead, wolfc, and some others on Ubuntu Forums refined a process by which folks can install the Creative X-fi driver. Unfortunately for Gutsy-using folks, the process requires a kernel recompile because the Gutsy kernel uses SLUB instead of SLAB.

However, the process does work. After compiling the kernel, there’s a a few simple steps and a single patch which customizes the source for Ubuntu users.

Read the thread at Ubuntu Forums entitled [HOW-TO] X-fi beta driver.

It’s really nice to have sound in Ubuntu after not having it for approximately two weeks. I’ve been hopping onto another computer when I need it and using that other computer as my jukebox.

PulseAudio is the new default sound server in Ubuntu Hardy (8.04 for those readers who are out-of-the-loop), but it retains its compatibility with ALSA, OSS, ESD, and various other sound servers in Linux. Hopefully, ALSA will have a driver out soon.

Apparently, a company called Auzentech is working on higher-quality drivers for Windows for its licensing of Creative’s X-Fi technology. It’s also working on Linux drivers, but the ETA isn’t until Q4 2008. If Auzentech can pull it off, you bet your sweet bippie I’ll trade my XtremeGamer for one of its cards. I like to support those who support Linux :-)

Can your OS do this? Colin swaps a motherboard

I received a few days ago an ASUS M3A32-MVP Deluxe motherboard for review at ThinkComputers. I finally got some time to install it today, replacing the Foxconn C51XEM2AA motherboard I’d been using since October.

The first order of business was to work on the review, so I slid in an extra hard drive and installed Windows XP Professional 64-bit onto it before I replaced the Foxconn board. I had no problems at all—I was able to finish the entirety of the benchmark suite without a single crash.

So, with that having been completed, I went about swapping the boards. The ASUS board is pretty neat—there’s a lot of heat pipes and passive cooling, and even a memory cooler. I’m not going to go on and on about it here; read the review when it gets posted.

I booted it, and was immediately prompted to reactivate Windows. I had to wait until I installed the NIC driver to do so, but it went through without a problem. I installed the remainder of the drivers and started benchmarking.

Then, it started: BLUE SCREENS GALORE. I doubled checked all of the packages I’d downloaded to ensure they were all 64-bit packages. Obviously, they were. So, I dealt with it. Windows would crash with STOP 0×50: PAGE_FAULT_IN_NONPAGED_AREA or something like that. It means that a driver, in this case disk.sys, tried to access a piece of memory that didn’t exist.

I figured that Windows didn’t like the motherboard swap, so I’d save myself a little bit of time and do a repair installation. Not only did the repair installation crap out near the end, but it didn’t help. When I finally got it up and running, I had to reactivate Windows. I still had consistent stop errors.

I decided to do a full re-installation. This time, I’d used all of my activations and had to spend 15 minutes on the phone with Microsoft’s activation people to get that squared away.

I still have blue screens. They are random, they are without warning. I seem to be the only person having this problem, as searches turn up nothing useful.

Frustrated and wanting to give up on Windows and get some other work done, I switched back to my other hard drive (I’d pulled its SATA cable to prevent myself from accidentally munging my Ubuntu install and my coveted save games and media files from previous builds on my Windows install). I didn’t want to mess with Windows at all, so I booted Ubuntu.

It booted straight up. It was like I’d not even switched the boards. Restricted Drivers Manager automatically enabled the Atheros drivers required for the built-in WiFi module. It recognized all the new devices without a hitch, and transparently! I’d even switched the hard drive’s SATA channels, something I figured would throw off GRUB (the bootloader) and frustrate me even more. Nope.

Can Windows survive a motherboard switch? No.
Can Ubuntu, and probably most other Linuxes, survive a motherboard switch? Yes.

Java on Ubuntu amd64 a work-in-progress

I’ve spent a few hours throughout the past few days attempting to get a working Java browser plugin to work on Rahab, which is my primary desktop running Ubuntu Gutsy amd64. It’s well-known that only the icedtea package provides a plugin that is at least java5-compliant. However, there’s a significant bug in it. There’s another version of Java that provides a java-1.4.2 plugin, but I need the newer one in order to upload my pictures to Facebook.

I’ve tried lots of things. I tried installing icedtea from the repos. It doesn’t work at all. I tried recompiling it from the repo source—some applets will load, but the one I really need (Facebook) will not. I tried installing a newer build from a developer’s stash, and it works better than my build (as it’s based on newer code from icedtea), but it still doesn’t load the Facebook photo applet.

I tried downloading Sun’s java-7 beta JDK package, but there’s not a plugin in it, either.

So, for now, I’m SOL. It looks like I’ll be using another computer running Ubuntu i386 or the Windows partition on Rahab to upload my photos.

Dear Lazyweb: any suggestions on how I can get ~400 pictures onto Facebook without uploading unmodified originals five at a time?

Whoa, Vista really does suck

I’ve used Ubuntu 7.10 (Gutsy) nearly exclusively for approximately a month as of today. I’ve used Windows XP here and there, but only for gaming or using a program such as OCCT that doesn’t have a Linux equivalent (if you, dear reader, know of a PSU voltage graphing program for Linux, please let me know in a comment).

Today, I helped my grandfather set up a new computer he’d bought during the summer. It’s a Compaq with a Celeron 365, 512 MB of RAM, a Radeon XPRESS 1100, and Windows Vista. It crawls. It’s my first experience with Windows Vista, and it was horrific.

The computer took more than forty minutes to uninstall Norton Antivirus, a trial of which had expired before my grandfather had even used the computer. Windows Explorer whited-out windows constantly because the computer was so loaded down with bloatware, including Yahoo! Search, HP Advisor, unnecessary, constantly intervening programs asking for Internet service provider contracts (grandfather already has an ISP—NetZero).

I can’t believe that Compaq could conscionably sell a computer like this.

I hooked him up with Firefox and Thunderbird, and attempted to install AVG’s free edition, the best free anti-virus available for Windows. It failed, though, because the version I had on my toolkit flash drive was the version just prior to Grisoft’s addition of Vista support.

Ridding this thing of all of the unnecessary crap was virtually hopeless. I would have liked to outfit the computer with Gutsy, but I didn’t have a CD more current than Edgy with me (700 MB on dial-up = fail). There’s also no one I know around Louisville who has enough Linux experience to help him out regularly, and I live 420 miles away.

Honestly, Vista feels like a beta of an operating system. I turned off the Aero eye candy in order to speed things up a bit, but it didn’t help significantly.

Now, after having used the latest in Linux (Gutsy) and the latest in Windows (Vista), I’m even more convinced that the Linux desktop experience is less intrusive, quicker, more usable, and, well, far superior to its Microsoft-pushed counterpart.

We’ll see in a few months how Mac OS X is—I plan to get one of Apple’s rumored ultraportables, should it materialize.

Update: Two User Access Control dialogs just to rename a shortcut on the desktop, neither of which say anything about what the user is doing? Excessive bullcrap. A single “Are you sure?” dialog would suffice. If this is indicative of the rest of the Vista experience, I think I’ll stick with Windows XP for my Windows needs.

HOWTO: Great Windows theme for Wine on Ubuntu

I found today a fantastic Windows theme to use with Wine on Ubuntu. It’s called Human for Windows.

  1. Download the zip file and extract it somewhere. I put it into ~/.wine so that it’s out of sight.
  2. Fire up winecfg at a terminal, or go to Applications > Wine > Configure Wine from the menu.
  3. Go to the Desktop Integration tab.
  4. Click Install Theme… and find where you put the extracted folder.
  5. Go inside it and open Human.msstyles.
  6. Change the drop down to Human.
  7. Hit OK.

Combine this with the mIRC on Linux tutorial from a few weeks ago, and the result is an mIRC that looks like it belongs in Ubuntu.

mIRC on Ubuntu using Wine and the “Human for Windows” Windows theme

HOWTO: Run mIRC on Ubuntu Linux

mIRC logo

Back in the day, before I saw the light of Linux, I was an mIRC user. I’d grown quite fond of mIRC, and even registered it to support Khaled Mardam-Bey.

However, now that I’m slowly attempting to move the majority of my major activities to Linux, I’ve found that I don’t really like the majority of the graphical IRC clients available for Linux. Xchat is nice, and Konversation is probably my favorite of them, but I yearned for mIRC. Pidgin and Kopete use too much of an IM-style window for it, especially the latter.

Somewhat unsurprisingly, mIRC works out of the box using Wine.

Download the installer from mirc.com to your home directory or Desktop. Fire up a terminal and do wine mircSetup.exe. Be sure to replace mircSetup.exe with the actual name of the executable. For me, it was mirc63.exe. Also, make sure that you have Wine installed (sudo apt-get install wine) and configured (winecfg).

Once it’s installed, you can execute it with wine C:\\Program\ Files\\mIRC\\mirc.exe. I’d recommend creating an application launcher for it on Gnome-panel or KDE Kicker. You can use the post icon as the icon for the launcher.

If the fonts look odd, you can install msttcorefonts with sudo apt-get install msttcorefonts and it should look better. Additionally, find a nice Windows theme somewhere and use it to make the Wine windows look more like the Human theme of Ubuntu. If you find such a theme, comment below so I can get it, too ;-)

Dell’s Ubuntu computer + Office 2007?

Yep, the configurator will allow it.

Dell’s Ubuntu configurator allows Office 2007

I got my chuckle for the day.