GNOME tips

From ArchWiki
Revision as of 11:06, 9 May 2010 by PIMPinator (Talk | contribs) (FAM)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Configuration Tips

Add/Edit GDM Sessions

Each session is a *.desktop file located at /usr/share/xsessions.

To add a new session:

1. Copy an existing *.desktop file to use as a template for a new session:

$ cd /usr/share/xsessions
$ sudo cp gnome.desktop other.desktop

2. Modify the template *.desktop file to open the required window manager:

$ sudo nano other.desktop

Alternatively, you can open the new session in KDM which will create the *.desktop file. Then return to using GDM and the new session will be available.

Tweaking

If your gnome applications seem sluggish and gnome hangs at start-up after killing the previous session, it's likely you haven't set your /etc/hosts file correctly and your /etc/hosts file includes:

127.0.0.1       localhost.localdomain     localhost      YOURHOSTNAME

Then run "/bin/hostname YOURHOSTNAME" and "/sbin/ifconfig lo up" as root.

See also [1]


Slow Performance

Due to an improper coded GNOME drawing library, some actions in GNOME can slow the system. If the theme icons are in SVG format, they make the system slower. A very fast improvement is to either use icons in PNG format or to convert the used icons into the PNG format.

Default applications

You may want to configure system-wide default applications and file associations. This is extremely useful when you have some KDE applications installed, but still prefer a GNOME ones to be launched by default.

To do that you can install gnome-defaults-list from AUR. It will place your configuration file at /etc/gnome/defaults.list.

If you want to do everything manually, create /usr/share/applications/defaults.list with the following format:

[Default Applications]
application/pdf=evince.desktop
image/jpeg=eog.desktop
...

Better Video Performance

Some users report that, if they move the player window while playing a video file, a blue border appears around the video while it is moving. If you experience this, go to Desktop->Preferences->Multimedia Systems Selector, and under video change the "Default Sink" to "XWindows (No Xv)". When you click test, the blue border should be gone and on the whole, video should perform better.

Note: This no longer applies to Gnome 2.20 and later (Evanlec)

Fonts Seem Skewed

You can alter the DPI of your fonts in Gnome with Right-click on the desktop>change desktop background>fonts>details>Resolution

Resolution: [96] dots per inch

On my x86_64 system, the default was set to 89 dots per inch for some reason. I upped it to 96 and everything looks 'normal' again.

Change the Default Background Image

The default background is that zoomed in picture of a green leaf. It appears for newly created users, but more importantly, this is the image shown when the screen is locked. As of 25-Apr-2009, you can find this image here

/usr/share/pixmaps/backgrounds/gnome/background-default.jpg

To change it, simply copy your favorite image to this location (as root) and rename it.

Make Shell Windows Open to a A Larger Size

Once you add a launcher for your gnome-terminal, you can modify it such that the terminal is larger than the standard. Right-click the launcher>properties. Now under the "Command" section, add the following

Command: gnome-terminal --geometry 105x25+100+20

Misc Tips

Screen Lock

  1. Make sure that dbus is running (probably a good idea to add it to the daemons array in rc.conf).
  2. Install xscreensaver
    # pacman -S xscreensaver
  3. Go to Desktop -> Preferences -> Screensaver
  4. Enable one or more screensavers
  5. Lock Screen will now start your screensaver and require your password to stop it.

or you can install gnome-screensaver:

# pacman -S gnome-screensaver

Also you can find here how to replace gnome-screensaver with xscreensaver.

Unlock Gnome-keyring on Login

In /etc/pam.d/gdm, add lines like this at the end:

auth            optional        pam_gnome_keyring.so
session         optional        pam_gnome_keyring.so  auto_start

In /etc/pam.d/gnome-screensaver, add a line like this:

auth        optional     pam_gnome_keyring.so

In /etc/pam.d/passwd, add a line like this:

password        optional        pam_gnome_keyring.so

http://live.gnome.org/GnomeKeyring/Pam


