If you are a Windows power user, the switch to a Linux desktop environment can be quite a shock. Many of your favorite shortcuts and tricks become useless, and it can be quite challenging to get back up to speed. There are many tweaks that you do to make Ubuntu’s Gnome 2 desktop environment easier to use and more powerful. This article presents a list of things to do after a fresh install that may help both Ubuntu newbies and adept users.

The default look of the Gnome 2 environment in Ubuntu.

Note that the 11.04 release of Ubuntu introduced a new desktop environment called Unity. It is a trainwreck of an UI at this point, and power-users will most likely be much more productive in the ‘classic’ Gnome 2 UI. The tips in this article apply to Gnome 2 for Ubuntu, but some things might work for other distros and UIs.

There are several invaluable programs that everyone should get after a fresh install.

Ubuntu Tweak is a tool for Ubuntu that makes it easy to configure your system and desktop settings. If you are a Windows user you might know Windows Powertoys, which is very similar. You can configure login settings, package related jobs, default folder locations, which items to display on  your desktop, and much more.

Use the Software Center to install Ubuntu Tweakj, or run

$ sudo apt-get install ubuntu-tweak

You can find it under Applications -> System Tools.

The Gnome Tweak application, showing some of the available Gnome settings.

The best video player is without a shadow of a doubt VLC Media Player. It will play pretty much every format in existence, is very feature-rich, and has great performance.

To install VLC, use the Software Center or run

$ sudo apt-get install vlc

Find VLC under Applications -> Sound & Video.

You can set things up so all media files are automatically opened with VLC. There are two methods,

Method 1: This method leaves the file associations untouched, and modifies the .desktop file so Open With Totem actually points to VLC. It is kind of a hack, but it only requires one command:

$ sudo cp /usr/share/applications/vlc.desktop /usr/share/<wbr>applications/totem.desktop
</wbr>

Method 2: This method is cleaner; it changes the actual file associations to VLC. You must change the MIME type associations file in your home directory to completely replace the default media player in Ubuntu 11.04 – Totem media player – with VLC. The two files involved are:

  • /usr/share/applications/defaults.list: System-wide default file associations
  • ~/.local/share/applications/mimeapps.list: User-specific file association overrides

Display the system-wide default MIME type associations, and filter for lines containing the text ‘video’:

$ cat /usr/share/applications/defaults.list | grep video
video/3gpp=totem.desktop
video/dv=totem.desktop
video/fli=totem.desktop
video/flv=totem.desktop
...

You need to override all these associations in the mimeapps.list file in your home directory. First, write everything to a temporary file and open it in GEdit.

$ cat /usr/share/applications/defaults.list | grep video > ~/assocs.txt
$ gedit ~/assocs.txt &

Now replace every occurence of totem.desktop with vlc.desktop using Search -> Replace.

Save the assocs.txt file. Open your current association overrides using

 $ gedit ~/.local/share/applications/mimeapps.list &

You will see your current file associations. The [Added Associations] section is important to us. Remove any existing <something>/video lines from that section, then copy-paste the lines from assocs.txt into the section.

Save the mimeapps.list file (you can remove assocs.txt), and enjoy using VLC as your default media player!

Other useful applications are:

  • Mozilla Thunderbird: Mail client.
  • Keepass Password Safe: Save your passwords in an encrypted container.
  • Netspeed: Network speed applet

    The ‘netspeed’ applet.

  • Shutter: Screen capture tool.
  • Wireshark: Network traffic analyzer.
  • 7zip: Advanced compression/uncompression tool.

In addition to installing essential programs, the Gnome 2 environment can be tailored to your needs with some specific tweaks.

In Windows, holding shift while right-clicking inside a folder will show the Open command window here option. You can enable a similar feature in Gnome’s file explorer: Nautilus.

Open your package manager and locate/install nautilus-open-terminal or, alternatively, open a terminal prompt and enter the command

sudo apt-get install nautilus-open-terminal

Now restart Gnome or terminate all nautilus instances by entering

sudo killall nautilus

Now when you right-click in a folder in Nautilus, you see the Open in terminal option:

Note that you can also enable this option using Ubuntu Tweak, in the Nautilus Settings section.

In Windows 7 you can press the Windows key, and immediately start typing to find and launch an application. There is a similar program for Gnome called Gnome Do. Gnome Do allows you to quickly search for many items present on your desktop or the web, and perform useful actions on those items.

First, install Gnome Do via the software center or use this command:

$ sudo apt-get install gnome-do

