Thursday 12 April 2012

Reduce horizontal spacing between icons in GNOME 3.2

One thing that annoys me about the default GNOME shell is the amount of horizontal space it wastes in between icons/indicators in the status area (top right on the panel).

Urgh look how much space is between all the icons!

I wrote a very simple GNOME shell extension to fix this. (My first ever! More an exercise in how to do it than anything else).

It's available for one-click install from extensions.gnome.org. The repository (for anyone interested in the code) is here.

If for some reason you don't want to/can't install from extensions.gnome.org, you can go to the 'Downloads' page and download the .zip file. Then start gnome-tweak-tool, select "Shell Extensions", "Install Shell Extensions", and choose the .zip file. Restart the gnome-shell, enable the extension, and you're all done!

The result?

Nice and slim

Voila! Enjoy :)

What it Does

It basically just modifies these lines from the file /usr/share/gnome-shell/theme/gnome-shell.css:

.panel-button {
    -natural-hpadding: 12px;
    -minimum-hpadding: 6px;
    /* ... and so on */
}

The attribute -natural-hpadding is set by default to 12 pixels wide. My extension sets this to 6 pixels wide (you can modify this if you want; just change the relevant lines in stylesheet.css that comes with the extensions).

If you set -naturial-hpadding below 6 pixels you will have to adjust -minimum-hpadding to match it too.

Shell Extensions in Gnome 3.2/Fedora 16

I just upgraded my work computer from Fedora 15 to Fedora 16, which uses Gnome 3.2. This is my first real experience with the GNOME shell in Fedora, because I got rid of it straight away (fallback mode) in F15 since I couldn't stand it so haven't used it since.

Anyhow, I thought I'd give it a shot this time as the GNOME team have apparently been doing good things with the newer versions of GNOME shell.

My first impression - danger Will Robinson! Switch back to fallback mode!

  • poor support for dual monitor which I use at work: top panel is only on one screen
  • to get to the Overview to switch/view windows I have to hover over the top left corner of the left-most screen, rather than just clicking a window from the top panel
  • the clock is in the middle of my top panel, meaning I wouldn't be able to see my current window title, except that
  • the window title of the current window I'm in doesn't show in the top panel. Just the application name.

I was just about to switch to fallback mode again, when I discovered GNOME shell extensions. These are little plugins (think of them like browser plugins) that add functionality to the GNOME shell interface.

Below I'll summarise some of the shell extensions that I found at the GNOME shell extensions website that rectified my problems. You generally install them from that website, and then use gnome-tweak-tool (or "Advanced Settings" in Fedora) to toggle them on and off.

You'll need to log out and in again or restart the shell (Alt+F2, type 'r' for restart, press Enter) to have them take effect.

Top Panel

Frippery Move Clock moves the clock to the left

Frippery Move Clock This moves the clock from the centre of the panel to the left of the status menu button (over the right of the screen). This frees up space for extensions that show icons for open windows, etc. Essential.

Extend Left Box This allows extensions using the top panel (e.g. window list extensions) to use the whole of the top panel instead of just the left half. Essential.

Status Title Bar This shows the entire title (e.g. "Blogger: Mathematical Coffee - Edit post - Google chrome") of your current window in the top panel, rather than just the application name ("Chrome"). Whether to use this or not depends on your top panel real-estate.< /p>

Status Title Bar with Extend Left Box show the full window title

Notification Icons

The following extensions affect the notification icons up the top-right of the screen (accessibility, volume, ...) and the messaging tray at the bottom of the screen.

Evil Status Icon Forever There are many extensions that hide icons (e.g. accessibility) or move icons from the messaging tray to the notification bar (dropbox, ...), but this one seems to cover the functionality of all of them. This allows you to set which notification icons to move from the messaging tray to the top panel (I added dropbox and guake up there) and which to hide (the accessibility icon). For instructions see here.

Evil Status Icon Forever lets me put dropbox & other icons up the top;
notice also the workspace indicator.
Places menu

