Opening a Root Terminal with gksu

On my Gentoo box, I’ve got this key-combination which is linked to a command to open a root terminal which I use very heavily. The command behind it is simply a call to gksu as follows: gksu -uroot /usr/bin/gnome-terminal. This same kind of command used to be a menu item, both in Gentoo, but also the Ubuntu distribution had a menu item like that by default.

Unfortunately however, already a while ago after a Gnome update, my key-combination stopped working. The menu item was gone. Not only on my Gentoo box, but I noticed that on a certain version of Ubuntu this menu item seemed to have disappeared too. After a search, I found I was not the only person suffering from this problem. There’s actually a bug report in Gnome’s Bugzilla for this particular issue. Unsolved at the time I found it, unfortunately. However, the suggested work-around was perfect for me. I changed the command behind my root-terminal-short-cut-key-combination to the following script:

#!/bin/sh
eval `dbus-launch --sh-syntax --exit-with-session`
/usr/libexec/gconfd-2 &
/usr/bin/gnome-terminal --geometry 112x38

While working on my Gentoo box today, my eye fell on a “Root Terminal” menu item in the “Accessories” menu. Interesting. It’s actually calling gksu with a Gnome terminal as root again. And it works! It seems that someone has fixed the problem. Thanks Christian Persch!

That’s one less work-around-convenience-script for me.

Qt and Fontconfig

Posted on 04 September 2010  •  Permalink  •  Category ubuntu

After upgrading to Lucid Lynx I found that all Qt based applications would not have anti-aliased fonts anymore. For example Skype would look awful with these pixelated fonts. Unfortunately Google didn’t help me out, so I started a little research of my own into this issue. I was previously able to tweak font settings using ~/.fonts.conf so I thought to start there.

To make a very long story a whole lot shorter; assigning pixelsize turns off font hinting for Qt apps. I wasn’t able to figure out why, but I did find a solution for my particular setup, resulting in the following ~/.fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match target="font">
    <test qual="all" name="family" compare="eq"><string>Arial</string></test>
    <test qual="all" name="pixelsize" compare="eq"><double>12</double></test>
    <edit name="pixelsize" mode="assign"><double>13</double></edit>
  </match>
</fontconfig>

You really have to look carefully to notice the difference with the original: it’s the qual="all" attribute in both test nodes. That did the trick for me.

Gnome Keyring Password Problem Fixed in Ubuntu 10.04

After I wrote up my post about problems changing my Ubuntu’s user account password, which didn’t automatically updated Gnome’s keyring, I found that I was not the only one suffering from this problem.

A while ago I upgraded to 10.04, and not long after that I had to change my password again (the half-yearly password-will-expire-soon emails started coming in on the account I use on that system). So I did. With that I can also confirm that the keyring password problems have been fixed by the Ubuntu team in 10.04.

Thanks Ubuntu!

Help, NUMLOCK is Broken!

I can’t remember after which update (of Gnome/Ubuntu) this happened, but each time when I fire up the Gnome Calculator and start hitting the numbers on my keyboard’s keypad, nothing appears in the calculator’s display! Aha, of course, NUMLOCK turned off. So I hit the NUMLOCK key and start banging on the keypad again. Still no numbers appear, but… What the heck, the mouse is moving?

After consulting the all-knowing Google, I found the cause of this rather interesting behavior. Open System → Preferences → Keyboard. Then go to the Mouse Keys tab. Now here’s the million dollar question. Why would somebody ever want to move its mouse pointer with the keypad? Maybe because you broke your mouse slamming it on your desk because you we’re so irritated that you couldn’t use your keypad? I don’t know. I’ve never had the urge to control my mouse pointer using the keyboard. Maybe they’d called it keypad-pointer if it was meant to be controlled by the keypad.

Well, they didn’t, so press Shift + NUMLOCK. This will uncheck the “Pointer can be controlled using the keypad” checkbox. Why was this box checked in the first place? Maybe its the default. Or maybe I once accidentally held down the shift key when I pressed NUMLOCK.

That must be it.

Ubuntu’s Small Arial

Being spoiled with the near perfect font rendering of Mac OS X on my MacBook, I always found Linux’ font appearance to be a bit behind. Especially in ye old days before libXft and FreeType2, font rendering in X11 applications was just plain ugly. However, with the introduction of font hinting, things have been improved a lot. Especially slight hinting looks very good.

As of Jaunty Jackalope, slight hinting (or “Subpixel Smooting” in Ubuntu terms) became the default in Ubuntu. But actually I kept reverting back to “Best Contrast” simply because of one annoying adverse effect of “Subpixel Smoothing”: Arial becomes too small on certain web pages. That is, on my 22” 1920x1200 LCD screen at work. Too bad. No subpixel smoothing at work for me.

Last week, with the release of Karmic Koala, I decided to revisit my subpixel smoothing choice again. I like it, so I found it was time to resolve my Arial 12px issue once and for all, so I could have my subpixel smoothing at work. So after the install finished, I switched to “Subpixel Smoothing” using the System → Preferences → Appearance → Fonts tab. Ahh, very nice… Except for Arial when I start browsing. Actually its even only Arial at a size of 12px.

So here’s what I need to solve: I don’t want any other font to change, it’s really only Arial 12px that’s bugging me. Yes, I’m being a nitpicker here, but hey, there are just too many websites that use Arial 12px, starting with my iGoogle start page already. The easiest workaround option is to remove Microsoft’s TrueType core fonts package, so Arial isn’t used, but a replacement. However, most websites do look a lot better with Microsoft’s core web fonts, and besides that, I hate workarounds. I like real solutions. So that’s when I decided to dive into fontconfig to see if that could fix my problem.

I couldn’t imagine it being so simple as putting a .fonts.conf in your home dir containing:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match target="font">
    <test name="family" compare="eq"><string>Arial</string></test>
    <test name="pixelsize" compare="eq"><double>12</double></test>
    <edit name="pixelsize" mode="assign"><double>13</double></edit>
  </match>
</fontconfig>

But it really is as simple as that. In human language, the XML file tells fontconfig to set the pixelsize of Arial to 13 when any program requests Arial with pixelsize 12. How beautiful.

Multi-Monitor Window Lists

If you are spoiled with a multiple monitor setup, and using Ubuntu, like me, you might be wondering whether it is possible to not have all your windows from your different monitors in one taskbar. The solution is easy: create a new panel by right clicking on an existing panel and choosing New Panel. Drag this panel to (one of) your additional monitor(s) — use the alt key to start dragging. Finally right click your new panel and choose Add to Panel..., and select the Window List item. That’s it; the newly added window list will only have buttons for those windows on that monitor where its parent panel is on.

Multi-monitor window lists are a feature of Gnome, so the steps mentioned earlier are not limited to Ubuntu.

Ubuntu Jaunty: How to Change Gnome Keyring Password

After I’d changed the password of my user account on my laptop’s Ubuntu install, Evolution kept on bothering me asking the password to unlock the keyring:

Gnome unlock keyring dialog

To unlock it, it required me to input my old password. Funny enough, if you change your user password, Ubuntu doesn’t change the keyring master password. After Googling around a bit, there are several blog and forum posts that point to ways of changing the keyring’s master password using seahorse, for example this one. However, all information and screenshots I found seem to be outdated; I was unable to find the “Gnome Keyring” tab everyone is talking about. After playing around with my version of seahorse, I was able to find out where this option has been moved. I don’t know in which version of seahorse this has changed, but what I do know is that that version of seahorse with its new password change interface is included in Jaunty Jackalope.

So for those of you who are reading this to figure out how to change your keyring password with Ubuntu 9.04, here goes: open seahorse via Applications → Accessories → Passwords and Encryption Keys. Click on the Passwords tab, and now you need the secret trick: right-click on the Passwords: login item and choose Change Password:

Seahorse passwords and encryption keys interface

If you change the password for the login passwords set to the same password as your user account, Gnome will automatically unlock your keyring during login. Yay!