CarmaBlog

Agility, Java programming, New technologies and more…
  • rss
  • Home
  • Management
  • Agile Programming
  • Technology
  • Linux
  • Event
  • Contact
  • About the author
  • English
  • Francais

Customizing Gnome 3 (Shell)

Fabian Piau | Thursday March 15th, 2012 - 01:01 AM
8,211 views
  • Twitter
  • Facebook
  • Google +1
  • LinkedIn

Update
February 22, 2013 : Post updated with information from Major Grubert on Ubuntu-fr forum to be compatible with Gnome 3.6.

I’ve been using Ubuntu for several years now, and like many users, I switched from Gnome 2 to Ubuntu Unity as display manager. I found lots of good ideas in Unity (very suitable for netbooks in particular), but it didn’t really convince me and I finally regretted my old Gnome 2 desktop.

After several months of using Unity, I decided to test Gnome 3, released Mid-Year of 2011.

Gnome Logo

After installing Gnome 3 and its Shell interface, I was pleasantly surprised to see that Gnome developers have taken a lot of good ideas from Unity, unless it’s in reverse… Even better, I find it more responsive and ergonomic. Only one drawback, user interface design is a bit poor especially compared to Unity.

Gnome Shell requires a little customization to be perfect. What you see below is what you can get in less than one hour !

Screenshot 1

After customizing

The following assumes you have already installed Gnome Shell.

  1. Then, install Gnome Tweak Tool, needed to customize Gnome 3 (show buttons in the toolbar, change theme, etc.).
    sudo apt-get install gnome-tweak-tool
  2. Add the user-theme extension (it unlocks an option in Gnome Tweak Tool to change the theme of Gnome Shell).
  3. Add the WebUpd8 PPA and install the Zukitwo theme. This is a direct download, but it will always be the latest version.
    sudo add-apt-repository ppa:webupd8team/themes
    sudo apt-get update
    sudo apt-get install zukitwo-dark-gtk-theme
  4. Install the Faenza icon theme.
    sudo add-apt-repository ppa:tiheum/equinox
    sudo apt-get update
    sudo apt-get install faenza-icon-theme
  5. Launch Gnome Tweak Tool and configure it as follows:
    Theme configuration

    Theme configuration

    The top bar in Zukitwo theme is transparent making a second menu shows up behind the top bar. If this is your case too, you can fix this by removing the old and useless global menu.

    sudo apt-get autoremove appmenu-gtk appmenu-gtk3 appmenu-qt
  6. To further improve the functionality, Gnome Shell has extensions support.
    Gnome Shell is based on CSS. Install/uninstall of extensions is simply a mouse click from the Gnome Shell Extensions website, simply amazing !

    • Alternative Status Menu : replaces Gnome Shell Status Menu with one showing suspend, hibernate and power off.
    • Analog Clock : shows an analog clock.
    • Applications Menu : adds a gnome 2 style menu for applications.
    • Battery Percentage Indicator : puts a percentage label next to the battery panel icon.
    • Bluetooth icon remover : removes the bluetooth icon from the panel.
    • Dock : adds a dock.

      To position the dock at the left, you must edit a javascript file (yes !).
      Open the file “.local/share/gnome-shell/extensions/dock@gnome-shell-extensions.gcampax.github.com/extension.js” and replace line 44 “const DOCK_POSITION = PositionMode.RIGHT;” by “const DOCK_POSITION = PositionMode.LEFT;” .

    • Extended Volume Indicator : switches output devices and adjusts application volume on volume indicator menu.
    • Media player indicator : controls your media player.
    • NetSpeed : displays internet speed.
    • Places Status Indicator : adds a systems status menu for quickly navigating places in the system.
    • Remove Accesibility : removes the accesibility button icon from the panel.
    • Show Desktop Button : hides all windows and shows the current desktop.
    • Shutdown Timer : adds a panel icon for delayed or scheduled power off.
    • System Monitor : adds a system monitor (disk and CPU usage).
    • Trash : adds a trash button.
    • Weather indicator : displays the current weather of your location.

      I did not find this extension on the official site, but you can use the following commands :

      sudo add-apt-repository ppa:gnome-shell-extensions
      sudo apt-get update
      sudo apt-get install gnome-shell-extension-weather

      To display the weather of your current location, you must configure the WOEID (Where on Earth IDentifier).
      You can get it by going to the site weather.yahoo.com. Enter your city/zip code, click on the RSS feed and get the code from its URL. For example : for Nantes, the URL is http://weather.yahooapis.com/forecastrss?p=FRXX0072&u=f. Thus, the WOEID to use is FRXX0072.

  7. I’m getting used to application launchers (cf. my article about Launchy for Windows), I now use Synapse on Linux.
    sudo add-apt-repository ppa:synapse-core/ppa
    sudo apt-get update
    sudo apt-get install synapse

    To have a black color would best fits with the Zukitwo-dark theme, add this gtkrc file in the ~/.config/synapse/ folder.

  8. To put the finishing touches to your desktop, you can also install Conky to display the date and some additional settings (the example is taken from tux-planet).
    sudo apt-get install conky-all ttf-ubuntu-font-family
    wget -O ~/.conkyrc www.tux-planet.fr/public/conf/conky/conky-gotham
    conky

    Do not forget to make Conky to run at startup.

  9. If you use Firefox, add this personas to improve compatibility with the Zukitwo theme. If you use Chrome/Chromium, add this theme
  10. You can download the wallpaper that I use (2560 x 1600). This is the Leopard wallpaper from Apple.
  11. Here are some additional screenshots to give you a better idea…

    Screenshot 2

    After customizing - 2

    Screenshot 3

    After customizing - 3

    Screenshot 4

    After customizing - 4

