Sunday, October 21, 2012

Seeing GTK mouse cursor in KDE?

If you have upgraded to Kubuntu 12.10, you’d notice that KDM has been replaced with LightDM.  LightDM looks pretty, but somehow doesn’t play well with KDE.  One annoying issue I have noticed is that GTK applications run in KDE use GTK mouse cursor under certain circumstances.  When Chrome shows a menu, the mouse cursor changes to a GTK one and it looks jarring.  Turns out, there’s a fix for that.

1. Install LightDM KDE greeter
sudo apt-get install lightdm-kde-greeter
2. Make LightDM use KDE greeter, and all will be well again. To do that, edit the file /etc/lightdm/lightdm.conf and change the value of greeter-session.  The file will look something like this after the change.  (Boldface text is the change you’d have to make.)
[SeatDefaults]
greeter-session=lightdm-kde-greeter
user-session=ubuntu
3. Save the file and test your changes by running LightDM in test mode:
lightdm --test-mode
If LightDM doesn’t open correctly, check if you have made any typing errors in the config file.  If you cannot fix the issue, just restore the file as it was before you edited; you’ll still have the ugly mouse cursor issue, but at least your computer will continue to work.

Sunday, October 7, 2012

Map Windows (aka Super) key to Escape

Did you know I have mapped Caps Lock on my computer to open a new browser tab?  Only today I figured my Vim sessions can be a lot better if I mapped ‘Windows’ key (aka Super key) to Escape.  It can be done by adding a single line to your ~/.Xmodmap file:
! Map left Windows key to Escape.
keysym Super_L = Escape
(Okay, that was two lines, but a little comment in obscure configuration files can be very helpful.)

Also, if you don’t feel like logging out and logging back in after these changes (or if you want to try the change before touching your config file), you can run this on a terminal to have the keybinding take effect immediately:
xmodmap -e 'keysym Super_L = Escape'