commit 505a45c4e2c3cbe7cf1d5e6eb54b4d4c418e5b40
parent a595263ed6ff4e706be6696bc932f3e3602716c0
Author: torter <koubbamohamedrayan@gmail.com>
Date: Sat, 21 Nov 2026 18:19:32 +0000
desktop: window maker with the dock apps and the NeXT look, for gentoo and chamesle
Diffstat:
12 files changed, 344 insertions(+), 1 deletion(-)
diff --git a/desktop/windowmaker/bin/chamesle-windowmaker b/desktop/windowmaker/bin/chamesle-windowmaker
@@ -0,0 +1,20 @@
+#!/bin/sh
+# the Window Maker desktop: startx chamesle-windowmaker, or pick it in a display manager.
+# the first time it puts its look, dock and menu in ~/GNUstep (what was there goes to *.before), after that
+# they are yours to change in WPrefs. CHAMESLE_WM_RESET=1 puts them back
+s=${CHAMESLE_WM_SHARE:-$(dirname "$(dirname "$(readlink -f "$0")")")/share/chamesle/windowmaker}
+g=$HOME/GNUstep
+export XDG_CURRENT_DESKTOP=WindowMaker XDG_SESSION_DESKTOP=WindowMaker
+if [ ! -e "$g/.chamesle-windowmaker" ] || [ -n "$CHAMESLE_WM_RESET" ]; then
+ mkdir -p "$g/Defaults" "$g/Library/WindowMaker"
+ for f in WindowMaker WMState WMRootMenu WMWindowAttributes; do
+ [ -e "$g/Defaults/$f" ] && [ ! -e "$g/Defaults/$f.before" ] && mv "$g/Defaults/$f" "$g/Defaults/$f.before"
+ sed "s|@SHARE@|$s|g" "$s/$f" > "$g/Defaults/$f"
+ done
+ a=$g/Library/WindowMaker/autostart
+ [ -e "$a" ] && [ ! -e "$a.before" ] && mv "$a" "$a.before"
+ printf '#!/bin/sh\nexec "%s/autostart"\n' "$s" > "$a"
+ chmod 755 "$a"
+ touch "$g/.chamesle-windowmaker"
+fi
+exec wmaker "$@"
diff --git a/desktop/windowmaker/dockapps b/desktop/windowmaker/dockapps
@@ -0,0 +1,29 @@
+#!/bin/sh
+# dockapps SRC OUT: builds the dock apps from the tarballs in SRC into OUT, for a system that has none packaged
+set -e
+src=$(cd "$1" && pwd) out=$2 here=$(cd "$(dirname "$0")" && pwd)
+mkdir -p "$out"
+out=$(cd "$out" && pwd)
+w=$(mktemp -d)
+trap 'rm -rf "$w"' EXIT
+export CFLAGS="${CFLAGS:--O2 -pipe} -std=gnu17 -fcommon" PKG_CONFIG_PATH="$out/usr/lib/pkgconfig" CPPFLAGS="-I$out/usr/include" LDFLAGS="-L$out/usr/lib"
+gnu() {
+ n=$1
+ shift
+ mkdir "$w/$n" && tar -C "$w/$n" -xf "$src/$n"-*.tar.gz
+ cd "$(dirname "$(find "$w/$n" -name configure.ac -o -name configure.in | sort | head -1)")"
+ re=
+ for p in "$here"/patches/"$n"-*.patch; do [ -f "$p" ] && patch -p1 < "$p" && re=1; done
+ [ -x configure ] && [ -z "$re" ] || autoreconf -fi >/dev/null 2>&1
+ ./configure -q --prefix=/usr --sysconfdir=/etc "$@" >/dev/null
+ make -s
+ make -s DESTDIR="$out" install
+}
+gnu libdockapp --disable-static
+for a in wmclock wmcpuload wmmemload wmix wmbattery wmsystemtray; do (gnu $a); done
+cd "$w" && tar -xf "$src"/wmnet-*.tar.gz && cd wmnet-*/
+sed -i '/define USE_LINUX_PPP/d' config.h
+xmkmf >/dev/null 2>&1 || true
+if [ -f Makefile ]; then make -s CDEBUGFLAGS="$CFLAGS"; else ${CC:-cc} $CFLAGS -o wmnet wmnet.c drivers.c -lX11 -lXext; fi
+install -Dm755 wmnet "$out/usr/bin/wmnet"
+rm -rf "$out/usr/lib/pkgconfig" "$out/usr/include" "$out/usr/lib"/*.la "$out/usr/share/doc" "$out/usr/share/fonts/X11/misc/fonts.dir"
diff --git a/desktop/windowmaker/install b/desktop/windowmaker/install
@@ -0,0 +1,13 @@
+#!/bin/sh
+# install [PREFIX]: puts the desktop in PREFIX (/usr/local), with DESTDIR in front if it is set
+set -e
+cd "$(dirname "$0")"
+p=$DESTDIR${1:-/usr/local}
+s=$p/share/chamesle/windowmaker
+mkdir -p "$p/bin" "$s"
+install -m755 bin/chamesle-windowmaker "$p/bin/"
+for f in WindowMaker WMState WMRootMenu WMWindowAttributes; do install -m644 "share/$f" "$s/"; done
+install -m755 share/autostart share/web "$s/"
+x=$DESTDIR/usr/share/xsessions
+mkdir -p "$x"
+printf '[Desktop Entry]\nName=Window Maker (Chamesle)\nComment=Window Maker with the dock apps, the NeXT look\nExec=%s/bin/chamesle-windowmaker\nType=Application\n' "${1:-/usr/local}" > "$x/chamesle-windowmaker.desktop"
diff --git a/desktop/windowmaker/patches/wmbattery-2.56-lto.patch b/desktop/windowmaker/patches/wmbattery-2.56-lto.patch
@@ -0,0 +1,12 @@
+diff -Naur wmbattery-2.56.orig/sonypi.c wmbattery-2.56/sonypi.c
+--- wmbattery-2.56.orig/sonypi.c 2022-06-03 21:22:12.000000000 +0200
++++ wmbattery-2.56/sonypi.c 2025-08-22 01:21:59.483780914 +0200
+@@ -24,7 +24,7 @@
+ return 1;
+ }
+
+-inline int sonypi_ioctl(int ioctlno, void *param)
++static int sonypi_ioctl(int ioctlno, void *param)
+ {
+ if (ioctl(spicfd, ioctlno, param) < 0)
+ return 0;
diff --git a/desktop/windowmaker/patches/wmsystemtray-1.4-ar.patch b/desktop/windowmaker/patches/wmsystemtray-1.4-ar.patch
@@ -0,0 +1,11 @@
+diff -Naur wmsystemtray-1.4.orig/configure.ac wmsystemtray-1.4/configure.ac
+--- wmsystemtray-1.4.orig/configure.ac 2014-02-23 03:14:09.000000000 +0100
++++ wmsystemtray-1.4/configure.ac 2021-01-03 00:23:12.004713692 +0100
+@@ -9,6 +9,7 @@
+ AC_SUBST(VERSION)
+
+ # Checks for programs.
++AM_PROG_AR
+ AC_PROG_AWK
+ AC_PROG_CC
+ AC_PROG_CC_STDC
diff --git a/desktop/windowmaker/share/WMRootMenu b/desktop/windowmaker/share/WMRootMenu
@@ -0,0 +1,29 @@
+(
+ "Chamesle",
+ ("Terminal", SHORTCUT, "Mod4+Return", EXEC, xterm),
+ ("Files", SHORTCUT, "Mod4+E", EXEC, xfe),
+ ("Web", SHORTCUT, "Mod4+W", EXEC, "@SHARE@/web"),
+ ("Applications", OPEN_PLMENU, "|| wmmenugen -parser:xdg /usr/share/applications /usr/local/share/applications"),
+ ("Run...", SHORTCUT, "Mod4+R", SHEXEC, "%A(Run,Type a command:)"),
+ (
+ "Workspaces",
+ WORKSPACE_MENU
+ ),
+ (
+ "Appearance",
+ ("Themes", OPEN_MENU, "-noext /usr/share/WindowMaker/Themes $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle"),
+ ("Styles", OPEN_MENU, "-noext /usr/share/WindowMaker/Styles $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle"),
+ ("Backgrounds", OPEN_MENU, "-noext /usr/share/WindowMaker/Backgrounds $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t"),
+ ("Preferences", EXEC, WPrefs)
+ ),
+ (
+ "Session",
+ ("Hide Others", HIDE_OTHERS),
+ ("Show All", SHOW_ALL),
+ ("Arrange Icons", ARRANGE_ICONS),
+ ("Refresh", REFRESH),
+ ("Lock", EXEC, "xscreensaver-command -lock || xlock"),
+ ("Restart", RESTART),
+ ("Log Out", SHORTCUT, "Mod4+Shift+Q", EXIT)
+ )
+)
diff --git a/desktop/windowmaker/share/WMState b/desktop/windowmaker/share/WMState
@@ -0,0 +1,135 @@
+{
+ Dock = {
+ AutoRaiseLower = No;
+ Applications = (
+ {
+ Command = "WPrefs";
+ Name = Logo.WMDock;
+ AutoLaunch = No;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,0";
+ Omnipresent = No;
+ DropCommand = "WPrefs %d";
+ Lock = Yes;
+ },
+ {
+ Command = "xterm";
+ Name = xterm.XTerm;
+ AutoLaunch = No;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,1";
+ Omnipresent = No;
+ DropCommand = "xterm %d";
+ Lock = Yes;
+ },
+ {
+ Command = "xfe";
+ Name = xfe.Xfe;
+ AutoLaunch = No;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,2";
+ Omnipresent = No;
+ DropCommand = "xfe %d";
+ Lock = Yes;
+ },
+ {
+ Command = "@SHARE@/web";
+ Name = Navigator.firefox;
+ AutoLaunch = No;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,3";
+ Omnipresent = No;
+ DropCommand = "@SHARE@/web %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmclock";
+ Name = wmclock.WMClock;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,4";
+ Omnipresent = No;
+ DropCommand = "wmclock %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmcpuload";
+ Name = wmcpuload.DockApp;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,5";
+ Omnipresent = No;
+ DropCommand = "wmcpuload %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmmemload";
+ Name = wmmemload.DockApp;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,6";
+ Omnipresent = No;
+ DropCommand = "wmmemload %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmnet";
+ Name = wmnet.WMNET;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,7";
+ Omnipresent = No;
+ DropCommand = "wmnet %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmix";
+ Name = wmix.wmix;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,8";
+ Omnipresent = No;
+ DropCommand = "wmix %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmbattery";
+ Name = wmbattery.wmbattery;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,9";
+ Omnipresent = No;
+ DropCommand = "wmbattery %d";
+ Lock = Yes;
+ },
+ {
+ Command = "wmsystemtray";
+ Name = wmsystemtray0.wmsystemtray;
+ AutoLaunch = Yes;
+ Forced = No;
+ BuggyApplication = No;
+ Position = "0,10";
+ Omnipresent = No;
+ DropCommand = "wmsystemtray %d";
+ Lock = Yes;
+ }
+ );
+ Lowered = Yes;
+ };
+ Workspaces = (
+ {Name = One;},
+ {Name = Two;},
+ {Name = Three;},
+ {Name = Four;}
+ );
+}
diff --git a/desktop/windowmaker/share/WMWindowAttributes b/desktop/windowmaker/share/WMWindowAttributes
@@ -0,0 +1,8 @@
+{
+ "*" = {Icon = defaultAppIcon.tiff;};
+ Logo.WMDock = {Icon = GNUstep3D.tiff;};
+ Logo.WMPanel = {Icon = GNUstep.tiff;};
+ XTerm = {Icon = TerminalGNUstep.tiff;};
+ Xfe = {NoAppIcon = No;};
+ DockApp = {NoTitlebar = Yes; NoResizebar = Yes;};
+}
diff --git a/desktop/windowmaker/share/WindowMaker b/desktop/windowmaker/share/WindowMaker
@@ -0,0 +1,63 @@
+{
+ IconSize = 64;
+ ModifierKey = Mod4;
+ FocusMode = sloppy;
+ NewStyle = next;
+ DisableClip = YES;
+ DisableDrawers = NO;
+ IconPosition = blh;
+ IconificationStyle = Zoom;
+ WorkspaceNameDisplayPosition = none;
+ MouseLeftButtonAction = SelectWindows;
+ MouseMiddleButtonAction = OpenWindowListMenu;
+ MouseRightButtonAction = OpenApplicationsMenu;
+ MouseWheelAction = SwitchWorkspaces;
+ WindowPlacement = auto;
+ OpaqueMove = YES;
+ OpaqueResize = NO;
+ Superfluous = YES;
+ AntialiasedText = YES;
+ TitleJustify = center;
+ WindowTitleFont = "Nimbus Sans:bold:pixelsize=13";
+ MenuTitleFont = "Nimbus Sans:bold:pixelsize=13";
+ MenuTextFont = "Nimbus Sans:pixelsize=13";
+ IconTitleFont = "Nimbus Sans:pixelsize=9";
+ ClipTitleFont = "Nimbus Sans:bold:pixelsize=10";
+ LargeDisplayFont = "Nimbus Sans:bold:pixelsize=24";
+ WorkspaceBack = (solid, "#505075");
+ IconBack = (dgradient, "#b4b4b4", "#6c6c6c");
+ FTitleBack = (solid, black);
+ PTitleBack = (solid, "#555555");
+ UTitleBack = (solid, "#aaaaaa");
+ FTitleColor = white;
+ PTitleColor = white;
+ UTitleColor = black;
+ ResizebarBack = (solid, "#aaaaaa");
+ MenuTitleBack = (solid, black);
+ MenuTitleColor = white;
+ MenuTextBack = (solid, "#aaaaaa");
+ MenuTextColor = black;
+ MenuDisabledColor = "#555555";
+ HighlightColor = white;
+ HighlightTextColor = black;
+ ClipTitleColor = black;
+ CClipTitleColor = "#454045";
+ FrameBorderColor = black;
+ FrameFocusedBorderColor = black;
+ FrameSelectedBorderColor = white;
+ WorkspaceBorder = None;
+ RootMenuKey = "Mod4+space";
+ WindowListKey = "Mod4+Tab";
+ CloseKey = "Mod4+Q";
+ MaximizeKey = "Mod4+M";
+ MiniaturizeKey = "Mod4+H";
+ HideKey = "Mod4+Shift+H";
+ FocusNextKey = "Mod1+Tab";
+ FocusPrevKey = "Mod1+Shift+Tab";
+ NextWorkspaceKey = "Mod4+Right";
+ PrevWorkspaceKey = "Mod4+Left";
+ Workspace1Key = "Mod4+1";
+ Workspace2Key = "Mod4+2";
+ Workspace3Key = "Mod4+3";
+ Workspace4Key = "Mod4+4";
+}
diff --git a/desktop/windowmaker/share/autostart b/desktop/windowmaker/share/autostart
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Window Maker runs this once it is up. the dock starts the dock apps itself
+command -v xsetroot >/dev/null && xsetroot -cursor_name left_ptr
+if ! pgrep -u "$(id -u)" -x pipewire >/dev/null; then
+ if command -v gentoo-pipewire-launcher >/dev/null; then gentoo-pipewire-launcher restart >/dev/null 2>&1 &
+ elif command -v pipewire >/dev/null; then pipewire >/dev/null 2>&1 &
+ fi
+fi
+(sleep 2; command -v nm-applet >/dev/null && exec nm-applet) &
+command -v xscreensaver >/dev/null && xscreensaver -no-splash &
+exit 0
diff --git a/desktop/windowmaker/share/web b/desktop/windowmaker/share/web
@@ -0,0 +1,3 @@
+#!/bin/sh
+for b in firefox firefox-bin librewolf chromium; do command -v $b >/dev/null && exec $b "$@"; done
+exec xmessage "no web browser, install firefox"
diff --git a/tools/mkpkgs b/tools/mkpkgs
@@ -1,7 +1,8 @@
#!/bin/sh
# mkpkgs ARCH OUT: Chamesle's own packages for one arch, signed with KEY, and the index of OUT.
# KEY=~/.chamesle-keys/chamesle-20261118.rsa MAG=~/src/mag/mag RIFLE=~/src/rifle/rifle mkpkgs x86_64 repo/x86_64
-# RIFLE is left out where rifle does not build (it is x86_64 only for now). REL is the -rN of the base's version
+# RIFLE is left out where rifle does not build (it is x86_64 only for now). REL is the -rN of the base's version.
+# DOCKAPPS is what desktop/windowmaker/dockapps built for this arch, chamesle-dockapps is left out without it
set -e
here=$(cd "$(dirname "$0")/.." && pwd)
[ $# = 2 ] && [ -f "$KEY" ] && [ -x "$MAG" ] || { echo "usage: KEY=... MAG=... [RIFLE=...] mkpkgs ARCH OUT" >&2; exit 2; }
@@ -37,4 +38,12 @@ cp "$here/handbook/handbook.md" "$b/usr/share/doc/chamesle/handbook.md"
mkapk -n chamesle-base -v "$(date +%Y%m%d)-r${REL:-0}" -d "Winchester, the files in /etc and the tools of Chamesle" \
-D "$deps" -s "$here/pkg/chamesle-base" "$b"
+d=$tmp/windowmaker
+DESTDIR=$d "$here/desktop/windowmaker/install" /usr
+mkapk -n chamesle-windowmaker -v "$(date +%Y%m%d)-r${WMREL:-0}" -d "Window Maker with the dock apps and the NeXT look" \
+ -D "windowmaker xterm xfe xsetroot font-urw-base35 font-misc-misc${DOCKAPPS:+ chamesle-dockapps}" "$d"
+if [ -n "$DOCKAPPS" ]; then
+ mkapk -n chamesle-dockapps -v "$(date +%Y%m%d)-r${WMREL:-0}" -d "wmclock, wmcpuload, wmmemload, wmnet, wmix, wmbattery and wmsystemtray" \
+ -D "libx11 libxext libxpm alsa-lib upower" "$DOCKAPPS"
+fi
"$here/tools/mkrepo" "$out" "$KEY"