Archive for the ‘Linux desktop’ Category


Reducing desktop power usage while idle

In Gnome,Linux desktop,open source on July 14, 2014 by oli4444

While remotely monitoring my desktop session with powertop while it was idle (screensaver active) I noticed that a few processes cause a lot of activity, and keeping the CPU from going into the PC7 state (the complete cpu package deepest sleep state). Most notably firefox and it’s plugin-container cause frequent wakeups.

I wrote a short script that listens on dbus for screensaver ActiveChanged messages, and either sends a STOP or a CONT signal to firefox and the plugin-container. This script makes my desktop go from 20W to 19W of power when I am not using it.

import subprocess
import datetime

import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop

stoplist = ['firefox', 'plugin-container', 'steam']
def msg2_cb(msg):
	dt =
	if (msg):
		for name in stoplist:["killall", "-STOP", name])
		for name in stoplist:["killall", "-CONT", name])

if __name__ == '__main__':
	bus = dbus.SessionBus()
	bus.add_signal_receiver(msg2_cb, 'ActiveChanged', None, None, '/org/gnome/ScreenSaver')
	mainloop = gobject.MainLoop () ()

The obvious caveat is that any downloads by firefox are also stopped if the screensaver becomes active.


Bluefish on the Raspberry Pi

In Bluefish,gtk+,Linux desktop,open source,Programming on January 1, 2013 by oli4444

After ordering in September, I finally received my Raspberry Pi a few weeks ago (the upside of the long time between order and delivery is that mine is the new revision with 512Mb RAM).


I have no specific plans with the device other than playing a bit around with it. One of the things I obviously had to try was to run Bluefish as editor on the Pi. Installing all the build dependencies and compiling takes a few hours, but Bluefish was running as expected. Entirely true? No, some bits were slow, most notably the auto completion popup. So I dug into the code to find out why.

In the auto-completion popup, Bluefish has a “reference pane”. This shows some rerefence information about the item you are trying to auto-complete. For an HTML tag this might show the valid attributes, for a C function it might shown the arguments and the return codes etc. This is implemented with a hash-table and the “changed” signal on the GtkTreeSelection: if the selection changes, a lookup in the hash table is performed to see if there is reference information available. On the next key-press, bluefish re-calucalates the possible auto-completion candidates, and re-fills the GtkListStore that lies underneath the GtkTreeView. And this is where the problem was: before filling the list of items, Bluefish has to clear the old items. And the selection changed signal is called for each item that is removed from the GtkListStore, which in it’s turn does a hash table lookup and renders the reference information in the reference pane. Do that for 15000 items and you’ll have 100% cpu load for a second on the Raspberry Pi.

So what is improved now: first, the number of items in the auto-completion popup is limited to 500 items. Second a boolean is added that is set to TRUE whenever the popup is clearing or filling items. As long as that boolean is TRUE, the selection changed signal will do nothing at all.


The result: even on the Raspberry Pi, Bluefish auto-completion is again much faster than you can type, and every bit of sluggishness is gone. We’re close to the 2.2.4 release, and this fix will be part of 2.2.4!


Install Gnome3 on Ubuntu 12.04

In Gnome,Gnome shell,Linux desktop,Ubuntu,Unity on June 23, 2012 by oli4444

You like the nice configuration defaults of Ubuntu but not Unity?

Add this to your /etc/apt/sources.list

deb precise main 
deb-src precise main
deb precise main 
deb-src precise main

Now run

sudo apt-get update && apt-get install gnome-shell

and you have an up-to-date gnome-shell. Even many of the pretty extensions are packaged as well.

As a bonus I found out that Gnome 3 runs much snappier than Unity on an old IBM T43 laptop (which has 6 years old Centrino technology).


After 5 year a new release for Directoryassistant

In Gnome,Linux desktop,open source on October 10, 2011 by oli4444

After ~5 years without a release, I released Directoryassistant 2.1. Directory Assistant is a small application for managing addresses and contact information in a LDAP address book. I originally wrote it because I organized my addresses in an ldap store so I could use them in different programs, but my girlfriend did not, so we always had incomplete or out-of-sync information. Nowadays we have the same addressbook on all our computers and smartphones in our household.

Directoryassistant 2.1 is just a minor feature enhancement release. I guess the next version will be major again because right now it still uses gtk+-2 and python-gtk2, so the next thing to do would be gtk+-3 compatibility and python with GObject-Introspection.


Gnome shell starting to become my favourite

In Gnome,Gnome shell,Linux desktop,open source,Unity on August 19, 2011 by oli4444

I have several different computers, running Gnome 2, Gnome 3, Unity and Mac OSX. New interfaces always take a while to get used to, so after the initial launch of Gnome 3 and Unity the “classic” Gnome 2 interface was still my favourite to get my work done.