Then you can press Windows+space to open the launcher.

The Gnome Do launcher window.

To make things more similar to your Windows desktop, you may want to remap the launcher shortcut to just the Windows key. The settings menu of Gnome Do does not allow you to do this, but it is possible. First, open the Gconf Editor.

$ gconf-editor

Then go to /apps/gnome-do/preferences/Do/Platform/Common/AbstractKeyBindingService/Summon_Do and change the value to

Super_L

It should look like this:

Now Gnome Do will pop up when you press the left Windows key.

If you want to automatically mount an SMB share (Windows share) on system boot, then there are two ways: through the GUI or through the command-line.

Nautilus is the name of the file explorer in Gnome 2. To automatically mount shares in Nautilus, start it up and go to  File -> Connect to Server.

Say you want to automatically mount \\dataserver.test.com\MyData\ with username bob and password secret, the configuration would like this:

The domain name doesn’t really matter for most applications, but entering the hostname of the server is a safe bet. A bookmark will be added in Nautilus that points to this share, so after a reboot you can easily re-mount the share. Note that the share won’t be automatically mounted – you need to click the bookmark in Nautilus before they are available again.

Next, you need to enter the password and save it indefinitely.

Click ‘Connect’, and you are done. The filesystem is now available in Nautilus, and also in ~/.gcfs/MyData on dataserver.test.com/. Obviously you need to be on the same local network as the server (or connected to the network through a VPN connection) in order to access the share.

Note that if you want to connect anonymously (without providing a username and password), you only need to fill in the Server field.

Using the method above, every mounted share will put an icon on your desktop, which can be a little annoying. If you want to disable this open gconf-editor and unchecked “volumes visible” in apps -> nautilus -> desktop.

You can also manually mount a share in the filesystem using the command-line.

First, you need to install the ‘smbfs’ package:

$ sudo apt-get install smbfs

Update the unmount order to prevent CIFS from hanging during shutdown.

$ sudo update-rc.d -f umountnfs.sh remove
$ sudo update-rc.d umountnfs.sh stop 15 0 6 .

Then, try to mount the filesystem

$ sudo mkdir /mnt/MyMountedShare
$ sudo mount -t cifs //dataserver.test.com/MyData -o username=bob,password=secret /mnt/MyMountedShare

If you get an error message, check dmesg | tail to get more information. If you see cifs_mount failed w/return code = -22 then you need to (re)install the ‘smbfs’ package.

When the mounting is succesful, you will find the share in the /mnt/MyMountedShare directory. By default it is owned by user root and group root.

$ ls -al /mnt/
total 8
drwxr-xr-x  3 root   root   4096 2011-10-01 12:58 .
drwxr-xr-x 22 root   root   4096 2011-09-28 19:07 ..
drwxr-xr-x  2 root   root   4096 2011-10-01 12:58 MyMountedShare

If you want an ordinary (i.e. non-root) user to use the share, then you need to add some options to the command. Unmount the share, then remount it with the owner and group specified. Let’s say we have a user and group both named john.

$ sudo umount /smb/MyMountedShare
$ sudo mount -t cifs //dataserver.test.com/MyShare -o username=bob,password=secret,uid=john,gid=john /mnt/MyMountedShare

Now the share is mounted with the specified permissions, and john can write to the share.

$ ls -al /mnt/
total 8
drwxr-xr-x  3 root   root   4096 2011-10-01 12:58 .
drwxr-xr-x 22 root   root   4096 2011-09-28 19:07 ..
drwxr-xr-x  2 john   john   4096 2011-10-01 12:58 MyMountedShare

In order to mount a share on system startup you need to edit the /etc/fstab file. The fstab file typically lists all available disks and disk partitions, and indicates how they are to be initialized or otherwise integrated into the overall system’s file system.

Open the fstab file in your favorite editor, i.e. nano.

$ sudo nano /etc/fstab

At the very least, you will see some information that represents your hard disk partition(s).

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
#
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=2a3b1f14-7c5c-49d0-81b5-dc25f54dcf0b /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda2 during installation
UUID=ff8fb58e-f9b6-4981-9ed7-7d3e1a6635e1 none            swap    sw              0       0

In this case the file contains information about two hard disk partitions: an ext3 partition and a swap partiton. We need to add a line that mounts the share. The server, share, username, password and owner settings are the same as in the previous section.

# Automatically mount share from dataserver.test.com.
//dataserver.test.com/MyShare /mnt/MyMountedShare cifs _netdev,rw,username=bob,password=secret,uid=john,gid=john 0 0

