Desktop Tricks

This section details some tips for using and customising Ubuntu's desktop environment (called GNOME), and the file manager (called Nautilus).

Menu Editing

Ubuntu comes with the Alacarte Menu Editor, so you can customize your menus and add entries for applications that don't automatically appear after they are installed.

To add a new menu entry:

  1. Open Alacarte with Applications->Accessories->Alacarte Menu Editor, or by right-clicking on any top-level menu and choosing Edit Menus.

  2. In Alacarte's left-hand pane, choose the submenu the new entry should appear in.

  3. Choose File->New Entry. In the New Entry window, choose a Name, Comment, Command and Icon. The Command will usually be the package name, Name is what will appear on the menu, and the Comment will appear in the tooltip that appears near the menu entry. Icons are added to the /usr/share/pixmaps directory by default, or can be chosen from anywhere in your files.

To change the order of menu entries, use the up and down arrows on the right-hand side of the Alacarte window.

To stop a menu entry from being displayed, use the checkboxes beside each entry. This does not erase the menu entry, so you can restore it later in the same way.

Start a Program Manually

Sometimes it can be useful to start a program manually, for example when the program does not have an entry in the menu. This is easy to do with the Run Applications dialogue.

For an application you intend to use regularly that does not have a menu entry, it is also very easy to add a menu entry to Ubuntu. (see the section called “Menu Editing”)

  1. Open the Run Applications dialogue by typing: Alt-F2

  2. Enter the name of the program you wish to run, and press Enter.

Run programs automatically when GNOME starts

  1. Choose System->Preferences->Sessions .

  2. Click on the Startup Programs tab.

  3. Use the Add, Edit, and Delete buttons to manage programs to run at startup. Some programs will automatically add themselves to this list when you configure them.

Login automatically to GNOME when the computer starts

It is possible to login a user automatically when the computer boots. This is not recommended for most computers, as it is not secure and may allow other users access to your information

  1. System->Administration->Login Screen Setup

  2. Select the Security tab. Check the Enable Automatic Login checkbox option.

  3. Choose the user you wish to be automatically logged in.

Change Display Mode in Nautilus

Ubuntu's file manager Nautilus provides two modes in which you can interact with your filesystem: Spatial mode and Browser mode.

  • In Browser mode, the file manager window represents a browser, which can display any location. Opening a folder updates the current file manager window to show the contents of the new folder.

  • In Spatial mode, the file manager window represents a particular folder. Opening a folder opens the new window for that folder. Each time you open a particular folder, you will find its window displayed in the same place on the screen and the same size as the last time you viewed it (this the reason for the name).

Browser mode is the default setting on Ubuntu, but you may wish to change this:

  1. In Nautilus, choose Edit->Preferences.

  2. Click on the Behavior tab.

  3. Unselect the Always open in browser windows check box.

  4. Close and reopen Nautilus.

Show hidden files and folders in Nautilus

  1. In Nautilus, use the Ctrl-H shortcut keys to toggle hidden files and folders on and off, or select View->Show Hidden Files.

  2. To permanently show all hidden files and folders, choose Edit->Preferences.

  3. Click on the Views tab.

  4. Select the Show hidden and backup files check box.

Open the Location Bar in Nautilus

The Location Bar is the bar in your file manager in which you can type an address. Toggle the bar on and off with: Go->Location... You can also use the Ctrl-L shortcut keys.

View remote SSH, FTP, and SFTP servers using Nautilus

  1. Make sure the Nautilus Location Bar is open (see the section called “Open the Location Bar in Nautilus).

  2. In the Location Bar, enter the following:

    For SSH, use:

    ssh://[email protected]

    For FTP, use:

    ftp://[email protected]

    For SFTP, use:

    sftp://[email protected]

    Replace username with your username and replace everything after the @ symbol with the server's address. You will be prompted for a password if needed. If there is no username (anonymous) omit the username and the @ symbol.

    Alternatively, to specify your password manually, change one of the above like so:

    ftp://username:[email protected]

  3. To access remote servers easily through Nautilus, add a permanent bookmark to the server by selecting Places->Connect to Server... and entering the details for the remote server.

