sometimes GTK and gsettings can go crazy, untrackably. more error messages i get, the better.
28 lines
950 B
Bash
Executable File
28 lines
950 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# reve desktop environment framework
|
|
# Yigid BALABAN <fyb@fybx.dev> 2024
|
|
|
|
# chore script
|
|
# type mode
|
|
# name gtk_theme.sh
|
|
# desc changes the GTK theme and color-scheme according to desktop_mode
|
|
# vars gtk_dark_theme, gtk_light_theme
|
|
|
|
# shellcheck source=../../_reve.sh
|
|
source "$(reve where)/_reve"
|
|
|
|
key="org.gnome.desktop.interface"
|
|
target_theme="$(util_read_config chore.gtk_"$RV_CURRENT_MODE"_theme)"
|
|
target_scheme="prefer-$RV_CURRENT_MODE"
|
|
|
|
if ! gsettings set "$key" gtk-theme "$target_theme" ||
|
|
[ "$(gsettings get "$key" gtk-theme | tr -d \')" != "$target_theme" ]; then
|
|
error E mode/gtk-theme "Could not set gtk-theme to: $target_theme"
|
|
fi
|
|
|
|
if ! gsettings set "$key" color-scheme "$target_scheme" ||
|
|
[ "$(gsettings get "$key" color-scheme | tr -d \')" != "$target_scheme" ]; then
|
|
error E mode/gtk-theme "Could not set color-scheme to: $target_scheme"
|
|
fi
|