Documentos de Académico
Documentos de Profesional
Documentos de Cultura
In this post I will share a modicum of what I have learned to date about customizing the new
GNOME 3 Shell. This is based on the GNOME Shell in Fedora 15 Alpha. The good news is that the
GNOME Shell is highly configurable. The bad news is that some of this information may become
out-of-date quite quickly as the GNOME Shell is still somewhat of a moving target even though it
is supposedly close to release.
ly
Here is what the GNOME Shell looks like in Fedora 15 Alpha with all updates applied as of March
23rd 2011:
on
se
a lu
o nn
rs
pe
r
By the way, that is a really beautiful wallpaper! I am glad that cooler heads prevailed and the
Fo
Fedora Project has finally decided to go with its own custom wallpaper rather than use the default
upstream GNOME Shell wallpaper.
ly
on
se
Here is what a GNOME terminal window looks like:
a lu
o nn
rs
pe
r
Fo
This is the default theme which, by the way, is called Adwaita. This post will show you how to
make the titlebar smaller so that it does not take up so much space on the screen, add back in the
minimize and maximize buttons, color the title bars, and more.
GNOME 3 contains some major changes with respect to persistent application settings data. The
GConf CORBA-based configuration system is no longer used; it has been replaced by GSettings.
GSettings is agnostic about its backend; dconf is merely one backend. Key names are restricted to
lowercase characters, numbers and dashes (-). Names must begin with a character, must be 32
characters or less in length, must not end with a dash and must not contain consecutive dashes.
GSettings stores its schemas in a binary format, unlike GConf which uses XML files.
Fedora 14 was the first Fedora release to include GSettings. See the glib-compile-schemas
manpage for further information.
A new command line utility gsettings, which replaces gconftool-2, is provided to enable you to
easily interface with GSettings.
$ gsettings
Usage:
gsettings COMMAND [ARGS...]
Commands:
help Show this information
list-schemas List installed schemas
ly
list-relocatable-schemas List relocatable schemas
list-keys List keys in a schema
on
list-children List children of a schema
list-recursively List keys and values, recursively
range Queries the range of a key
get Get the value of a key
set Set the value of a key
se
reset Reset the value of a key
writable Check if a key is writable
monitor Watch for changes lu
Use 'gsettings help COMMAND' to get detailed help.
$ gsettings list-schemas
org.gnome.nautilus.desktop
a
org.gnome.color-manager
org.gnome.gedit.plugins.filebrowser.nautilus
nn
org.gnome.settings-daemon.peripherals.wacom
org.gnome.Empathy.hints
org.gnome.settings-daemon.peripherals.touchpad
org.gnome.settings-daemon.plugins.keyboard
o
org.gnome.Nautilus.Sendto
org.gnome.FileRoller.Dialogs.BatchAdd
rs
org.freedesktop.Telepathy.Logger
org.gnome.yelp
....
pe
....
org.gnome.gcalctool
org.gnome.settings-daemon.peripherals.wacom.eraser
org.gnome.FileRoller.General
org.gnome.libgnomekbd.preview
r
org.gnome.gnome-system-log
Fo
org.gnome.libgnomekbd.keyboard
org.webkitgtk-1.0
org.gnome.gedit.state
org.gnome.system.proxy
org.gnome.gnome-system-monitor.disktreenew
org.gnome.eog.ui
org.gnome.gnome-screenshot
org.gnome.settings-daemon.plugins
org.gnome.gedit.preferences.encodings
org.gnome.Bluetooth.nst
org.gnome.desktop.lockdown
org.gnome.crypto.cache
org.gnome.settings-daemon.peripherals.wacom.stylus
org.gnome.DejaDup
org.gnome.eog.plugins
org.gnome.gnome-system-monitor.proctree
org.gnome.eog.fullscreen
org.gnome.settings-daemon.plugins.housekeeping
org.gnome.FileRoller.Dialogs.Add
org.gnome.desktop.thumbnailers
org.gnome.Empathy.sounds
org.gnome.desktop.a11y.keyboard
ly
favorite-apps
looking-glass-history
on
As an example, here is how to enable the digital clock on the top panel to show the date and
seconds:
se
$ gsettings list-keys org.gnome.shell.clock
show-date
show-seconds
lu
# note the failure if you are root!
# gsettings set org.gnome.shell.clock show-date true
**
a
GLib-GIO:ERROR:gdbusconnection.c:2279:initable_init: assertion failed: (connection->initia
lization_error == NULL)
nn
Here is how to list all the settings for the GNOME Shell:
pe
While the gsettings utility enables you to modify certain properties of the GNOME Shell, it does
not enable you to really customize the current theme. Generally you will have to directly edit the
theme configuration files.
However, if you do not wish to directly edit configuration files, you may be able to customize what
you want to do using the Configuration Editor which is available under Applications, System Tools.
ly
on
se
lu
Another method is to use dconf-editor which you may need to load on your system as it is not
a
installed by default. However, be warned, dconf and dconf-editor both seem to be highly unstable
as of the date of this post. Worse still, absolutely no documentation or manpages are currently
nn
Alternatively, you can customize a small subset of the GNOME Shell using the new Tweak Tool (
o
gnome-tweak-tool.)
rs
pe
r
Fo
Astute readers will notice that my version of gnome-tweak-tool is different than the default OOTB
This utility, like many others, does not show up in the Application Overview. You have to use the
Searchbar to access it.
Incidently, Tweak Tool can be used to add minimize and maximize buttons to windows. See the
above screenshot. Observe also the different theme and the dark colored titlebars. All will be
revealed! Just keep reading.
ly
As stated previously, the default GNOME Shell theme is Adwaita. You can modify this theme by
editing /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml. One of the more interesting
on
sections of this configuration file is:
se
4">
<distance name="left_width" value="1" />
<distance name="right_width" value="1" />
<distance name="bottom_height" value="2" />
lu
<distance name="left_titlebar_edge" value="0"/>
<distance name="right_titlebar_edge" value="0"/>
<distance name="title_vertical_pad" value="13"/>
a
<border name="title_border" left="10" right="10" top="1" bottom="1"/>
<border name="button_border" left="0" right="0" top="1" bottom="3"/>
nn
If you are already using the GNOME Shell, you probably have noticed that it is difficult to grab the
o
frame of a window to stretch it. This is because the frame is only 1 pixel wide at the sides and 2
rs
pixels in height on the bottom. To make windows easier to grab, I suggest you change each of
these values to 3, 3 and 5 respectively. If you want a less intrusive titlebar, I suggest you change
the value of title_vertical_pad to 8.
pe
The other sections of this file that you may wish to customize are the color constants:
....
<constant name="C_border_focused" value="#000064" />
<constant name="C_border_unfocused" value="#0052FF" />
ly
<constant name="C_border_attached_focused" value="#000064" />
<constant name="C_titlebar_focused_hilight" value="#000064" />
on
<constant name="C_titlebar_unfocused" value="#0052FF" />
....
<draw_ops name="titlebar_fill_focused_alt">
<gradient type="vertical" x="0" y="0" width="width" height="height">
<color value="#6B6EAC"/>
se
<color value="#000064"/>
</gradient>
</draw_ops>
....
<draw_ops name="titlebar_fill_unfocused">
lu
<gradient type="vertical" x="0" y="0" width="width" height="height">
<color value="#7096E3"/>
<color value="#0052FF"/>
a
</gradient>
</draw_ops>
nn
....
and reload the Shell, you will have colored window titlebars and frames:.
o
rs
pe
r
Fo
Currently, there is no built-in mechanism for changing GNOME Shell themes. I understand that
this functionality is planned for inclusion in a future version of the GNOME Shell. However, it is
quite easy to change the theme if you are careful. As an example, I will walk you though the steps
to use the GNOME Shell Dark Glass theme designed by the English digital artist Sean Wilson
together with the refFresh 11 wallpaper (background) by the artist Salman Arif.
$ ls
calendar-arrow-left.svg scroll-button-down.png
calendar-arrow-right.svg scroll-button-up-hover.png
calendar-today.svg scroll-button-up.png
close.svg section-more-open.svg
close-window.svg section-more.svg
corner-ripple.png separator-white.png
dash-placeholder.svg toggle-off-intl.svg
ly
filter-selected.svg toggle-off-us.svg
gnome-shell.css toggle-on-intl.svg
hover-indicator.svg toggle-on-us.svg
on
process-working.png ws-switch-arrow-down.svg
running-indicator.svg ws-switch-arrow-up.svg
scroll-button-down-hover.png
se
Download the theme and unzip it in a temporary directory. A subdirectory called theme will be
created and it will contain the above files. Back up the contents of the current GNOME Shell
theme directory /usr/share/gnome-shell/theme. Then copy the contents of the theme subdirectory
lu
to /usr/share/gnome-shell/theme.
Download the wallpaper (reFresh_II_by_salmanarif.rar) and unpack it. You may have to install the
a
rar utility! It does not ship with Fedora but is available from RPM Fusion and elsewhere. There are
a number of different wallpaper files in the archive:
nn
$ ls *.jpg
o
Each image is sized for a particular display geometry. Install the appropriate wallpaper file using
the background tool which is available in the GNOME Shell Settings panel.
For details of standard names and colors, see /usr/share/themes/Adwaita/gtk-3.0/gtk.css. You can
overwrite such names and colors using your own custom CSS file, i.e. ~/.config/gtk-3.0/gtk.css.
When you restart the GNOME Shell, you should see the following screen:
ly
on
se
lu
This is what your Applications Overview should look like:
a
o nn
rs
pe
r
Fo
ly
on
se
lu
This is actually a very nice theme and quite easy on the eyes. It has become my default theme for
now.
a
o nn
rs
pe
r
Fo
ly
on
se
lu
Turning now to the question of icon customization. To configure the layout of the application icons
in the GNOME Shell, you have to modify /usr/share/gnome-shell/theme/gnome-shell.css. Note that
the contents of this file may vary as it is dependent on the particular theme that you are using. In
a
the case of the Dark Glass theme, here are the modifications necessary to reduce the size and
layout of the displayed icons by 50% in Applications Overview.
nn
.icon-grid {
o
}
.all-app .icon-grid {
-shell-grid-item-size: 59px; /* was 118px */
pe
}.
all-app .overview-icon {
icon-size: 48px; /* was 96px */
}
r
Fo
Here is what Applications Overview looks like when the GNOME Shell is restarted.
ly
on
se
By the way, with this theme, running applications are indicated by a light pane around them
lu
instead a glow behind the application name. I will leave it as an exercise for you to reduce the size
of the displayed application name.
a
What if I want the GNOME Shell to display a different icon for the GNOME Tweak Tool? There are
two places you need to modify. The first is /usr/share/applications/gnome-tweak-tool.desktop:
nn
[Desktop Entry]
o
Exec=gnome-tweak-tool
Terminal=false
Type=Application
pe
StartupNotify=true
Categories=GNOME;GTK;Settings;
OnlyShowIn=GNOME;
r
I am going to change the Icon key-value pair to preferences-desktop-personal. You can see the
available icons if you look in /usr/share/icons. Which icon file is actually selected depends on the
Fo
current icon theme and the icon lookup mechanism. Icon lookup is first done in the current theme,
then recursively in each of the current theme’s parents and finally in the hicolor default theme. As
soon as an icon of any size is matched, the search stops. See the Icon Theme specification for
further information.
# desktop-file-validate /usr/share/applications/gnome-tweak-tool.desktop
Categories=GNOME;GTK;Settings;
to
Categories=GNOME;GTK;Utilities;
You can also add your own icon for an application to one of the icon themes under /usr/share/icons.
ly
If you do this, you need to update the icon cache using gtk-update-icon-cache before the icon is
available for use. Here is a simple shell script which updates all the icon caches for you.
on
#!/bin/bash
find /usr/share/icons -maxdepth 1 -type d | \
se
while read -r THEME; do
if [[ -f "$THEME/index.theme" ]]; then
echo "Updating $THEME cache"
gtk-update-icon-cache -f -q "$THEME"
fi
lu
done
a
Suppose you want to remove the Available and Busy menu options from the user menu (the menu
nn
under your name.) Just edit /usr/share/gnome-shell/js/ui/statusMenu.js and comment out the
following lines in _createSubMenu:
o
this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item;
item = new PopupMenu.PopupSeparatorMenuItem();
Fo
this.menu.addMenuItem(item);
Turning to the issue of customizing fonts. The default font for GNOME 3 is Cantarell, a new
contemporary sans serif open font specially commissioned by GNOME. The current version of
Cantarell does not cover all the supported languages in GNOME. This means that, depending on
your particular locale settings, you may fallback to another font.
You can use Fontik to tweak and configure some font properties. Other ways of tweating fonts
include dconf-editor and gsettings. The GNOME Tweak Tool also enables you to easily change
some font settings.
Finally, you can no longer customize the screensaver in GNOME 3. When your screen is locked all
you get is a black screen with the clock, a lock symbol and your name at the top of the screen.
There are plans to remove gnome-screensaver in GNOME 3.2 and putting its functionality partially
in the GNOME Shell and the remainder in gnome-session or gnome-settings-daemon. It may then
be possible to write a themed Clutter-based screensaver extension for GNOME Shell.
Well, it is time to wrap up this post. Obviously there is a lot more to the subject of customizing the
new GNOME Shell but I have tried to cover the basics. Unfortunately, at present, there is a dearth
of good accurate information on the underpinnings of the GNOME Shell out there on the Internet
ly
so I cannot point you to any reference material on the subject. Hopefully the GNOME developers
will provide complete documentation in the future.
on
se
a lu
o nn
rs
pe
r
Fo