Places Status Indicator adds a folder to the notification tray that, when clicked, shows a list of folders to open in nautilus.

If you want to remove an individual icon (accessibility, bluetooth, volume, ..) from the notification bar, use Evil Status Icon Forever. If for some reason you don't want to do that, you can install the volume icon remover, bluetooth icon remover, or gnome-shell-extension-remove-accessibility-icon from the fedora repositories.

Workspace indicator adds a little drop-down menu from the notification area letting you switch between workspaces (The '1' in the box in the above picture). Since I added this functionality on my docklet (later in this post), I didn't need this any more).

Status Icon

The "Status Icon" is the menu at the top-right of your panel with a speech bubble next to your user name. The speech bubble is your chat availability - you can control it from there. The menu also contains the "System Settings", "Log out", etc options.
Chat, Hibernate, Power Off options;
No name on the button

Alternative Status Menu By default the status menu only gives a "Suspend" option for closing your computer, and you have to hold down Alt to see "Hibernate" or "Power Off". This extension adds the "Hibernate" and "Power Off" buttons permanently to the menu. Very useful (for me anyway), because I want to power off my computer much more often than suspend it.

Status Only icon removes your username from next to the speech bubble, leaving just the speech bubble. I know my name already so there's no use having it there taking up space!

Empathy Menu You can set your availability for chat with the status menu, but you can't actually start a chat from it. What a pain! This extension adds an option "Chat" to the menu that launches empathy (there are similar ones for Pidgin and Gwibber). I still think I'd like to be able to click on a contact's name from that menu though, like Unity.

Notifications Alert this paints the speech bubble on the status menu red when you have a new notification (e.g. IM messages).

Window list

My biggest gripe is not having a one-click window list. I just want something like the good old gnome-panel. There are a number of extensions providing this functionality. These all work best with Frippery Move Clock extension and the Extend Left extension.

Dock this puts a permanent dock on the left or right side of the screen, the same dock that appears in the overview. You can configure it to autohide or not, and which side of the screen to put it on (not top and bottom though, and doesn't support one per monitor). Quite slick, although not very customisable.

Window List does what it says on the can. Adds window buttons (icon and text) to the top panel. Like the Windows XP task bar.

Window list

Window Icon List Adds icons for open windows to the top panel, like Windows 7.

Panel Docklet S I've saved the best til last! This is the extension I ended up going with - sleek, infinitely customisable. It lets me create either a panel or docklet (my chose) on any side of the screen I like. I can show one icon per group of icons (text too if I want), or one icon per application, and best of all, I can put one docklet per monitor, and I'll only get icons for applications on that monitor! I can also add a workspace switcher (depreciating the need for a separate workspace switcher app), add a button to go to the desktop, add my 'favourites' (on the side dock) as icon shortcuts, and much, much more. I strongly recommend this. The only downfall is that I find that the panel on the second monitor sometimes shows icons of applications even though they've already been closed, and if I right click on them gnome-shell crashes :(.

Panel Docklet S in 'docklet' mode
Panel Docklet S in 'panel-docklet' mode over my top panel

Other

User Themes: this allows you to install custom skins for the GNOME shell and switch between them from gnome-tweak-tool.

Lame Extensions Manager while you're playing around with all the shiny extensions on extensions.gnome.org, this provides a button in the status bar allowing you to toggle them on and off quickly.\

Summary

In the end, I managed to fix most my gripes - removed notification icons I don't use, moved the clock to the left, removed the name from the status bar, and these freed up a lot of space in the top panel.

With that free space I dumped a Panel Docklet S there (in the 'docklet panel' mode) which allows me to quickly see what windows I have open on a particular monitor and go to them (as well as letting me switch between workspaces), and changed the title bar to show the full name of the current window rather than the application name.

All in all, that covers most the gripes I started with! The fact that I can make one docklet per monitor soothes the gnome-shell dual-monitor pain, and the docklet really lets me do most things I wanted (workspace and window switching, shortcuts).