Posts Tagged ‘Gnome’

Cpu Frequency and Gnome Power Manager

Thursday, February 12th, 2009

I’ve installed Debian with Gnome on my new Asus EeePC 1000H, and for some reason the Gnome Power Manager preferences wouldn’t let me decide on what cpu frequency scaling governor I wanted to use.

I’m trying to squeeze as much time as I can out of the battery, so I wanted it to be “powersave” when on battery.

The options weren’t there.

After a bit of digging I fould a gconf key,


which, when set, causes the options to be shown.

It’s a bit annoying with all these hidden preferences but at least we have gconf-editor πŸ™‚

Suspend / hibernate problems in new Debian Testing install

Thursday, January 31st, 2008

MenuI’ve had quite a bit of problems getting suspend and hibernate to work in Gnome on my new Zepto Znote 3215W.

The problem was that Gnome Power Manager simply refused to suspend or hibernate.

The actual functions of suspend or hibernation works great, with a minimum of fiddling. The Gnome Power Manager comes with a handful of wrapper scripts around the uswsusp programs s2disk and s2ram. The pm-hibernate script works out of the box from the command line as root. The system resumes correctly afterwards.

The laptop isn’t on the whitelist for s2ram, but it works with the –force flag, and that is easily automated by creating a file /etc/pm/config.d/s2ram with the line


and making the file executable. That will cause the pm-suspend script to pass –force to s2ram as default. Again, the system resumes correctly.

The problem was that when I tried to suspend or hibernate though the context menu of the Power Manager applet, I immediately got a dialog with the text:

Sleep Problem
Your computer failed to suspend.
Check the help file for common problems.

It happened so fast that no attempt at suspending could possibly have been made.

One track I followed was that the applet uses HAL to do the actual suspend/hibernate and HAL will only do that if it believes the laptop is capable of it. That can be checked by running the command:

lshal | grep power_management

I currently, after I solved my problems, get this output:

$ lshal | grep power_management
  power_management.acpi.linux.version = '20070126'  (string)
  power_management.can_hibernate = true  (bool)
  power_management.can_suspend = true  (bool)
  power_management.can_suspend_hybrid = true  (bool)
  power_management.can_suspend_to_disk = true  (bool)
  power_management.can_suspend_to_ram = true  (bool)
  power_management.is_powersave_set = false  (bool)
  power_management.quirk.none = true  (bool)
  power_management.type = 'acpi'  (string

To get HAL to recognise the laptop I have made a file
with this content:

<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
    <match key="system.hardware.vendor" prefix="ZEPTO">
      <match key="system.hardware.product" string="ZNOTE">
             <merge key="power_management.quirk.none" type="bool">true</merge>

and restarted HAL and logged out and in again. That should, as far as I have understood, whitelist the laptop in HAL by affirming that pm-suspend doesn’t need any additional options to work.

It didn’t make any difference, though. I still got the error message when trying to suspend from the applet’s context menu.

At this point I was about to give up. One last search on google brought up something new, however. There’s another level of permission checks involved, which is specified in the file /etc/dbus-1/system.d/hal.conf. In this file I found, among many other things, these lines:

  <!-- This configuration file specifies the required security policies
       for the HAL to work. -->


  <!-- Debian groups policies -->
  <policy group="powerdev">
    <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
    <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>

which seem to indicate that I need to belong to the “powerdev” group to be able to use these functions.

I added myself to the group, logged out, logged in again, and everything worked.

This is the kind of experience that leaves you feeling a bit stupid. Totally unjustified, because I’m not to blame, but after having spend so much time looking in other directions, the solution is so simple.

Now the problem is solved, I hope to be able to use many of the useful functions of the Gnome Power Manager, such as automatic hibernation in low power situations.

I have notices another little thing that has changed. When I used the Fn-F4 and Fn-F5 keys to adjust the backlight on the display, I got a little on screen display, but it didn’t do anything, it just sat there. After I’m in the “powerdev” group, the on screen display actually shows an indicator of how the backlight is changed.

Zepto Znote 3215W with Debian Testing/lenny

Monday, January 28th, 2008

Zepto Znote 3215WAs my old Asus M2N laptop got older and older, and for some reason slower and slower, I decided to buy a new one. I ended up gettinng a Zepto Znote 3215W with a few customisations. There were several reason for this choice:

  • Zepto has very competive prices,
  • Zepto will sell laptops without an OS preinstalled – no involuntary Microsoft tax,
  • laptops can be customised as you want them,
  • and then this quote: “Works with Ubuntu Linux. 3215W is tested and will work together with Ubuntu Linux 7.10 beta, Out-of-the-box. For Wifi you will need to use the Intel Pro/Wireless 4965 netcard.”

The specs of mine are:

  • Intel Centrino “Santa Rosa” chipset
  • Intel Core2 Duo CPU T5450 @ 1.66GHz (*)
  • 2 Gb DDR2 800MHz RAM (*)
  • 120 Gb SATA harddisk 7200 rpm (*)
  • DVD-RW DL drive (*)
  • 15.4″ WXGA “Crystal Clear” display at 1280×800
  • Intel GMA X3100 graphics chipset
  • Intel Pro/Wireless 4965AGN wireless network adapter (*)
  • Broadcom NetLink BCM5906M network adapter
  • Broadcom internal USB bluetooth adapter (*)
  • Ricoh Firewire adapter
  • Ricoh SD/MMC card reader

The items marked with (*) are where I have asked for changes or additions to the default configuration.

It is a fairly large laptop, measuring 36Γ—27Γ—4cm and weighing 2.8kg which is OK for the kind of semi-stationary work I do currently.


Most parts of the laptop work immediately with little or no manual configuration on a Debian Testing install, but there are several parts that doesn’t. Most of these seem to have a solution on the way. Zepto states that the laptop is fully Ubunto 7.10 compatible, but not everything went that smooth with Debian.

An install of Debian Testing (lenny) with a Linux 2.6.23 kernel leaves these parts non-functional:

and these only partly functional:

  • X server sometimes fails to restore textmode correctly
  • Touchpad not recognised but it still usable
  • ACPI works only partially
  • Minor issues with sound and headphones

and these require an extra effort to get fully functional:

  • Compiz window manager
  • SD/MMC card reader
  • Keyboard hotkeys


Google Calendar in the Gnome panel

Thursday, December 20th, 2007

My calendar on the desktopI haven’t really used the calendar part of the little clock I have in my gnome panel, since its integrated with Evolution, and I use Thunderbird for my mail and Google Calendar for my calendar.

The other day I decided to try out Evolution again—after all, you never know—and I subscribed to some of my calendars from Google Calendar, and they appeared automatically in the panel calendar.

Now I can have my calendars on my desktop πŸ™‚

The calendars show up even without Evolution, because they are handled by the Evolution Database Server which can be used independently of Evolution.

Gnome desktop links open in epiphany

Tuesday, August 15th, 2006

At some point recently desktop links have started to open in Epiphany, no matter what I do.

I have set Firefox as my preferred browser and I have checked all entries in /etc/alternatives, and everything says ‘firefox’. Still, a link on my desktop will always open in Epiphany, whether I have Firefox running or not.

I have no idea about how to fix it πŸ™

UPDATE: It appears desktop links open with the default handler for the mime type “text/html”. Change that to something else and the desktop links will open with that handler. Thanks, Bin Guo.

GThumb but no thumb(nails)

Sunday, August 14th, 2005

GThumb without thumbnailsWhile I was ordering and sorting a bunch of holiday snaps at some point GThumb just stopped showing the thumbnails. I just got a generic icon for an image.

I have absolutely no idea what happened.

There was nothing in the GThumb preferences about not showing thumbnails, so I was a bit at a loss. Fortunately I got the idea of using the Gnome Configuration Editor, which on my Debian testing system is on Applications | System Tools | Configuration Editor and there it was. The gconf key /apps/gthumb/browser/show_thumbnails was not set.

Once the key was set to ‘true’ (by checking the box) GThumb immediately showed the thumbnails again.

So the fix was easy, but I still haven’t got a clue why it was turned off automatically in the middle of a session. (more…)

With GNU Emacs you can always learn

Sunday, June 5th, 2005

It is close to twenty years that I have been using GNU Emacs almost daily, and you still figure out new stuff.

I’ve been somewhat annoyed that copying and pasting between Emacs and Gnome applications were so inconsistent, and then its all in the manual:

Using the Clipboard

As well as the primary and secondary selection types, X supports a “clipboard” selection type which is used by some applications, particularly under OpenWindows and Gnome.

The command `M-x menu-bar-enable-clipboard’ makes the `Cut’, `Paste’ and `Copy’ menu items, as well as the keys of the same names, all use the clipboard.

You can customize the option `x-select-enable-clipboard’ to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise they do not access the clipboard at all. Using the clipboard is the default on MS-Windows, unlike most systems.

Maybe its time to read it again.

Gnome 2.8

Wednesday, December 8th, 2004

So Gnome 2.8 finally made it to Debian Testing, more or less. In the end I got most of the packages from Unstable.

I have mostly noted two visible changes, though there are many more. The most visible is without doubt the automatic handling of removable media, though the combination of hal, udev, hotplug and gnome-volume-manager. Finally you can just plug in a camera or a cd and it Just Works(tm).

The other change is the way applications are associated with filetypes. It is definitely more intuitive than before, but it is bit difficult getting decent display names shown in the context menu for the chosen applications. It still requires some editing of .desktop files by hand.

Sawfish and the Gnome “Run Application” dialog

Friday, September 24th, 2004

It has long annoyed me that I couldn’t attach a keyboard short cut to the Gnome panels “Run Application” dialog in Sawfish.

When people ask on the net about it, the answer is usually “Press Alt-F2”, but that only works in metacity, not in sawfish.

In earlier versions of Gnome there was a gnome-run program, but that has gone.

Then, on this blog, I found an explanation and a little program that opens the “Run Application” dialog. All that’s missing is to use add a Sawfish binding to the program, using the sawfish function run-shell-command.

Download a copy of gnome-run.c here. The program is a simple X11 program, compiled with:

gcc gnome-run.c -o gnome-run -L/usr/X11R6/lib -lX11

Looking at the program, I would expect to be able to do it directly from sawfish, but somehow it didn’t work. What I tried was this:

(send-client-message 'root (x-atom '_GNOME_PANEL_ACTION)
     [(x-atom '_GNOME_PANEL_ACTION_RUN_DIALOG) 0] 32)

but, alas, it didn’t work. Would have been neat, though πŸ™‚

Sawfish functions for hotkeys and panel launchers

Monday, August 30th, 2004

One of my laptops has a series of hotkeys that send ACPI events, so I made a script to handle these events, which I later extended to be usable from the desktop or the panel too.

The various applications have different needs, and I use them in different ways. I only have one mail reader open, and its always in the same workspace, while I have many browser windows open in different workspaces. Others, like my calendar application, are used more like dialogs, where I show and hide them in the current workspace. Many require a close interaction with my window manager.

The core of the script looks like this:

case "$1" in
	case "$3" in
	    00000030) aumix -v+5;;
	    00000031) aumix -v-5;;
	    00000032) mute;;

	    00000040) xmms --rew & ;;
	    00000041) xmms --fwd & ;;
	    00000043) xmms --stop & ;;
	    00000045) xmms --play-pause & ;;

	    00000050) launch_mailer;;
	    00000051) launch_browser;;
	    00000052) launch_xchat;;
	    00000053) launch_calendar ;;

	    0000005c) show_hide_desktop ;;

    weblogs)	launch_web_logs;;
    xchat)	launch_xchat;;
    calendar)	launch_calendar;;
    mail)	launch_mailer;;
    vmware)	launch_vmware;;

When called by acpid the invokation is like this:

hotkey hotkey ATKD 00000052

and from a Gnome launcher in the panel or on the desktop:

hotkey calendar

Sound keys

The cd player keys and the volume controls are all software controlled, so if I don’t do anything, they won’t work. I usually play music with xmms and use aumix or setmixer for volume control, so they are the programs used in my scripts.

The volume up/down and play/rew/fwd/stop commands above are all self explanatory. Its all the in the manuals for xmms and aumix. There is no mute function in aumix, so I had to invent one, and it had to restore the correct volume after muting. After some attempts I came up with this:

function mute () {
    case "$(aumix -vq)" in
	"vol 0, 0")
	    (grep '^vol:' ~/.aumixrc-mute 2>/dev/null || echo 'vol:100:100:P') |
	    aumix -f /dev/stdin -L >/dev/null
            aumix -f ~/.aumixrc-mute -S -v0

It’ll mute and restore the volume at alternating invocations, perfect for a mute button.

Hide and show all windows

I think the button is intended to turn the wifi trasmitter on and off, but I use it for the desktop. The code is this:

function show_hide_desktop () {
    exec sawfish-client -- << EOF
(if (showing-desktop-p)

Only one application instance open

For some applications I only want one instance open at a given time. It can be my mail reader, vmware, my irc client or any other applications where several instances can be confusing or harmful.

I use the window manager to decide what to do, for example for the mail client:

function launch_mailer () {
    exec sawfish-client -- << EOF
(let ((window (or (get-window-by-name-re "^Mutt")
		  (get-window-by-name-re " - Ximian Evolution$")
		  (get-window-by-name-re "Mozilla Thunderbird$"))))
  (if window
      (display-window window)
    (select-workspace (cdr (workspace-limits )))
    (start-process nil "mozilla-thunderbird")

This function will check for an open mail reader, and if found switch to that window (changing workspace if necessary), and if not found, it will move to the last workspace and launch Mozilla Thunderbird.

Dialog-type application

This is a bit more complicated. I want my calendar to always be around when I need it, but not get in the way when I don’t need it.

I do this by always keeping it in the current workspace, but iconified. This function does it all:

function launch_calendar () {
    exec sawfish-client -- << EOF
(let ((window (or (get-window-by-name "Mozilla Sunbird")
                  (get-window-by-name "Mozilla Calendar"))))
  (if window
      (if (and (window-in-workspace-p window current-workspace)
	       (not (window-iconified-p window))
	       (eq (window-visibility window) 'unobscured))
	  (iconify-window window)
	(move-window-to-workspace window (car (window-workspaces window)) current-workspace)
	(display-window window))
    (start-process nil "sunbird")

If the calendar application is already started, it will check if it is in the current workspace and fully visible. If it is it is iconified, otherwise it is moved into the current workspace, de-iconified and brought to the front. If the calendar is not running, it is started.

The overall effect of this is that alternately display and hide the calendar, regardless of where it was left the last time. One click opens the calendar, the next click closes it.

None of this is quite rocket science, but they are some of those little things that makes day to day work move a bit swifter.