feat(qt,gtk): overhaul theming — qt6ct style plugin, dark palette, GTK color-scheme
Qt: replace QT_STYLE_OVERRIDE/QT_STYLE_SHEET env vars with QT_QPA_PLATFORMTHEME=qt6ct + QT_QUICK_CONTROLS_STYLE=Fusion; add cyberqueer Qt6 style plugin (QProxyStyle wrapping Fusion with hardcoded dark palette); enable custom_palette in qt6ct.conf so qt6ct applies the dark QPalette directly for both Qt Widgets and Qt Quick apps. GTK: fix dark mode not applying — set gtk-application-prefer-dark-theme=1 in GTK3 settings.ini; add gsettings color-scheme=prefer-dark to install script (required by libadwaita apps which ignore gtk-theme-name); add index.theme so the theme is recognized by GTK theme discovery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main
parent
cfb949dff3
commit
3a49ab44d9
|
|
@ -51,6 +51,10 @@ USER_FILES=(
|
|||
"desktopenvs/hyprland/ulauncher/user-themes/cyberqueer/generated.css|$HOME/.config/ulauncher/user-themes/cyberqueer/generated.css"
|
||||
"desktopenvs/hyprland/Vencord/themes/cyberqueer.theme.css|$HOME/.config/Vencord/themes/cyberqueer.theme.css"
|
||||
"desktopenvs/hyprland/Vencord/themes/system24/theme/flavors/cyberqueer.theme.css|$HOME/.config/Vencord/themes/system24/theme/flavors/cyberqueer.theme.css"
|
||||
"qt-themes/cyberqueer/style.qss|$HOME/.config/qt6ct/qss/style.qss"
|
||||
"qt-themes/cyberqueer/cyberqueer.conf|$HOME/.config/qt6ct/colors/cyberqueer.conf"
|
||||
"qt-themes/cyberqueer/style-plugin/CyberQueerStyle.cpp|$DOTFILES/qt-themes/cyberqueer/style-plugin/CyberQueerStyle.cpp"
|
||||
"qt-themes/cyberqueer/hyprpolkitagent-qt.conf|$HOME/.config/systemd/user/hyprpolkitagent.service.d/qt-theme.conf"
|
||||
)
|
||||
|
||||
# System-owned paths — sed is run via sudo
|
||||
|
|
@ -200,6 +204,26 @@ for entry in "${SYS_FILES[@]}"; do
|
|||
fi
|
||||
done
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Reload services that read their config once at start
|
||||
|
||||
POLKIT_DROP="$HOME/.config/systemd/user/hyprpolkitagent.service.d/qt-theme.conf"
|
||||
if [[ -f "$POLKIT_DROP" ]] && systemctl --user is-active --quiet hyprpolkitagent 2>/dev/null; then
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user restart hyprpolkitagent
|
||||
echo "Restarted hyprpolkitagent with updated colors."
|
||||
fi
|
||||
|
||||
# Rebuild Qt style plugin if its source was updated
|
||||
PLUGIN_BUILD="$DOTFILES/qt-themes/cyberqueer/style-plugin/build.sh"
|
||||
if [[ -f "$PLUGIN_BUILD" ]]; then
|
||||
if bash "$PLUGIN_BUILD"; then
|
||||
echo "Rebuilt cyberqueer Qt style plugin."
|
||||
else
|
||||
echo "Warning: Qt style plugin rebuild failed — relaunch apps will still use old colors."
|
||||
fi
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Persist state
|
||||
|
||||
|
|
|
|||
|
|
@ -3,5 +3,4 @@ env = GDK_SCALE,2
|
|||
env = XCURSOR_SIZE,40
|
||||
env = HYPRCURSOR_SIZE,40
|
||||
env = QT_QPA_PLATFORMTHEME,qt6ct
|
||||
env = QT_STYLE_OVERRIDE,Fusion
|
||||
env = QT_STYLE_SHEET,~/.config/qt6ct/qss/style.qss
|
||||
env = QT_QUICK_CONTROLS_STYLE,Fusion
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@ gtk-xft-antialias=1
|
|||
gtk-xft-hinting=1
|
||||
gtk-xft-hintstyle=hintslight
|
||||
gtk-xft-rgba=rgb
|
||||
gtk-application-prefer-dark-theme=0
|
||||
gtk-application-prefer-dark-theme=1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
hl.env("GTK_THEME", "cyberqueer")
|
||||
hl.env("GDK_SCALE", "2")
|
||||
hl.env("XCURSOR_SIZE", "40")
|
||||
hl.env("HYPRCURSOR_SIZE", "40")
|
||||
hl.env("QT_QPA_PLATFORMTHEME", "qt6ct")
|
||||
hl.env("QT_STYLE_OVERRIDE", "Fusion")
|
||||
hl.env("QT_STYLE_SHEET", "~/.config/qt6ct/qss/style.qss")
|
||||
hl.env("GTK_THEME", "cyberqueer")
|
||||
hl.env("GDK_SCALE", "2")
|
||||
hl.env("XCURSOR_SIZE", "40")
|
||||
hl.env("HYPRCURSOR_SIZE", "40")
|
||||
hl.env("QT_QPA_PLATFORMTHEME", "qt6ct")
|
||||
hl.env("QT_QUICK_CONTROLS_STYLE", "Fusion")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
[Desktop Entry]
|
||||
Type=X-GNOME-Metatheme
|
||||
Name=cyberqueer
|
||||
Comment=CyberQueer dark theme
|
||||
Encoding=UTF-8
|
||||
|
||||
[X-GNOME-Metatheme]
|
||||
GtkTheme=cyberqueer
|
||||
MetacityTheme=cyberqueer
|
||||
IconTheme=Papirus-Dark
|
||||
CursorTheme=Nordzy-cursors-lefthand
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[ColorScheme]
|
||||
active_colors=#ffd6abab, #ff1a1a1a, #ff2a2a2a, #ff252525, #ff0d0d0d, #ff1f1f1f, #ffd6abab, #ffffffff, #ffd6abab, #ff1a1a1a, #ff1a1a1a, #ff2a2a2a, #ff5018dd, #ffffffff, #ff5018dd, #ffe40046, #ff222222, #ffffffff, #ff5018dd, #ffffffff, #80808086
|
||||
inactive_colors=#ffd6abab, #ff1a1a1a, #ff2a2a2a, #ff252525, #ff0d0d0d, #ff1f1f1f, #ffd6abab, #ffffffff, #ffd6abab, #ff1a1a1a, #ff1a1a1a, #ff2a2a2a, #ff5018dd, #ffffffff, #ff5018dd, #ffe40046, #ff222222, #ffffffff, #ff5018dd, #ffffffff, #80808086
|
||||
disabled_colors=#ff808086, #ff1a1a1a, #ff2a2a2a, #ff252525, #ff0d0d0d, #ff1f1f1f, #ff808086, #ffffffff, #ff808086, #ff1a1a1a, #ff1a1a1a, #ff2a2a2a, #ff5018dd, #ffffffff, #ff5018dd, #ffe40046, #ff222222, #ffffffff, #ff5018dd, #ffffffff, #80808086
|
||||
|
|
@ -1,5 +1,31 @@
|
|||
#!/usr/bin/bash
|
||||
export QT_STYLE_OVERRIDE="Fusion"
|
||||
export QT_QPA_PLATFORMTHEME="qt5ct"
|
||||
export QT_STYLE_SHEET="~/Dotfiles/qt-themes/cyberqueer/style.qss"
|
||||
# Deploy the cyberqueer Qt theme files to ~/.config/qt6ct/ and the
|
||||
# hyprpolkitagent systemd drop-in. Safe to re-run after reinstalls.
|
||||
set -euo pipefail
|
||||
|
||||
DOTFILES="${DOTFILES:-$HOME/Dotfiles}"
|
||||
SRC="$DOTFILES/qt-themes/cyberqueer"
|
||||
|
||||
# QSS stylesheet for Qt Widgets apps (loaded by qt6ct)
|
||||
mkdir -p "$HOME/.config/qt6ct/qss"
|
||||
cp "$SRC/style.qss" "$HOME/.config/qt6ct/qss/style.qss"
|
||||
|
||||
# qt6ct color palette (QPalette roles for Fusion style)
|
||||
mkdir -p "$HOME/.config/qt6ct/colors"
|
||||
cp "$SRC/cyberqueer.conf" "$HOME/.config/qt6ct/colors/cyberqueer.conf"
|
||||
|
||||
# qt6ct config — expand leading ~ to $HOME in file paths
|
||||
mkdir -p "$HOME/.config/qt6ct"
|
||||
sed "s|~|$HOME|g" "$SRC/qt6ct.conf" > "$HOME/.config/qt6ct/qt6ct.conf"
|
||||
|
||||
# cyberqueer Qt style plugin
|
||||
bash "$SRC/style-plugin/build.sh"
|
||||
|
||||
# hyprpolkitagent systemd drop-in: Material style + cyberqueer colors
|
||||
POLKIT_DROP="$HOME/.config/systemd/user/hyprpolkitagent.service.d"
|
||||
mkdir -p "$POLKIT_DROP"
|
||||
cp "$SRC/hyprpolkitagent-qt.conf" "$POLKIT_DROP/qt-theme.conf"
|
||||
systemctl --user daemon-reload || true
|
||||
systemctl --user restart hyprpolkitagent || true
|
||||
|
||||
echo "cyberqueer Qt theme deployed."
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
[Service]
|
||||
Environment="QT_QUICK_CONTROLS_STYLE=Material"
|
||||
Environment="QT_QUICK_CONTROLS_MATERIAL_THEME=Dark"
|
||||
Environment="QT_QUICK_CONTROLS_MATERIAL_ACCENT=#5018DD"
|
||||
Environment="QT_QUICK_CONTROLS_MATERIAL_BACKGROUND=#1A1A1A"
|
||||
Environment="QT_QUICK_CONTROLS_MATERIAL_FOREGROUND=#D6ABAB"
|
||||
Environment="QT_QUICK_CONTROLS_MATERIAL_PRIMARY=#1A1A1A"
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
[Appearance]
|
||||
custom_palette=true
|
||||
color_scheme_path=~/.config/qt6ct/colors/cyberqueer.conf
|
||||
icon_theme=Papirus-Dark
|
||||
standard_dialogs=default
|
||||
style=cyberqueer
|
||||
|
||||
[Fonts]
|
||||
fixed="Agave Nerd Font Mono,14,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
general="Agave Nerd Font Mono,14,-1,5,400,0,0,0,0,0,0,0,0,0,0,1"
|
||||
|
||||
[Interface]
|
||||
activate_item_on_single_click=1
|
||||
buttonbox_layout=0
|
||||
cursor_flash_time=1000
|
||||
dialog_buttons_have_icons=1
|
||||
double_click_interval=400
|
||||
gui_effects=@Invalid()
|
||||
keyboard_scheme=2
|
||||
menus_have_icons=true
|
||||
show_shortcuts_in_context_menus=true
|
||||
stylesheets=~/.config/qt6ct/qss/style.qss
|
||||
toolbutton_style=4
|
||||
underline_shortcut=1
|
||||
wheel_scroll_lines=3
|
||||
|
||||
[Troubleshooting]
|
||||
force_raster_widgets=1
|
||||
ignored_applications=@Invalid()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
project(cyberqueer-qt-style)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Widgets)
|
||||
|
||||
add_library(cyberqueer MODULE
|
||||
plugin.cpp
|
||||
CyberQueerStyle.cpp
|
||||
CyberQueerStyle.h
|
||||
)
|
||||
|
||||
target_link_libraries(cyberqueer PRIVATE Qt6::Widgets)
|
||||
|
||||
install(TARGETS cyberqueer
|
||||
LIBRARY DESTINATION /usr/lib/qt6/plugins/styles
|
||||
)
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
#include "CyberQueerStyle.h"
|
||||
#include <QPalette>
|
||||
|
||||
CyberQueerStyle::CyberQueerStyle()
|
||||
: QProxyStyle(QStringLiteral("Fusion"))
|
||||
{}
|
||||
|
||||
// Primary theme colors — hex literals are updated by apply-theme.sh.
|
||||
// After changing colors, rebuild with: qt-themes/cyberqueer/style-plugin/build.sh
|
||||
void CyberQueerStyle::polish(QPalette &p)
|
||||
{
|
||||
QProxyStyle::polish(p);
|
||||
|
||||
const QColor bg (QRgb(0xFF1A1A1A));
|
||||
const QColor fg (QRgb(0xFFD6ABAB));
|
||||
const QColor accent(QRgb(0xFF5018DD));
|
||||
const QColor hot (QRgb(0xFFE40046));
|
||||
|
||||
for (auto grp : {QPalette::Active, QPalette::Inactive}) {
|
||||
p.setColor(grp, QPalette::Window, bg);
|
||||
p.setColor(grp, QPalette::WindowText, fg);
|
||||
p.setColor(grp, QPalette::Base, bg);
|
||||
p.setColor(grp, QPalette::AlternateBase, QColor(0x22, 0x22, 0x22));
|
||||
p.setColor(grp, QPalette::Text, fg);
|
||||
p.setColor(grp, QPalette::BrightText, Qt::white);
|
||||
p.setColor(grp, QPalette::Button, bg);
|
||||
p.setColor(grp, QPalette::ButtonText, fg);
|
||||
p.setColor(grp, QPalette::Highlight, accent);
|
||||
p.setColor(grp, QPalette::HighlightedText, Qt::white);
|
||||
p.setColor(grp, QPalette::Link, accent);
|
||||
p.setColor(grp, QPalette::LinkVisited, hot);
|
||||
p.setColor(grp, QPalette::ToolTipBase, accent);
|
||||
p.setColor(grp, QPalette::ToolTipText, Qt::white);
|
||||
p.setColor(grp, QPalette::Light, QColor(0x2A, 0x2A, 0x2A));
|
||||
p.setColor(grp, QPalette::Midlight, QColor(0x25, 0x25, 0x25));
|
||||
p.setColor(grp, QPalette::Dark, QColor(0x0D, 0x0D, 0x0D));
|
||||
p.setColor(grp, QPalette::Mid, QColor(0x1F, 0x1F, 0x1F));
|
||||
p.setColor(grp, QPalette::Shadow, QColor(0x2A, 0x2A, 0x2A));
|
||||
p.setColor(grp, QPalette::PlaceholderText, QColor(0x80, 0x80, 0x86));
|
||||
}
|
||||
p.setColor(QPalette::Disabled, QPalette::WindowText, QColor(0x80, 0x80, 0x86));
|
||||
p.setColor(QPalette::Disabled, QPalette::Text, QColor(0x80, 0x80, 0x86));
|
||||
p.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(0x80, 0x80, 0x86));
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
#include <QProxyStyle>
|
||||
|
||||
class CyberQueerStyle : public QProxyStyle {
|
||||
Q_OBJECT
|
||||
public:
|
||||
CyberQueerStyle();
|
||||
void polish(QPalette &palette) override;
|
||||
};
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/bash
|
||||
# Build and install the cyberqueer Qt6 style plugin.
|
||||
# Re-run after changing colors in CyberQueerStyle.cpp.
|
||||
set -euo pipefail
|
||||
|
||||
DIR="$(dirname "$(realpath "$0")")"
|
||||
BUILD="$DIR/build"
|
||||
|
||||
cmake -B "$BUILD" -S "$DIR" -DCMAKE_BUILD_TYPE=Release -Wno-dev --log-level=WARNING
|
||||
cmake --build "$BUILD" -j"$(nproc)"
|
||||
sudo cmake --install "$BUILD"
|
||||
echo "cyberqueer Qt style installed to /usr/lib/qt6/plugins/styles/"
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"Keys": ["cyberqueer"]}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#include <QStylePlugin>
|
||||
#include "CyberQueerStyle.h"
|
||||
|
||||
class CyberQueerStylePlugin : public QStylePlugin {
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "cyberqueer.json")
|
||||
public:
|
||||
QStyle *create(const QString &key) override
|
||||
{
|
||||
if (key.compare(QLatin1String("cyberqueer"), Qt::CaseInsensitive) == 0)
|
||||
return new CyberQueerStyle;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
#include "plugin.moc"
|
||||
|
|
@ -70,6 +70,8 @@ sudo cp ~/Dotfiles/desktopenvs/hyprlua/btop/themes/cyberqueer.theme /usr/share/b
|
|||
sudo cp -f ~/Dotfiles/etc-ly-config.ini /etc/ly/config.ini
|
||||
sudo ln -sf /usr/bin/kitty /usr/bin/xdg-terminal-exec
|
||||
sudo ln -sf /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass
|
||||
bash ~/Dotfiles/qt-themes/cyberqueer/enable.sh
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
|
||||
# 7. Cursor setup
|
||||
mkdir -p ~/.icons
|
||||
|
|
|
|||
Loading…
Reference in New Issue