Powered By Blogger

Donnerstag, 16. Mai 2013

Switching keyboard layout in X11

There are three keyboard layouts that are in use on my computers:
1. Most time I need the German keyboard layout, because German is my native language.
2. Once in a while I like to use the English one because some characters like '[', '{' (which are used often in programming) and so on are easier to access.
3. Sometimes I need the Russian keyboard layout because I learn Russian and need to write texts in Russian.

In XFCE, it is possible to set up keyboard layouts and switch between them by clicking the corresponding entry in the settings dialog, but if you have to switch very frequently, that is quite annoying. In Windows, there is a keyboard shortcut for switching and also in Gnome it is possible to set that up. However, in XFCE there is only a setting for switching the input method, but none for switching the keyboard layout (at least in version 4.10 that I use in Xubuntu 12.10). But finally I found a solution, that is really simple:

As root, create a file named 65Xkbmap in /etc/X11/Xsession.d with the following contents:

setxkbmap -option grp:alt_shift_toggle,grp_led:scroll at,gb,ru

This would allow switching the keyboard layouts at (German), gb (English) and ru (Russian) by pressing "alt" and "shift" (left or right one - doesn't matter). To see which keyboard layout is currently active, a plug-in can be added to the XFCE panel.

Dienstag, 7. Mai 2013

Trying Debian kFreeBSD Squeeze

Recently I tried out Debian kFreeBSD Squeeze as a VirtualBox guest. It ships with FreeBSD 8.1, which is quite old (according to Distrowatch it has been released in July 2010) but not unusual for Debian, because its stable branch uses "well tested" software. I confess that I am good in Linux but just a beginner in FreeBSD. ;-)

The installation process went quite smooth as usual for Debian. I partitioned the virtual disk in a root and a /home partition. If I recall correctly, the installation took about an hour. I also installed the XFCE desktop. Unfortunately, the screen resolution could not be set higher than 800x600. There are VirtualBox guest additions for FreeBSD, but not on the built-in virtual CD, they must be installed via ports. I did not have an idea how to install ports on Debian kFreeBSD, googling did not yield helping results and I didn't want to invest too much time in that. There is a package "virtualbox-ose-guest-source", maybe that could be used somehow.

XFCE 4.6.2 in Debian kFreeBSD running FreeBSD 8.1


IPv6 works basically, but DHCPv6 doesn't. "dhclient -6" never returns. So the interface has only one IPv6 address assigned via router advertisements.

The system takes about half a minute until I can see the login screen. Now there are 3.1 GB used on the root partition.

Other problems that occured:
  • Trying to start Synaptic fails - it asks for the password (tried both the root password and that of my "normal" user), but Synaptic never appears. However, it is possible to do a "su" on the terminal and then type "synaptic" to start it.
  • Restarting the system from GDM doesn't work (just does nothing).
  • Logging in as root doesn't work in GDM (might be disabled for security reasons - I am certain that can be changed in some configuration file).
  • I browsed the web a little bit with Epiphany, but then it suddenly stopped working. Also Iceweasel doesn't work reliably. Restarting the system did not help. After trying around a bit, I found out that all IPv6-enabled sites don't work, but those only serving via IPv4 work perfectly.
  • ZFS is not installed by default, but there is a package "zfsutils"
Conclusion: Although there were some problems (some of them are my fault, maybe), Debian kFreeBSD looks promising to me. The possibility to use APT and its related tools like Synaptic is fascinating. The system runs fast and stable.


Epiphany and Iceweasel

Sonntag, 5. Mai 2013

Some years ago I noted a few lines in my wiki to "transfer" an installation of an operating system that uses APT from one system to another ("system" doesn't denote a "machine" but simply an installation of some operating system). Yesterday, I used this to transfer the installation from Xubuntu 12.04 x86 to Xubuntu 12.04 x64. Interestingly, it happend that there were a lot of "i386" packages installed. You can see this if you grep "386" from "dpkg --list". Results could be like this:

ii  6tunnel:i386                                                0.11rc2-5                                           TCP proxy for non-IPv6 applications

To replace these packages with their (in my case) amd64 counterparts, it is first necessary to remove those i386-packages:

apt-get remove `dpkg --list | grep "386" | cut -d' ' -f3 | tr '\n' ' '`

Explanation: List all packages that contain 386 in their name and take only that name, replace all line feeds with spaces and send the results to apt-get.

Next, let's write all packages that should be reinstalled to a file:

dpkg --list | grep "386" | cut -d' ' -f3 | sed 's/:i386/ /g' | grep -v ^lib | tr '\n' ' ' > new_packages

(possibly, that could be optimized to grep all lines not beginning with lib and containing 386 in one statement rather than two statements)

We can then review the file (maybe there are packages we don't need any more). After that, we issue

apt-get install `cat new_packages`

and apt-get installs the requested packages.