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
1 changed files with 5 additions and 2 deletions

7
fetch
View File

@ -540,7 +540,7 @@ getuptime () {
"Mac OS X" | *"BSD")
# Get boot time in seconds
boot="$(sysctl -n kern.boottime)"
boot="${boot/{ sec = }"
boot="${boot/'{ sec = '}"
boot=${boot/,*}
# Get current date in seconds
@ -763,7 +763,7 @@ getwm () {
case "$os" in
"Mac OS X") wm="Quartz Compositor" ;;
"Windows") wm="Explorer" ;;
*) wm="Unknown" ;;
"Linux" | *"BSD") return ;;
esac
fi
}
@ -1176,6 +1176,9 @@ 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