gtk: add install scripts, fix GTK4 dark mode switching#154
Open
hydroakri wants to merge 2 commits into
Open
Conversation
Move theme files under theme/ and generator code under src/. Add install.sh and uninstall.sh scripts that handle both GTK3 and GTK4. Fix GTK4 dark/light switching: GTK4 does not load gtk-dark.css from ~/.config/gtk-4.0/ when color-scheme changes — that mechanism only works for theme directories. install.sh now generates a single combined gtk.css using @media (prefers-color-scheme: dark), which GTK4 4.x maps from the color-scheme gsettings value, and uses absolute @import paths to avoid symlink path resolution issues. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lor-scheme install.sh now inlines libadwaita.css and libadwaita-tweaks.css into the generated gtk.css so the file has no external dependencies and survives theme directory moves (catppuccin-style self-contained output). Also: read and preserve the user's existing color-scheme preference instead of leaving a manual post-install step; print a nudge only when still on 'default'. Fix the 400/600-series description in README (was inverted: 600-series is light-mode foreground, 400-series is dark-mode foreground). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
gtk/port: theme files moved undertheme/, TypeScript color generator undersrc/install.shanduninstall.shscripts for proper GTK3 + GTK4 installationcolor-schemegsettingsGTK4 dark mode fix
The existing documentation (and common advice) says to symlink
gtk-dark.cssinto~/.config/gtk-4.0/. This does not work: GTK4 only loadsgtk.cssfrom the user config directory — thegtk-dark.cssdark-variant mechanism only applies to files under~/.local/share/themes/, which libadwaita ignores entirely.The fix is to generate a single combined
gtk.cssusing@media (prefers-color-scheme: dark), which GTK4 4.x maps from thecolor-schemegsettings value.install.shextracts the@define-colordeclarations from both light and dark theme files and writes a combined file with the dark colors inside the media query block.@importpaths are written as absolute paths to avoid symlink path-resolution issues.Install
Test plan
install.sh, verify GTK3 apps pick up the Flexoki themeinstall.sh, togglecolor-schemebetweenprefer-darkandprefer-light, verify GTK4/libadwaita apps switch colors without restartuninstall.sh, verify theme files and generated CSS are removed and gsettings is resetcd gtk/src && npm install && npm run buildto verify the generator still produces correct output under the new directory structure🤖 Generated with Claude Code