If the DE detection fails fallback to the generic theme detection
This commit is contained in:
parent
caf55803f3
commit
cbc33486f7
10
fetch
10
fetch
|
@ -1089,6 +1089,10 @@ getresolution () {
|
||||||
# GTK Theme/Icons/Font {{{
|
# GTK Theme/Icons/Font {{{
|
||||||
|
|
||||||
getgtk () {
|
getgtk () {
|
||||||
|
# Fix weird output when the function
|
||||||
|
# is run multiple times.
|
||||||
|
unset gtk2theme gtk3theme
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
theme)
|
theme)
|
||||||
name="gtk-theme-name"
|
name="gtk-theme-name"
|
||||||
|
@ -1147,8 +1151,9 @@ getgtk () {
|
||||||
gtk2theme=$(xfconf-query -c xsettings -p /Net/$xfconf)
|
gtk2theme=$(xfconf-query -c xsettings -p /Net/$xfconf)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
*)
|
if [ -z "$gtk2theme" ] && [ -z "$gtk3theme" ]; then
|
||||||
# Check for gtk2 theme
|
# Check for gtk2 theme
|
||||||
if [ -f "$HOME/.gtkrc-2.0" ]; then
|
if [ -f "$HOME/.gtkrc-2.0" ]; then
|
||||||
gtk2theme=$(grep "^[^#]*$name" "$HOME/.gtkrc-2.0")
|
gtk2theme=$(grep "^[^#]*$name" "$HOME/.gtkrc-2.0")
|
||||||
|
@ -1175,8 +1180,7 @@ getgtk () {
|
||||||
gtk3theme=${gtk3theme/${name}*=}
|
gtk3theme=${gtk3theme/${name}*=}
|
||||||
gtk3theme=${gtk3theme//\"}
|
gtk3theme=${gtk3theme//\"}
|
||||||
gtk3theme=${gtk3theme/[[:space:]]/ }
|
gtk3theme=${gtk3theme/[[:space:]]/ }
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
# Toggle visibility of gtk themes.
|
# Toggle visibility of gtk themes.
|
||||||
[ "$gtk2" == "off" ] && unset gtk2theme
|
[ "$gtk2" == "off" ] && unset gtk2theme
|
||||||
|
|
Reference in New Issue