1/24/2015

Gnome 3 Desktop Tips and Tricks

Gnome 3 Desktop Tips and Tricks

In updating to RHEL 7 / CentOS 7, I found myself having to live with the Gnome 3 Desktop.  Fortunately, Red Hat has documentation available at DESKTOP MIGRATION AND ADMINISTRATION GUIDE.  As I've been reading through this documentation and other sources, I'll be sharing the helpful tricks and tips that I find.

First, as you might read this documentation, you should know that when they refer to the SUPER key, they mean the Windows key on your keyboard.  Here are some of the shortcuts:

Shortcuts

 SUPER + m :  Display the message notification panel, and press ESC to return to normal view
                        This also happens when you point and click at the bottom of the screen, click again to return 
 SUPER + Tab:  Display window switcher


Desktop Customization

In the current desktop environment, you can customize the desktop by using the dconf-editor.
The dconf-editor package is not installed by default, and gives you access to be able to edit the settings of the desktop.  This tool replaces the gconf-editor that was used in Gnome 2 Desktop.  To install the tool you will need to have set yourself as an administrator during installation, or know the root password.

If you have been set up as an administrator, then you can execute and provide your own password:

sudo yum install dconf-editor

Otherwise, if you know the root password, then you can execute and provide the root password:

su -c 'yum install dconf-editor'

After executing as the user whose desktop you want to customize:

dconf-editor

Then, you can navigate the tree on the left to org.gnome.desktop and then click on settings on the right to change your desktop settings.  For example you can click on the background and provide a simple file URI to change the desktop from the default xml file.  

For example, clicking on org, then gnome, desktop, and then background on the left, you could then click on picture-uri on the right.  The default setting is an xml file named file:///usr/share/backgrounds/default.xml, but you could set it to something like file:///home/kwright/Pictures/Wallpapers/_DSC1468.png. By the way, an easier way of accomplishing the above is to locate the picture you want to use as a wallpaper, and then right-click on it and choose 'Set as Wallpaper'.

If you liked icons on your desktop, like in the Gnome 2 Desktop environment, then in the same org.gnome.desktop.background part of the dconf-editor, you can select show-desktop-icons.

The org.gnome.desktop.interface selection of the dconf-editor has some nice customization options for the clock like being able to show the date and display a 12 hour clock.

One feature I went looking for and could not find within the standard interface was a way to control how long my session was idle before the screensaver came on.  You can adjust this time by going to org.gnome.desktop.session and selecting idle-delay and entering the number of seconds to delay.

Finally, if you want to lock down what a user can do, then you can go to the org.gnome.desktop.lockdown part of the dconf-editor and lock down the ability of the user to do things such as print, change the print setup, access the command line, and save to the disk among other options.

Gsettings

The gsettings command can be used to get, set and query different keys and schemas. It's main utility is that you can use it in scripts to automate the process of customizing settings. Otherwise, the dconf-editor provides a more user friendly interface, and is easier to explore.

Getting a Key

If I had set the custom background as shown above, then using the following gets what the key picture-uri is set to within the org.gnome.desktop.background schema:

gsettings get org.gnome.desktop.background picture-uri
'file:///home/kwright/Pictures/Wallpapers/fireworks.png'



Setting a Key

To change the value of the same key, again there will be a space between the schema and the key, but using the sub-command set instead of get:

gsettings set org.gnome.desktop.background picture-uri  'file:///home/kwright/Pictures/Exports/2greatblueherons.jpg'




For keys that have a checkbox in the dconf-editor, you can use the value true or false to mean the box is checked or not.  For example, to display the icons on the desktop, you could use true as the value for the show-desktop-icons key:

gsettings set org.gnome.desktop.background show-desktop-icons true


Listing the keys

To list the keys of the org.gnome.desktop.background schema, you can use the list-keys sub-command:

gsettings list-keys org.gnome.desktop.background
color-shading-type
picture-opacity
picture-options
picture-uri
primary-color
secondary-color

show-desktop-icons

For more details about using gsettings, execute:

 man gsettings


Gnome Classic Desktop

Each user can choose whether they want to use classic desktop, which is more like Gnome 2 than Gnome 3, or the real Gnome 3.  By default users login with the classic desktop.  At the graphical login screen, you can click on the settings icon, which looks like a small gear, and choose which installed desktop they want to user.

To switch to the classic desktop for a session, from the command line you can execute:

gnome-shell --mode=classic -r &

If you are in a classic desktop, and want to use the current Gnome 3 desktop, then you can execute:

gnome-shell --mode=user -r &

For making a permanent change to which desktop a user will have, the file /var/lib/AccountsService/users/username can be modified.  The contents of this file on my CentOS 7 system looked like this:

[User]
Language=en_US.utf8
XSession=gnome-classic
SystemAccount=false

Notice that the XSession is set to gnome-classic.  By default, users user the "classic" desktop.  In order to make the desktop use the true Gnome 3 desktop, then this file would look like the following with the XSession set to gnome.

[User]
Language=en_US.utf8
XSession=gnome
SystemAccount=false

After updating the file, the user will need to log out and back in again.

Locking Down Settings

If you want to lock down certain settings, and then you can create the following directory by executing as an administrator:

mkdir /etc/dconf/db/local.d/locks/

Next, create a file named something like 00-local-lockdown.  Its contents should be any keys that you want to lock down like the following:

/org/gnome/desktop/background/picture-uri
/org/gnome/desktop/session/idle-delay

After creating the file, execute as root or with sudo:

dconf update


No comments:

About Me - WrightRocket

My photo

I've worked with computers for over 30 years, programming, administering, using and building them from scratch.

I'm an instructor for technical computer courses, an editor and developer of training manuals, and an Android developer.