Wednesday, November 19, 2008

HowTo: Logitech MX500 under FreeBSD

I have both a Logitech MX500 and a MX518, however I've loaned the MX518 to my brother. So I took my previous post on MX518 and mirrored it to MX500.

Being an Enemy Territory (ET) old timer I need to make full use of the MX500 mouse under FreeBSD, which means having the Back, Forward and the other weird button below the wheel working as available binds while playing ET.

The bellow xorg.conf settings were tested under FreeBSD 7.0 and X.Org X Server 1.4.2.
  • % su
  • # vim /etc/X11/xorg.conf

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5"
Option "ButtonMapping" "1 2 3 6 7 8 9 10 4 5"
Option "Emulate3Buttons" "false"
With these settings you're free to bind MOUSE4, MOUSE5 and KP_EQUALS to Enemy Territory.

As a bonus, you can now use the Back and Forward buttons under Opera.

HowTo: Activate keyboard numlock on KDE under Gentoo

Having finished compiling KDE 3.5.9 as described here I proceeded fine tuning it which involves among other things enabling the keyboard numlock.

In this post I'll lay down some alternatives that will allow you to activate the keyboard numlock on the KDE desktop environment:
  1. on a per user basis using KDE's autostart mechanism
  2. through the KDM login manager
  3. installing the kxkb package and graphically using the Kcontrol center
Alternative 1
You can activate the keyboard numlock on peer use basis like so:
  • $ su
  • # emerge --ask --tree --verbose numlockx
  • # exit
  • $ vim .kde3.5/Autostart/numlockx
numlockx on
  • $ chmod +x .kde3.5/Autostart/numlockx
Alternative 2
In alternative if you use KDM as your login manager you can set it on system wide:
  • $ su
  • # echo "/usr/bin/numlockx on" >> /usr/kde/3.5/share/config/kdm/Xsetup
Alternative 3
Yet another alternative is to install kde-base/kxkb if you've installed KDE using split ebuilds (like I did here):
  • $ su
  • # emerge --ask --tree --verbose kxkb
  • browse to KDE's Control Center > Peripherals > Keyboard > NumLock > Turn on
As a side note the above procedures can easily be mirrored to any Unix like system.

Now go ahead and fully use your keyboard ;-)


Tip: Fixing e2fsprogs block on Gentoo

A portage block as popped up lately on the portage tree. The block regards sys-fs/e2fsprogs, sys-libs/e2fsprogs-libs, sys-libs/ss and sys-libs/com_err.

Normally when facing with blocks on world it just a matter of unmerging the blocking packages, resuming and running revdep-rebuild just in case. However in this particular block were dealing with the system set. This means that while unmerging the blocking packages there a good chance you'll break something... badly.

Here's how to deal with the e2fsprogs block:
  1. $ su
  2. # eix-sync
  3. # emerge --fetchonly e2fsprogs e2fsprogs-libs
  4. # emerge --unmerge com_err ss e2fsprogs
  5. # emerge --oneshot e2fsprogs
Basically on step 3 we've fetched the source for e2fsprogs and e2fsprogs-libs. On step 4 we've unmerged the blockers and finally on step 5 emerge e2fsprogs.

Notice that by unmerging com_err or ss you'd break wget making it impossible to fetch the e2fsprogs and ef2progs-libs packages through portage (though you could fetch them manually). The --oneshot option is used on step 5 as e2fprogs is a system package and should not be in world.

Also consider as a safety precaution adding buildsyspkg to the FEATURES variables in /etc/make.conf as this enables the build of binary packages for just packages in the system set.