ATERM themes support.
- Themes and AfterStep.
- Compiling aterm with theme support.
- Using theme.
- Creating your own theme.
- Sample theme.
Themes and AfterStep. |
Themes under
AfterStep
are simply a new and popular name for the very old concept of
the Look.
Nowdays everybody's running around screaming "Themes! Themes!",
so we are joining the crowd and calling theme what we used to call look.
As you might have guessed already, AfterStep theme (or look) is defined in
the look file. Definitions are grouped together into a small and convinient units
called MyStyle.
Each MyStyle has a name, and it may hold some or all the visual
attributes, that can be used on virtually any piece of user interface. Attributes
include Font, Back- and Fore-colors, background image and gradient.
Please read
AfterStep man pages
for more info.
The good thing about MyStyles is that you can define one MyStyle and then
use it in as many places as you need, simply reffering to it by name. For example
you can use single MyStyle for focused window's titlebar, focused icon's title,
and focused window representation in Pager. You can Inherit one MyStyle
in another MyStyle, so for example you can define your font properties
in one MyStyle, and then simply inherit it in all the other MyStyles.
This way if you ever want to change font - you just have to change it in one place.
Now question pops up: Can I use AfterStep look in other applications?
Yes you can. When AfterStep reads and loads look file it creates a shared
database of visual information in X server memory, and any other application
that is running on the same server can use this database. All that has to be done
is that app must be linked to AfterStep libraries.
That is exactly what aterm does. It checks wether AfterStep libraries are
available, and if it is - it will link to them, and instantly you can start
used shared AfterStep look/theme, presently loaded into memory. While doing so
aterm is looking for standard MyStyle name, like "*aterm", so if your theme
includes MyStyle with such name - off you go, aterm will automagically pick
it up. Switch theme to another one that has such MyStyle, and aterm will
automagically update itself. Read below for more details.
|
Compiling aterm with theme support. |
This part could be tricky indeed. Problem is that AfterStep libraries and header files
has to be installed on the system, and available to a compiler/linker.
Good news is that AfterStep 1.9 development series
has been updated to make such a process as easy as possible.
Bad news is that stable AfterStep 1.8.2 requires some manual steps.
It may change in the near future, but so far its like that.
Note: you may need to add the path to installed AfterStep libraries to your LDFLAGS, like so:
export LDFLAGS="-L/usr/local/lib" prior to running ./configure.
Compiling with AfterStep 1.9.*
All you have to do here is to compile AfterStep, and then install it as root.
Make sure that libraries gets installed in location, included into
$LD_LIBRARY_PATH, and header files are in /usr/include/afterstep.
If all that is done correctly, then all you have to do is simply run
./configure in aterm source dir, then make; make install. aterm should find
AfterStep files automagically. If it does it will display something like that
at the end of ./configure script execution :
AfterStep libraries: -lafterstep -lasimage
with AfterStep headers installed,
with AfterStep MyStyles support available
Compiling with AfterStep 1.8.2
This one is trickier, since AfterStep 1.8.2 only istalls libraries, if you compile
it with shared libraries enabled, and it does not install header files at all.
Solution here is to manually copy libraries and headers into locations, known
to linker/compiler. Lets say you have AfterStep sources in /usr/local/src/AfterStep-1.8.0,
and your libraries usually go into /usr/local/lib, and your headers into /usr/include.
Here is the sequence of command to do everything you need :
To install libraries :
su root ;
cd /usr/local/src/AfterStep-1.8.0 ;
cp lib/libafterstep.a /usr/local/lib ;
cp asimagelib/libasimage.a /usr/local/lib ;
ldconfig
To install headers :
su root ;
cd /usr/local/src/AfterStep-1.8.0/include ;
mkdir /usr/include/afterstep ;
cp * /usr/include/afterstep
That should be all. Now all you have to do is run ./configure ; make ; make install
in aterm source dir. Again, doublecheck that aterm has found AfterStep files:
At the end of configure run it should display following :
AfterStep libraries: -lafterstep -lasimage
with AfterStep headers installed,
with AfterStep MyStyles support available
|
Using theme. |
If properly compiled, aterm will attempt to use MyStyle with name, that
is build from * and executable name. For example if you start aterm as aterm,
it will look for MyStyle named "*aterm". You may choose to create a symlink
to aterm with some other name, for example:
ln -s /usr/local/bin/aterm BitchXaterm ;
In that case in invoked as BitchXaterm aterm will look for
MyStyle named "*BitchXaterm".
Alternatevely you can ask aterm to use any other MyStyle with command line
option -mst, like so:
aterm -mst AlternativeName ;
In that case aterm will attempt to find standard style first, and then it
will look for command line specifyed MyStyle. If both are found then aterm
will use all available options from the command line MyStyle, and it will
use missing options, from what is available in standard MyStyle. In short
any available option of command line MyStyle overrides same option in
standard MyStyle.
Note that all of the MyStyle options are supported. Also note that it is
better to use fixed width fonts with aterm, for example fixed9x15. Proportional
fonts are supported as well, but may not look nice.
Of course alternative MyStyle can be defined as X resource.
Resource Name is MyStyle, as you may have guessed already.
|
Creating your own theme. |
To create aterm theme - all you have to do is create some nice looking
MyStyle definition. For ideas and details on how to do that - please visit
AfterStep Practical Configuration Guide.
If you would like to make this aterm style a part of your AfterStep theme,
then all you have to do is add MyStyle named "*aterm" to your look file,
with this information of yours, and it will be picked up automagically by
AfterStep theme handler.
Please be sure to visit as.themes.org for helpfull
resources and information on creating and using AfterStep themes.
|
Sample theme. |
Here is the example of MyStyle that I use :
MyStyle "*aterm"
Font 9x15
ForeColor white
BackColor grey10
BackPixmap 129 cyan3
~MyStyle
|
|
|