Dotfiles/docs/md/theming.md

6.1 KiB
Raw Blame History

CyberQueer Theme System

The CyberQueer theme is a single-source colour system: every config file that needs colours references a small set of hex values that can be changed in one place and propagated everywhere with a single command.


The Palette

Defined in ~/Dotfiles/colors.conf (bare 6-digit hex, no # prefix):

COLOR_TEXT=D6ABAB       # Rose-white — foreground text, labels
COLOR_BG=1A1A1A         # Near-black — base surface, backgrounds
COLOR_HIGHLIGHT=E40046  # Hot pink   — primary accent, active borders
COLOR_DARK=5018DD       # Violet     — secondary accent, inactive borders
COLOR_RED=F50505        # Red        — danger indicators, alerts

Terminal ANSI Palette

The 5 base colours above cover UI accents, but terminals (kitty, Alacritty, Ghostty) also need a full 16-colour ANSI palette. The "CyberQueer" terminal theme extends the base palette with neon green/yellow/magenta/cyan tints kept in the same violet/crimson family, so ls, git, and syntax highlighting stay legible instead of clashing.

Defined in desktopenvs/hyprdrive/kitty/themes/cyberqueer.conf (canonical source) and mirrored into every kitty and Alacritty config in the repo:

Slot Name Normal Bright
0/8 black #1A1A1A #4B3A55
1/9 red #E40046 #F50505
2/10 green #33E6A0 #5CFFC2
3/11 yellow #E8B23D #FFD873
4/12 blue #5018DD #8C6FFF
5/13 magenta #A6178C #FF5FC0
6/14 cyan #34C6C6 #6FF5F0
7/15 white #D6ABAB #F2DEDE

Plus the fixed UI slots:

Role Hex
Foreground #D6ABAB
Background #1A1A1A
Cursor #E40046
Cursor text #5018DD
Selection background #5018DD
Selection foreground #E40046

This palette is deployed identically to kitty (kitty/themes/cyberqueer.conf, kitty/current-theme.conf), Alacritty (alacritty/alacritty.toml, [colors] tables), and Ghostty (ghostty/config) across every desktop environment, so switching terminal emulators doesn't change the colours you see.


Applying the Theme

# Apply using the default colors.conf
bash ~/Dotfiles/apply-theme.sh

# Apply from a custom palette file
bash ~/Dotfiles/apply-theme.sh /path/to/custom-colors.conf

apply-theme.sh will:

  1. Read colors.conf (or the file you pass)
  2. Compare against the last-applied state in ~/.config/colors.state
  3. Replace only changed colour values across all tracked files
  4. Save the new state to colors.state

If nothing changed it exits immediately — safe to call repeatedly.

First-Run Bootstrap

On a fresh install where configs have been copied but no state file exists yet, apply-theme.sh bootstraps ~/.config/colors.state with the repository defaults so the diff works correctly from the start.


What Gets Themed

User Configs (~/.config/…)

File What it styles
starship.toml Shell prompt segment colours
yazi/theme.toml File manager UI colours
hypr/hyprland.conf Active/inactive window border gradients
hypr/hyprtoolkit.conf Additional Hyprland colours
hypr/hyprlock.conf Lock screen colours
kitty/current-theme.conf Terminal colour palette
kitty/kitty.conf Terminal background & accents
kitty/themes/cyberqueer.conf Kitty colour scheme definition
alacritty/alacritty.toml Alacritty terminal colour palette
ghostty/config Ghostty terminal colour palette
waybar/style.css Top bar widget colours
wofi/style.css App launcher colours
walker/themes/cyberqueer.css Walker launcher theme
nwg-dock-hyprland/style.css Application dock
nwg-drawer/drawer.css Application drawer
nwg-panel/menu-start.css Panel start menu
vicinae/cyberqueer.toml Gesture launcher
scripts/onscreenkb.sh On-screen keyboard colours
spicetify/Themes/*/color.ini Spotify client theme (×2 variants)
ulauncher/user-themes/cyberqueer/manifest.json uLauncher theme
ulauncher/user-themes/cyberqueer/theme.css uLauncher CSS
ulauncher/user-themes/cyberqueer/generated.css uLauncher generated CSS
Vencord/themes/cyberqueer.theme.css Discord theme
Vencord/themes/system24/…/cyberqueer.theme.css Discord system24 variant

System Files (applied via sudo)

File What it styles
/etc/ly/config.ini TUI login manager colours
/usr/share/themes/cyberqueer/gtk-3.0/gtk.css GTK 3 theme
/usr/share/themes/cyberqueer/gtk-4.0/gtk.css GTK 4 theme

Customising the Palette

Edit ~/Dotfiles/colors.conf, then run apply-theme.sh:

# Example: shift the accent to cyan
nano ~/Dotfiles/colors.conf
# → COLOR_HIGHLIGHT=00B4D8

bash ~/Dotfiles/apply-theme.sh

The tui-install.sh installer also offers a colorway dialog as its final step: enter new hex values in the form; leave them unchanged to skip.


How It Works Internally

apply-theme.sh reads two keyvalue files and computes the diff:

~/.config/colors.state   (old values — what's currently applied)
colors.conf              (new values — what you want)

For each changed key it runs:

sed -i "s/${OLD_HEX}/${NEW_HEX}/gI" <file>

The case-insensitive (I) flag matches uppercase hex codes that some apps emit. After all replacements succeed, colors.state is updated.

apply-theme.sh refuses to run if any deployed config path resolves back into ~/Dotfiles/ via symlink. This prevents theme changes from being committed directly into the git repository. The new-style install (via tui-install.sh) copies configs instead of symlinking them, so this guard is normally never triggered.


Answerfile Theming

If you generate an answerfile with generate-answerfile.sh, custom colours can be embedded in it:

{
  "colors": {
    "COLOR_TEXT": "D6ABAB",
    "COLOR_BG": "1A1A1A",
    "COLOR_HIGHLIGHT": "E40046",
    "COLOR_DARK": "5018DD",
    "COLOR_RED": "F50505"
  }
}

tui-install.sh will apply these at the end of an automated install.