Remove getvisualstyle and merge it with getstyle

This commit is contained in:
Dylan 2016-02-19 23:10:09 +11:00
parent c151f41067
commit c7fa222ede

38
fetch
View file

@ -1176,9 +1176,6 @@ getresolution () {
# Theme/Icons/Font {{{
getstyle () {
# If X isn't running don't print the theme.
[ ! -n "$DISPLAY" ] && return
# Fix weird output when the function
# is run multiple times.
unset gtk2theme gtk3theme
@ -1190,6 +1187,8 @@ getstyle () {
gconf="gtk_theme"
xfconf="ThemeName"
kde="widgetStyle"
path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft"
path+="/Windows/CurrentVersion/Themes/CurrentTheme"
;;
icons)
@ -1209,6 +1208,7 @@ getstyle () {
;;
esac
if [ -n "$DISPLAY" ]; then
# Current DE
desktop="$XDG_CURRENT_DESKTOP"
desktop=${desktop,,}
@ -1331,6 +1331,17 @@ getstyle () {
theme=${theme/ '[GTK3]'}
theme=${theme/ '[GTK2/3]'}
fi
else
case "$os" in
"Windows")
theme="$(head -n1 $path 2>/dev/null)"
theme="${theme##*\\}"
theme="${theme%.*}"
theme="${theme^}"
;;
esac
fi
}
gettheme () {
@ -1565,27 +1576,6 @@ getcols () {
# }}}
# Windows Visual Style {{{
getvisualstyle () {
case "$os" in
"Windows"*)
path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft"
path+="/Windows/CurrentVersion/Themes/CurrentTheme"
visualstyle="$(head -n1 $path)"
visualstyle="${visualstyle##*\\}"
visualstyle="${visualstyle%.*}"
visualstyle="${visualstyle^}"
;;
*)
visualstyle="This feature only works on Windows"
;;
esac
}
# }}}
# }}}