Uppercase without function

This commit is contained in:
Dylan Araps 2016-10-15 22:07:12 +11:00
parent 30d808c52d
commit 5e167e4c02
1 changed files with 9 additions and 20 deletions

View File

@ -539,7 +539,7 @@ getwm() {
case "$wm" in case "$wm" in
"xwlc") "xwlc")
wm="$(ps -e | grep -m 1 -oE "sway|orbment|velox|orbital")" wm="$(ps -e | grep -m 1 -oE "sway|orbment|velox|orbital")"
wm="$(uppercase "$wm")" [ "$version" -ge 4 ] && wm="${wm^}"
;; ;;
esac esac
@ -663,7 +663,7 @@ getwmtheme() {
esac esac
wmtheme="${wmtheme//\'}" wmtheme="${wmtheme//\'}"
wmtheme="$(uppercase "$wmtheme")" [ "$version" -ge 4 ] && wmtheme="${wmtheme^}"
} }
# }}} # }}}
@ -1396,7 +1396,7 @@ getstyle() {
theme="$(grep "^[^#]*$kde" "$kde_config_file")" theme="$(grep "^[^#]*$kde" "$kde_config_file")"
theme="${theme/${kde}*=}" theme="${theme/${kde}*=}"
theme="$(uppercase "$theme")" [ "$version" -ge 4 ] && theme="${theme^}"
gtk_shorthand="on" gtk_shorthand="on"
return return
@ -1471,8 +1471,10 @@ getstyle() {
gtk3theme=${gtk3theme//\'} gtk3theme=${gtk3theme//\'}
# Uppercase the first letter of each gtk theme # Uppercase the first letter of each gtk theme
gtk2theme="$(uppercase "$gtk2theme")" if [ "$version" -ge 4 ]; then
gtk3theme="$(uppercase "$gtk3theme")" gtk2theme="${gtk2theme^}"
gtk3theme="${gtk3theme^}"
fi
# Toggle visibility of gtk themes. # Toggle visibility of gtk themes.
[ "$gtk2" == "off" ] && unset gtk2theme [ "$gtk2" == "off" ] && unset gtk2theme
@ -1558,7 +1560,7 @@ getterm() {
*) term="$name" ;; *) term="$name" ;;
esac esac
term="$(uppercase "$term")" [ "$version" -ge 4 ] && term="${term^}"
} }
# }}} # }}}
@ -1608,7 +1610,7 @@ gettermfont() {
;; ;;
esac esac
termfont="$(uppercase "$termfont")" [ "$version" -ge 4 ] && termfont="${termfont^}"
} }
# }}} # }}}
@ -2665,19 +2667,6 @@ bold() {
# }}} # }}}
# Uppercase {{{
# Uppercase the first letter of $1
uppercase () {
if [ "$version" -ge 4 ]; then
printf "%s" "${1^}"
else
printf "%s" "${1}"
fi
}
# }}}
# Linebreak {{{ # Linebreak {{{
getlinebreak() { getlinebreak() {