Change the default "Open with" program for a file type

  1. In Nautilus, right click on the file and choose Properties from the menu that appears. The Properties dialog opens.

  2. Click on the Open With tab. A list of applications appears.

  3. Select the default application you want for the file type. If the application is not on the list, use the Add button to add the application to the list.

Open files with administrative privileges from the file manager

To enable support for opening files with administrative privileges from the file manager, you need to add a Nautilus script:


Please note that opening files with administrative privileges constitutes a security risk. Always ensure that you are familiar with the file that you are opening.

  1. Open a new file to edit in the relevant directory:

    gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

  2. Insert the following lines into the new file:

    gksudo "gnome-open $uri" &
  3. Save the edited file (an example)

  4. Make the edited file executable:

    chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

  5. You can now open files as root by right clicking on the file and selecting Scripts->Open as Administrator

Install Extra Fonts

This section describes how to install extra fonts from the Ubuntu archives.

  1. For international fonts, install the following packages from the Universe repository (see Chapter 2, Adding, Removing and Updating Applications):


  2. For Microsoft TrueType core fonts, install the msttcorefonts package from the Multiverse repository (see Chapter 2, Adding, Removing and Updating Applications).

  3. For Ghostscript fonts, install the gsfonts-x11 package (see Chapter 2, Adding, Removing and Updating Applications).

  4. After installing any new font, rebuild the font information files by typing the following at a terminal prompt:

    sudo fc-cache -f -v

If you prefer to download individual fonts by hand, you can install them simply and easily by opening a file manager, and typing fonts:/// into the location bar (See the section called “Open the Location Bar in Nautilus). Then you can simply drag the font you downloaded into the group of existing fonts.

RAR Archiver

  1. Install the rar package from the Multiverse repository (see Chapter 2, Adding, Removing and Updating Applications).

  2. Run:

    sudo ln -fs /usr/bin/rar /usr/bin/unrar

  3. To open a rar file, double click on it.

Advanced Desktop Applets

gDesklets is a system for bringing mini programs (desklets), such as weather forecasts, news tickers, system information displays, or music player controls, onto your desktop, in a symbiotic relationship of eye candy and usefulness.

  1. Install the gdesklets and gdesklets-data packages from the Universe repository (see Chapter 2, Adding, Removing and Updating Applications).

  2. Choose: Applications->Accessories->gDesklets

  3. For more information, visit the gDesklets website

Hide Recent Documents in the Places menu

To hide Recent Documents from the Places menu, open a terminal and run the command:

chmod 400 ~/.recently-used

To enable it again, run the command:

chmod 600 ~/.recently-used

Show the Computer, Home, and Trash desktop icons in GNOME

  1. Open the Configuration Editor, by running the program gconf-editor (see the section called “Start a Program Manually”).

  2. Choose apps->nautilus->desktop.

  3. Tick the box beside computer_icon_visible, home_icon_visible, and trash_icon_visible. The changes take effect immediately.

Change my preferred email client to Mozilla Thunderbird

  1. Choose System->Preferences->Preferred Applications

  2. Click on the Mail Reader tab, and select the Custom option.

  3. In the Command text box, type mozilla-thunderbird %s, then close the dialog.

Restart GNOME without rebooting the computer

  1. Save and close all open applications.

  2. Use the Ctrl-Alt-Backspace shortcut keys to restart GNOME.

  3. If Ctrl-Alt-Backspace is disabled, type

    sudo /etc/init.d/gdm restart

    (See the section called “Preventing the Ctrl-Alt-Backspace shortcut keys from restarting X” to disable Ctrl-Alt-Backspace.)

Preventing the Ctrl-Alt-Backspace shortcut keys from restarting X

  1. Make a backup copy of your existing /etc/X11/xorg.conf file:

    sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup

  2. Open /etc/X11/xorg.conf for editing:

    gksudo gedit /etc/X11/xorg.conf

  3. Add the following lines to the end of the file:

    Section	"ServerFlags"
    Option	"DontZap"	"yes"

  4. Save the edited file (an example).

  5. The change will take effect the next time you log in to GNOME. If you want the change to take effect immediately, restart GNOME manually. (See the section called “Restart GNOME without rebooting the computer”.)