The Linux Moderate

One Man Standing Up for Computers That Get Work Done

Transforming Xubuntu into DBCOS

with one comment

Part 6: Altering an IceWM Theme

Now it’s time to make a new theme for IceWM.

Before we start work on a new theme, though, we’re going to make one trip back to the regular Xubuntu desktop to find a “User Interface” theme we like. Log out of IceWM, and choose “XFCE Session” from the Session menu when you log in. Now go to the Settings Manager (Applications, Settings, Settings Manager) and click on User Interface. Pick a theme you like. I’m going to choose “Industrial.”

If you’ve put a line for xfce-mcs-manager in your IceWM startup file, then when you log back in to IceWM, the User Interface you chose will be the one IceWM uses for buttons and menus in applications.

Window decorations, the main menu, and the toolbar are controlled by the IceWM theme. That’s what we’ll tackle next.

As I said, we’re going to do it mostly by stealing bits from other people’s themes, which is perfectly legal and ethical because almost all the themes for IceWM are released under the GNU General Public License, which guarantees your right to use and alter the theme in any way you like, and requires you to give other people the same right if you make your alterations public.

So we need to find a theme we’d like to steal from.

You might find one you like among the themes we already have installed. I didn’t. But you can find more than 200 themes for IceWM here on the Freshmeat site.

To add a theme from this site to IceWM, just create a folder in your .icewm folder and name it themes. Then download the new theme into that folder and extract it from the archive.

Maybe you’ll find a theme you like so well that you won’t want to alter it. What I found was a bunch of really hideous themes, a few very good themes that just didn’t strike my fancy, and a few good-looking themes that I might like if I could change them around a bit. I’m not going to tell you which ones I thought were hideous, because those will probably be just the ones you like, and then we’ll both be embarrassed. But I will tell you that one of the ones I liked was called “Milked Expresso.” I downloaded it and extracted it in the themes folder I made, and here it is.

This is a vaguely Mac-like theme without colored buttons. I like the window decorations; I don’t like the background, and I don’t understand the order of the buttons. The button at top left isn’t a menu button, as it is in almost every Gnome, KDE, XFCE, or IceWM theme that doesn’t put the buttons in Mac order. It’s the rollup button: a button that makes the window appear to roll up, leaving only the title bar on screen, like the Cheshire Cat’s smile. (Not every theme uses a rollup button, but I find it useful.) The menu button is on the right, fourth from the end, where it just looks silly.

That’s just my opinion, of course. Obviously the person who created this theme has a lot more artistic talent than I have: otherwise he’d be stealing from me instead of vice versa. But the whole point of this exercise is to get a theme that’s exactly the way I like it.

It shouldn’t surprise you by now that the key to most of those differences in taste is a text file.

First we download and install our new theme. Installing is easy. In your .icewm folder (the one we bookmarked), create a folder called themes.

To install new themes, just extract them into a folder called "themes" in your ".icewm" folder.
To install new themes, just extract them into a folder called “themes” in your “.icewm” folder.

When you download the compressed theme, extract it into that folder. That’s all. Now, when you go to the menu and choose Settings, and then Themes, the new theme will be in the list in its proper alphabetical place.

Now, let’s make a duplicate of the theme. In the themes folder, just right-click on the Milked.Expresso folder and choose “Copy.” Now right-click on some blank space in the file window and choose “Paste.” PcmanFM will prompt you for a new file name. We’ll call it “Milked.Expresso-altered.” The “altered” version is the one we’ll work on. If we make a complete mess of it, we can revert to the original theme without having to download it again.

Now open the folder Milked-Expresso-altered. Inside it you’ll find a text file called default.theme. This file is the key to everything.

In fact, if you find a theme whose window decorations you like, but you don’t think much of the menu fonts and so forth, you can actually take the default.theme file from a theme whose menus you like and use it to replace the one in the theme whose window decorations you like. You’ll have to make a few alterations, but it gives you a huge head start.

The other alternative, of course, is to take the default.theme file I’m about to give you. This one is stuffed with explanations, and it’s designed to change the theme Milked-Expresso into something that looks rather different.

