No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
nnra6864 4e43d9f780 feat: Qt apps take the general and fixed fonts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:07:29 +01:00
.gitignore chore: Ignore build output 2026-11-11 00:28:37 +01:00
App.zig feat: Qt apps take the general and fixed fonts 2026-11-17 05:07:29 +01:00
build.zig feat: A qt5ct and qt6ct color scheme of its own, selected in each program's config 2026-11-11 00:28:37 +01:00
build.zig.zon feat: Running Qt apps take new colors and fonts after an apply, and Darkly windows the background's alpha 2026-11-16 18:58:34 +01:00
Palette.zig feat: A qt5ct and qt6ct color scheme of its own, selected in each program's config 2026-11-11 00:28:37 +01:00
README.md feat: Qt apps take the general and fixed fonts 2026-11-17 05:07:29 +01:00
root.zig feat: Qt apps take the general and fixed fonts 2026-11-17 05:07:29 +01:00

kosm_qtct

qt5ct and qt6ct for kosm: a color scheme of their own, so Qt apps using the qt5ct or qt6ct platform theme (QT_QPA_PLATFORMTHEME) take the theme's colors. It also exports the qt adapter, the INI that QSettings writes.

For each program the app writes the scheme whole (~/.config/qt5ct/colors/kosm.conf, ~/.config/qt6ct/colors/kosm.conf), then sets [Appearance]'s color_scheme_path to it and custom_palette=true in the program's config, keeping everything else byte for byte. Those keys must be in the config already, as the program writes them once a scheme is picked in it. Set a program to null to leave it alone, or its config to null to select the scheme yourself. After each apply the app updates each config's modification time (touch -c), which makes running Qt apps re-read their colors and fonts about a second later. With the theme's files = .per_kosmos each scheme is named after the kosmos instead (krystallos.dark.conf), so each kosmos applied keeps its own. A set icon_theme and fonts go into the same configs' [Appearance] and [Fonts], whose keys must be there already too.

A scheme holds three color groups (active, inactive, disabled), each a color for every QPalette role in Qt's order, spelled #aarrggbb. qt6ct also gets Qt 6.6's accent when it is set.

Colors are written opaque unless a program is translucent: Breeze and Fusion draw a window whose color has alpha darker, not see-through. Darkly (https://github.com/Bali10050/Darkly) draws translucent windows from the palette's alpha, so with style = "Darkly" and translucent = true Qt windows take the theme's background alpha. Darkly paints a window's background twice, so the scheme holds a lower alpha that shows as the theme's after both layers; panels an app paints on top add layers of their own and look more opaque. A window turns translucent only when its app starts; colors and alpha change live after that.

from(theme) sets windows and inputs from the theme's background role with its background alpha, bevels from its lightness steps, text from the foreground role, selections from the theme's state.selected, links from the link role and the accent from the accent role. Disabled text takes the theme's state.disabled; inactive windows look like active ones.

Fields

Field Default
qt5ct .{ .scheme = "~/.config/qt5ct/colors/{name}.conf", .config = "~/.config/qt5ct/qt5ct.conf" }; null leaves qt5ct alone
qt6ct .{ .scheme = "~/.config/qt6ct/colors/{name}.conf", .config = "~/.config/qt6ct/qt6ct.conf" }; null leaves qt6ct alone
qt5ct.style, qt6ct.style null: the program's own choice; otherwise its [Appearance] style (Darkly, Breeze, Fusion)
qt5ct.translucent, qt6ct.translucent false: colors written opaque
icon_theme null: the program's own choice; otherwise its [Appearance] icon_theme, in both programs
fonts.general, fonts.fixed null: the program's own choice; otherwise [Fonts]' general and fixed (a Font: family, size in points), in each program's own Qt format
files the theme's files: {name} is kosm (.shared), or the kosmos' name (.per_kosmos)
active every role null; a written group needs all but accent
inactive null: the same as active
disabled null: the same as active

Fonts are not covered: qt5ct and qt6ct keep them as serialized QFonts, which their settings window writes.