Xfce Tips

Background Image

There’s a bug with the xfce background image chooser setting that won’t let you choose a different image folder. If you want to change your background, you can browse a folder in the “ristretto” application and once you find an image you like, choose “view -> set as wallpaper”. And choose xfce, and I suggest “zoomed” in the dialogue box that follows. The default background is linked to /usr/share/images/desktop-base/default.


When the screen is locked it redirects you to the login window to unlock it. Your session is still active and you have not been logged out. Take care however, if you have a habit of tapping the space bar to wake up the screen, you may inadvertently have a leading space before your username when you login. If you do this, your login credentials will be accepted, but it will fail to match you to the running session correctly. Just wiggle the mouse and be a little patient when waking the screen.

Flickering in gedit or similar

Some people have noticed flickering in gedit or some other applications. If you enable compositing (settings manager -> window manager tweaks -> compositing - tick the box) this seems to alleviate this.

Firefox/Iceweasel spell checking language

There is a (long-standing) problem of firefox defaulting to a undesirable language for spell checking in Linux if it is using system dictionaries (as is the case on the cluster workstations). The (excellent) Arch Linux wiki describes how to fix this.


Xfce defaults to using gpg-agent to handle ssh keys. This may not be the best for a given workflow. Xfce can instead use either ssh-agent directly or GNOME services (which matches the behaviour of Xfce under Ubuntu 12.04). See http://docs.xfce.org/xfce/xfce4-session/advanced for details.

Mimicking Aero Snap

Some people like to be able to resize a window to fill exactly half a screen; this is useful when writing LaTeX, for example, as it makes it easy to have both a PDF viewer and a terminal side-by-side. Tiling window managers can do this trivially. This is possibly with shortcut keys in Xfce (see, for example, this blog post). Another way is to use wmctrl:

  1. Save the following script to, for example, $HOME/bin/wmctrl_aero_snap:

    # first maximize the window
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    # now find the dimensions
    id=$(xdotool getactivewindow)
    max_width=$(xwininfo -id $id | awk  '/Width:/{print $NF}')
    max_height=$(xwininfo -id $id | awk  '/Height:/{print $NF}')
    # now reset the window to it's previous size so we can set it to half-width,
    # full-height
    wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz
    if [[ "$1" == "right" ]]; then
        wmctrl -r :ACTIVE: -e 0,$half_width,0,$half_width,$max_height
    elif [[ "$1" == "left" ]]; then
        wmctrl -r :ACTIVE: -e 0,0,0,$half_width,$max_height
  2. Make the script executable:

    $ chmod +x $HOME/wmctrl_aero_snap
  3. Calling

    $ $HOME/wmctrl_aero_snap left

    will cause the active window terminal to fill the left half of the screen. Similarly

    $ $HOME/wmctrl_aero_snap right

    will cause the active window terminal to fill the right half of the screen.

  4. Assign shortcut keys to the left and right commands (Menu->Settings->Settings Manager->Application Shortcuts). You will need to replace $HOME with the full path to your home directory (e.g. /home/username/).

Input methods

The “input method” controls how text (especially in non-Latin alphabets such as Chinese, Japanese and Korean) is entered in X11 (upon which Xfce runs). Ideally the workstations would use ibus <https://github.com/ibus/ibus> but, sadly, this does not play nicely with UK keyboard layouts. Rather than requiring everyone to work around this individually, the workstations are configured to not use ibus by default. If you wish to use ibus, then create the file ~/.xinputrc with the contents:

run_im ibus

You will need to log out and back in for the change to be picked up.

Default applications

A sensible(ish) set of default applications for common file types is made on all workstations and are used by xdg-open and by opening files from the desktop/thunar/etc. These can be most easily customised, if desired, using the xfce4-mime-settings program.