10.28.2008

PDF readers on Eee PC

Today I have fixed some smaller annoyances on my Eee PC 901 related to the installed Acrobat Reader. First of all, I am not very happy with this reader, on my other computers I use evince wherever it is possible. I like that this stores where I was in the text, so it will open my books where I have left last time. The second thing I like in evince that it can work better in full screen mode. Acrobat Reader show always the full page in full screen mode (correct me if I am wrong), however I prefer page with fit view. On the other hand it seems that Acrobat Reader overperforms evince in case of complex documents with a lot of pictures, just like my favourite Linux Magazine, what I intend to read also on my minilaptop. So finally I have decided to keep both reader program. I will mostly use evince, but Acrobat is kept for the shake of Linux Mag. (Linux diversity rulez!)
The first thing I have done was to get rid of the Finnish internationalization package for acrobat reader: apt-get remove acroread-fi
Then I have installed evince from the debian repository. I have udes this article from EeeUser as a guide. I have added the debian etch repo as explained earlier, evince was installed with apt-get install evince
Of course after that I have disabled again the debian repo to avoid unnecessary complications with the updates.
Finally I have set up in konqeror that evince will be the default programs fo PDF documents and acroread just an option when I cannot avoid it. And that's it! An even more confortable desktop on my Eee PC 901!

10.22.2008

Some more tricks on the desktop of my Eee PC

So I had recognised already in the first days of using my Eee PC 901, that the desktop is composed from KDE programs. Using the Ctrl+Alt+T and the xterm I can start a lot of preinstalled KDE 3 programs. Because of that I thought that it is a real KDE desktop customized by Asus. I am somewhat familiar with KDE since I use it on all my other computers. I started to streamlined the desktop of my Eee PC to make it more familiar. First I have started kconrol, the KDE Control Center. In that I was able to setup the necessary keyboard layouts (Finnish and Hungarian, since I use both in my work) and also some keyboard shortcuts. I was satisfied with this, but when I logged in next time, I have noticed that my settings were disappeared. Today I was hunting for the solution. It turned out, the the desktop is in reality IceWM, so I have created the /home/use/.icewm directory to contain my personalized config files. I have just copied the system wide configs, because mostly I am happy with them:

