- Extend geminux-sync-gtk-theme and geminux-apply-theme to synchronize GTK4/libadwaita (dconf + ADW_DISABLE_PORTAL=1), qt6ct (QT_QPA_PLATFORMTHEME=qt6ct:gtk3), Kvantum, and live classic/ttk Tk apps - Preinstall dconf, gtk+2.0, tcl, tcl-lib, tcl-tls, tk, and custom zero-glycin geminux-gtkttk (GtkTtk 0.9 with XImage blitting, RESOURCE_MANAGER live reload, and *TkTheme: gtkTtk) - Add kernel patch 0011 to open gemini-lid keyboard/touchscreen handles for synchronous raw Hall GPIO66 input filtering, inhibit SSD2092 touch while closed, and set 1 ms hall-switch / 10 ms keyboard-matrix debounce in DT
1408 lines
36 KiB
Bash
Executable File
1408 lines
36 KiB
Bash
Executable File
#!/bin/sh
|
|
# Synchronize active GTK2, GTK3, GTK4/libadwaita, xsettingsd, and Qt5/Qt6 themes with .Xresources/.xth theme.
|
|
set -eu
|
|
|
|
HOME_DIR="${HOME:-/home/user}"
|
|
RUNTIME_HOME="${GEMINUX_RUNTIME_HOME:-$HOME_DIR}"
|
|
XRES_FILE="${GEMINUX_XRESOURCES:-$HOME_DIR/.Xresources}"
|
|
if [ ! -r "$XRES_FILE" ] && [ -r /etc/skel/.Xresources ]; then
|
|
XRES_FILE="/etc/skel/.Xresources"
|
|
fi
|
|
|
|
THEMES_OUT_DIR="${GEMINUX_GTK_THEMES_DIR:-$HOME_DIR/.themes}"
|
|
XDG_THEMES_OUT_DIR="${GEMINUX_XDG_THEMES_DIR:-$HOME_DIR/.local/share/themes}"
|
|
GTK2_RC_OUT="${GEMINUX_GTK2_RC:-$HOME_DIR/.gtkrc-2.0}"
|
|
GTK3_CONF_DIR="${GEMINUX_GTK3_DIR:-$HOME_DIR/.config/gtk-3.0}"
|
|
GTK4_CONF_DIR="${GEMINUX_GTK4_DIR:-$HOME_DIR/.config/gtk-4.0}"
|
|
XSETTINGSD_CONF="${GEMINUX_XSETTINGSD_CONF:-$HOME_DIR/.config/xsettingsd/xsettingsd.conf}"
|
|
QT6CT_CONF_DIR="${GEMINUX_QT6CT_DIR:-$HOME_DIR/.config/qt6ct}"
|
|
KVANTUM_CONF_DIR="${GEMINUX_KVANTUM_DIR:-$HOME_DIR/.config/Kvantum}"
|
|
|
|
get_xres() {
|
|
key="$1"
|
|
def="$2"
|
|
if [ -r "$XRES_FILE" ]; then
|
|
val="$(awk -F: -v k="$key" '
|
|
$0 !~ /^[[:space:]]*[!#]/ {
|
|
kpart = $1
|
|
gsub(/^[[:space:]]+|[[:space:]]+$/, "", kpart)
|
|
if (kpart == k) {
|
|
sub(/^[^:]*:[[:space:]]*/, "", $0)
|
|
gsub(/^[[:space:]"'\'']+|[[:space:]"'\'']+$/, "", $0)
|
|
print $0
|
|
}
|
|
}
|
|
' "$XRES_FILE" | tail -n 1)"
|
|
if [ -n "$val" ]; then
|
|
printf '%s' "$val"
|
|
return
|
|
fi
|
|
fi
|
|
printf '%s' "$def"
|
|
}
|
|
|
|
RAW_NAME="$(get_xres "theme.name" "GeminuxHelio")"
|
|
SAFE_NAME="$(printf '%s' "$RAW_NAME" | tr -cd 'A-Za-z0-9._-')"
|
|
[ -n "$SAFE_NAME" ] || SAFE_NAME="GeminuxHelio"
|
|
GTK_THEME_NAME="Geminux-$SAFE_NAME"
|
|
|
|
BG_MAIN="$(get_xres "theme.bgMain" "#0f1419")"
|
|
BG_BAR="$(get_xres "theme.bgBar" "$BG_MAIN")"
|
|
BG_HEADER="$(get_xres "theme.bgHeader" "$BG_MAIN")"
|
|
BG_FOOTER="$(get_xres "theme.bgFooter" "$BG_HEADER")"
|
|
BG_OVERLAY="$(get_xres "theme.bgOverlay" "$BG_HEADER")"
|
|
BG_ALT_EVEN="$(get_xres "theme.bgAltEven" "$BG_MAIN")"
|
|
BG_ALT_ODD="$(get_xres "theme.bgAltOdd" "$BG_ALT_EVEN")"
|
|
BG_INPUT="$(get_xres "theme.bgInput" "$BG_MAIN")"
|
|
BG_BUTTON="$(get_xres "theme.bgButton" "$BG_ALT_EVEN")"
|
|
BG_INPUT_FOCUS="$(get_xres "theme.bgInputFocus" "$BG_BUTTON")"
|
|
BG_SEARCH="$(get_xres "theme.bgSearch" "$BG_BUTTON")"
|
|
FG_MAIN="$(get_xres "theme.fgMain" "#e6e1cf")"
|
|
FG_BRIGHT="$(get_xres "theme.fgBright" "$FG_MAIN")"
|
|
FG_MUTED="$(get_xres "theme.fgMuted" "#7b8898")"
|
|
SEL_BG="$(get_xres "theme.selBg" "#2b5278")"
|
|
SEL_FG="$(get_xres "theme.selFg" "#ffffff")"
|
|
ACCENT="$(get_xres "theme.accent" "$SEL_BG")"
|
|
ACCENT_ALT="$(get_xres "theme.accentAlt" "$ACCENT")"
|
|
HIGHLIGHT="$(get_xres "theme.highlight" "$ACCENT")"
|
|
BORDER="$(get_xres "theme.border" "#283444")"
|
|
DIVIDER="$(get_xres "theme.divider" "$BORDER")"
|
|
SUCCESS="$(get_xres "theme.success" "#2ecc71")"
|
|
INFO="$(get_xres "theme.info" "#5dade2")"
|
|
WARNING="$(get_xres "theme.warning" "#e67e22")"
|
|
DANGER="$(get_xres "theme.danger" "#f07178")"
|
|
DANGER_BG="$(get_xres "theme.dangerBg" "#4c1d24")"
|
|
|
|
FONT_FACE="$(get_xres "theme.fontFace" "Fira Code" | tr -d '"')"
|
|
[ -n "$FONT_FACE" ] || FONT_FACE="Fira Code"
|
|
|
|
BASE_SIZE="$(get_xres "theme.baseFontSize" "32")"
|
|
case "$BASE_SIZE" in
|
|
''|*[!0-9]*) BASE_SIZE=32 ;;
|
|
esac
|
|
PT_SIZE="$(awk -v b="$BASE_SIZE" 'BEGIN {
|
|
pt = int(b * 10 / 32 + 0.5)
|
|
if (pt < 8) pt = 8
|
|
if (pt > 16) pt = 16
|
|
printf "%d", pt
|
|
}')"
|
|
GTK_FONT="$FONT_FACE $PT_SIZE"
|
|
|
|
CURSOR_THEME="$(get_xres "Xcursor.theme" "default" | tr -d '"')"
|
|
[ -n "$CURSOR_THEME" ] || CURSOR_THEME="default"
|
|
CURSOR_SIZE="$(get_xres "Xcursor.size" "64")"
|
|
case "$CURSOR_SIZE" in
|
|
''|*[!0-9]*) CURSOR_SIZE=64 ;;
|
|
esac
|
|
|
|
IS_DARK="$(awk -v h="$BG_MAIN" '
|
|
function hex2(s, i, a, b) {
|
|
s = tolower(s)
|
|
a = index("0123456789abcdef", substr(s, i, 1)) - 1
|
|
b = index("0123456789abcdef", substr(s, i + 1, 1)) - 1
|
|
if (a < 0 || b < 0) return -1
|
|
return a * 16 + b
|
|
}
|
|
BEGIN {
|
|
if (length(h) == 7 && substr(h, 1, 1) == "#") {
|
|
r = hex2(h, 2)
|
|
g = hex2(h, 4)
|
|
b = hex2(h, 6)
|
|
if (r >= 0 && g >= 0 && b >= 0) {
|
|
lum = 0.2126 * r + 0.7152 * g + 0.0722 * b
|
|
print (lum < 128.0) ? "1" : "0"
|
|
exit
|
|
}
|
|
}
|
|
print "1"
|
|
}
|
|
')"
|
|
|
|
if [ "$IS_DARK" = "1" ]; then
|
|
ADWAITA_IMPORT="resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained-dark.css"
|
|
GTK4_BASE_IMPORT="resource:///org/gtk/libgtk/theme/Default/Default-dark.css"
|
|
PREFER_DARK_BOOL="true"
|
|
COLOR_SCHEME="prefer-dark"
|
|
else
|
|
ADWAITA_IMPORT="resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained.css"
|
|
GTK4_BASE_IMPORT="resource:///org/gtk/libgtk/theme/Default/Default-light.css"
|
|
PREFER_DARK_BOOL="false"
|
|
COLOR_SCHEME="prefer-light"
|
|
fi
|
|
|
|
argb_ff() {
|
|
printf '#ff%s' "${1#\#}" | tr 'A-F' 'a-f'
|
|
}
|
|
|
|
argb_80() {
|
|
printf '#80%s' "${1#\#}" | tr 'A-F' 'a-f'
|
|
}
|
|
|
|
PREV_THEME=""
|
|
if [ -r "$XSETTINGSD_CONF" ]; then
|
|
PREV_THEME="$(awk '$1 == "Net/ThemeName" {
|
|
sub(/^Net\/ThemeName[[:space:]]+/, "", $0)
|
|
gsub(/^"|"$/, "", $0)
|
|
print $0
|
|
exit
|
|
}' "$XSETTINGSD_CONF")"
|
|
fi
|
|
|
|
THEME_ROOT="$THEMES_OUT_DIR/$GTK_THEME_NAME"
|
|
mkdir -p "$THEME_ROOT/gtk-2.0" "$THEME_ROOT/gtk-3.0" "$THEME_ROOT/gtk-4.0" \
|
|
"$XDG_THEMES_OUT_DIR" "$(dirname "$GTK2_RC_OUT")" \
|
|
"$GTK3_CONF_DIR" "$GTK4_CONF_DIR" "$(dirname "$XSETTINGSD_CONF")" \
|
|
"$QT6CT_CONF_DIR/colors" "$KVANTUM_CONF_DIR/Geminux"
|
|
|
|
cat > "$THEME_ROOT/index.theme.tmp.$$" <<EOF
|
|
[Desktop Entry]
|
|
Type=X-GNOME-Metatheme
|
|
Name=$GTK_THEME_NAME
|
|
Comment=Auto-generated Geminux GTK2/GTK3/GTK4 theme from $RAW_NAME
|
|
Encoding=UTF-8
|
|
|
|
[X-GNOME-Metatheme]
|
|
GtkTheme=$GTK_THEME_NAME
|
|
IconTheme=hicolor
|
|
CursorTheme=$CURSOR_THEME
|
|
CursorSize=$CURSOR_SIZE
|
|
EOF
|
|
mv -f "$THEME_ROOT/index.theme.tmp.$$" "$THEME_ROOT/index.theme"
|
|
|
|
cat > "$THEME_ROOT/gtk-2.0/gtkrc.tmp.$$" <<EOF
|
|
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
|
|
gtk-color-scheme = "bg_color:$BG_MAIN\nfg_color:$FG_MAIN\nbase_color:$BG_INPUT\ntext_color:$FG_MAIN\nselected_bg_color:$SEL_BG\nselected_fg_color:$SEL_FG\ntooltip_bg_color:$BG_OVERLAY\ntooltip_fg_color:$FG_BRIGHT\nlink_color:$ACCENT"
|
|
|
|
style "geminux-default" {
|
|
xthickness = 2
|
|
ythickness = 2
|
|
|
|
GtkWidget::link-color = "$ACCENT"
|
|
GtkWidget::visited-link-color = "$ACCENT_ALT"
|
|
|
|
bg[NORMAL] = "$BG_MAIN"
|
|
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
|
|
bg[ACTIVE] = "$BG_ALT_ODD"
|
|
bg[SELECTED] = "$SEL_BG"
|
|
bg[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
fg[NORMAL] = "$FG_MAIN"
|
|
fg[PRELIGHT] = "$FG_BRIGHT"
|
|
fg[ACTIVE] = "$FG_BRIGHT"
|
|
fg[SELECTED] = "$SEL_FG"
|
|
fg[INSENSITIVE] = "$FG_MUTED"
|
|
|
|
base[NORMAL] = "$BG_INPUT"
|
|
base[PRELIGHT] = "$BG_INPUT_FOCUS"
|
|
base[ACTIVE] = "$BG_ALT_ODD"
|
|
base[SELECTED] = "$SEL_BG"
|
|
base[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
text[NORMAL] = "$FG_MAIN"
|
|
text[PRELIGHT] = "$FG_BRIGHT"
|
|
text[ACTIVE] = "$FG_BRIGHT"
|
|
text[SELECTED] = "$SEL_FG"
|
|
text[INSENSITIVE] = "$FG_MUTED"
|
|
}
|
|
|
|
style "geminux-button" = "geminux-default" {
|
|
xthickness = 4
|
|
ythickness = 3
|
|
|
|
bg[NORMAL] = "$BG_BUTTON"
|
|
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
|
|
bg[ACTIVE] = "$SEL_BG"
|
|
bg[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
fg[NORMAL] = "$FG_BRIGHT"
|
|
fg[PRELIGHT] = "$FG_BRIGHT"
|
|
fg[ACTIVE] = "$SEL_FG"
|
|
fg[INSENSITIVE] = "$FG_MUTED"
|
|
}
|
|
|
|
style "geminux-entry" = "geminux-default" {
|
|
xthickness = 3
|
|
ythickness = 3
|
|
|
|
bg[NORMAL] = "$BG_INPUT"
|
|
bg[SELECTED] = "$SEL_BG"
|
|
bg[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
base[NORMAL] = "$BG_INPUT"
|
|
base[ACTIVE] = "$BG_INPUT_FOCUS"
|
|
base[SELECTED] = "$SEL_BG"
|
|
base[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
text[NORMAL] = "$FG_BRIGHT"
|
|
text[ACTIVE] = "$FG_BRIGHT"
|
|
text[SELECTED] = "$SEL_FG"
|
|
text[INSENSITIVE] = "$FG_MUTED"
|
|
}
|
|
|
|
style "geminux-menubar" = "geminux-default" {
|
|
bg[NORMAL] = "$BG_BAR"
|
|
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
|
|
bg[ACTIVE] = "$BG_HEADER"
|
|
bg[SELECTED] = "$SEL_BG"
|
|
|
|
fg[NORMAL] = "$FG_MAIN"
|
|
fg[PRELIGHT] = "$FG_BRIGHT"
|
|
fg[SELECTED] = "$SEL_FG"
|
|
}
|
|
|
|
style "geminux-menu" = "geminux-default" {
|
|
xthickness = 2
|
|
ythickness = 2
|
|
|
|
bg[NORMAL] = "$BG_OVERLAY"
|
|
bg[PRELIGHT] = "$BG_INPUT_FOCUS"
|
|
bg[ACTIVE] = "$BG_INPUT_FOCUS"
|
|
bg[SELECTED] = "$SEL_BG"
|
|
|
|
fg[NORMAL] = "$FG_MAIN"
|
|
fg[PRELIGHT] = "$FG_BRIGHT"
|
|
fg[SELECTED] = "$SEL_FG"
|
|
}
|
|
|
|
style "geminux-menu-item" = "geminux-menu" {
|
|
xthickness = 4
|
|
ythickness = 3
|
|
|
|
bg[PRELIGHT] = "$SEL_BG"
|
|
bg[SELECTED] = "$SEL_BG"
|
|
fg[PRELIGHT] = "$SEL_FG"
|
|
fg[SELECTED] = "$SEL_FG"
|
|
}
|
|
|
|
style "geminux-notebook" = "geminux-default" {
|
|
bg[NORMAL] = "$BG_MAIN"
|
|
bg[ACTIVE] = "$BG_HEADER"
|
|
fg[NORMAL] = "$FG_BRIGHT"
|
|
fg[ACTIVE] = "$FG_MUTED"
|
|
}
|
|
|
|
style "geminux-treeview" = "geminux-default" {
|
|
base[NORMAL] = "$BG_ALT_EVEN"
|
|
base[ACTIVE] = "$SEL_BG"
|
|
base[SELECTED] = "$SEL_BG"
|
|
base[INSENSITIVE] = "$BG_ALT_EVEN"
|
|
|
|
text[NORMAL] = "$FG_MAIN"
|
|
text[ACTIVE] = "$SEL_FG"
|
|
text[SELECTED] = "$SEL_FG"
|
|
text[INSENSITIVE] = "$FG_MUTED"
|
|
}
|
|
|
|
style "geminux-scrollbar" = "geminux-default" {
|
|
bg[NORMAL] = "$DIVIDER"
|
|
bg[PRELIGHT] = "$ACCENT"
|
|
bg[ACTIVE] = "$SEL_BG"
|
|
bg[INSENSITIVE] = "$BG_BAR"
|
|
}
|
|
|
|
style "geminux-progressbar" = "geminux-default" {
|
|
bg[NORMAL] = "$BG_SEARCH"
|
|
bg[PRELIGHT] = "$ACCENT"
|
|
bg[SELECTED] = "$ACCENT"
|
|
fg[NORMAL] = "$FG_BRIGHT"
|
|
fg[SELECTED] = "$SEL_FG"
|
|
}
|
|
|
|
style "geminux-tooltip" = "geminux-default" {
|
|
xthickness = 4
|
|
ythickness = 4
|
|
|
|
bg[NORMAL] = "$BG_OVERLAY"
|
|
fg[NORMAL] = "$FG_BRIGHT"
|
|
}
|
|
|
|
class "GtkWidget" style "geminux-default"
|
|
class "GtkButton" style "geminux-button"
|
|
widget_class "*.<GtkButton>*" style "geminux-button"
|
|
class "GtkEntry" style "geminux-entry"
|
|
class "GtkTextView" style "geminux-entry"
|
|
class "GtkSpinButton" style "geminux-entry"
|
|
class "GtkMenuBar" style "geminux-menubar"
|
|
class "GtkToolbar" style "geminux-menubar"
|
|
class "GtkMenu" style "geminux-menu"
|
|
widget_class "*<GtkMenu>*" style "geminux-menu"
|
|
class "GtkMenuItem" style "geminux-menu-item"
|
|
widget_class "*<GtkMenuItem>*" style "geminux-menu-item"
|
|
class "GtkNotebook" style "geminux-notebook"
|
|
class "GtkTreeView" style "geminux-treeview"
|
|
widget_class "*.<GtkTreeView>*" style "geminux-treeview"
|
|
class "GtkScrollbar" style "geminux-scrollbar"
|
|
class "GtkProgressBar" style "geminux-progressbar"
|
|
widget "gtk-tooltip*" style "geminux-tooltip"
|
|
EOF
|
|
mv -f "$THEME_ROOT/gtk-2.0/gtkrc.tmp.$$" "$THEME_ROOT/gtk-2.0/gtkrc"
|
|
|
|
cat > "$THEME_ROOT/gtk-3.0/gtk.css.tmp.$$" <<EOF
|
|
/* Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME) */
|
|
@import url("$ADWAITA_IMPORT");
|
|
|
|
@define-color theme_fg_color $FG_MAIN;
|
|
@define-color theme_text_color $FG_BRIGHT;
|
|
@define-color theme_bg_color $BG_MAIN;
|
|
@define-color theme_base_color $BG_INPUT;
|
|
@define-color theme_selected_bg_color $SEL_BG;
|
|
@define-color theme_selected_fg_color $SEL_FG;
|
|
@define-color insensitive_bg_color $BG_ALT_EVEN;
|
|
@define-color insensitive_fg_color $FG_MUTED;
|
|
@define-color insensitive_base_color $BG_ALT_EVEN;
|
|
@define-color theme_unfocused_fg_color $FG_MUTED;
|
|
@define-color theme_unfocused_text_color $FG_MAIN;
|
|
@define-color theme_unfocused_bg_color $BG_MAIN;
|
|
@define-color theme_unfocused_base_color $BG_ALT_EVEN;
|
|
@define-color theme_unfocused_selected_bg_color $SEL_BG;
|
|
@define-color theme_unfocused_selected_fg_color $SEL_FG;
|
|
@define-color unfocused_insensitive_color $FG_MUTED;
|
|
@define-color borders $BORDER;
|
|
@define-color unfocused_borders $DIVIDER;
|
|
@define-color warning_color $WARNING;
|
|
@define-color error_color $DANGER;
|
|
@define-color success_color $SUCCESS;
|
|
@define-color link_color $ACCENT;
|
|
@define-color visited_link_color $ACCENT_ALT;
|
|
@define-color content_view_bg $BG_INPUT;
|
|
@define-color text_view_bg $BG_INPUT;
|
|
@define-color wm_bg_a $BG_HEADER;
|
|
@define-color wm_bg_b $BG_BAR;
|
|
@define-color wm_border $BORDER;
|
|
|
|
* {
|
|
caret-color: $ACCENT;
|
|
outline-color: $ACCENT;
|
|
}
|
|
|
|
window,
|
|
window.background,
|
|
dialog,
|
|
messagedialog,
|
|
.background {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
window:backdrop,
|
|
.background:backdrop {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
headerbar,
|
|
.titlebar,
|
|
toolbar,
|
|
.primary-toolbar,
|
|
actionbar,
|
|
searchbar {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_BRIGHT;
|
|
border-color: $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
headerbar:backdrop,
|
|
.titlebar:backdrop {
|
|
background-color: $BG_BAR;
|
|
color: $FG_MUTED;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
menubar,
|
|
.menubar {
|
|
background-image: none;
|
|
background-color: $BG_BAR;
|
|
color: $FG_MAIN;
|
|
border-bottom: 1px solid $BORDER;
|
|
}
|
|
|
|
statusbar,
|
|
.statusbar {
|
|
background-color: $BG_BAR;
|
|
color: $FG_MUTED;
|
|
border-top: 1px solid $BORDER;
|
|
}
|
|
|
|
menu,
|
|
.menu,
|
|
.context-menu,
|
|
popover,
|
|
popover.background {
|
|
background-image: none;
|
|
background-color: $BG_OVERLAY;
|
|
color: $FG_MAIN;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
menuitem,
|
|
modelbutton,
|
|
row.activatable {
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
menuitem:hover,
|
|
menuitem:selected,
|
|
modelbutton:hover,
|
|
row.activatable:hover {
|
|
background-image: none;
|
|
background-color: $BG_INPUT_FOCUS;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
menuitem:disabled,
|
|
modelbutton:disabled,
|
|
label:disabled {
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
*:selected,
|
|
selection,
|
|
row:selected,
|
|
row.activatable:selected,
|
|
treeview.view:selected,
|
|
iconview:selected,
|
|
textview text selection,
|
|
entry selection,
|
|
label selection {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
button {
|
|
background-image: none;
|
|
background-color: $BG_BUTTON;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
button:hover {
|
|
background-image: none;
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $ACCENT;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
button:active,
|
|
button:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
button:disabled {
|
|
background-image: none;
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MUTED;
|
|
border-color: $DIVIDER;
|
|
}
|
|
|
|
button.flat,
|
|
button.titlebutton {
|
|
background-color: transparent;
|
|
border-color: transparent;
|
|
box-shadow: none;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
button.flat:hover,
|
|
button.titlebutton:hover {
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $BORDER;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
button.suggested-action {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
button.destructive-action {
|
|
background-image: none;
|
|
background-color: $DANGER_BG;
|
|
color: $FG_BRIGHT;
|
|
border-color: $DANGER;
|
|
}
|
|
|
|
entry,
|
|
spinbutton {
|
|
background-image: none;
|
|
background-color: $BG_INPUT;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
caret-color: $ACCENT;
|
|
}
|
|
|
|
entry:focus,
|
|
spinbutton:focus {
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
entry:disabled,
|
|
spinbutton:disabled {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
textview,
|
|
textview text,
|
|
.view,
|
|
iconview {
|
|
background-color: $BG_INPUT;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
treeview.view {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
treeview.view header button {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_MAIN;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
list,
|
|
listbox,
|
|
.list-row,
|
|
row {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MAIN;
|
|
border-color: $DIVIDER;
|
|
}
|
|
|
|
notebook {
|
|
background-color: $BG_MAIN;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header {
|
|
background-image: none;
|
|
background-color: $BG_BAR;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header tab {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_MUTED;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header tab:hover {
|
|
color: $FG_MAIN;
|
|
background-color: $BG_ALT_EVEN;
|
|
}
|
|
|
|
notebook > header tab:checked {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_BRIGHT;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
checkbutton check,
|
|
radiobutton radio {
|
|
background-color: $BG_INPUT;
|
|
border-color: $BORDER;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
checkbutton check:checked,
|
|
radiobutton radio:checked,
|
|
modelbutton check:checked,
|
|
modelbutton radio:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
border-color: $ACCENT;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
switch {
|
|
background-image: none;
|
|
background-color: $BG_BUTTON;
|
|
border: 1px solid $BORDER;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
switch:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
border-color: $ACCENT;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
switch slider {
|
|
background-image: none;
|
|
background-color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
}
|
|
|
|
progressbar trough,
|
|
scale trough {
|
|
background-image: none;
|
|
background-color: $BG_SEARCH;
|
|
border: 1px solid $BORDER;
|
|
}
|
|
|
|
progressbar progress,
|
|
scale highlight {
|
|
background-image: none;
|
|
background-color: $ACCENT;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
scale slider {
|
|
background-image: none;
|
|
background-color: $FG_BRIGHT;
|
|
border: 1px solid $ACCENT;
|
|
}
|
|
|
|
scrollbar {
|
|
background-color: $BG_BAR;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
scrollbar trough {
|
|
background-color: $BG_BAR;
|
|
}
|
|
|
|
scrollbar slider {
|
|
background-image: none;
|
|
background-color: $DIVIDER;
|
|
}
|
|
|
|
scrollbar slider:hover {
|
|
background-color: $ACCENT;
|
|
}
|
|
|
|
scrollbar slider:active {
|
|
background-color: $SEL_BG;
|
|
}
|
|
|
|
tooltip,
|
|
tooltip.background,
|
|
.tooltip {
|
|
background-image: none;
|
|
background-color: $BG_OVERLAY;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $ACCENT;
|
|
}
|
|
|
|
separator,
|
|
.separator {
|
|
background-color: $DIVIDER;
|
|
color: $DIVIDER;
|
|
}
|
|
|
|
frame > border,
|
|
scrolledwindow > border,
|
|
.frame {
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
*:link {
|
|
color: $ACCENT;
|
|
}
|
|
|
|
*:visited {
|
|
color: $ACCENT_ALT;
|
|
}
|
|
|
|
infobar.info {
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
infobar.warning {
|
|
background-color: $BG_OVERLAY;
|
|
color: $WARNING;
|
|
border-color: $WARNING;
|
|
}
|
|
|
|
infobar.error {
|
|
background-color: $DANGER_BG;
|
|
color: $FG_BRIGHT;
|
|
border-color: $DANGER;
|
|
}
|
|
EOF
|
|
mv -f "$THEME_ROOT/gtk-3.0/gtk.css.tmp.$$" "$THEME_ROOT/gtk-3.0/gtk.css"
|
|
|
|
cat > "$THEME_ROOT/gtk-3.0/gtk-dark.css.tmp.$$" <<EOF
|
|
@import url("gtk.css");
|
|
EOF
|
|
mv -f "$THEME_ROOT/gtk-3.0/gtk-dark.css.tmp.$$" "$THEME_ROOT/gtk-3.0/gtk-dark.css"
|
|
|
|
cat > "$THEME_ROOT/gtk-4.0/gtk.css.tmp.$$" <<EOF
|
|
/* Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME) */
|
|
@import url("$GTK4_BASE_IMPORT");
|
|
|
|
@define-color theme_fg_color $FG_MAIN;
|
|
@define-color theme_text_color $FG_BRIGHT;
|
|
@define-color theme_bg_color $BG_MAIN;
|
|
@define-color theme_base_color $BG_INPUT;
|
|
@define-color theme_selected_bg_color $SEL_BG;
|
|
@define-color theme_selected_fg_color $SEL_FG;
|
|
@define-color insensitive_bg_color $BG_ALT_EVEN;
|
|
@define-color insensitive_fg_color $FG_MUTED;
|
|
@define-color insensitive_base_color $BG_ALT_EVEN;
|
|
@define-color theme_unfocused_fg_color $FG_MUTED;
|
|
@define-color theme_unfocused_text_color $FG_MAIN;
|
|
@define-color theme_unfocused_bg_color $BG_MAIN;
|
|
@define-color theme_unfocused_base_color $BG_ALT_EVEN;
|
|
@define-color theme_unfocused_selected_bg_color $SEL_BG;
|
|
@define-color theme_unfocused_selected_fg_color $SEL_FG;
|
|
@define-color unfocused_insensitive_color $FG_MUTED;
|
|
@define-color borders $BORDER;
|
|
@define-color unfocused_borders $DIVIDER;
|
|
@define-color accent_bg_color $SEL_BG;
|
|
@define-color accent_fg_color $SEL_FG;
|
|
@define-color accent_color $ACCENT;
|
|
@define-color destructive_bg_color $DANGER_BG;
|
|
@define-color destructive_fg_color $FG_BRIGHT;
|
|
@define-color destructive_color $DANGER;
|
|
@define-color success_bg_color $SUCCESS;
|
|
@define-color success_fg_color $BG_MAIN;
|
|
@define-color success_color $SUCCESS;
|
|
@define-color warning_bg_color $WARNING;
|
|
@define-color warning_fg_color $BG_MAIN;
|
|
@define-color warning_color $WARNING;
|
|
@define-color error_bg_color $DANGER_BG;
|
|
@define-color error_fg_color $FG_BRIGHT;
|
|
@define-color error_color $DANGER;
|
|
@define-color window_bg_color $BG_MAIN;
|
|
@define-color window_fg_color $FG_MAIN;
|
|
@define-color view_bg_color $BG_INPUT;
|
|
@define-color view_fg_color $FG_MAIN;
|
|
@define-color headerbar_bg_color $BG_HEADER;
|
|
@define-color headerbar_fg_color $FG_BRIGHT;
|
|
@define-color headerbar_border_color $BORDER;
|
|
@define-color headerbar_backdrop_color $BG_BAR;
|
|
@define-color sidebar_bg_color $BG_BAR;
|
|
@define-color sidebar_fg_color $FG_MAIN;
|
|
@define-color sidebar_backdrop_color $BG_MAIN;
|
|
@define-color secondary_sidebar_bg_color $BG_ALT_EVEN;
|
|
@define-color secondary_sidebar_fg_color $FG_MAIN;
|
|
@define-color card_bg_color $BG_ALT_EVEN;
|
|
@define-color card_fg_color $FG_MAIN;
|
|
@define-color dialog_bg_color $BG_OVERLAY;
|
|
@define-color dialog_fg_color $FG_MAIN;
|
|
@define-color popover_bg_color $BG_OVERLAY;
|
|
@define-color popover_fg_color $FG_MAIN;
|
|
@define-color thumbnail_bg_color $BG_ALT_EVEN;
|
|
@define-color thumbnail_fg_color $FG_MAIN;
|
|
@define-color shade_color rgba(0, 0, 0, 0.36);
|
|
@define-color scrollbar_outline_color $BORDER;
|
|
|
|
:root {
|
|
--accent-bg-color: $SEL_BG;
|
|
--accent-fg-color: $SEL_FG;
|
|
--accent-color: $ACCENT;
|
|
--destructive-bg-color: $DANGER_BG;
|
|
--destructive-fg-color: $FG_BRIGHT;
|
|
--destructive-color: $DANGER;
|
|
--success-bg-color: $SUCCESS;
|
|
--success-fg-color: $BG_MAIN;
|
|
--success-color: $SUCCESS;
|
|
--warning-bg-color: $WARNING;
|
|
--warning-fg-color: $BG_MAIN;
|
|
--warning-color: $WARNING;
|
|
--error-bg-color: $DANGER_BG;
|
|
--error-fg-color: $FG_BRIGHT;
|
|
--error-color: $DANGER;
|
|
--window-bg-color: $BG_MAIN;
|
|
--window-fg-color: $FG_MAIN;
|
|
--view-bg-color: $BG_INPUT;
|
|
--view-fg-color: $FG_MAIN;
|
|
--headerbar-bg-color: $BG_HEADER;
|
|
--headerbar-fg-color: $FG_BRIGHT;
|
|
--headerbar-border-color: $BORDER;
|
|
--headerbar-backdrop-color: $BG_BAR;
|
|
--sidebar-bg-color: $BG_BAR;
|
|
--sidebar-fg-color: $FG_MAIN;
|
|
--sidebar-backdrop-color: $BG_MAIN;
|
|
--secondary-sidebar-bg-color: $BG_ALT_EVEN;
|
|
--secondary-sidebar-fg-color: $FG_MAIN;
|
|
--card-bg-color: $BG_ALT_EVEN;
|
|
--card-fg-color: $FG_MAIN;
|
|
--dialog-bg-color: $BG_OVERLAY;
|
|
--dialog-fg-color: $FG_MAIN;
|
|
--popover-bg-color: $BG_OVERLAY;
|
|
--popover-fg-color: $FG_MAIN;
|
|
--thumbnail-bg-color: $BG_ALT_EVEN;
|
|
--thumbnail-fg-color: $FG_MAIN;
|
|
--shade-color: rgba(0, 0, 0, 0.36);
|
|
--scrollbar-outline-color: $BORDER;
|
|
--border-color: $BORDER;
|
|
}
|
|
|
|
* {
|
|
caret-color: $ACCENT;
|
|
outline-color: $ACCENT;
|
|
}
|
|
|
|
window,
|
|
.background {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
window:backdrop,
|
|
.background:backdrop {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
headerbar,
|
|
.titlebar,
|
|
actionbar,
|
|
searchbar {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_BRIGHT;
|
|
border-color: $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
headerbar:backdrop,
|
|
.titlebar:backdrop {
|
|
background-color: $BG_BAR;
|
|
color: $FG_MUTED;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
popover > contents,
|
|
popover > arrow {
|
|
background-image: none;
|
|
background-color: $BG_OVERLAY;
|
|
color: $FG_MAIN;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
modelbutton,
|
|
row.activatable {
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
modelbutton:hover,
|
|
row.activatable:hover {
|
|
background-image: none;
|
|
background-color: $BG_INPUT_FOCUS;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
modelbutton:disabled,
|
|
label:disabled {
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
*:selected,
|
|
selection,
|
|
row:selected,
|
|
row.activatable:selected {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
button {
|
|
background-image: none;
|
|
background-color: $BG_BUTTON;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
}
|
|
|
|
button:hover {
|
|
background-image: none;
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $ACCENT;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
button:active,
|
|
button:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
button:disabled {
|
|
background-image: none;
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MUTED;
|
|
border-color: $DIVIDER;
|
|
}
|
|
|
|
button.flat {
|
|
background-color: transparent;
|
|
border-color: transparent;
|
|
box-shadow: none;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
button.flat:hover {
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $BORDER;
|
|
color: $FG_BRIGHT;
|
|
}
|
|
|
|
button.suggested-action {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
color: $SEL_FG;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
button.destructive-action {
|
|
background-image: none;
|
|
background-color: $DANGER_BG;
|
|
color: $FG_BRIGHT;
|
|
border-color: $DANGER;
|
|
}
|
|
|
|
entry,
|
|
spinbutton {
|
|
background-image: none;
|
|
background-color: $BG_INPUT;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
box-shadow: none;
|
|
caret-color: $ACCENT;
|
|
}
|
|
|
|
entry:focus-within,
|
|
spinbutton:focus-within {
|
|
background-color: $BG_INPUT_FOCUS;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
entry:disabled,
|
|
spinbutton:disabled {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MUTED;
|
|
}
|
|
|
|
textview,
|
|
textview text,
|
|
.view {
|
|
background-color: $BG_INPUT;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
listview,
|
|
columnview {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
columnview > header > button {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_MAIN;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
list,
|
|
row {
|
|
background-color: $BG_ALT_EVEN;
|
|
color: $FG_MAIN;
|
|
border-color: $DIVIDER;
|
|
}
|
|
|
|
notebook {
|
|
background-color: $BG_MAIN;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header {
|
|
background-image: none;
|
|
background-color: $BG_BAR;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header > tabs > tab {
|
|
background-image: none;
|
|
background-color: $BG_HEADER;
|
|
color: $FG_MUTED;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
notebook > header > tabs > tab:hover {
|
|
color: $FG_MAIN;
|
|
background-color: $BG_ALT_EVEN;
|
|
}
|
|
|
|
notebook > header > tabs > tab:checked {
|
|
background-color: $BG_MAIN;
|
|
color: $FG_BRIGHT;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
checkbutton > check {
|
|
background-color: $BG_INPUT;
|
|
border-color: $BORDER;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
checkbutton > check:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
border-color: $ACCENT;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
switch {
|
|
background-image: none;
|
|
background-color: $BG_BUTTON;
|
|
border: 1px solid $BORDER;
|
|
color: $FG_MAIN;
|
|
}
|
|
|
|
switch:checked {
|
|
background-image: none;
|
|
background-color: $SEL_BG;
|
|
border-color: $ACCENT;
|
|
color: $SEL_FG;
|
|
}
|
|
|
|
switch > slider {
|
|
background-image: none;
|
|
background-color: $FG_BRIGHT;
|
|
border: 1px solid $BORDER;
|
|
}
|
|
|
|
progressbar > trough,
|
|
scale > trough {
|
|
background-image: none;
|
|
background-color: $BG_SEARCH;
|
|
border: 1px solid $BORDER;
|
|
}
|
|
|
|
progressbar > trough > progress,
|
|
scale > trough > highlight {
|
|
background-image: none;
|
|
background-color: $ACCENT;
|
|
border-color: $ACCENT;
|
|
}
|
|
|
|
scale > trough > slider {
|
|
background-image: none;
|
|
background-color: $FG_BRIGHT;
|
|
border: 1px solid $ACCENT;
|
|
}
|
|
|
|
scrollbar,
|
|
scrollbar > range > trough {
|
|
background-color: $BG_BAR;
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
scrollbar > range > trough > slider {
|
|
background-image: none;
|
|
background-color: $DIVIDER;
|
|
}
|
|
|
|
scrollbar > range > trough > slider:hover {
|
|
background-color: $ACCENT;
|
|
}
|
|
|
|
scrollbar > range > trough > slider:active {
|
|
background-color: $SEL_BG;
|
|
}
|
|
|
|
tooltip,
|
|
tooltip.background {
|
|
background-image: none;
|
|
background-color: $BG_OVERLAY;
|
|
color: $FG_BRIGHT;
|
|
border: 1px solid $ACCENT;
|
|
}
|
|
|
|
separator {
|
|
background-color: $DIVIDER;
|
|
color: $DIVIDER;
|
|
}
|
|
|
|
frame,
|
|
scrolledwindow {
|
|
border-color: $BORDER;
|
|
}
|
|
|
|
*:link {
|
|
color: $ACCENT;
|
|
}
|
|
|
|
*:visited {
|
|
color: $ACCENT_ALT;
|
|
}
|
|
EOF
|
|
mv -f "$THEME_ROOT/gtk-4.0/gtk.css.tmp.$$" "$THEME_ROOT/gtk-4.0/gtk.css"
|
|
|
|
cat > "$THEME_ROOT/gtk-4.0/gtk-dark.css.tmp.$$" <<EOF
|
|
@import url("gtk.css");
|
|
EOF
|
|
mv -f "$THEME_ROOT/gtk-4.0/gtk-dark.css.tmp.$$" "$THEME_ROOT/gtk-4.0/gtk-dark.css"
|
|
|
|
if [ "$THEMES_OUT_DIR" = "$HOME_DIR/.themes" ] && [ "$XDG_THEMES_OUT_DIR" = "$HOME_DIR/.local/share/themes" ]; then
|
|
ln -sfn "../../../.themes/$GTK_THEME_NAME" "$XDG_THEMES_OUT_DIR/$GTK_THEME_NAME"
|
|
else
|
|
ln -sfn "$THEME_ROOT" "$XDG_THEMES_OUT_DIR/$GTK_THEME_NAME"
|
|
fi
|
|
|
|
cat > "$GTK2_RC_OUT.tmp.$$" <<EOF
|
|
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
|
|
gtk-theme-name="$GTK_THEME_NAME"
|
|
gtk-icon-theme-name="hicolor"
|
|
gtk-font-name="$GTK_FONT"
|
|
gtk-cursor-theme-name="$CURSOR_THEME"
|
|
gtk-cursor-theme-size=$CURSOR_SIZE
|
|
gtk-toolbar-style=GTK_TOOLBAR_ICONS
|
|
EOF
|
|
mv -f "$GTK2_RC_OUT.tmp.$$" "$GTK2_RC_OUT"
|
|
|
|
cat > "$GTK3_CONF_DIR/settings.ini.tmp.$$" <<EOF
|
|
[Settings]
|
|
gtk-theme-name=$GTK_THEME_NAME
|
|
gtk-icon-theme-name=hicolor
|
|
gtk-font-name=$GTK_FONT
|
|
gtk-cursor-theme-name=$CURSOR_THEME
|
|
gtk-cursor-theme-size=$CURSOR_SIZE
|
|
gtk-application-prefer-dark-theme=$PREFER_DARK_BOOL
|
|
EOF
|
|
mv -f "$GTK3_CONF_DIR/settings.ini.tmp.$$" "$GTK3_CONF_DIR/settings.ini"
|
|
|
|
cat > "$GTK3_CONF_DIR/gtk.css.tmp.$$" <<EOF
|
|
/* Auto-generated by geminux-sync-gtk-theme for GTK3 user color overrides ($RAW_NAME) */
|
|
@define-color theme_fg_color $FG_MAIN;
|
|
@define-color theme_text_color $FG_BRIGHT;
|
|
@define-color theme_bg_color $BG_MAIN;
|
|
@define-color theme_base_color $BG_INPUT;
|
|
@define-color theme_selected_bg_color $SEL_BG;
|
|
@define-color theme_selected_fg_color $SEL_FG;
|
|
@define-color insensitive_bg_color $BG_ALT_EVEN;
|
|
@define-color insensitive_fg_color $FG_MUTED;
|
|
@define-color borders $BORDER;
|
|
EOF
|
|
mv -f "$GTK3_CONF_DIR/gtk.css.tmp.$$" "$GTK3_CONF_DIR/gtk.css"
|
|
|
|
cat > "$GTK4_CONF_DIR/settings.ini.tmp.$$" <<EOF
|
|
[Settings]
|
|
gtk-theme-name=$GTK_THEME_NAME
|
|
gtk-icon-theme-name=hicolor
|
|
gtk-font-name=$GTK_FONT
|
|
gtk-cursor-theme-name=$CURSOR_THEME
|
|
gtk-cursor-theme-size=$CURSOR_SIZE
|
|
gtk-application-prefer-dark-theme=$PREFER_DARK_BOOL
|
|
EOF
|
|
mv -f "$GTK4_CONF_DIR/settings.ini.tmp.$$" "$GTK4_CONF_DIR/settings.ini"
|
|
|
|
cat > "$GTK4_CONF_DIR/gtk.css.tmp.$$" <<EOF
|
|
/* Auto-generated by geminux-sync-gtk-theme for libadwaita & GTK4 from active .Xresources theme ($RAW_NAME) */
|
|
@define-color accent_bg_color $SEL_BG;
|
|
@define-color accent_fg_color $SEL_FG;
|
|
@define-color accent_color $ACCENT;
|
|
@define-color destructive_bg_color $DANGER_BG;
|
|
@define-color destructive_fg_color $FG_BRIGHT;
|
|
@define-color destructive_color $DANGER;
|
|
@define-color success_bg_color $SUCCESS;
|
|
@define-color success_fg_color $BG_MAIN;
|
|
@define-color success_color $SUCCESS;
|
|
@define-color warning_bg_color $WARNING;
|
|
@define-color warning_fg_color $BG_MAIN;
|
|
@define-color warning_color $WARNING;
|
|
@define-color error_bg_color $DANGER_BG;
|
|
@define-color error_fg_color $FG_BRIGHT;
|
|
@define-color error_color $DANGER;
|
|
@define-color window_bg_color $BG_MAIN;
|
|
@define-color window_fg_color $FG_MAIN;
|
|
@define-color view_bg_color $BG_INPUT;
|
|
@define-color view_fg_color $FG_MAIN;
|
|
@define-color headerbar_bg_color $BG_HEADER;
|
|
@define-color headerbar_fg_color $FG_BRIGHT;
|
|
@define-color headerbar_border_color $BORDER;
|
|
@define-color headerbar_backdrop_color $BG_BAR;
|
|
@define-color sidebar_bg_color $BG_BAR;
|
|
@define-color sidebar_fg_color $FG_MAIN;
|
|
@define-color sidebar_backdrop_color $BG_MAIN;
|
|
@define-color secondary_sidebar_bg_color $BG_ALT_EVEN;
|
|
@define-color secondary_sidebar_fg_color $FG_MAIN;
|
|
@define-color card_bg_color $BG_ALT_EVEN;
|
|
@define-color card_fg_color $FG_MAIN;
|
|
@define-color dialog_bg_color $BG_OVERLAY;
|
|
@define-color dialog_fg_color $FG_MAIN;
|
|
@define-color popover_bg_color $BG_OVERLAY;
|
|
@define-color popover_fg_color $FG_MAIN;
|
|
@define-color thumbnail_bg_color $BG_ALT_EVEN;
|
|
@define-color thumbnail_fg_color $FG_MAIN;
|
|
@define-color shade_color rgba(0, 0, 0, 0.36);
|
|
@define-color scrollbar_outline_color $BORDER;
|
|
|
|
:root {
|
|
--accent-bg-color: $SEL_BG;
|
|
--accent-fg-color: $SEL_FG;
|
|
--accent-color: $ACCENT;
|
|
--destructive-bg-color: $DANGER_BG;
|
|
--destructive-fg-color: $FG_BRIGHT;
|
|
--destructive-color: $DANGER;
|
|
--success-bg-color: $SUCCESS;
|
|
--success-fg-color: $BG_MAIN;
|
|
--success-color: $SUCCESS;
|
|
--warning-bg-color: $WARNING;
|
|
--warning-fg-color: $BG_MAIN;
|
|
--warning-color: $WARNING;
|
|
--error-bg-color: $DANGER_BG;
|
|
--error-fg-color: $FG_BRIGHT;
|
|
--error-color: $DANGER;
|
|
--window-bg-color: $BG_MAIN;
|
|
--window-fg-color: $FG_MAIN;
|
|
--view-bg-color: $BG_INPUT;
|
|
--view-fg-color: $FG_MAIN;
|
|
--headerbar-bg-color: $BG_HEADER;
|
|
--headerbar-fg-color: $FG_BRIGHT;
|
|
--headerbar-border-color: $BORDER;
|
|
--headerbar-backdrop-color: $BG_BAR;
|
|
--sidebar-bg-color: $BG_BAR;
|
|
--sidebar-fg-color: $FG_MAIN;
|
|
--sidebar-backdrop-color: $BG_MAIN;
|
|
--secondary-sidebar-bg-color: $BG_ALT_EVEN;
|
|
--secondary-sidebar-fg-color: $FG_MAIN;
|
|
--card-bg-color: $BG_ALT_EVEN;
|
|
--card-fg-color: $FG_MAIN;
|
|
--dialog-bg-color: $BG_OVERLAY;
|
|
--dialog-fg-color: $FG_MAIN;
|
|
--popover-bg-color: $BG_OVERLAY;
|
|
--popover-fg-color: $FG_MAIN;
|
|
--thumbnail-bg-color: $BG_ALT_EVEN;
|
|
--thumbnail-fg-color: $FG_MAIN;
|
|
--shade-color: rgba(0, 0, 0, 0.36);
|
|
--scrollbar-outline-color: $BORDER;
|
|
--border-color: $BORDER;
|
|
}
|
|
EOF
|
|
mv -f "$GTK4_CONF_DIR/gtk.css.tmp.$$" "$GTK4_CONF_DIR/gtk.css"
|
|
|
|
ACTIVE_QT_COLORS="$(argb_ff "$FG_MAIN"), $(argb_ff "$BG_BUTTON"), $(argb_ff "$BG_INPUT_FOCUS"), $(argb_ff "$BG_SEARCH"), $(argb_ff "$BG_BAR"), $(argb_ff "$DIVIDER"), $(argb_ff "$FG_BRIGHT"), $(argb_ff "$FG_BRIGHT"), $(argb_ff "$FG_BRIGHT"), $(argb_ff "$BG_INPUT"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BORDER"), $(argb_ff "$SEL_BG"), $(argb_ff "$SEL_FG"), $(argb_ff "$ACCENT"), $(argb_ff "$ACCENT_ALT"), $(argb_ff "$BG_ALT_EVEN"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BG_OVERLAY"), $(argb_ff "$FG_BRIGHT"), $(argb_80 "$FG_MUTED")"
|
|
DISABLED_QT_COLORS="$(argb_ff "$FG_MUTED"), $(argb_ff "$BG_ALT_EVEN"), $(argb_ff "$BG_BUTTON"), $(argb_ff "$BG_ALT_ODD"), $(argb_ff "$BG_BAR"), $(argb_ff "$DIVIDER"), $(argb_ff "$FG_MUTED"), $(argb_ff "$FG_MUTED"), $(argb_ff "$FG_MUTED"), $(argb_ff "$BG_ALT_EVEN"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BORDER"), $(argb_ff "$DIVIDER"), $(argb_ff "$FG_MUTED"), $(argb_ff "$FG_MUTED"), $(argb_ff "$FG_MUTED"), $(argb_ff "$BG_ALT_EVEN"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BG_OVERLAY"), $(argb_ff "$FG_MUTED"), $(argb_80 "$FG_MUTED")"
|
|
INACTIVE_QT_COLORS="$(argb_ff "$FG_MAIN"), $(argb_ff "$BG_BUTTON"), $(argb_ff "$BG_INPUT_FOCUS"), $(argb_ff "$BG_SEARCH"), $(argb_ff "$BG_BAR"), $(argb_ff "$DIVIDER"), $(argb_ff "$FG_MAIN"), $(argb_ff "$FG_BRIGHT"), $(argb_ff "$FG_MAIN"), $(argb_ff "$BG_INPUT"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BORDER"), $(argb_ff "$SEL_BG"), $(argb_ff "$SEL_FG"), $(argb_ff "$ACCENT"), $(argb_ff "$ACCENT_ALT"), $(argb_ff "$BG_ALT_EVEN"), $(argb_ff "$BG_MAIN"), $(argb_ff "$BG_OVERLAY"), $(argb_ff "$FG_MAIN"), $(argb_80 "$FG_MUTED")"
|
|
|
|
QT6CT_SCHEME_FILE="$GTK_THEME_NAME.conf"
|
|
cat > "$QT6CT_CONF_DIR/colors/$QT6CT_SCHEME_FILE.tmp.$$" <<EOF
|
|
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
|
|
[ColorScheme]
|
|
active_colors=$ACTIVE_QT_COLORS
|
|
disabled_colors=$DISABLED_QT_COLORS
|
|
inactive_colors=$INACTIVE_QT_COLORS
|
|
EOF
|
|
mv -f "$QT6CT_CONF_DIR/colors/$QT6CT_SCHEME_FILE.tmp.$$" "$QT6CT_CONF_DIR/colors/$QT6CT_SCHEME_FILE"
|
|
cp -f "$QT6CT_CONF_DIR/colors/$QT6CT_SCHEME_FILE" "$QT6CT_CONF_DIR/colors/Geminux.conf"
|
|
|
|
if [ -n "${GEMINUX_QT6CT_DIR:-}" ]; then
|
|
RUNTIME_QT6CT_COLORS="$QT6CT_CONF_DIR/colors/$QT6CT_SCHEME_FILE"
|
|
else
|
|
RUNTIME_QT6CT_COLORS="$RUNTIME_HOME/.config/qt6ct/colors/$QT6CT_SCHEME_FILE"
|
|
fi
|
|
|
|
# Rewrite in-place to preserve QFileSystemWatcher inode monitoring for running Qt6 apps.
|
|
cat > "$QT6CT_CONF_DIR/qt6ct.conf" <<EOF
|
|
# Theme: $RAW_NAME
|
|
[Appearance]
|
|
color_scheme_path=$RUNTIME_QT6CT_COLORS
|
|
custom_palette=true
|
|
icon_theme=hicolor
|
|
standard_dialogs=default
|
|
style=Fusion
|
|
|
|
[Fonts]
|
|
fixed="$FONT_FACE,$PT_SIZE,-1,5,50,0,0,0,0,0"
|
|
general="$FONT_FACE,$PT_SIZE,-1,5,50,0,0,0,0,0"
|
|
EOF
|
|
|
|
cat > "$KVANTUM_CONF_DIR/kvantum.kvconfig.tmp.$$" <<EOF
|
|
[General]
|
|
theme=Geminux
|
|
EOF
|
|
mv -f "$KVANTUM_CONF_DIR/kvantum.kvconfig.tmp.$$" "$KVANTUM_CONF_DIR/kvantum.kvconfig"
|
|
|
|
cat > "$KVANTUM_CONF_DIR/Geminux/Geminux.kvconfig.tmp.$$" <<EOF
|
|
[%General]
|
|
author=Geminux
|
|
comment=Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
|
|
|
|
[GeneralColors]
|
|
window.color=$BG_MAIN
|
|
base.color=$BG_INPUT
|
|
alt.base.color=$BG_ALT_EVEN
|
|
button.color=$BG_BUTTON
|
|
light.color=$BG_INPUT_FOCUS
|
|
mid.light.color=$BG_SEARCH
|
|
dark.color=$BG_BAR
|
|
mid.color=$DIVIDER
|
|
highlight.color=$SEL_BG
|
|
inactive.highlight.color=$SEL_BG
|
|
text.color=$FG_MAIN
|
|
window.text.color=$FG_MAIN
|
|
button.text.color=$FG_BRIGHT
|
|
disabled.text.color=$FG_MUTED
|
|
tooltip.text.color=$FG_BRIGHT
|
|
highlight.text.color=$SEL_FG
|
|
link.color=$ACCENT
|
|
link.visited.color=$ACCENT_ALT
|
|
EOF
|
|
mv -f "$KVANTUM_CONF_DIR/Geminux/Geminux.kvconfig.tmp.$$" "$KVANTUM_CONF_DIR/Geminux/Geminux.kvconfig"
|
|
|
|
write_xsettingsd() {
|
|
cat > "$XSETTINGSD_CONF.tmp.$$" <<EOF
|
|
# Auto-generated by geminux-sync-gtk-theme from active .Xresources theme ($RAW_NAME)
|
|
Net/ThemeName "$1"
|
|
Net/IconThemeName "hicolor"
|
|
Gtk/FontName "$GTK_FONT"
|
|
Gtk/CursorThemeName "$CURSOR_THEME"
|
|
Gtk/CursorThemeSize $CURSOR_SIZE
|
|
EOF
|
|
mv -f "$XSETTINGSD_CONF.tmp.$$" "$XSETTINGSD_CONF"
|
|
}
|
|
|
|
write_xsettingsd "$GTK_THEME_NAME"
|
|
|
|
if [ "${1:-}" != "--no-reload" ]; then
|
|
XSD_PIDS="$(pidof xsettingsd 2>/dev/null || true)"
|
|
if [ -n "$XSD_PIDS" ]; then
|
|
if [ "$PREV_THEME" = "$GTK_THEME_NAME" ]; then
|
|
write_xsettingsd "Adwaita"
|
|
for pid in $XSD_PIDS; do
|
|
kill -HUP "$pid" 2>/dev/null || true
|
|
done
|
|
sleep 0.05 2>/dev/null || sleep 1
|
|
write_xsettingsd "$GTK_THEME_NAME"
|
|
fi
|
|
for pid in $XSD_PIDS; do
|
|
kill -HUP "$pid" 2>/dev/null || true
|
|
done
|
|
elif [ -n "${DISPLAY:-}" ] && command -v xsettingsd >/dev/null 2>&1; then
|
|
xsettingsd -c "$XSETTINGSD_CONF" >/dev/null 2>&1 </dev/null &
|
|
fi
|
|
|
|
if [ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ] && command -v gsettings >/dev/null 2>&1; then
|
|
gsettings set org.gnome.desktop.interface gtk-theme "$GTK_THEME_NAME" 2>/dev/null || true
|
|
gsettings set org.gnome.desktop.interface color-scheme "$COLOR_SCHEME" 2>/dev/null || true
|
|
gsettings set org.gnome.desktop.interface font-name "$GTK_FONT" 2>/dev/null || true
|
|
fi
|
|
|
|
if [ -n "${DISPLAY:-}" ] && command -v xrdb >/dev/null 2>&1; then
|
|
printf '*TkTheme: gtkTtk\n' | xrdb -merge 2>/dev/null || true
|
|
fi
|
|
fi
|