pondělí 27. dubna 2009

Ubuntu & IBM middle button scrolling

How to enable middle button scrolling on IBM R51 laptop running on Ubuntu 8.10? Create file mouse.fdi in directory /etc/hal/fdi/policy/.

Edit mouse.fdi:
<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.ZAxsisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.ButtonMapping" type="string">1 1 3 4 5 6 7</merge>
</match>


Two bold lines will disable "paste" by middle button.

I am not sure if is necessary but you may need to install following packages
sudo apt-get install build-essential git-core
sudo apt-get build-dep xserver-xorg-input-evdev
git clone git://git.freedesktop.org/git/xorg/driver/xf86-input-evdev
cd xf86-input-evdev
git reset --hard 5f2c8a2dcdf98b39997ee5e7c9a9ace3b640bfa3
./autogen.sh --prefix=/usr
make
sudo make install

I found it here.

Then just restart gdm and hal
sudo /etc/init.d/gdm restart
sudo /etc/init.d/hal restart

sobota 11. dubna 2009

Ubuntu verbose boot

I read many manuals how to set up splash screen during boot. However I would prefer verbose mode to see actual boot status. If you are using grub as a loader then edit /boot/grub/menu.lst.

title Ubuntu 8.10, kernel 2.6.27-11-generic
uuid 31e024bc-8ee3-42ec-b58c-4955e93cfcd6
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=31e024bc-8ee3-42ec-b58c-4955e93cfcd6 ro quiet splash
initrd /boot/initrd.img-2.6.27-11-generic
quiet


If you remove the parts in bold, you will boot without splash screen. Quiet in "kernel" line and at last line is same.

You also might want to change appearance of grub. I am using green grub which you can define by this line in grub:

color green/black light-green/black

Now you should have colorized grub and boot without splash screen. Some distributions also use green [OK] and red [FAIL] or [!!] in output. You need to edit function log_end_msg () in /etc/lsb-base-logging.sh.


log_end_msg () {
if [ -z "$1" ]; then
return 1
fi

if log_use_usplash; then
if [ "$1" -eq 0 ]; then
usplash_write "SUCCESS OK" || true
else
usplash_write "FAILURE failed" || true
fi
fi

log_to_console log_end_msg "$@"

if [ "$COL" ] && [ -x "$TPUT" ]; then
printf "\r"
NORMAL=`$TPUT op`
GREEN=`$TPUT setaf 2`
RED=`$TPUT setaf 1`
$TPUT hpa $COL
if [ "$1" -eq 0 ]; then
echo '['
echo " ${RED}OK${NORMAL} "
echo ']'
else
printf '['
echo " ${RED}!!${NORMAL} "
echo ']'
fi
else
if [ "$1" -eq 0 ]; then
echo " ...done."
else
echo " ...fail!"
fi
fi
return $1
}