Related posts

Eject diskHow to properly eject an external hard drive with Ubuntu?
Comments
13 Comments »
Categories
Linux
Tags
faenza, gnome, gnome shell, ubuntu, zukitwo
Comments rss Comments rss

Extend your laptop’s battery life

Fabian Piau | Sunday July 4th, 2010 - 11:25 AM
551 views
  • Twitter
  • Facebook
  • Google +1
  • LinkedIn

To continue on the topic of my previous post, I introduce you some tips under Linux (Ubuntu & Debian distributions) and general tips to increase your laptop’s battery life.

Laptop Battery

Turn off the screen

You have to make a phone call, go through a document or… a body need. During this time, you often leave your computer on. Rather than keeping your monitor on or suspending the system (note that when the system wakes up, it consumes a great amount of energy), why not turn the screen off temporary with a single click?

For this, you just have to create a launcher (shortcut) and configure it to execute this command:

xset dpms force off

Then, it can be added to your taskbar or desktop. For daily use, you can also assign it to your own keyboard shortcut.

The acronym DPMS stands for Display Power Management Signaling. It is a command line program that allows power saving behaviour of monitors when the computer is not in use. Other options are available. You can read this post for more information.

Launcher to turn off screen


CPU Scaling

CPU Scaling is a feature built into most modern mobile CPUs that allows them to scale up or down in how fast they run (the frequency). If you have a fairly modern mobile computer there is a very good chance that your CPU can handle frequency scaling. For example, my five-year-old computer is based on an Intel Centrino CPU which supports it !

It is a pity that your processor runs at full speed if you are using a word processing or surfing the internet. Unless you are editing a movie or playing video games, this enables you to extend the use time of your laptop.

The idea is to “underclock” the processor when it is not fully stressed by your applications. A processor can save energy by running slower. Unfortunately, this will result in a slight performance degradation. So you have to find the good compromise.

Processors handle scaling differently. Various frequencies and modes are available depending on your model. To know yours, you need to install and activate the “CPU Frequency Scaling Monitor” applet.

CPU Scaling applet

Here is a short explanation for each mode:

  • “Powersave” will keep the CPU constantly at the lowest frequency. This mode is very useful to preserve the battery;
  • “Ondemand” will set the CPU at the lowest frequency until use of the CPU increases, then it will automatically set it up to the highest frequency. This is generally the default mode;
  • “Performance” simply sets the CPU at the highest available frequency. It is better to have your laptop plugged-in while using this mode;
  • “Conservative” is quite similar to the « Ondemand » mode. Your CPU will go up as needed, starting at the lowest frequency, and then setting up to the next available frequency (not the highest). It is the best compromise when you do not pay too much attention to your battery;
  • Finally, you also have the possibility of setting manually the frequency. In my case, I have four choices (0.798 GHz, 1.06 GHz, 1.33 GHz and 1.73 GHz).


GPU Scaling

The graphics card is also very energy-consuming. Following the example of the CPU, it is possible to put its chip into a low voltage mode. In my example, I use an ATI graphics card. It does seem that Nvidia provides a similar software.

We will use the command line tool “ATI Powerstate” available when you install the official driver. In the same time, we will make it more user-friendly for daily usage by adding a GUI.

First, you need to write a bash script:

#!/bin/bash

## Mode selection
    ACT=$(aticonfig --lsp | grep :  | zenity --list --title "ATI PowerState" --width=230 --height=166 \
        --text="Select a mode :"\
        --column="Mode"\
);
        if [ "${PIPESTATUS[0]}" != "0" ]; then
            exit
        fi


