Adding discreet XFCE borders to themes

Any theme that has XFWM4 files can be customized if you want borders that are more discreet than the default borders, e.g. this is 2px borders I’m currently using with the Nordic-darker theme.

XFWM4

Inside the xfwm4 folder there are image files that correspond to each element of the frame, e.g. left-active.png and left-inactive.png are the files that generate the active and inactive left side of the window frame.

The images needed to make the entire frame are active and inactive: left, right, bottom, bottom-left, bottom-right, top-left, top-right, title-1…5

If your theme doesn’t have xpm files, you can convert images files to xpm with imagemagick.

for f in ./*.png ; do covert "$f" "{$f%.*}".xpm ; done

xpm files are bitmaps as text in an C style array format, with a header the defines the number of columns, rows, colors, and chars pr pixel.

Copy the xpm files to dom0 and place them in the xfwm4 folder inside the theme, when you delete the image files the xpm will be used to render the window frame.

e.g. if you delete left-active.png then left-active.xpm will be used.

Go through the left, right, bottom, bottom-left, bottom-right, top-left, top-right files and delete the image files one by one, and reload the theme between each file deleted. If there were any errors in the conversion, you need to manually edit the xpm bitmap array.

Customizing the header.

The easiest way to I found to modify the header (title-1…5), was to use the original header image files and the parts I want Qubes OS colored I make transparent, using GIMP.

I don’t delete the image files for the header, and allow the WM to load both the xpm and png files, the xpm files will be displayed first and the png files displayed on top of the xpm image, any transparent part of the png file will be colored by the xpm file.

This allows you to make custom header designs without Qubes OS coloring the entire header, it also means you don’t need to worry about buttons or icons, they are all made using the standard assets from the image files.

4 Likes

how did you get the XFCE/dom0 borders to work?
I followed your guide on github, I did not manage to copy setup-desktop.sh in /opt/user-scripts, it is not found in my AppVM, can you detail the guide or do you know the cause of the problem?

github site: qubes-os-dark-theme/appvm-files at main · renehoj/qubes-os-dark-theme · GitHub

what program did you use to put the terminals in the center of the desktop?

Add /opt/user-scripts to your $PATH environment variable or just run it by specifying the full path to the script e.g.:

$ /opt/user-scripts/setup-desktop.sh red
1 Like

The file is in the repo

https://github.com/renehoj/qubes-os-dark-theme/blob/main/appvm-files/setup-desktop.sh

It just sets the theme to the selected color, and sets up the fonts and icons, you can manually do this without using the script.

You just need to remember to add the original gtk.css, with the Qubes OS specific styles, to the end of the new gtk.css.

cp /usr/share/themes/Qubes-$1/gtk-4.0/gtk.css /home/user/.config/gtk-4.0
cat /opt/user-scripts/qubes-gtk.css >> /home/user/.config/gtk-4.0/gtk.css

The file /opt/user-scripts/qubes-gtk.css is the original gtk.css file.

1 Like