desktop: seed ~/.config on login (CBPP-style) so autostart fires for any user
desktop: seed ~/.config on login (CBPP-style) so autostart fires for any user
Root cause of the bare desktop (branded menu but no wallpaper/tint2/conky for
zygaena): openbox-autostart only runs /etc/xdg/openbox/autostart or
~/.config/openbox/autostart -- it does NOT honor XDG_CONFIG_DIRS, so it never
runs the autostart we ship under /usr/local/etc/xdg. The openbox WM binary DOES
honor XDG_CONFIG_DIRS (hence the branded menu), but the autostart helper does
not, and a fresh user has no ~/.config/openbox.
Fix mirrors CrunchBang++/BunsenLabs (bunsenlabs-session copies default config
from the system skel when the user has none): new hh-desktop-init seeds
~/.config/{openbox,tint2,conky} from /usr/local/etc/xdg if absent
(copy-if-missing, never clobbers). Called from the xdm Xsession and the skel
.xsession before openbox-session. hammerhead-desktop 1.5.0, hammerhead-xdm r6.
Author:
Chris Tusa <chris.tusa@leafscale.com>
Date:
Jul 24, 2026 11:11
Changeset:
7512ccfa0367f5952453753f8ee25c9553ea7461
Branch:
default
Diff
diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-desktop/build.sh --- a/base/hammerhead-desktop/build.sh Fri Jul 24 10:40:57 2026 -0500 +++ b/base/hammerhead-desktop/build.sh Fri Jul 24 11:11:39 2026 -0500 @@ -88,3 +88,9 @@ # ~/.xsession setup. mkdir -p "$PKGDIR/etc/skel" install -m 755 "$PORTDIR/dot-xsession" "$PKGDIR/etc/skel/.xsession" + +# --- Step 12: hh-desktop-init (per-user ~/.config seed, CBPP-style) --- +# openbox-autostart only reads ~/.config or /etc/xdg (not our /usr/local/etc/xdg), +# so the X session entrypoints call this to seed ~/.config on login for new AND +# existing users (copy-if-missing). +install -m 755 "$PORTDIR/hh-desktop-init" "$PKGDIR$PREFIX/bin/hh-desktop-init" diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-desktop/dot-xsession --- a/base/hammerhead-desktop/dot-xsession Fri Jul 24 10:40:57 2026 -0500 +++ b/base/hammerhead-desktop/dot-xsession Fri Jul 24 11:11:39 2026 -0500 @@ -7,4 +7,7 @@ # run ~/.xsession directly, get the branded desktop too.) export XDG_CONFIG_DIRS="/usr/local/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}" export XDG_DATA_DIRS="/usr/local/share:${XDG_DATA_DIRS:-/usr/share}" +# Seed ~/.config so openbox-autostart (which only reads ~/.config or /etc/xdg) +# runs our autostart -> tint2/conky/wallpaper. See hh-desktop-init. +/usr/local/bin/hh-desktop-init exec /usr/local/bin/openbox-session diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-desktop/hh-desktop-init --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/base/hammerhead-desktop/hh-desktop-init Fri Jul 24 11:11:39 2026 -0500 @@ -0,0 +1,24 @@ +#!/bin/sh +# hh-desktop-init - seed the user's ~/.config with the Hammerhead desktop +# defaults if absent, then return. Called from the X session entrypoint +# (xdm Xsession / ~/.xsession) BEFORE openbox-session. +# +# Why: openbox-autostart (run by openbox-session) only executes +# /etc/xdg/openbox/autostart or ~/.config/openbox/autostart -- it does NOT +# honor XDG_CONFIG_DIRS, so it never runs the autostart we ship under +# /usr/local/etc/xdg. Likewise tint2/conky look in ~/.config first. A fresh +# user (no ~/.config) therefore gets a bare desktop: no wallpaper, panel, or +# monitor. This mirrors CrunchBang++/BunsenLabs, whose session copies the +# default config from the system skel when the user has none. +# +# Copy-if-missing only: never clobbers a user's own customizations. +TMPL=/usr/local/etc/xdg +CFG="${XDG_CONFIG_HOME:-$HOME/.config}" + +for d in openbox tint2 conky; do + if [ ! -e "$CFG/$d" ] && [ -d "$TMPL/$d" ]; then + mkdir -p "$CFG/$d" 2>/dev/null || continue + cp -R "$TMPL/$d/." "$CFG/$d/" 2>/dev/null + fi +done +exit 0 diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-desktop/package.toml --- a/base/hammerhead-desktop/package.toml Fri Jul 24 10:40:57 2026 -0500 +++ b/base/hammerhead-desktop/package.toml Fri Jul 24 11:11:39 2026 -0500 @@ -7,7 +7,7 @@ [package] name = "hammerhead-desktop" -version = "1.4.0" +version = "1.5.0" release = 1 description = "Zygaena marine-dark desktop branding: wallpaper, Openbox theme, tint2/conky configs, categorized menu w/ CBPP-style Places/Recent pipemenus, autostart" url = "https://git.sharkos.one/zygaena/hammerhead" diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-xdm/Xsession --- a/base/hammerhead-xdm/Xsession Fri Jul 24 10:40:57 2026 -0500 +++ b/base/hammerhead-xdm/Xsession Fri Jul 24 11:11:39 2026 -0500 @@ -9,6 +9,10 @@ export XDG_CONFIG_DIRS="/usr/local/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg}" export XDG_DATA_DIRS="/usr/local/share:${XDG_DATA_DIRS:-/usr/share}" +# Seed ~/.config with the Hammerhead desktop defaults if absent, so the +# openbox autostart (tint2/conky/wallpaper) fires even for a fresh user. +/usr/local/bin/hh-desktop-init + # Prefer the user's own ~/.xsession; otherwise the Hammerhead Openbox session. if [ -x "$HOME/.xsession" ]; then exec "$HOME/.xsession" diff -r ccd8c9f06cc5 -r 7512ccfa0367 base/hammerhead-xdm/package.toml --- a/base/hammerhead-xdm/package.toml Fri Jul 24 10:40:57 2026 -0500 +++ b/base/hammerhead-xdm/package.toml Fri Jul 24 11:11:39 2026 -0500 @@ -10,7 +10,7 @@ [package] name = "hammerhead-xdm" version = "1.0.0" -release = 5 +release = 6 description = "Zygaena marine-dark xdm greeter branding, system Xsession/Xservers wiring, and a disabled zyginit xdm service" url = "https://git.sharkos.one/zygaena/hammerhead" license = "CDDL-1.0"