## Available modes

    # Idle
        echo "$ACT" | grep "1:" >/dev/null
            if [ "$?" = 0 ] ; then
                aticonfig --set-powerstate=1 | echo message:Idle mode activated | zenity --notification --listen --window-icon="info"
            fi

    # Default
        echo "$ACT" | grep "2:" >/dev/null
            if [ "$?" = 0 ] ; then
                aticonfig --set-powerstate=2 | echo message:Normal mode activated | zenity --notification --listen --window-icon="info"
            fi

Then, we create a launcher to execute this script.

Tune up graphic chip

Ati PowerState

In my case, I have two power states available. You can have more choices depending on the model of your graphic chip. Thus, it can be necessary to modify the script. By default (whether the laptop is plugged-in or not), the graphic card will run at full speed.

After selection, a tooltip shows up to confirm you about the running mode.

Idle mode activated

Normal mode activated

Once again, you will be in a dilemma, choosing between energy saving and a decrease in performance. For example, the greatest 3D effects are a little bit jerky when I activate the idle mode.

Still and always the good practices…

Except these few tips which have required the installation and/or the use of specific software, there are no secrets to preserve the energy of your battery ! There are still the good practices, the ones that have always been known to work on any computer and under any operating system. Here is a non-exhaustive list:

  • Disconnect your external devices when you do not use them: hard drive, USB stick, mouse, webcam or any USB powered device;
  • Deactivate wireless technologies (WI-FI and Bluetooth) when you do not use it;
  • Close the applications you do not use. Multitasking stresses the CPU and storing lot of information in memory consumes energy;
  • Deactivate the extra and unnecessary 3D effects (Oh no ! My nice-looking visual effects ! I’m afraid that’s another compromise again… ;) );
  • Decrease the screen brightness if necessary;
  • Under Windows, defragment your hard drive regularly. Of course, do not launch the defrag process while your laptop is not plugged-in;
  • Finally (with no ulterior motive), keep in mind that some available operating systems manage defragmentation and battery lifetime better than others.

With all these advices, you will certainly succeed in double your battery lifetime, and thereby extend your battery lifespan.

Related posts

No posts found...

Comments
No Comments »
Categories
Linux
Tags
bash, battery, mobile computing, ubuntu
Comments rss Comments rss

How to properly eject an external hard drive with Ubuntu?

Fabian Piau | Tuesday June 23rd, 2009 - 03:02 PM
913 views
  • Twitter
  • Facebook
  • Google +1
  • LinkedIn

I have two Western Digital external hard drives: a Passport and a My Book model. I don’t want to do any advertisement here, but the following tip has been adapted to these models.

Thus, you will need to slightly modify the scripts for your own hard drive.

Hard drives are fully recognized by Ubuntu (mounting & unmounting). But, when I unmount one of them, disk is still in activity (spinning). And, when I disconnect my drive, I heard a clicking sound related to an aggressive head parking.

On the long run, these hard shutdowns will ultimately reduce the longevity of the hard disk.

This issue does not appear with Windows XP. In Windows, when using the “safely remove hardware”, the disk stops spinning, even though the drive keeps getting electricity from the USB cable, as a light on the drive stays on.

To remedy this problem with Ubuntu, here is the script to unmount and spin-down the hard drive. Please take note that scripts are differents depending on the kind of power supply.


If your device is powered by an external power adapter

(WD My Book model)

#!/bin/bash

WD=/dev/sdc1
# unmount
gksudo "umount $WD"
# spin down
gksudo "hdparm -Y $WD"
# message
echo message:Your WD My Book hard drive can be safely removed now. | zenity --notification --listen --window-icon="info" | zenity --notification --window-icon="info" --text="Your WD My Book hard drive can be safely removed now."

“/dev/sdc1″ is the mount point of your drive.

Line 9 is not necessary. It uses the notification system to notify the user he can safely unplug the device.

Notification

Notification

To help you, the following is the command showing all the assigned mount points. Watch before and after plugging your hard drive. Thus, you will see easily which mount point is used by your device.

sudo fdisk -l
Fdisk - before plug in

Fdisk - before plug in

Fdisk - after plug in

Fdisk - after plug in


If your device is powered by the USB port itself

(WD Passport model)

#!/bin/bash

cd /sys/bus/usb/devices
good_usb=$(grep -H Western usb?/?-?/manufacturer | cut -d"/" -f1,2)
cd ${good_usb}/power
gksudo "sh -c 'echo "suspend" > level'"
echo message:Your WD Passport hard drive can be safely removed now. | zenity --notification --listen --window-icon="info" | zenity --notification --window-icon="info" --text="Your WD Passport hard drive can be safely removed now."

I have created one launcher (shortcut) for each script in the gnome panel. That’s very user-friendly with these icons.

Launchers

Launchers

My Book icon             Passport icon

