LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > LINUX mostly DEBIAN - hardware and software
User Name
Password

Notices


12 happy years of experience with DEBIAN starting from version 5 Sid until the recent 8.3 Jessie.
Before that done 6 years of system administration including a SCO UNIX Server and a couple of Windows Servers and dozens of workstations. The largest system was nearly 100 PC's, devices etc. at 3 locations with LAN and VPN's, Firewall and Phone via landline and VoIP.

I like to experiment and then share the experience. With sharing I may post silly stuff and get corrected - the way to learn something from anybody.

Have fun, insight and maybe share your knowledge with me.
Rate this Entry

.xpm File format - additional information border width in Xfce

Posted 12-13-2015 at 02:34 PM by error_401

Most xfce themes have the shortcoming of having very narrow borders. Resizing such a window with the mouse is hard, awkward and can drive one nuts.

BTW this may not work at all if the applications use GTK. It's frustrating at best and using an available theme may save you a lot of time. So I'm just blogging what I found out about the xfwm4 theme definition in 2 hours of searching and tinkering with the definition file. No luck so far and I drop the subject.

All the forum entries normally tell you to change the border value in the active bla bla file but never give precise indications on where this is hidden.

The following links may help:

en.wikipedia.org/wiki/X_PixMap

The format was originally created to draft icons and are a definition of a bitmap which is then used by the theme to draw the borders, title, buttons etc. of the containing window of the x-manager.
This is the reason for them to use several files for the different things of the window.

1. WHERE TO FIND THE THEME
================================================================================
(Linux Debian) /usr/share/themes/
is the location where themes are stored. Other locations may exist depending on the distro.
Then the themes files are stored in the themes folder in the xfwm4 directory.
e.g. /usr/share/themes/Bluebird/xfwm4/bottom-active.xpm

wiki.xfce.org/howto/xfwm4_theme

2. PRECAUTIONS
================================================================================
Just copy the whole folder and safe with a new name such as mytheme or any precaution you like.

From the Bluebird theme I'll pick the bottom-active.xpm file as an actual example.

Code:
nano bottom-active.xpm
what you get is something like the following:

Code:
/* XPM */
static char * bottom_active_xpm[] = {
"5 2 3 1",
"       c None",
".      c #5F9BD9",
"+      c #385B80",
".....",
"+++++"};
Let's have a better look at it:
This file is simply the definition of a bitmap which forms the bottom of an active window in xfce.

I'll add explanations to the entries C comment syntax wich is /* explanation */.
See the same file content with the legend / comments.

Code:
/* XPM */   /* This is the comment about the content of the file XPM Format */
static char * bottom_active_xpm[] = {   /* This opens the declaration section */
"5 2 3 1",   /* See afterwards - this is the important stuff for borders */
"       c None",   /* a color definition for the blank space */
".      c #5F9BD9",   /* a color definition for the dot used in the bitmap */
"+      c #385B80",   /* a color definition for the + used in the bitmap */
".....",   /* this is the actual content of this bitmaps first line */
"+++++"};   /* this is the actual content of this bitmaps second line */
Now we have a rough idea on how it works. For the location see:
wiki.xfce.org/howto/xfwm4_theme

3. CHANGING THE WIDTH OF THE BORDER
================================================================================
The trick is to realize how the four figures on the third line are used to define the bitmap.

The english wikipedia entry for the xpm does not contain the definition. I may add this later on. The german wiki gets it:

https://de.wikipedia.org/wiki/X_PixMap

The whole definition in X_PixMap is 6 figures long but for this we do not need the last two which define a hotspot for use of a bitmap e.g as a mouse pointer.

The definition is as follows:

1. Width of the bitmap in pixels
2. Height of the bitmap in pixels
3. Number of colors in the bitmap
4. Number of signs per pixel (not too sure what it does)
5. The x-position of a hotspot (not used)
6. The y-position of a hotspot (not used)

BTW: The next definitions are the colors used where:

c = color
g4 = 4 shades of grey
g = more than 4 shades of grey
m = monochrome
s = symbolic e.g. background to be interpreted by the program.

We only use the first four if any.

Then follow the bitmap data line by line from top left to bottom right.

4. CHANGES
================================================================================
To change the width of a border we have to change the value related to that border. For vertical borders this would be value 1. the width while for the top or bottom border this would be value 2. the height.

5. OUTCOME
================================================================================

So much for the theory! I think that I'm mostly right on the application of changes to the xfwm4 theme just the apps may use GTK 2 or 3 or + and this will mess up my efforts for a broader border in xfwm4 and therefore I simply drop the subject and go back to installing my EPSON 4490 scanner.

Have fun, tinker, learn but know when to stop investing time
Posted in Uncategorized
Views 386 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration