Don't display Theme, Icons, Font or Window Manager if X isn't running

This commit is contained in:
Dylan 2016-02-19 20:47:13 +11:00
parent ba2c66daa7
commit 058e0bc3e6

7
fetch
View file

@ -540,7 +540,7 @@ getuptime () {
"Mac OS X" | *"BSD") "Mac OS X" | *"BSD")
# Get boot time in seconds # Get boot time in seconds
boot="$(sysctl -n kern.boottime)" boot="$(sysctl -n kern.boottime)"
boot="${boot/{ sec = }" boot="${boot/'{ sec = '}"
boot=${boot/,*} boot=${boot/,*}
# Get current date in seconds # Get current date in seconds
@ -763,7 +763,7 @@ getwm () {
case "$os" in case "$os" in
"Mac OS X") wm="Quartz Compositor" ;; "Mac OS X") wm="Quartz Compositor" ;;
"Windows") wm="Explorer" ;; "Windows") wm="Explorer" ;;
*) wm="Unknown" ;; "Linux" | *"BSD") return ;;
esac esac
fi fi
} }
@ -1176,6 +1176,9 @@ getresolution () {
# Theme/Icons/Font {{{ # Theme/Icons/Font {{{
getstyle () { getstyle () {
# If X isn't running don't print the theme.
[ ! -n "$DISPLAY" ] && return
# Fix weird output when the function # Fix weird output when the function
# is run multiple times. # is run multiple times.
unset gtk2theme gtk3theme unset gtk2theme gtk3theme