Easier way: Install SEAHORSE with "pacman -S seahorse". Now you find under "Applications-> Accessories-> Password and Encryption Settings" a nice GUI where you can set for the keyring "Automatically unlocked when user logs in".

Nautilus Tips

Get a certain path in spatial view? Just press:

Control + L

Change Browser Mode (Spatial View)

  1. Start gconf-editor
  2. Browse to apps/nautilus/preferences
  3. Change the value of "always_use_browser" (it's a yes/no value and should be visible as a checkbox or say "false", for the later change the value to "true")

Or you can do this through the preferences:

  1. In a Nautilus window go to Edit>>Preferences
  2. Change to the Behaviour tab
  3. Check (or uncheck) Always Open in Browser Windows

Music Information Columns in List View (bitrate etc.)

Nautilus lacks the abillity to display metadata for music files in list view mode. A Python script was written to add columns for:

  • Artist
  • Album
  • Track Title
  • Bitrate

First, install the requirements.

sudo pacman -S mutagen

And, from AUR, [python-nautilus]

wget http://aur.archlinux.org/packages/python-nautilus/python-nautilus.tar.gz
tar -zxvf python-nautilus.tar.gz
cd python-nautilus
makepkg
sudo pacman -U *.pkg.tar.gz

Now, create a directory called python-extensions in ~/.nautilus. Place the following script, named bsc.py, in this newly created folder. You may download the script here: [bsc.py] (please drop --stefanwilkens a line if this goes down)
Mirror: [bsc.py]

Restart nautilus. You can now configure this new functionallity in Edit -> Preferences -> List Columns

Stop Nautilus drawing the desktop

You need to open the gconf-editor:

apps>nautilus>preferences untick "show_desktop"

In breezy you also need to go to:

desktop>gnome>background and untick "draw_background"

Speed Up Panel Autohide

If you find that your panels are taking too long to appear/disappear when using the Panel Autohide feature, try this;

  1. Start gconf-editor
  2. Browse to /apps/panel/global
  3. Set panel_hide_delay and panel_show_delay to more sensible (integer) values. Note that these values represent milliseconds!

GNOME Menu Tips

Speed Tweak

You can remove the delay in GNOME menus by running this command:

echo "gtk-menu-popup-delay = 0" >> ~/.gtkrc-2.0

Or just add "gtk-menu-popup-delay = 0" to .gtkrc-2.0

However, this setting is reported to crash banshee, and possibly other programs.

Menu Editing

Most Gnome users complain about the menu. Changing menu entries system-wide or for one or several users alone is poorly documented.

User menus

Recent versions of Gnome (ie, v2.22) have a menu editor in which you can de-select menu entires, but not add new menu entries. Right-click on the menu panel and select Edit Menus. Unchecking the box next to a entry will prevent it from displaying.

To add new menu entries, create a .desktop file in the $XDG_DATA_HOME/applications directory (most likely $HOME/.local/share). A sample .desktop file can be seen below, or take a look at Gnome documentation.

Or install Alacarte, which makes it easy to create, change and remove menu entries with a GUI. Do this with:

# pacman -S alacarte
Group menus, System menus

You will find common gnome menu entries as 'appname.desktop' objects inside one of the $XDG_DATA_DIRS/applications directories (most likely /usr/share/applications). To add new menu items for all users, create an 'appname.desktop' file in one of those directories.

  • Edit one of them to fit your needs for a new application, then save it.
  • Save it as a menu entry for all users
    Most often, you will set this files permissions to 644 (root: rw group: r others: r), so all users can see it.
  • Save it as a menu entry for a group or user alone
    You may also have different user permissions; for example, some menu entries should only be available for a group or for one user.

Here is an example how a Scite menu entry definition file could look:

[Desktop Entry]
Encoding=UTF-8
Name=SciTE
Comment=SciTE editor
Type=Application
Exec=/usr/bin/scite
Icon=/usr/share/pixmaps/scite_48x48.png
Terminal=false
Categories=GNOME;Application;Development;
StartupNotify=true

Change the Gnome Foot Icon to an Arch Icon

Note: Thanks to arkham who posted this method in [this forum post] which I have typed up here.
  • Download [this Arch icon] (filename is Template:Filename)
  • Alternatively get the artwork package using "pacman -S archlinux-artwork", this puts all artwork in the /usr/share/archlinux directory, and resize your desired logo to 24x24px
  • Figure out which icon set you're using (right-click desktop>Change Background Image>Theme>Customize>Icon). For example, Crux, *GNOME, High Contrast, High Contrast Inverse, Mist, etc.)
  • Now make a backup of your current gnome icon in the correct directory. In the example below, I'm using the GNOME icons but adjust the directory structure accordingly for your icon set:
# mv /usr/share/icons/gnome/24x24/places/start-here.png /usr/share/icons/gnome/24x24/places/start-here.png-virgin
  • Copy Template:Filename you just downloaded to the same directory renaming it start-here.png
# cp /path/to/starthere.png /usr/share/icons/gnome/24x24/places/start-here.png
  • Restart your gnome-panels and the new Arch logo should be displayed
$ pkill gnome-panel

Note: To get this to work (gnome 2.28) I had to delete the icon-theme.cache file in /usr/share/icons/gnome

Change the Gnome Foot Icon to an Arch Icon (without root access)

  • Figure out which icon set you're using (right-click desktop>Change Background Image>Theme>Customize>Icon). For example, Crux, *GNOME, High Contrast, High Contrast Inverse, Mist, etc.)
  • Duplicate that icon set's directory structure for 24x24/places in your home directory under .icons
$ mkdir -p ~/.icons/gnome/24x24/places
$ wget -O ~/.icons/gnome/24x24/places/start-here.png http://img23.imageshack.us/img23/9679/starthere.png
  • Alternatively get the artwork package using "pacman -S archlinux-artwork", this puts all artwork in the /usr/share/archlinux directory, and resize your desired logo to 24x24px and copy it into that directory as 'start-here.png'
  • Restart your gnome-panels and the new Arch logo should be displayed
$ pkill gnome-panel

Note: To get this to work (gnome 2.28) I had to delete the icon-theme.cache file in /usr/share/icons/gnome

Custom Icon using gconf-editor

  1. Open the configuration editor in gnome (it should be in System Tools of your main menu) or run gconf-editor
  2. In the configuration editor go to apps > panel > objects > find the object for your menu (an easy way to spot the correct object is that it will have "Main Menu" in the tool tip section).
  3. Set the path to your icon in the "Custom_Icon" field.
  4. Check "Use_Custom_Icon" a little ways down.
  5. The panel should reload momemtarily, if not, open a terminal window and type:
$ killall gnome-panel

Removing default icons from desktop

I like to keep my desktop clean, and perhaps someone else too. So here is how to remove home folder, computer and trash from desktop:

  1. Open terminal
  2. On terminal type: gconf-editor
  3. Configuration Editor opens. From there navigate to: apps --> nautilus --> desktop
  4. Untick all the icons you dont want to see
  5. You are done, the icons should dissappear immeadiately

Disabling scroll in taskbar

For years there is "bug" in Gnome taskbar: the mouse scroll switches the windows. The annoying feature if you have a good mice turns to be a real pain if you have the touchpad. It is impossible to scroll precisely using touchpad, so if you accidentally touch it when your mouse is on the taskbar, then all the windows will flash/switch wildly. There is no setting in gconf/preferences, that can disable this functionality. This is true for KDE 3, I don't know if problem persist in KDE 4. The solution was to install xfce4-panel, which hasn't scrolling at all and looks like default gnome panel. The bug is better described here [2].

This bug will be probably never fixed, but we have ABS, so we can build custom software. Install ABS (+70Mb), then

cp -r /var/abs/extra/libwnck /home/{your name}/Desktop/somewhere

Navigate to that dir, then

makepkg --nobuild

This will download and extract the sources. Go to src/libwnck-{version}/libwnck. Edit tasklist.c, search for "scroll-event". You will see somethign like

g_signal_connect(obj, "scroll-event", G_CALLBACK(wnck_tasklist_scroll_cb), NULL);

This line enables scroll-event handler, comment the line out (place /* before and */ after the line). Now go back to /home/{username}/Desktop/somewhere and

makepkg --noextract --syncdeps

You will need sudo to be able to install missing dependencies (intltool), but you can always 'pacman -S' them apart if you don't want --syncdeps automatically. The --noextract option tells makepkg to not extract sources and use existing src/

pacman -U libwnck-{version}.pkg.tar.gz

Then logout/login, enjoy. Delete dir with the sources from you desktop, you may also uninstall abs if you want. Next step will be to add gconf option, but I will leave this for Gnome gurus. I just don't need this "feature", not even if I use the mouse (alt+tab is better anyway).

Custom transitioning background

This will create a transitioning background similiar to the "cosmos" background found in the gnome-backgrounds package. There are two ways to do this.

Note: The image filenames must not have spaces in them.

Manual

You can create an XML file similiar to the one created by gnome-backgrounds in "/usr/share/backgrounds/cosmos/".

<background>
  <starttime>
    <hour>00</hour>
    <minute>00</minute>
    <second>01</second>
  </starttime>
<!-- The first section set an arbitrary start time. -->
  <static>
    <duration>1795.0</duration>
    <file>/path/to/background1.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/path/to/background1.jpg</from>
    <to>/path/to/background2.jpg</to>
  </transition>
  <static>
    <duration>1795.0</duration>
    <file>/path/to/background2.jpg</file>
  </static>
  <transition>
    <duration>5.0</duration>
    <from>/path/to/background2.jpg</from>
    <to>/path/to/background1.jpg</to>
  </transition>
</background>

Note that the <duration> tag sets each image as the background for 1795 seconds, or 29 minutes and 55 seconds, and the <transition> then takes 5 seconds. You can add any number of images as long as the last one transitions back to the first (if you want a full loop). Once completed, the XML file can be added to GNOME under System > Preferences > Appearance > Background tab > Add.

Automatic

There is also a script which automates this process:

#!/bin/sh
#This script creates xml files that can act as dynamic wallpapers for Gnome by referring to multiple wallpapers
#Coded by David J Krajnik

if [ "$*" = "" ]; then
  echo "This script creates xml files that can act as dynamic backgrounds for Gnome by referring to multiple wallpapers";
  echo "Usage: mkwlppr target-file.xml [duration] pic1 pic2 [pic3 .. picN]";
else
  files=$*;
  #Grab the name of the target xml file
  xmlfile=`echo $files | cut -d " " -f 1`;
  #remove the first item from $files
  files=`echo $files | sed 's/^\<[^ ]*\>//'`;
  if [ "`echo $xmlfile | grep '\.xml$'`" = "" ]; then
    echo "Your target file must be an XML file";
  else
    inputIsValid="true";
    firstItem=`echo $files | cut -d " " -f 1`;
    duration="1795.0";#set the default duration
    if [ "`echo $firstItem | grep '^[0-9]\+\.[0-9]\+$'`" != "" ]; then
      echo "The duration must be an integer";
      files=`echo $files | sed 's/^\<[^ ]*\>//'`;
      inputIsValid="";
    elif [ "`echo $firstItem | grep '^[0-9]\+$'`" != "" ]; then
      #If the item is a number, then use it as the duration for each wallpaper image
      duration="`expr $firstItem - 5`.0";
      #remove the duration from the list of files
      files=`echo $files | sed 's/^\<[^ ]*\>//'`;
    fi
    if [ "$files" = "" ]; then
      echo "You must enter image files to associate with the XML file";
    else
      for file in $files
      do
        if [ ! -f $file ]; then
	  echo "\"$file\" does not exist";
	  inputIsValid="";
        elif [ "`echo $file | sed 's/^.*\.\(jpg\|jpeg\|bmp\|png\|gif\|tif\|tiff\|jif\|jfif\|jp2\|jpx\|j2k\|j2c\)$//'`" != "" ]; then
	  echo "\"$file\" is not an image file";
	  inputIsValid="";
	fi
      done
      if [ $inputIsValid ]; then
        currDir=`pwd`;
        echo "<background>" >> $xmlfile
        echo "  <starttime>\n    <year>2009</year>\n    <month>08</month>\n    <day>04</day>" >> $xmlfile;
        echo "    <hour>00</hour>\n    <minute>00</minute>\n    <second>00</second>\n  </starttime>" >> $xmlfile;
        echo "  <!-- This animation will start at midnight. -->" >> $xmlfile;
        firstFile=`echo $files | cut -d " " -f 1`;#grab the first item
        if [ "`echo $firstFile | sed 's/\(.\).*/\1/'`" != "/" ]; then
          #If the first character in the filename is not '/', then it is a relative path and must have the current directory's path appended
          firstFile="$currDir/$firstFile";
        fi
        firstFile=`echo $firstFile | sed 's/[^/]\+\/\.\.\/\?//g'`;#Remove occurrences of ".." from the filepath
        files=`echo $files | sed 's/^\<[^ ]*\>//'`;#remove the first item
        prevFile=$firstFile;
        currFile="";
        #TODO add absolute path to the filenames
        #if $currFile =~ "^/.*" then the file needs to path appended
        echo "  <static>\n    <duration>$duration</duration>\n    <file>$firstFile</file>\n  </static>" >> $xmlfile;
        for currFile in $files
        do
          if [ "`echo $currFile | sed 's/\(.\).*/\1/'`" != "/" ]; then
            #If the first character in the filename is not '/', then it is a relative path and must have the current directory's path appended
            currFile="$currDir/$currFile";
          fi
          currFile=`echo $currFile | sed 's/[^/]\+\/\.\.\/\?//g'`;#Remove occurrences of ".." from the filepath
          echo "  <transition>\n    <duration>5.0</duration>\n    <from>$prevFile</from>\n    <to>$currFile</to>\n  </transition>" >> $xmlfile;
          echo "  <static>\n    <duration>$duration</duration>\n    <file>$currFile</file>\n  </static>" >> $xmlfile;
          prevFile=$currFile;
        done
        echo "  <transition>\n    <duration>5.0</duration>\n    <from>$currFile</from>\n    <to>$firstFile</to>\n  </transition>" >> $xmlfile;
        echo "</background>" >> $xmlfile;
      fi
    fi
  fi
fi

Copy the code for the script above into a file called mkwlppr (short for "make wallpaper"). Make the script executable by typing:

sudo chmod 711 mkwlppr

Move the file so that you can run it from any directory by just using its name:

sudo mv mkwlppr /bin

Execute the script; it will tell you what input it requires from you. Use the script with input to create as many wallpaper XML files as you want.

Notes: Since this script is not interactive, you can use Unix's wildcards with it if you want to use all files in a directory and/or if you do not care about the order of the images. You can specify paths relative to your current directory, and the script will put the files' absolute paths into the XML file for you; so you can create the XML file anywhere you want and move it afterward without rendering it useless. If you want to run the script inside the /usr/share/backgrounds/ directory, you might have problems with permissions unless you run the command with sudo like this: sudo mkwlppr -parameters If you do not know what duration to specify for the images, simply do not provide a number in the input, and the progam will use the default values of 29 minutes and 55 seconds per image and a 5 second transition. For more information, please see this page.

Useful Add-ons

FAM

FAM allows gnome to do useful things such as automatically update the menu when new applications are installed, and refresh nautilus when a directory it is viewing is changed.

See the FAM Wiki for instructions on how to install it.

Gnome System Monitor

This application appears when the "System Monitor" applet is clicked, and displays the processor/memory usage of all running applications. It is not installed by default in the GNOME group, so you need to install it separately using:

# pacman -S gnome-system-monitor

Burning CDs from Nautilus

# pacman -S nautilus-cd-burner

Gnome System Tools

This adds several Gnome menu items under System->Administration, specifically user management, date and time, network configuration, runlevels, and shared folders through samba or NFS. See Gnome documentation.

# pacman -S gnome-system-tools

Pay attention to the post-install message from pacman.

Gdesklets: Desktop Candy

Put a clock, calendar, weather report, and more onto your desktop

# pacman -S gdesklets

You can find more desklets at gdesklets.org. To install them, download the files. Next, in the Gnome menu, open Applications->Accessories->gDesklets. When the gDesklets Shell appears, drag the new gdesklet file onto the shell. If you want gdesklets to load when you log in, click on the Gnome menu under System->Preferences->Sessions. Choose "Startup Programs", click "add", and type in the data. The command should be /usr/bin/gdesklets. You can always find such a path by typing "whereis gdesklets".

Other Applications

These are some other nice applications and utilities for gnome, most of which can be downloaded all at once with:

# pacman -S gnome-extra

This is a group, so it is quite easy to choose not to download some of the packages, such as the documentation.

gnome-terminal

Install this application before logging into gnome for the first time unless you prefer to use xterm.

Drop Down Consoles

Gnome has a few dropdown consoles inspired by the ones found in FPS's such as Quake and Half-life (ie pressing the ~ key) These follow Yakuake from KDE, below are a few ones native to Gnome.

Guake

Guake requires Python, it can be installed via the following command. F12 is the default to toggle the terminal. Guake features mutiple tabs and by default Ctrl+PgUp and Ctrl+PgDown can be used to switch between these terminals.

# pacman -S guake

You can set transparency and other settings by first toggling to the terminal via F12, right clicking and selecting Preferences.

Guake can be started automatically by adding the following to Gnome Sessions via System -> Preferences -> Sessions. Select Add, and these settings can be used:

  • Name: Guake
  • Command: guake &
  • Comment: Guake Dropdown Terminal.
Tilda

Tilda is another dropdown terminal for Gnome. Kindly add to this section if possible.

# pacman -S tilda

Tilda has fewer dependencies than Guake (no Python), and about the same features; however, it gives the user more control over the appearance of the terminal window.

gedit

A text editor with syntax highlighting.

eog

Eye-of-Gnome, a handy, fast little image viewer which can re-size and rotate photos.

file-roller

An archive manager which supports many different formats. (Install unrar, unzip, ... to get the respective formats)

gcalctool

A calculator, what else?

rhythmbox

An iTunes like audio library and player.

sound-juicer

CD Ripper, integrates with rhythmbox.

To enable default mp3 profiles in preferences menu:

# pacman -S gstreamer0.10-lame gstreamer0.10-taglib

Note: This should not be necessary anymore, since these packages now are included in gstreamer0.10-ugly-plugins and gstreamer0.10-good-plugins.

If you're having other problems with SoundJuicer, click here

totem

A video player which uses gstreamer for decoding its input.

gimp

An open-source Photoshop alternative for linux. A must-have if you ever do anything with graphics.

gftp

An nice little FTP client for gnome.

abiword

A small, fast, .doc compatible word processor.

gnumeric

A very nice, excel like spreadsheet editor.

Leave message feature in gnome screensaver

This is a cool feature provided by gnome-screensaver 2.20, somebody can leave a message for you when you are not at your desk. Please install notification-daemon to make this work.

DevilsPie

A useful application that can be run as a daemon within gnome. It manipulates windows allowing you to start programs on a desired desktop or in a size of your choice among many other things. DevilsPie brings a whole new level of control into the metacity engine. There's a good HOWTO on their homepage,

See also