ThemeDescription="Clouds"
#
# Window Decorations ------------------------------------------------
# 1. Look.
# There are several different "looks" that govern the small details
# of the theme: gtk, metal, motif, nice, pixmap, warp3. We choose
# "metal," which is nicer than "nice."
Look=metal
# 2. Title Bar.
# The title bar includes the title of the window and several buttons
# that control the window. You get to decide which buttons will
# appear in your theme.
TitleBarHeight=19
# The height of the title bar (in pixels) must be the same as
# the height of the .xpm images whose names begin with "title."
# An easy way to check is to open, say, "titleAB.xpm" in the GIMP,
# which will tell you the height in pixels.
TitleButtonsSupported="xmirs"
TitleButtonsRight="xmir"
TitleButtonsLeft="s"
# These three lines control which buttons will appear and in what order.
#     x = Close
#     m = Maximize
#     i = Minimize
#     r = Rollup
#     s = Menu
#
# TitleButtonsRight specifies the order of the buttons at the top right of
# the window, starting at the far right and going from RIGHT to LEFT. In
# the same way, TitleButtonsLeft specifies the order of the buttons at the
# top left, starting at the far left and going from LEFT to RIGHT.
TitleBarJustify=2
# TitleBarJustify controls where the title text will appear in the title
# bar. The far left is 0; 50 is the middle; our choice of 2 leaves a bit of
# space between the menu button and the title.
BorderSizeX=3                  # [0-128]
BorderSizeY=3                  # [0-128]
TitleBarRollupButton=1         # [0-5] Double-click left button to roll up
TitleBarMaximizeButton=2       # [0-5] Double-click middle button to maximize
#
# Desktop Background -------------------------------------------------
# Specify an image file here. Keep the image in the theme's folder. To
# change the background, put another image in the theme folder and
# specify that image here.
DesktopBackgroundImage="2008-06-26-Clouds-02-1024x768.jpg"
# DesktopBackgroundColor=""
# The theme doesn't use a DesktopBackgroundColor, because it uses an
# image for a background.
#
# Colors -------------------------------------------------------------
# You can find a good chart of X11 color names at Wikipedia:
#
# http://en.wikipedia.org/wiki/X11_color_names
#
# The names of the color specs are mostly self-explanatory.
ColorNormalTitleBarText="gray"
ColorActiveTitleBarText="black"
ColorNormalBorder="WhiteSmoke"
ColorActiveBorder="WhiteSmoke"
ColorNormalButton="WhiteSmoke"
ColorNormalButtonText="black"
ColorNormalTitleButton="WhiteSmoke"
ColorNormalTitleButtonText="black"
ColorNormalMinimizedWindow="WhiteSmoke"
ColorNormalMinimizedWindowText="black"
ColorActiveMinimizedWindow="WhiteSmoke"
ColorActiveMinimizedWindowText="black"
ColorDialog="WhiteSmoke"
ColorNormalMenu="WhiteSmoke"
ColorNormalMenuItemText="black"
ColorDisabledMenuItemText="azure4"
ColorMoveSizeStatus="WhiteSmoke"
ColorMoveSizeStatusText="black"
ColorMoveSizeStatus="WhiteSmoke"
ColorQuickSwitch="WhiteSmoke"
ColorQuickSwitchText="black"
ColorDefaultTaskBar="WhiteSmoke"
ColorNormalTaskBarApp="WhiteSmoke"
ColorNormalTaskBarAppText="black"
ColorMinimizedTaskBarApp="WhiteSmoke"
ColorMinimizedTaskBarAppText="black"
ColorInvisibleTaskBarApp="WhiteSmoke"
ColorInvisibleTaskBarAppText="black"
ColorScrollBar="WhiteSmoke"
ColorScrollBarSlider="azure1"
ColorScrollBarButton="azure1"
ColorScrollBarButtonArrow="black"
ColorListBox="WhiteSmoke"
ColorListBoxText="black"
ColorListBoxSelection="WhiteSmoke"
ColorListBoxSelectionText="black"
ColorToolTip="white"
ColorToolTipText="black"
ColorLabel="WhiteSmoke"
ColorLabelText="black"
ColorInput="white"
ColorInputText="black"
ColorInputSelection="WhiteSmoke"
ColorInputSelectionText="black"
ColorClock="WhiteSmoke"
ColorClockText="black"
#
# Font Specifications --------------------------------------------
# You can experiment with different fonts installed on your system.
# Not all of them will work or work well. For our theme, we fly
# in the face of conventional wisdom and choose a serif font
# for most text. The names of the specs are mostly self-explanatory.
TitleFontNameXft		=	serif:size=9:italic
MenuFontNameXft			=	serif:size=9
MinimizedWindowFontNameXft	=	serif:size=9
ActiveButtonFontNameXft		=	serif:size=10:bold
NormalButtonFontNameXft		=	serif:size=9
ToolButtonFontNameXft		=	serif:size=9
NormalWorkspaceFontNameXft	=	serif:size=9
ActiveWorkspaceFontNameXft	=	serif:size=9
QuickSwitchFontNameXft		=	serif:size=9
ListBoxFontNameXft		=	serif:size=9
StatusFontNameXft		=	serif:size=9
ToolTipFontNameXft		=	serif:size=9
ActiveTaskBarFontNameXft	=	serif:size=9:italic
NormalTaskBarFontNameXft	=	serif:size=9
ClockFontNameXft		=	serif:size=11
InputFontNameXft		=	serif:size=9
# Taskbar Clock -------------------------------------------------
# I hate fake LED clocks, so I turn off the LED option with this line:
TaskBarClockLeds=0

With this text file, we’ve changed the look of the theme considerably. We have a different background image (I picked a sepia picture of clouds, but you can substitute any picture you like), the fonts are different, the rollup and menu buttons have changed places, inactive title bars are easier to distinguish from active ones, and the clock is in normal text instead of fake LED numbers.

we've done all we can with the text file.
Halfway there: we’ve done all we can with the text file.

There are still some alterations I’d like to make. I want the rollup button to be the same shape as the other three buttons on the right. I want to get rid of that now-useless image in the toolbar. I want a different menu button. For all these things, we’re actually going to have to deal with graphics files.

But we’re not going to have to do any real drawing. As usual, we’ll accomplish most of what we want to do by cheating.

Advertisements

Written by cbaile19

August 13, 2008 at 7:48 pm

Posted in DBCOS, Xubuntu

One Response

Subscribe to comments with RSS.

  1. […] done all we can by editing the default.theme text file. Now it’s time to mess with the actual graphics a bit. […]

    The Linux Moderate

    August 16, 2008 at 8:14 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: