Tweaking GDM


After you configure the color scheme, fonts, and sound, you'll want to modify the Gnome Desktop Manager (GDM). This means adding buttons and menus for frequently used functions. You may also want to change the overall widget theme and application skins.

Adding a Prompt Button

The toolbars at the top and bottom of the screen are convenient locations for buttons. Buttons give you a quick way to run commands. I usually add buttons for X-terminals since I regularly use the command- line. I also add a button for my favorite games and other applications that I regularly run.

Adding a new button is pretty straightforward: just right-click an empty part of either the top or bottom toolbar and select Add to Panel. The default applet shows you common applications, like Weather Report and Workspace Switcher, that you can drag and drop onto the toolbar. But when the application you want does not exist, you'll need to select the Custom Application Launcher (see Figure 2-6).

image from book
Figure 2-6: Add to Panel and Custom Application Launcher.

The Custom Application Launcher prompts you for the button's name. This is the text that will appear when you hover the mouse over the button. The command is the active element- this is any line that you can enter on a command line. In Figure 2-6, I created an xterm with a dark blue (#000020) background and white text. Rather than opening a terminal on the local system, I use Secure Shell (ssh) to connect to a remote host. This way, I can color-code my terminal windows to specific hosts. You should also choose an icon for your button. Clicking the empty icon button shows you a large system of ready-to-go icons. Alternately, you can create your own; PNG is the best format for this.

Note 

The command can be any valid command line. If you want to use pipes or redirection, consider using the bash command. For example: bash -c ‘ls | more’. And be sure to select the Run in Terminal check box. This way, the command will run and you can see the output. Otherwise, it will never open a window (which could be desirable if you don't want to see any text results).

After you create your button, it will appear on the toolbar. You can always right-click the button to change its properties (name, command, icon, and so on). This menu also enables you to move the button along the toolbar, to another toolbar (for example, from the top to the bottom), or to lock the icon so it won't move.

Tip 

Laptop computers can either use their own screen or an external monitor. These screens are commonly at different resolutions. If you find yourself switching resolutions often, you might want to enable the Lock To Panel property for each toolbar icon. Otherwise, they can move around and get bunched up in the middle of the toolbar.

Buttons are not restricted to the toolbars. They can also be created on the desktop.

  1. On the desktop, right-click to bring up the desktop menu.

  2. Select Create Launcher. The applet looks just like the menu from the panels.

  3. Enter a name and command line for the button, then click OK.

The new button appears on your desktop. Double-clicking the button starts the application.

Adding Panels

The default Dapper user interface has two panels (toolbars): one at the top and one at the bottom. Each panel has a limited amount of screen real estate for placing menus and buttons; you might run out of room. To resolve this, you can add more panels.

  1. Right-click any empty space on any panel. This brings up the panel menu.

  2. Select New Panel from the menu. A new panel appears.

To move the panel, grab it with the mouse (left button) and move it. It can reside along any screen edge or along another panel. For example, you can easily stack multiple panels along the top edge for adding lots of buttons.

Panels can also have sub-panels, called drawers. A drawer is a pop-out panel where you can store more buttons. To create a drawer:

  1. Right-click any empty portion of the panel to bring up the panel menu.

  2. Select the Add to Panel option. This brings up the list of available applets.

  3. Drag the drawer icon from the Add to Panel window to the panel.

  4. Left-click the drawer icon in order to open the drawer.

Clicking the drawer icon once opens it. Clicking it a second time closes it. The open drawer acts as another panel and you can add panel icons to it. The opened drawer is normally three icons tall. However, if you add more icons to add then it will automatically widen.

Adding Menus

The default Dapper desktop contains one text-based top-level menu with three items in it: Applications, Places, and System. In Gnome2, the developers removed the ability to add custom menus. The implementation was reportedly unstable, so it was disabled. Hopefully this will be added to a later version of Ubuntu. In the meantime, you can add custom menus under the existing top-level menu items (Applications and System) by right-clicking the menu and selecting Edit Menus.

Note 

Other menu items were also disabled in Dapper. For example, earlier Ubuntu versions had an Applications image from book System Tools menu for running the Configuration Editor (gconf-edit) and other tools. That menu option is gone under a Dapper clean install, but present if you performed an upgrade to Dapper.

The Gnome Menu items contain can contain two different types of items. First, they can contain additional menus. For example, Applications contains Games (Applications image from book Games). There is no limit to the depth of the menus; you can have a menu in a menu in a menu.

Second, the Gnome Menu can contain entries. An entry is just like a button but uses text (with an optional graphic) to denote the functionality; buttons only have graphics. Like buttons, entries can run any command on the system.

Warning 

Only menu items that contain items are displayed, and only empty menus can be deleted.

Although adding menu items is easy, deleting them can be a little confusing (the Gnome interface is not exactly production quality in this regard).

  1. Open the Alacarte Menu Editor by right-clicking the menu and selecting Edit Menu.

  2. Delete all menu entries by right-clicking each item and selecting Delete. You can delete menus that started off empty, but you cannot delete a menu that you just emptied. The next steps (Steps 3–5) are for deleting an empty menu.

  3. Close the Alacarte Menu Editor. (That's right! Close it so you can open it again to delete it!) The menu editor does not update and realize that the menu is empty until you close it.

  4. Re-open the Alacarte Menu Editor.

  5. Now delete the empty menu by right-clicking and selecting Delete.

Selecting Themes and Skins

The default widgets-window borders, scrollbars, and buttons-that ship with Ubuntu are nice, but they can be made nicer. You can change the desktop theme by selecting System image from book Preferences image from book Theme. From this menu you can select from a wide range of themes, color schemes, and control widgets (see Figure 2-7). Besides the existing theme selections, you can choose Theme Details, and modify the controls, window borders, and icons. Your choices here will impact every application you run.

image from book
Figure 2-7: The Theme Preferences and Theme Details applets

Unfortunately, the theme selection applet does not give as many options as other operating systems. (Yes, Windows and even OS/2 both have more options than Gnome.) But there are ways to tweak aspects that are not available from the Theme Preferences applet.

  1. Become root. Open a terminal and type:

         sudo bash 
    Warning 

    This starts a command prompt as root. You have the ability to delete and destroy the entire operating system. Be careful and have fun.

  2. Go to the directory /usr/share/themes.

     cd /usr/share/themes 
  3. Copy your favorite theme to a new directory. This uses the existing theme as a template. For example, if you like the AgingGorilla theme, then use:

     cp -R AgingGorilla MyTheme 
  4. In the MyTheme/metacity-1 directory is a file called metacity-theme-1.xml (/usr/share/themes/MyTheme/metacity-1/metacity-theme-1.xml). Edit this file.

The theme file contains XML that describes the theme's name and attributes. By editing this file, you can change colors, border sizes, icons, and more. And this gives you much more editing power for creating a custom theme than other operating systems. As an example, I can set the title bar to have a couple of bars that grow by editing the "title_tile" section and specifying:

 <draw_ops name="title_tile">   <line color="#0000ff" x1="0" y1="0" x2="width" y2="0"/>   <line color="#3030f0" x1="0" y1="1" x2="width" y2="1"/> </draw_ops> 

This sets two alternating horizontal stripes. One is blue (#0000ff) and the other is a grayish blue (#3030f0). If you want to change the icons for close, maximize, minimize, and so on, then you just need to edit the appropriate PNG file in the /usr/share/themes/MyTheme/metacity-1/ directory.

Changes to the active theme take effect immediately. If you change the theme using the System image from book Preferences image from book Theme applet, you can re-select your customizations by clicking the Theme Details button and choosing the MyTheme selection.



Hacking Ubuntu
Hacking Ubuntu: Serious Hacks Mods and Customizations (ExtremeTech)
ISBN: 047010872X
EAN: 2147483647
Year: 2004
Pages: 124
Authors: Neal Krawetz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net