mkdir /home/use/.icewm
cp /etc/X11/icewm/* /home/use/.icewm

I wanted to start the keyboard layout handler program and the shortcut handler program when starting the desktop, so I have created the custom startup script for icewm: /home/use/.icewm/startup. The content of the file:

#!/bin/sh
/usr/bin/kxkb # KDE keyboard layou handler
/usr/bin/khotkeys # KDE hotkeys handler

Of course, I have made it executble with chmod +x /home/use/.icewm/startup
I turned out, that it does not work as such. The icewm config files are used there, for example I can make the start menu visible by setting the value 1 for TaskBarShowStartMenu in the file /home/use/.icewm/preferences. But the startup script was not executed. I have googled around and have found out, that this is because in the initialisation script: /usr/bin/startsimple.sh icewm is started an inproper way. edited the file as root (sudo -i) and replaced the line
exec icewm
to
exec icewm-session
as recommended in the documentation of icewm, and voilas, everything works like a dream!

10.21.2008

The touchpad of my Eee PC

Today I was playing around with the touchpad of my Eee PC. I works basically well, but I lack a lot the middle mouse button feature. As you know, middle mouse button has a very special function on linux: When you highlight text in most of the programs, it is automatically copied to the clipboard. You can easily paste that text with the middle button anywhere. I am very used to this feature, I use it in command line and also in the OpenOffice. The touchpad of the Eee PC has only two physical buttons, but I want that middle one also. On my old laptop it was the tapping with two fingers mapped to this function, so my goal was to set up the same here.
My first step was to have a look into the config file of X.org: /etc/X11/xorg.conf. I was lucky, I have found the related part there:

Section "InputDevice"
Identifier "synaptics"
Driver "synaptics"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "LeftEdge" "1400"
Option "RightEdge" "5900"
Option "TopEdge" "1400"
Option "BottomEdge" "4500"
Option "PalmDetect" "0"
Option "SHMConfig" "true"
Option "SendCoreEvents" "yes"
Option "HorizScrollDelta" "0"
Option "VertScrollDelta" "155"
Option "RBCornerButton" "0"
Option "RTCornerButton" "0"
Option "TapButton2" "0"
Option "MinSpeed" "0.095"
Option "MaxSpeed" "0.38"
Option "VertTwoFingerScroll" "1"
Option "VertEdgeScroll" "0"
Option "HorizEdgeScroll" "0"
EndSection

I was very happy to see that my touch pad here is using the standard synaptics driver, the same as my old laptop. I was also happy to see those optiion lise, that has hinted me that I can find the right one for my purpose. But what are those options doing? Looking around for some documentation of this driver, I have found that there is a man page for this, so a simple man synaptics command has poured the needed info. I have quickly found that I can map the middle button to the two finger tap by setting the "TapButton2" option to 2. I have edited the file as root and after restarting X (using the Ctrl+Alt+Bakspace key combination) I have now the feature.

10.20.2008

Dictionaries on Eee PC 901

During the weekend I have written I have written my first blog entry using my Eee PC, and I have realised that I lack the spell checker aid of OpenOffice and Firefox. (Shame on me and the gaps in my long ago forgotten grammar studies.) So I have started to find out how to install the Hungarian and English (UK and US) dictionaries for these programs.
For Firefox, it was easy. I have visited the Firefox Add-ons page, and with a few clicks I have installed the necessary files. After restarting firefox, everything was working.
In case of OpenOffice it was a bit trickier. I have found easily the wiki page of the program, so I could download the required packages. But the suggested method, i.e. to use the wizard for the installation didn't work for me, OpenOffice was hanging whenever I tried to open the wizard file (DicOOo.sxw).
Instead I have done this. I have download the zip files. For each languages there are two files in the zip package, for example for Hungarian there is hu_HU.aff and hu_HU.dic. These files were copied into the dir: /usr/lib/openoffice/share/dict/ooo
Affter that I had to update the /usr/lib/openoffice/share/dict/ooo/dictionary.lst file:

cat >> /usr/lib/openoffice/share/dict/ooo/dictionary.lst

DICT hu HU hu_HU # Hungarian

DICT en GB en_GB # British English


DICT en US en_US # American English


Ctrl+D


Obviously these shoulld be done as root in the console, which can be reached by Ctrl+Alt+T and then typing sudo -i
After that when I have restarted OpenOffice, I had spell checker for all these languages.

Latest book I have read: The last theorem

It is the last book of Arthur C. Clarke, one of the best science fiction writers. This book was co-written with Frederik Pohl, another maser of the genre. The main character of this novel is a mathematician, who is successful to give a simple proof for Fermat's famous theorem about the diophantine equations. This book has an interesting structure as it is like a gallery of the sci-fi themes invented by the two author, but mainly by Clarke. We can see the evergreen space elevator, solar sails, powerful super ETs, and and electromagnetic weapon, which is capable to destruct all the electronic tools of the enemy.
Unfortunately some parts were included from earlier novels, like the solar sail race or the heechee like aliens (the Grand Galactics). On the other hand I was very happy with the some kind of happy end feeling of the story, because it pushes the 'we have hope under any circumstances' thinking which is close to me. It was heart breaking to read about the machine stored ethereal life, since Clarke has finished this piece just months before his own death. I hope he is enjoying now his heaven, machine stored or otherwise. This novel is not his best masterpiece, but I am sure that the Clarke fans will enjoy it and remember of this big author of the ever best science fiction themes. R. I. P. Sir Arthur Clarke!

10.16.2008

Adding programs to Eee PC 901

So I am a happy owner of an Eee PC 901 with the original linux (almost Xandros) operating system. Before I have bougth this small laptop, I have read a lot of information, how much tweakable this toy is. So it is, and I have found nice pagen on the net providing the details. Unfortunately almost all the documentations are focused on the first generation Eee PCs (700 and 701 if I am correct), and there were some complains in the comments that applying them has made their 901 model broken. So I has become cautious.
I have learned that Eee PC has an operating system derived from Debian Etch via Xandros 4. However the version on the PC is not fully compatible either with Debian or Xandros, therefore I cannot install anything from those distributions. But I have learned from this that Eee PC uses apt as the package mangment system, which is known to be one of the best such package managers. I am quite familiar with rpm and yum from Fedora, so apt is something new for me to learn.
As maybe many of you know, programs in linux are organized to so called packages, which are compressed archives containing the binaries, libraries and usually the documentation necessary for usage of the programs. Package managers are downloading these packages from repositories, therefore the easy way to install new programs to a system to add the correct repos.
The first thing I have made was to replace the Finnish language repositories to the English one to be able to change the language of the system as I have written earlier. For that I have edited /etc/apt/sources.list file as root:

sudo -i

vim /etc/apt/sources.lost

You can use nano instead of vim if you are not familiar with this text editor.
I have changed the line for the Finnish files:
deb http://update.eeepc.asus.com/1.6/ fi main
to the English one:
deb http://update.eeepc.asus.com/1.6/ en main
After this I have installed several programs and packages with the synaptic program, which is a kind of graphical interface for the apt system.
After this I still had a lot of missings from my favourite programs, so I have decided to cross the dangerous line to install packages from Debian Etch. For this I have added a new entry to the sources.list file:

sudo -i

cat >> /etc/apt/sources.list

deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free


Ctrl+D


After this I have downloaded the list of the available packages with
apt-get update
And intstalled some programs:

apt-get install emacs

apt-get install steghide

apt-get install unison


Since that was all what I needed, I have decided to comment out the debian repo from the sources.list file, so it won't offend the updates. To do this I simply put a hashmark (#) symbol to the beginning of the the offending line:
#deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free
I updated again the package list with
apt-get update
And I am back again to the safe waters.
I have also installed the debian packages for FBReader from their site to have a decent ebook reader. So that is all. Now I have everything I need for my work on the Eee PC 901.

Personalizing my Eee Pc 901

On Tuesday I have got my new Eee PC 901. I intend to use as a replace of my old Acer laptop, which suffered breaks on its hinges. I am living in Finland, so it is not a surprize that my shiny new gadget arrived with a Finnish localized operatin system. Since I know, thet the desktop is a taylored KDE, I thougth, that it should not be a problem to change the language to English, or even to Hungarien, which is my mother tonge. As it turned out, I was wrong.
I turned out, that the kde-i18n packages are not available from standard repositories at Asus, so the most I can do is to swich it to English, since this is the fallback language. I have used info from EeeUser's wikipedia and mostly I was able to do the language change.
The first thing I have made was to install all the available English language related packages from the standard Eee PC repositories. (In another article I will explain it a bit more.)
After this I have changed the value of the LANG variable in the /etc/defaults/locale file from
LANG=fi_FI.UTF8
to
LANG=en_US.UTF8
By this step I was able to change most of the not KDE related messages. I also figured out, that I can disable the KDE i18n mo files in the /usr/share/locale directory this way:

sudo -i

cd /usr/share/locale
mv fi fi_orig
mv fi_FI fi_FI_orig

This way also most of the KDE also become English with a few exception messages. I could not figure out how to force Acrobat Reader to use English, maybe simply because the Finnish version is installed. Probably I should uninstall it and reinstall the English version. At the moment that is the most I was able to do about the topic, possibly later on I will be able to fix the last few Finnish texts.

10.11.2008

My skype for linux hack

I use skype for being in touch with my relatives in Hungary. It is not very unusual, but I do it on linux (actually now on fedora 8). In November of 2007 Skype released the first beta versions of their program for linux, which have supported the video transmissions. I started to experiment immediately, since before that we had really lacked this feature. Unfortunately I have an unsupported Logitech QuickCam Express webcam: ID 046d:0870. This old webcam uses the qc-usb driver, and gives picture format which is not suitable for the skype program. Luckily the trick has arrived soon, with the tool called gstfakevideo I can use the cam for video conferencing. So I had everything together, but there were tricks to be implemented.
First of all, the gstfakevideo is a gstreamer program, which redirect picture from /dev/video1 source and emulate a /dev/video0 device, which is then suitable for the skype. Unfortunately the gstfakevideo is not very flexible, so I had to solve, that the real devise to be created as /dev/video1 device, instead of video0 which is the default. It is possible to do by using a kernel module parameter: video_nr=1. To automate this I put a lint into the /etc/modprobe.conf file:

options quickcam compatible=2 video_nr=1


So it does the trick. Not I have the device file as /dev/video1, but I cannot read and write as a user, so I have to change the rights with the command:

chmod a+rw /dev/video1

I had to do it as root whenever I wanted to use skype with video. Plus I had to start skype with this command:

gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace


Obviously not very convenient, but what is worse, my wife cannot repeat all the steps whenever she wants. So I looked for the simplification.
First I solved the case of the read/write permission of the device file. I have created the file: /etc/udev/rules.d/10-custom.rules and I put into that the following lines:

# for the webcam driver permissions

ATTR{name}=="QuickCam USB", MODE="0666", OPTIONS+="last_rule"


By this step udev now happy to create the device files with the permissions: crw-rw-rw-

Next step was a bit harder: I had to create a small shell script, which will start the gstfakevideo program with the correct parameters, and looks like the skype program. The problem with this, that the skype executable should be in the PATH for the wrapper, but if I will call the script also skype, I will confuse everything which one will be started. I have skype installed under the /usr/local/share/skype directory. The actual executabvle is the /usr/local/share/skype/skype file, and I had a symlink as /usr/local/bin/skype. I have removed the symlink and I have put my script called skype into the /usr/local/bin dir. The content of the script:

export PATH='/usr/local/share/skype/':$PATH
/usr/local/bin/gstfakevideo v4lsrc device=/dev/video1 ! ffmpegcolorspace


So nice, now everything works like I want. The skype executable is in the PATH for the gstfakevideo, but for the user the command skype calls the /usr/local/bin/skype, which is the wrapper. And what is even better, when I leave the skype open when log out, the next time I will log in, KDE will start automatically skype, but since in its PATH only the wrapper is available, I will have it with video support!
And great, there is not manual startings anymore, and also my wife can enjoy Skype for linux with video! And again, our parents can see us and our children without manual tricks.