feat(wbconf): GTK4 settings GUI (obconf-style) + fix C++ i18n#65
Merged
Conversation
Introduce wbconf, an optional graphical configuration tool for waybox modelled after Openbox's obconf. It edits the user's rc.xml in place through a small, unit-tested libxml2 model and asks a running waybox to reload (SIGUSR2). - wb::RcDocument (waybox/wbconf.cpp): loads rc.xml, reads/writes only the settings wbconf manages — standard Openbox keys (theme/name, placement/policy, margins) and the waybox extensions (titlebar/menu/switcher attributes on <waybox> children) — preserving keybindings, app rules and comments. Round-trip unit-tested (test/wbconf_test.cpp). - wb::installed_theme_names(): enumerate themes with an openbox-3/themerc. - wbconf/main.cpp: GTK4 UI with obconf-style tabs (Appearance, Windows, Margins, Menu, Switcher), Save & Apply (writes ~/.config/waybox/rc.xml and signals waybox), built only when GTK4 is present (meson feature 'wbconf', auto). - Ships wbconf.desktop (validated). i18n: every wbconf string is wrapped in _() and the text domain initialised. The gettext build defines (USE_NLS/GETTEXT_PACKAGE/LOCALEDIR) were only applied to C, so after the C->C++ port the compositor's own _() strings were no longer translated at runtime; extend them to C++ and refresh POTFILES.in to the .cpp filenames plus wbconf, regenerating waybox.pot. Tests: 27 green (g++/ASan, incl. the new wbconf model test); clang + release clean; headless smoke shows the GUI maps and populates under real Wayland with no ASan/GTK errors; pot extraction includes the wbconf strings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restyle the wbconf GUI to match obconf's visual idiom and wire it into the
default menu like Openbox does with obconf:
- Each tab is now a page of bold section headers ("<span weight='bold'>…")
over 12px-indented content, matching obconf's layout.
- The Theme tab is a scrolling, browse-selection list of installed themes
(obconf-style) instead of a drop-down, with the active theme selected.
- Tabs renamed to obconf's vocabulary: Theme, Appearance ("Window Titles"),
Windows ("Placing Windows"), Margins ("Reserved Screen Margins"), Menu
("Root Menu"), Switcher ("Task Switcher").
- data/menu.xml: add a separator and a "Configure" entry that launches wbconf
in the root menu, mirroring Openbox shipping ObConf in its menu. (Separators
were already supported by the menu parser/renderer.)
All strings remain wrapped in _() for translation.
Verified: full suite 27 green (g++/ASan); wbconf builds and maps under real
Wayland with the new layout and no GTK/ASan errors; waybox parses the updated
menu (separator + Configure) without error.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds wbconf, an optional graphical configuration tool for waybox, modelled after Openbox's obconf.
What it does
rc.xmlin place (preserves keybindings, application rules and comments) through a small libxml2 model, then asks a running waybox to reload via SIGUSR2 (the signal Openbox uses).Structure
wb::RcDocument(waybox/wbconf.cpp) — the testable rc.xml model: reads/writes only the managed nodes (standardtheme/name,placement/policy,marginsas element text; the<waybox>titlebar/menu/switcher extensions as attributes). Round-trip unit-tested.wb::installed_theme_names()— enumerate themes with anopenbox-3/themerc.wbconf/main.cpp— GTK4 UI; built only when GTK4 is present (-Dwbconf=auto). Ships a validatedwbconf.desktop.i18n / l10n
Every wbconf string is wrapped in
_()with the text domain initialised. Also fixes a post-migration regression: the gettext build defines (USE_NLS/GETTEXT_PACKAGE/LOCALEDIR) were applied only to C, so after the C→C++ port the compositor's own_()strings were no longer translated at runtime — now extended to C++.POTFILES.inrefreshed to the.cppfilenames plus wbconf;waybox.potregenerated.Testing
wbconfmodel round-trip test (read existing, round-trip all settings, in-place update without duplication, clearing removes nodes/attrs, keybindings preserved).--buildtype=releaseclean (compositor + wbconf).waybox.potextraction includes the wbconf strings.Notes / follow-ups (tracked)
rc.xsd/menu.xsdextended with a waybox xsd — not WebView._()is queued.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com