Save the file and exit nano. Now re-mount the filesystems in the fstab file:

$ sudo mount -a

Now the share will be available in /mnt/MyShare, even after a reboot. You can drag the directory to the Places list in Nautilus to create a bookmark for easy access.

There are several tweaks you can do to make Nautilus easier to use.

Go to Edit -> Preferences and change View new folders using to List View. The default view is now List View, which will show more detail (Size, Modified Data).

By default the left pane displays ‘Places’. To get a view that is more similar to Windows Explorer change the view to Tree.

The above image shows Nautilus with the Tree View in the left pane, and the List View in the right pane.

You can add custom items to the right-click context menu in Gnome 2. First, open the Software Center and download and install the Nautilus Actions Configuration program.

After installing you can access it through System -> Preferences -> Nautilus-Actions Configuration.

It can be very convenient to add a context menu entry that opens the file in your favorite text editor, i.e. SciTe. Start the Nautilus-Actions Configuration tool and click the ‘Define a new action’ button in the top-left.

Set the label of the entry to Edit with SciTe, and configure an icon. Most icons are located in /usr/share/app-install/icons.

In the Command tab, configure the program or command  associated with this context-menu entry. The command-line parameters of this program also need to be specified. In this case the program is scite, and the command-line parameter is %f  (the full path to the file).

Finally, click the Save button (next to the ‘Add’ button) to apply the changes. Now when you right-click any file, you will see the option to open the file in SciTe:

The context menu icons are disabled by default in Ubuntu 11.04, so you might not see them. To enable them, you need to use gconf-editor.

$ gconf-editor

Now check the menus_have_icon box to enable the icons. This option is located at /desktop/gnome/interface/menus_have_icons.

By default Firefox does not know how to handle links to Windows shares, such as smb://dataserver.test.com/MyShare. You can configure Firefox to open these links in Nautilus.

Enter about:config in the Firefox location bar. Right-click to open the context-menu, and choose New -> Boolean. Add the two entries below.

network.protocol-handler.expose.smb = false
network.protocol-handler.external.smb = true

Now, enter an SMB link in the Firefox location bar, i.e. smb://dataserver.test.com/MyShare. A windows will pop up.

Click Choose…, then select the Nautilus binary at /usr/bin/nautilus. Check the box in front of ‘Remember my choice for smb links’. and click OK.

Now clicking an SMB link in Firefox will open up the share in a new Nautilus window! You can also manually type an SMB link in Nautilus using Ctrl + L or clicking the ‘magnifying glass’ icon.

In Places->Recent Documents it lists recent documents on Gnome 2. You can clear the recent documents, by clicking on “Clear Recent Documents”, just turn off the feature.

To disable the Recent Documents feature completely, first create a file by entering the following command in a terminal

$ sudo touch ~/.gtkrc-2.0

Then, open the file in GEdit

$ sudo gedit ~/.gtkrc-2.0

Add the line below, then save and close the file.

gtk-recent-files-max-ago=0&lt;/pre&gt;
&lt;pre lang=&quot;bash&quot;&gt;

Restart Gnome, and the Recent Documents won’t appear anymore.

By default, Gnome 2 has a panel at the top and the bottom of the screen. The elements in the panels, such as the clock, main menu, show desktop icon and notification area are called applets. You can right-click an applet and uncheck Lock To Panel to unlock an applet, then click Move to move it around. Use the Add To Panel option to add new applets to a panel, or drag items onto the panel to create a shortcut.

An example layout is shown below.

An example workspace layout of Gnome 2 for Ubuntu 11.04 Classic Mode.

This layout only uses a single panel, which helps save some screen space. The applet names are:

  1. Main Menu: The main GNOME menu.
  2. Application Launcher: Shortcuts to Firefox, Thunderbird, Nautilus, and Terminal. The globe icon is not actually an Application Launcher applet, but a Connect to Server… applet.
  3. Window List: Switch between open windows using buttons.
  4. Notification Area: Area where notification icons appear. In the image, the area only contains the Shutter icon.
  5. Indicator Applet: An applet with three icons: network status, sound volume and the envelope – for email and chat.
  6. Clock: Get the current time and date. Customizable.
  7. Show Desktop: Hide application windows and show the desktop.

The desktop icons were enabled using Ubuntu Tweak, and the background can be downloaded here.

Tips for Tweaking a New Ubuntu/Gnome2 Installation

Leave a Reply

Your email address will not be published. Required fields are marked *