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
}


čtvrtek 12. března 2009

Home & End key v terminálu

Z různých operačních systémů jsem si navykl používat klávesu HOME, resp. END k přesunu kurzoru na začátek, resp. konec řádky. Jelikož tato vlastnost v OpenBSD neni by default, rozhodl jsem se trochu prolistovat manuálové stránky.

Pokud nahlédneme např. do manuálové stránky bash(1) tak nás bude zajímat podsekce Readline Initialization. Zde se dozvíme, jak nadefinovat klávesám různé akce. Ty jsou uloženy v souboru ~/.inputrc, resp. v souboru, který obsahuje promněnná INPUTRC.

Můj .inputrc definující akce pro klávesy HOME, END a DEL vypadá následovně:

"\e[1~": beginning-of-line
"\e[3~": delete-char
"\e[4~": end-of-line

pondělí 15. prosince 2008

PC Bata box

During one long winter's night...











pátek 12. prosince 2008

Fluxbox on OpenSolaris

Finally I had a little bit of time to play with fluxbox under OpenSolaris. I chose fluxbox-1.0.0 and my OpenSolaris is build 99.

Compiling
Using GNU compiler with 64b flags:
$ CC=gcc CXX=g++ CFLAGS=-m64 CXXFLAGS=-m64 ./configure
$ make

At the end of compiling you can see some error messages due to illegal option in
util/fluxbox-generate_menu but default menu will be generated.

(I was unable to compile it with Sun Studio. More accurately I could not compile FbTk/Font.cc.)

Finally there are many good reasons to create package and add it instead of compiling directly into to system.

Gdm
We add fluxbox in our system so it could be pretty good to log into after login. We only need to create file fluxbox.destkop in /usr/share/xsessions/ directory.

fluxbox.destkop:
[Desktop Entry]
Encoding=UTF-8
Name=Fluxbox
Comment=Highly configureable low resource X11 Window Manager
Exec=fluxbox
Terminal=False
TryExec=fluxbox
Type=Application


Persuade that your system is using gdm and not dtlogin as a display manager.

$ svcs gdm
STATE STIME FMRI
online 15:08:57 svc:/application/graphical-login/gdm:default


If you don't see online status you are probably using dtlogin. To enable gdm you should log into console and use svcadm. If you stay in Xorg your system will probably fail.

$ svcadm enable gdm
$ svcadm disable cde-login

If you are in console just logout yourself and after a few seconds gdm will appear with new
fluxbox option.

Just for fun

at first I thought.