Give WindowMaker a macos Mojave look
1098 words, 6 minutes
Once again, I was wandering on r/unixporn when a screenshot raised my attention. It was probably featuring a obscure window manager that I would never use but I felt like I could tune my beloved WindowMaker to not look so 1990.
Before deciding to read further, you may want to look at what is achieved.
Also note that I’m using OpenBSD and have a DPI of 144. Things might need some adjustements for some other configuration. Now, here’s what I did.
Icons and cursor set
Depending on the software, XDG specs are fully matched or not. So I install the
resources in ~/.local/share/icons
and have the ~/.icons
symbolic link point
to it.
I’m using the Simp1e-breeze
cursor theme.
Simply download and extract the content of the archive to the icons directory.
Usage of the cursor is activated by editing the proper configuration files ; or
you can simply use some dedicated software like lxappearance
.
# grep cursor ~/.Xresources ~/.gtkrc-2.0 ~/.config/gtk-3.0/settings.ini
/home/jca/.Xresources:Xcursor.theme: Simp1e-breeze
/home/jca/.Xresources:Xcursor.size: 32
/home/jca/.gtkrc-2.0:gtk-cursor-theme-name="Simp1e-breeze"
/home/jca/.gtkrc-2.0:gtk-cursor-theme-size=32
/home/jca/.config/gtk-3.0/settings.ini:gtk-cursor-theme-name=Simp1e-breeze
/home/jca/.config/gtk-3.0/settings.ini:gtk-cursor-theme-size=32
# cat ~/.icons/default/index.theme
(...)
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=Simp1e-breeze
(...)
Regarding the icons set, I went for the one from the CutefishOS project . Pull the source, run the install script and Voilà.
# git clone https://github.com/cutefishos/icons.git
# cd icons
# mkdir build ; cd build
# cmake -DCMAKE_INSTALL_PREFIX:PATH=~/.local ..
# make
# make install
Using those icons is now a matter of configuring the proper files.
# grep icon-theme ~/.gtkrc-2.0 ~/.config/gtk-3.0/settings.ini
/home/jca/.gtkrc-2.0:gtk-icon-theme-name="Crule"
/home/jca/.config/gtk-3.0/settings.ini:gtk-icon-theme-name=Crule
Theme
To customize the GUIs, I went for Vince’s Mojave Gtk Theme rather than the cutefishos ; mostly because I prefer the menu rendering from the Mojave-Light theme.
# git clone https://github.com/cutefishos/gtk-themes.git
# gtk-themes
# mkdir build
# cd build
# cmake -DCMAKE_INSTALL_PREFIX:PATH=~/.local ..
# make
# make install
# git clone https://github.com/vinceliuice/Mojave-gtk-theme.git
# cd Mojave-gtk-theme
# bash install.sh -d ~/.local/share/themes -t all -i normal
Enabling the theme can be done via a third-party application or by configuring the proper configuration files.
# grep -i gtk-theme ~/.gtkrc-2.0 ~/.config/gtk-3.0/settings.ini
/home/jca/.gtkrc-2.0:gtk-theme-name="Mojave-Light"
/home/jca/.config/gtk-3.0/settings.ini:gtk-theme-name=Mojave-Light
QT applications
I’m not using much QT applications ; but there seem to be a way to get the same look with QT applications than with GTK ones. It requires the use of qt5ct and setting the appropriate environment variable.
# cat ~/.xsession
(...)
export QT_QPA_PLATFORMTHEME=qt5ct
There seem to be issues when using the Nextcloud client and this parameter. When using it, the dialog boxes are void and the application basically freezes. So I’m just not using qt5ct.
WindowMaker
Using Window Maker Preferences is the easiest way to build a theme ; at least when you don’t really know what you’re doing.
To get the titlebar look, I grabbed title-1-active.png
and title-1-inactive.png
from .themes/Mojave-Light/xfwm4
and removed to border that rendered a duplicate
effect with WindowMaker titlebars.
To get the colors, I opened .themes/Mojave-Light/gtk-2.0/gtkrc
and the various
rc files to identify which color to use on which widget.
The theme can be saved using the build-in WindowMaker function. It will be saved
in ~/GNUstep/Library/WindowMaker/Themes
, can be archived and restored in the
same location. My archived theme can be downloaded from
here
.
The wallpaper is macOS Ten Peaks, by Basic Apple Guy .
The Dock is disabled, because it can only store dockapps vertically. The Clip is used as a Dock ; but each workspace will have it’s own sets of apps. In my case, I only use a single workspace.
WindowMaker doesn’t know how to use SVG file. So the icon files have to be converted to be used in Dock, Clip and iconified state.
# _svgdir="/home/jca/.icons/Crule/apps/scalable"
# _pngdir="/home/jca/GNUstep/Library/Icons/Crule"
# for _icon in "$_svgdir"/*; do
_icon="$(basename ${_icon%.*})"
convert -background none -resize $_size \
"$_svgdir"/"$_icon".svg \
"$_pngdir"/"$_icon".png
done
Each applications can now be affected the desired icon.
Dockapps can be used to render specific stuff on the Dock/Clip. I’m using Docker to show the system tray icons.
# wmdocker -wmaker
Other stuff
Fonts
I’m using Nerd Fonts in Terminal. But I also use it in some of my Conky stuff. Sans-serif family is set to “SF Pro Display”, Serif family is set to “New York” and Monospace family is set to “CodeNewRoman Nerd Font”.
# cat ~/.config/fontconfig/fonts.conf
(...)
<alias>
<family>serif</family>
<prefer><family>New York</family></prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer><family>SF Pro Display</family></prefer>
</alias>
<alias>
<family>sans</family>
<prefer><family>SF Pro Display</family></prefer>
</alias>
<alias>
<family>monospace</family>
<prefer><family>CodeNewRoman Nerd Font</family></prefer>
</alias>
(...)
Conky
Speaking of Conky, this is what can be used to draw system informations on the
desktop. I’m also using it near the Clip to render information about time, volume
and battery life. I could use dockapps but I couldn’t find one that were customizable
like I wished. Conky instances are started from the .xsession
file.
# cat ~/.xsession
(...)
conky -c ~/.config/conky/wmstatusbar.conf
conky -c ~/.config/conky/system.conf
The configuration files can be downloaded here and there .
Picom
Shadows and transparency is managed using picom. The only specific stuff with the configuration is to disable shadow for the Clip/Dock to get the flat look.
# cat ~/.config/picom.conf
(...)
shadow-exclude = [
"class_g = 'Firefox' && argb",
"class_g = 'Thunderbird' && argb",
"class_g = 'conky'",
"class_g = 'Conky'",
"XdndAware:a = 'ARC'",
];
(...)
opacity-rule = [
"92:class_g = 'XTerm'",
]
(...)
blur: {
method = "dual_kawase";
strengh = 12;
background = true;
background-fixed = true;
};
(...)
backend = "glx"
(...)
# cat ~/.xsession
(...)
picom --experimental-backends -b
Rofi
WindowMaker has a built-in “Run” command. But Rofi has a more bling-bling one.
# git clone https://github.com/adi1090x/rofi.git
# cd rofi
# bash setup.h
(...)
[*] Choose your screen resolution -
[1] 1920x1080
[2] 1366x768
[?] Select Option : 1
(...)
When installation is done, there’s a few modifications required to enable the wished look.
--- ./1080p/launchers/misc/launcher.sh Mon May 23 10:51:40 2022
+++ /home/jca/.config/rofi/launchers/misc/launcher.sh Thu May 26 00:21:15 2022
@@ -13,10 +13,10 @@
# column row row_center screen row_dock row_dropdown
-theme="screen"
+theme="launchpad"
dir="$HOME/.config/rofi/launchers/misc"
# comment these lines to disable random style
-themes=($(ls -p --hide="launcher.sh" $dir))
-theme="${themes[$(( $RANDOM % 16 ))]}"
+#themes=($(ls -p --hide="launcher.sh" $dir))
+#theme="${themes[$(( $RANDOM % 16 ))]}"
-rofi -no-lazy-grab -show drun -modi drun -theme $dir/"$theme"
+rofi -dpi 0 -no-lazy-grab -show drun -modi drun -theme $dir/"$theme"
--- ./1080p/launchers/misc/launchpad.rasi Mon May 23 10:51:40 2022
+++ /home/jca/.config/rofi/launchers/misc/launchpad.rasi Thu May 26 00:21:42 2022
@@ -9,7 +9,7 @@
configuration {
- font: "Noto Sans Bold 10";
+ font: "Sans 10";
show-icons: true;
- icon-theme: "Papirus";
+ icon-theme: "Crule";
display-drun: "";
drun-display-format: "{name}";
@@ -42,5 +42,5 @@
background-color: @background-alt;
text-color: @foreground;
- font: "FantasqueSansMono Nerd Font 12";
+ font: "Mono 10";
}
Add a menu entry and/or a key binding to run
$HOME/.config/rofi/launchers/misc/launcher.sh
and you’re all done.
After all this, you’re still wondering “but why?”. Well, because you can ;-)