Gnome 3 has the best looks (yes, I like it better than OSX), but to get my work done I don’t need the best looks. A long time ago I ran Enlightenment with the aliens theme to have a very cool desktop, but I always switched the Sawfish when I had some real programming to do.

So what is making Gnome 3 making my first choice? The main reason for that is the keyboard control. Hit <alt><f1> or the <windows> key and start typing some characters of the program name and hit enter. Better, start typing the name of the bluefish project file that I used recently and hit enter, and I have my project open. I don’t have to type the exact name of the command (typing “te” already selects “gnome-terminal” for me, “tru” selects my “bluefish_trunk” bluefish project file, “fi” selects firefox, etc.) which makes it very fast and convenient. Switching virtual desktops (called workspaces in gnome 3) is <ctrl><alt><up> or <ctrl><alt><down>, and when I need a new desktop it is automatically created by hitting <down> one extra time.

Some other things I like a lot: tiling widows side by side by dragging a window to the right/left, and restoring the original size when moving the window again. However, I would like to be able to widen the windows after tiling, the left window can be widened on the bottom-right corner, but there is no way to make the left window a bit wider. I like <alt><`> for switching between windows of the same application (it feels natural because it is so close to <alt><tab>). I like <alt><f2> to start new commands, especially when using <ctrl><enter> to start that command in a new terminal.

What would make things even better for me:

  • <Alt><tab> behavior per desktop per window. I just doesn’t make sense to me that switching between two web-pages in two firefox windows is different from switching between two web-pages in chrome-and-firefox. I often <alt><tab> between a couple of terminal windows and bluefish windows. The default just switches applications, and I usually need a specific session of that application on the same virtual desktop. The alternate tab extension however, makes me tab between all open windows on all virtual desktops (which usually is a long list).
  • Easier mouse access to virtual desktops. The hot corner is left, but to switch to a different virtual desktop without key combination, I have to move the mouse all the way to the right (which is a long way on a widescreen display). I have the workspaces menu extension installed to have the virtual desktops in the top bar, but it needs two mouseclicks to switch between two desktops. An improvement could be to make the top-right of the screen a second hot corner that activates the workspaces area by default (I have the right-hot-corner extension installed, but I first have to move the mouse to the top right for the hot corner, and then to the middle to activate the workspaces area).
  • Better use of the vertical screen space. The top bar of each window is quite high, and it only has a close button and you use it to drag the window. Especially when maximising a window the top space of the screen has a lot of unused space. This is an area where Unity tries to do good things (except that the menu thing in unity is slow and buggy as I posted earlier). Luckily Bluefish has a fullscreen feature!
  • Make it the default to open a new window. For most programs I use I have multiple open windows (terminals, bluefish sessions, firefox sessions etc.). If I want to switch to an open window it is much faster to select that window in the overview mode than clicking the icon in the dash (which selects just one of the open sessions which is anyway usually not the one you need). I want to use the dash to start a new session, regardless if I have a session running already. Having the hold <ctrl> while clicking is annoying. Same for starting a program using the keyboard control: if I type “fi” and hit enter, I don’t want any of my existing firefox sessions, I want a new session!


A gnome desktop and 3000 printers

In enterprise,Gnome,Linux desktop,open source on August 2, 2011 by oli4444

We have something like 3000 printers. They are named something like “MF2301” and “MF2302”. The printer properties luckily show the location of the printer.

So let’s fire up system-config-printer and search for the right printer. First thing is that it takes ages for system-config-printer to start with 3000 printers. Somewhere close to 20 seconds. What’s happening? Is it requesting the status for each printer? Is the delay caused by 3000 icons (Nautilus is faster when displaying a directory with 3000 files)? Then we have the search field. Hmmm it allows only searches on the name, not by location or description.¬†Unfortunately our users are humans and not computers, so they usually know the location where they are, but not the number of the printer. So I first have to walk to the printer, write the name down and walk back to my thin-client to select the correct printer and click “set as default”.

Now I want to print something. So I hit <ctrl><p> in, and it shows MF00001 as printer? That was not my default printer! shows a dropdown with all printers, so I have to scroll through the 3000 printers to select the right printer again.

So far for printing for now.

Update: let me be clear, I don’t want to bash the developers of the printer settings (I’m very glad it exists!!!!) but I just want to show some of the issues that arise in large desktop deployments.


Ubuntu Unity breaks Bluefish

In Bluefish,Linux desktop,open source,Ubuntu,Unity on July 13, 2011 by oli4444

Slowly more bug reports are arriving that can only be reproduced on Ubuntu 11.04 with Unity. Ubuntu 11.04 with the Gnome shell, or with classic gnome are not affected. This is kind of difficult for an application developers perspective. I personally don’t care too much about Unity, I like Gnome shell better so I switched to Fedora. But a lot of users do use a default Ubuntu install, so they will have to deal with Unity. And that’s why I have to deal with Unity bugs…

Menu synchronisation is broken

If you open two documents in Bluefish, and you disable for example “Show right margin” for one document, and you switch to the other¬†document (which has show right margin still enabled) , the menu toggle option is disabled. It seems that unity was not designed for applications that change menu toggle options without the user clicking on it.

Snippets menu is totally gone

If you use the snippets plugin, Bluefish has two menu bars. Unity seems to disable all menu bars to show them on the window border. But the snippets menu bar isn’t showed in the window border… It seems that Unity was not designed for applications that have multiple menu bars.

No menu when full screen

A popular feature for netbooks is the fullscreen mode of Bluefish. But if you hit F11 with unity, there is no menu. Not really a killer bug, since unity already optimises the vertical screen space, so fullscreen makes little difference.

All recent menu entries open the same file

… which renders the recent menu quite useless. Always the top-most entry in the recent menu is activated, regardless which entry is clicked.

Weird user interface shifting

This one puzzles me. I can’t really describe it, so I made a screencast. Every click on the user interface moves the user interface from left to right. You can’t open a file by doubleclicking. You can’t click a button, you’ll end up with the buton next to it.

It doesn’t happen all the time, but once it happens it is really annoying!

What to do now?

I filed some bugreports for unity, but I haven’t seen a response yet (there are quite a few bugreports, so I can image the developers have a busy time). What should I do as application developer? Tell users to avoid Ubuntu with Unity?


New desktop GUI’s and terminal servers

In enterprise,Gnome,Linux desktop,open source on May 2, 2011 by oli4444

Gnome shell, but also Unity, make extensive use of modern video hardware possibilities. Which is a good thing. The downside is that they do not function anymore without access to the modern video hardware. In an organisation that uses thin-clients and terminal servers over a wide area network this becomes a bit of a problem. Protocols like NX (Nomachine) and VNC (many products, such as ThinLinc) that can handle the high latencies on wide area networks do not provide access to these functions of the video hardware.

This means that the thin-clients are limited to the “fallback” gnome desktop. But how long will that be maintained? When will the first open source product decide to drop support for the oldfashioned gnome desktop? What if Empathy or Networkmanager will not work anymore with the fallback desktop? Does that make our thin-clients worthless?

What is your strategy regarding thin-clients?


Storage and backup for desktops and laptops in the enterprise

In enterprise,Linux desktop,open source,security on February 17, 2011 by oli4444

For desktops it is generally considered a good idea that all user created data is stored on a NAS on which backup and restore is implemented.

For Linux desktops NFS is commonly used. However, NFSv3 is usually not acceptable because in large organisations there is too little control over IP adresses. So NFSv4 with Kerberos authentication is the answer. Large organisations also tend to have large networks, so latency is another factor, and again NFS4 (with the delegation feature) allows better client side caching. There is also FS-Cache/CacheFS that does a lot more caching on clients, but it does not improve performance in all situations (if bandwidth is not an issue don’t use it).

But now laptops. What you would like for laptops is the situation where the users work locally with their data, but whenever they have a network connection the data is synchronised to the enterprise NAS. That way they can disconnect their network at any time and continue working. There is the OFS (offline file system) that works on SMB network file systems, but that seems to be not completely mature yet. A second problem with laptops is authentication. A user may want to log on locally without network, and then connect the laptop to the network and expect it to start sychronising data. But that won’t work unless we first get our Kerberos ticket. I wonder what Windows laptops do in this situation, would they cache the password and re-use in the background to obtain a Kerberos ticket? Related to this: you need a feature sometimes called “cached credentials” to allow you to log on locally if your kerberos/ldap server is not available. There are some projects trying to adress this, but this is also still not well integrated yet.


Printing in the enterprise

In enterprise,Linux desktop,open source on January 27, 2011 by oli4444

In an enterprise organisation there might be 10000 to 100000 users, and 1000 to 5000 printers. There are a couple of tricky things in such a situation.

First is print queue scalability. Converting the print job to the right format for the right printer is quite CPU intensive. If you let the desktop handle this it scales nicely with all your desktops, but if you want the server to handle this it becomes a scalability nightmare.

Users need to select their printer. Showing a list with 5000 printers doesn’t help the user, he wants to search by location, by name, by department etc. Worse: showing 5000 printers and trying to show their status (as system-config-printer does) will eat 100% cpu.

Finally you need to configure the printers. How do you deal with 5000 printers on 50000 desktops?

If anybody has a good primer how to do such things with for example CUPS please leave a comment below!