|
|
|
@@ -1,8 +1,9 @@
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
# Synchronize active GTK2, GTK3, and xsettingsd themes/fonts with .Xresources/.xth theme.
|
|
|
|
|
# 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"
|
|
|
|
@@ -12,7 +13,10 @@ 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"
|
|
|
|
@@ -116,14 +120,24 @@ IS_DARK="$(awk -v h="$BG_MAIN" '
|
|
|
|
|
|
|
|
|
|
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" {
|
|
|
|
@@ -135,15 +149,16 @@ if [ -r "$XSETTINGSD_CONF" ]; then
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
THEME_ROOT="$THEMES_OUT_DIR/$GTK_THEME_NAME"
|
|
|
|
|
mkdir -p "$THEME_ROOT/gtk-2.0" "$THEME_ROOT/gtk-3.0" \
|
|
|
|
|
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" "$(dirname "$XSETTINGSD_CONF")"
|
|
|
|
|
"$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 theme from $RAW_NAME
|
|
|
|
|
Comment=Auto-generated Geminux GTK2/GTK3/GTK4 theme from $RAW_NAME
|
|
|
|
|
Encoding=UTF-8
|
|
|
|
|
|
|
|
|
|
[X-GNOME-Metatheme]
|
|
|
|
@@ -728,6 +743,419 @@ cat > "$THEME_ROOT/gtk-3.0/gtk-dark.css.tmp.$$" <<EOF
|
|
|
|
|
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
|
|
|
|
@@ -756,6 +1184,185 @@ 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)
|
|
|
|
@@ -793,4 +1400,8 @@ if [ "${1:-}" != "--no-reload" ]; then
|
|
|
|
|
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
|