From f2fefb5379f2797e4b321170bbb5e2001fc2de1e Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 18 Jul 2021 17:44:37 +0200 Subject: [PATCH] Use XSETTINGS to get theme without a DE GTK is using XSETTINGS as the primary information for theme, icons and font. It surpasses what's inside the configuration files. DE will advertise the values they have in their own registries to XSETTINGS. Without a DE, users can get XSETTINGS with xsettingsd. It is shipped with `dump_xsettings` to get the current values. Unrelated, but without a DE, I doubt the content of gsettings matter much. GTK will not read it by itself. I would remove it. People running a part of a DE (gnome-control-center maybe?) will get XSETTINGS. --- neofetch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neofetch b/neofetch index 71a8043e..5253f787 100755 --- a/neofetch +++ b/neofetch @@ -3189,6 +3189,9 @@ get_style() { fi # Check for general GTK3 Theme. + if [[ -z "$gtk3_theme" ]] && type -p dump_xsettings >/dev/null; then + gtk3_theme="$(dump_xsettings | sed -n "s,^${xfconf#/} ,,p")" + fi if [[ -z "$gtk3_theme" ]]; then if [[ -f "${XDG_CONFIG_HOME}/gtk-3.0/settings.ini" ]]; then gtk3_theme="$(grep "^[^#]*$name" "${XDG_CONFIG_HOME}/gtk-3.0/settings.ini")"