As a precaution, during the execution, you will be asked for your root password (sudo).


Last resort Tip

One last thing, in case the device still seems to be spinning even after the script tells you it’s safe to unplug. It is really a “system D” tip. Sometimes, I continue to use this solution when Windows stubbornly refuses to eject my WD Passport (50% time…)

Trick is to gradually unplug the hard drive very slowly. You can feel there are two steps: a first one where spinning stops (like at the end of the script), and a second one where hard drive is shutting down.

Related posts

Laptop's batteryExtend your laptop’s battery life
Comments
No Comments »
Categories
Linux
Tags
bash, unmount, hard drive, eject, script, ubuntu
Comments rss Comments rss
Page 1 of 11

Language

  • Français
  • English

Most viewed posts

  • Changing the language in Firefox - 18,877 views
  • Java EE & CDI vs. Spring - 10,084 views
  • Customizing Gnome 3 (Shell) - 8,211 views
  • Firefox Nightly, Aurora, Beta, Desktop, Mobile, ESR & Co. - 6,005 views
  • WordPress plugins of CarmaBlog - 5,374 views
  • Open Street Map, better map than Google Maps? - 3,138 views
  • This file is currently used, you cannot do anything… Thanks you Windows ! - 2,911 views
  • Belbin – Team Role Theory - 2,394 views
  • Using Google Docs to create an online survey - 2,056 views
  • Changing the Eclipse splash screen in few seconds - 2,017 views

Tags

hard drive script docjax cloud automation build extreme programming unit test mobile computing plugin documents search engine itil windows seven google wordpress jug extension agility unmount best practices configuration management watin fosdem java windows 7 agile ci test sharing ubuntu ebook chrome tdd wave nosql hibernate jquery blog bash continuous integration nantes mongodb firefox shortcut eject eclipse training c# tool .net

Recent Posts

  • Get the opportunity to start a course about Gamification Tuesday April 2nd, 2013
  • Comparing NoSQL: Couchbase & MongoDB Friday March 8th, 2013
  • IconFinder, find efficiently your icons Friday March 1st, 2013
  • Fosdem 2013 Impressions Wednesday February 20th, 2013
  • Fosdem, a truly open conference Monday January 28th, 2013
  • Free online MongoDB training Tuesday January 1st, 2013
  • Discover Maxthon Tuesday December 11th, 2012
  • Shutdown, standby or hibernate your computer? Sunday December 9th, 2012
  • A mobile version of your WordPress Blog Sunday October 28th, 2012
  • Using Google Docs to create an online survey Monday September 24th, 2012
  • Open Street Map, better map than Google Maps? Wednesday July 25th, 2012
  • First steps with Apache Camel Friday May 11th, 2012
  • This file is currently used, you cannot do anything… Thanks you Windows ! Sunday April 22nd, 2012
  • Customizing Gnome 3 (Shell) Thursday March 15th, 2012
  • Give your application a facelift – CSS Wednesday February 15th, 2012

RSS feeds

RSS Feed RSS - Posts

RSS Feed RSS - Comments

Email Subscription

Enter your email address to receive notifications of new posts.

Links

  • Agile Nantes
  • Blog Ippon Technologies
  • Blog Netapsys
  • Blog Xebia France
  • Blog Zenika
  • Coursera
  • Developpef
  • Le Touilleur Express
  • Les Cast Codeurs Podcast
  • new Blog( perso );
  • OCTO talks !
  • The Coder's Breakfast

Follow me!

Follow me on TwitterFollow me on LinkedInFollow me on Google+Follow me on About.meFollow me on SlideShare

Categories

  • Event (9)
  • Linux (3)
  • Management (4)
  • Agile programming (11)
  • Technology (26)

Archives

  • April 2013 (1)
  • March 2013 (2)
  • February 2013 (1)
  • January 2013 (2)
  • December 2012 (2)
  • October 2012 (1)
  • September 2012 (1)
  • July 2012 (1)
  • May 2012 (1)
  • April 2012 (1)
  • March 2012 (1)
  • February 2012 (1)
  • January 2012 (2)
  • December 2011 (1)
  • November 2011 (2)
  • October 2011 (2)
  • September 2011 (1)
  • July 2011 (1)
  • June 2011 (2)
  • April 2011 (1)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • November 2010 (2)
  • September 2010 (1)
  • August 2010 (1)
  • July 2010 (1)
  • June 2010 (1)
  • May 2010 (1)
  • April 2010 (1)
  • March 2010 (1)
  • February 2010 (1)
  • December 2009 (1)
  • November 2009 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (3)
  • July 2009 (1)
  • June 2009 (2)
rss Comments rss get firefox
Fabian Piau | Copyright © 2009 - 2013
All Rights Reserved | Top ↑