18 KiB
Windows XP Start Menu for Hyprland (Ubuntu 26.04 LTS) — Architecture & Implementation Blueprint
1. Executive Summary
The cleanest, most pixel-accurate way to build a two-column Windows XP Start Menu for Hyprland on Ubuntu 26.04 LTS is a resident Python 3 + PyGObject (Gtk 3.0 + GtkLayerShell 0.1) daemon that reuses the exact GTK3 widget hierarchy and CSS classes already compiled into all 9 installed xfce-winxp-tc themes under /usr/local/share/themes/<theme>/gtk-3.0/gtk.css.
- Zero new system dependencies:
Gtk 3.0,GtkLayerShell 0.10.0,Gio/GioUnix, andGdkPixbufare already installed and verified working (is_supported: Trueon Wayland). - Zero duplicated theme artwork: By using
.csd,.wintc-personal-menu,.start-userpane,.start-vuserpane,.start-columns,.start-programs-column,.start-places-column,.start-logoffpane, and.start-all-programs, the menu automatically inherits all 9 themes' PNGborder-images, gradients, fonts, and colors. - Wayland-native UX: Replaces fragile X11-style cascading
Gtk.Menupopups with an in-placeGtk.Stackleft-pane switch (Pinned/MFU↔All Programs↔Live Search), paired with a transparentGtkLayerShellbackdrop layer + Hyprlandsocket2IPC for reliable click-outside dismissal.
2. Upstream xfce-winxp-tc Start Menu Analysis
Inspected files:
/home/carsten/.local/src/xfce-winxp-tc/shell/taskband/src/res/personal-menu.ui/home/carsten/.local/src/xfce-winxp-tc/shell/taskband/src/res/start-menu.css/home/carsten/.local/src/xfce-winxp-tc/shell/taskband/src/start/personal.c/home/carsten/.local/src/xfce-winxp-tc/shell/taskband/src/start/progmenu.c/home/carsten/.local/src/xfce-winxp-tc/themes/build-common/gtk-3.0-base/styling/start-menu.scss/home/carsten/.local/src/xfce-winxp-tc/themes/build-common/gtk-3.0-base/override/wintc-start-menu.scss- Compiled
/usr/local/share/themes/*/gtk-3.0/gtk.css(all 9 installed themes)
2.1 Upstream Widget Hierarchy & CSS Classes
From personal-menu.ui, personal.c, and start-menu.css, the exact GTK3 widget tree is:
GtkWindow (.csd .wintc-personal-menu)
└── GtkBox (vertical, #main-box)
├── GtkBox (.start-userpane, horizontal)
│ ├── GtkBox (vertical — avatar container styled dynamically with userpic CSS)
│ │ └── GtkEventBox (#eventbox-userpic)
│ └── GtkLabel (#label-username-horz)
├── GtkBox (.start-columns, horizontal, expand=True)
│ ├── GtkBox (.start-vuserpane, vertical — used ONLY by Professional theme)
│ │ └── GtkLabel (#label-username-vert, angle=90, pack-type=end)
│ ├── GtkBox (.start-programs-column, vertical, expand=True)
│ │ └── GtkMenuBar (pack-direction=ttb)
│ │ ├── GtkMenuItem (.start-default-item) [Pinned apps: bold name + gray subtitle]
│ │ ├── GtkSeparatorMenuItem
│ │ ├── GtkMenuItem [MFU / Recent apps]
│ │ ├── GtkSeparatorMenuItem (valign=end, vexpand=True)
│ │ └── GtkMenuItem (.start-all-programs)
│ │ └── GtkBox (horizontal, halign=center)
│ │ ├── GtkLabel ("All Programs")
│ │ └── GtkBox (.arrow)
│ └── GtkBox (.start-places-column, vertical)
│ └── GtkMenuBar (pack-direction=ttb)
│ ├── GtkMenuItem (.significant) [Bold Places: Documents, Pictures, Music, Computer]
│ ├── GtkSeparatorMenuItem
│ ├── GtkMenuItem [Control Panel, Theme Switcher, Display Settings, ...]
│ ├── GtkSeparatorMenuItem
│ └── GtkMenuItem [Run...]
└── GtkBox (.start-logoffpane, horizontal)
├── GtkButton (#button-shutdown, pack-type=end)
│ └── GtkBox (horizontal)
│ ├── GtkBox (.shutdown-icon)
│ └── GtkLabel ("Turn Off Computer")
└── GtkButton (#button-logoff, pack-type=end)
└── GtkBox (horizontal)
├── GtkBox (.logoff-icon)
└── GtkLabel ("Log Off")
2.2 Compiled Theme Assets & Cross-Theme Differences (All 9 Themes)
Every theme in /usr/local/share/themes/<theme>/gtk-3.0/gtk.css already compiles ~37 .start-* rules referencing ../Resources/*.png:
-
Luna (
Blue,Olive Green,Silver),Royale,Royale Noir,Zune style,Embedded style:window.csd.wintc-personal-menu:background-color: rgba(0,0,0,0); border-style: none;(relies on PNGborder-images on child panes for rounded top corners)..start-userpane:start_userpane_body.png(or Silver's linear-gradient) +start_userpane_border.png; avatar frame uses.start-userpane box(user_tile_border.png,48x48viastart-menu.css)..start-programs-column:start_programs_border.png, white (#fff) in Luna/Silver/Olive, dark (#353F4D,#2F2F2F,#013C6B) in Royale Noir/Zune/Embedded..start-places-column:start_places_border.png, tinted (#D3E5FA,#F2F1E4,#E3E7EB,#5A606F,#666,#2E75AD)..start-logoffpane:start_logoffpane_body.png+start_logoffpane_border.png,.logoff-icon/.shutdown-icon(24x24) withlogoff_button.png/_hover.pngandshutdown_button.png/_hover.png..start-all-programs .arrow:all_programs_arrow.pngandall_programs_arrow_hover.png..start-vuserpane label: collapsed tofont-size: 0ptviastart-menu.css.
-
Windows Classic style:window.csd.wintc-personal-menu: solid#D4D0C8with 2pxborder-image: url("../Resources/popup_menu_border.png")..start-userpane:linear-gradient(90deg, #09066A 0%, #A6CAF0 100%), avatar box hidden (min-height: 0px; min-width: 0px; opacity: 0.0)..start-logoffpane: flat#D4D0C8background,#0A246Ahover highlight.
-
Professional(Windows 2000/NT-inspired vertical banner):.start-userpane: hidden (label { font-size: 0pt }, avatar0x0,opacity: 0.0)..start-vuserpane: visible on the left (background-color: #5096F8,start_vert_userpane_body.png), vertical 90°label(14ptitalic bold white)..start-places-column: includesstart_places.pngwatermark;menubar > menuitem:hoveruses text underline instead of a solid fill.
Key takeaway: If we keep both .start-userpane and .start-vuserpane in the widget tree and load the upstream start-menu.css rules (at PRIORITY_APPLICATION - 1, below the GTK theme's PRIORITY_THEME? Wait: GTK PRIORITY_THEME is 200, PRIORITY_APPLICATION is 600, so rules in start-menu.css like .start-vuserpane label { font-size: 0pt } must be loaded at GTK_STYLE_PROVIDER_PRIORITY_USER - 1 or PRIORITY_THEME - 1 (199) so theme overrides in Professional and Windows Classic style win!).
3. Technology Comparison & Local Runtime Verification
3.1 Local Runtime Verification
Tested on this machine (Ubuntu 26.04 LTS / resolute, Hyprland):
python3 -c "import gi; gi.require_version('Gtk','3.0'); gi.require_version('GtkLayerShell','0.1'); from gi.repository import Gtk, GtkLayerShell, Gio, GdkPixbuf; print('OK')"→OKGtkLayerShellversion:0.10.0,GtkLayerShell.is_supported()→TrueGio.DesktopAppInfo.get_all()→ 43 visible.desktopapplications (note: GLib 2.86+ emits aPyGIDeprecationWarningforGio.DesktopAppInfo, recommendingGioUnix.DesktopAppInfowith fallback toGio.DesktopAppInfo).apt-cache policy libgtk-3-dev libgtk-layer-shell-dev: available (3.24.52-0ubuntu1and0.10.0-1), not installed and not needed for Python + PyGObject.Waybar v0.15.0running with Hyprland IPC sockets at$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sockand.socket2.sock.
3.2 Architecture Decisions
| Decision | Option A | Option B (Recommended) | Why |
|---|---|---|---|
| Language / Toolkit | C/Vala + libgtk-layer-shell-dev |
Python 3 + PyGObject (Gtk 3.0 + GtkLayerShell 0.1) |
Zero build step, zero -dev packages, native GioUnix.DesktopAppInfo + Gtk.CssProvider, trivial JSON state/config handling. |
| Lifecycle | On-demand launch per click | Resident daemon (--daemon) + SIGUSR1 / Unix socket toggle |
On-demand cold-starts GTK3 + parses 43 .desktop files + loads theme CSS (~180–300 ms). Resident daemon toggles visibility in <10 ms (~40 MB RSS) and reloads theme on SIGHUP. |
| Click-outside Dismissal | KeyboardMode.EXCLUSIVE + focus-out only |
Transparent full-screen GtkLayerShell backdrop + Escape + Hyprland socket2 IPC |
focus-out-event is unreliable across wlr-layer-shell surfaces on Hyprland. A transparent Layer.TOP backdrop window (mapped just before the menu window so the menu stacks above it) catches any outside click reliably; Hyprland socket2 (activewindow>>, workspace>>) catches keyboard window/workspace switches. |
| All Programs & Search | Classic cascading Gtk.Menu popups |
In-place Gtk.Stack left-pane switch + live keyboard search |
Cascading Gtk.Menu submenus on Wayland wlr-layer-shell frequently misposition, clip at monitor edges, or break pointer grabs. An in-place Gtk.Stack (pinned ↔ all_programs ↔ search) stays inside the single layer surface, supports scrolling, and enables instant type-to-search. |
4. Concrete Blueprint
4.1 Recommended File Layout (When Implemented)
- Daemon & CLI toggle:
~/.local/bin/xp-start-menu(single Python script, or module in~/.local/share/xp-start-menu/) - Pinned apps & MFU state:
~/.config/xp-start-menu/pinned.jsonand~/.local/state/xp-start-menu/mfu.json - Hyprland startup:
exec-once = ~/.local/bin/xp-start-menu --daemon - Toggle invocation:
~/.local/bin/xp-start-menu --toggle(sendstoggleover$XDG_RUNTIME_DIR/xp-start-menu.sock, orSIGUSR1to PID file).
4.2 Exact GTK3 Widget Tree & CSS Strategy
-
Window & Transparency:
- Create
Gtk.Window(type=Gtk.WindowType.TOPLEVEL)withset_decorated(False),set_app_paintable(True), andscreen.get_rgba_visual()set on the window sowindow.csd.wintc-personal-menu { background-color: rgba(0,0,0,0); }renders clean rounded top corners on Luna/Royale/Zune/Embedded. - Add CSS classes
csdandwintc-personal-menudirectly towin.get_style_context(). - Configure
GtkLayerShell:init_for_window(win)set_layer(win, GtkLayerShell.Layer.TOP)set_anchor(win, GtkLayerShell.Edge.BOTTOM, True)andset_anchor(win, GtkLayerShell.Edge.LEFT, True)set_margin(win, GtkLayerShell.Edge.BOTTOM, 0)(sits flush above Waybar's 30px exclusive zone) andset_margin(win, GtkLayerShell.Edge.LEFT, 0)set_keyboard_mode(win, GtkLayerShell.KeyboardMode.ON_DEMAND)(allows typing immediately for search without stealing global compositor hotkeys likeSUPER).
- CSS Priority: Load base
start-menu.cssdefaults atGtk.STYLE_PROVIDER_PRIORITY_THEME - 1(199) so the active GTK theme (PRIORITY_THEME = 200) overrides.start-vuserpane label(forProfessional) and.start-userpane box(forWindows Classic style). Load small app-specific layout fixes (e.g.Gtk.Stackscrollbar/listbox reset, search entry styling) atGtk.STYLE_PROVIDER_PRIORITY_APPLICATION(600).
- Create
-
Top User Pane (
.start-userpane):- Avatar (
48x48): Check~/.face→/var/lib/AccountsService/icons/$USER→ fallback/home/carsten/.local/src/xfce-winxp-tc/shell/taskband/src/res/userpic.bmp. Apply viaGtk.CssProvideron the parentGtk.Boxof#eventbox-userpic:* { background-image: url('...'); background-size: 100% 100%; }. - Username:
pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0] or pwd.getpwuid(os.getuid()).pw_name.
- Avatar (
-
Left Column (
.start-programs-column,min-width: 182px–220px):- Uses a
Gtk.Stack(transition_type=SLIDE_LEFT_RIGHT,duration=120) inside.start-programs-column:- Page 1 (
pinned):- Pinned Apps (
.start-default-itemstyle:32x32lunaicon, boldName+ mutedGenericNamesubtitle):Firefox(firefox.desktop, subtitleInternet)Ghostty(com.mitchellh.ghostty.desktop, subtitleCommand Prompt)Thunar(thunar.desktop, subtitleFile Manager)Text Editor(org.gnome.TextEditor.desktop)
Gtk.Separator(styled to matchmenubar > separator)- Most Frequently Used (MFU) (up to 6 recently/frequently launched
.desktopapps frommfu.json,32x32icon + single-line name). - Expanding spacer +
Gtk.Separator+ All Programs row (.start-all-programswith.arrowGtk.Boxsoall_programs_arrow.png/_hover.pngrender natively).
- Pinned Apps (
- Page 2 (
all_programs):Gtk.ScrolledWindow(vexpand=True,hscrollbar_policy=NEVER,min-content-height=320) containing categorized.desktopentries (16x16icons) grouped into XP-style collapsible/flat sections (Accessories,Games,Internet,Multimedia,Office,System,Settings,Other).- Bottom
Gtk.Separator+ Back row (reversed arrow/label) returning topinned.
- Page 3 (
search):- Activated automatically when typing any printable character while the menu is open (or via a subtle compact search
Gtk.Entryat the top/bottom of the left column). Filters allGioUnix.DesktopAppInfo.get_all()entries byName,GenericName,Comment,Keywords, andExec.Returnlaunches the top match;Escapeclears search back topinned(secondEscapecloses the menu).
- Activated automatically when typing any printable character while the menu is open (or via a subtle compact search
- Page 1 (
- Uses a
-
Right Column (
.start-places-column,min-width: 178px):- All items use
24x24lunaicons andGtk.MenuIteminsideGtk.MenuBar(pack-direction=ttb) so.start-places-column menubar > menuitemand.significantrules apply verbatim:- Bold (
.significant):My Documents(folder-documents) →thunar ~/DocumentsMy Pictures(folder-pictures) →thunar ~/PicturesMy Music(folder-music) →thunar ~/MusicMy Computer(computer) →thunar computer:///
Gtk.SeparatorMenuItem- Regular:
Control Panel(preferences-other) →nwg-look(orxfce4-settings-managerif installed)Theme Switcher(preferences-desktop-theme) →~/.local/bin/xp-theme-switch --menuDisplay Settings(preferences-desktop-display) →nwg-displays
Gtk.SeparatorMenuItem- Regular:
Run...(system-run) →~/.config/hypr/scripts/xp-run.sh
- Bold (
- All items use
-
Bottom Logoff Pane (
.start-logoffpane):- Right-aligned (
pack-type=end)Gtk.Buttons matchingpersonal-menu.ui:Log Off(.logoff-icon+"Log Off") →~/.config/hypr/scripts/xp-power-menu.sh(or directhyprctl dispatch exitconfirmation)Turn Off Computer(.shutdown-icon+"Turn Off Computer") →~/.config/hypr/scripts/xp-power-menu.sh
- Right-aligned (
4.3 Waybar Start Button Integration
Currently ~/.config/waybar/config.jsonc defines custom/start with on-click only. To keep #custom-start visually pressed (start_button_press_body.png + start_button_press_border.png) while the Start Menu is open:
- Add
"return-type": "json","signal": 8, and"exec": "cat ${XDG_RUNTIME_DIR:-/tmp}/xp-start-menu.waybar 2>/dev/null || echo '{\"text\":\"start\",\"class\":\"closed\"}'"tocustom/startinwaybar/config.jsonc. - In
xp-start-menudaemon, whenever the menu opens or closes, atomically write{"text":"start","class":"open"}(or"closed") to$XDG_RUNTIME_DIR/xp-start-menu.waybarand runpkill -SIGRTMIN+8 waybar. - In
waybar/style.css(andxp-theme-switchtemplate), style#custom-start.openidentically to#custom-start:active.
5. Edge Cases & Gotchas
Gtk.MenuBar/Gtk.MenuItemClick Handling Without Submenus: InsideGtkLayerShell,Gtk.MenuItemitems without submenus fire"activate"on click, except if you attach abutton-press-eventthat returnsTruewithout callingactivate. Prefer connecting"activate"onGtk.MenuItems and closing the menu beforesubprocess.Popen(..., start_new_session=True)so launched apps don't inherit the daemon's process group or layer-shell state.- Backdrop Layer Stacking Order: On Hyprland, two
Layer.TOPwindows stack in creation/map order. Alwaysshow_all()the transparent backdrop window first, thenshow_all()the Start Menu window (or place the backdrop onLayer.TOPand the menu onLayer.OVERLAY—thoughTOP+TOPavoids coveringLayer.OVERLAYlockscreens/notifications). - Theme Hot-Reload:
xp-theme-switchupdatesorg.gnome.desktop.interface gtk-themeandicon-themeviagsettings. The daemon should connect toGtk.Settings.get_default().connect("notify::gtk-theme-name", ...)(andSIGHUP) to refreshGtk.IconThemeand re-evaluateProfessional/Windows Classic stylelayout visibility if needed. - Rounded Corners & Hyprland
layerrule: Inhyprland.conf, addlayerrule = noanim, xp-start-menu(if a namespace is set viaGtkLayerShell.set_namespace(win, "xp-start-menu")) so Hyprland doesn't apply fade/slide animations that lag behind the instant XP popup feel, and avoid forcingbluron the transparent backdrop layer. - Multi-Monitor Targeting: Call
GtkLayerShell.set_monitor(win, gdk_display.get_monitor_at_point(x, y))using the active monitor fromhyprctl -j monitors(focused: true) beforeshow_all(), so pressingSuperopens the Start Menu on the currently focused monitor. - Minimum Height / Content Stability: Set a consistent
min-height(~380–420px) on.start-columnsso switching betweenPinned(8–10 items),All Programs, andSearchdoes not cause the menu window's top edge to jump vertically.