- Zig 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| App.zig | ||
| build.zig | ||
| build.zig.zon | ||
| Palette.zig | ||
| README.md | ||
| root.zig | ||
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.