mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 11:39:53 +00:00
Resolution: exit correctly
This commit is contained in:
13
fetch
13
fetch
@@ -23,6 +23,7 @@
|
|||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
export LANG=c
|
export LANG=c
|
||||||
export LANGUAGE=C
|
export LANGUAGE=C
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
# Config Options {{{
|
# Config Options {{{
|
||||||
@@ -1040,16 +1041,22 @@ getsong () {
|
|||||||
getresolution () {
|
getresolution () {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | *"BSD")
|
"Linux" | *"BSD")
|
||||||
resolution=$(xdpyinfo 2>/dev/null | awk '/dimensions:/ {printf $2}')
|
if type -p xdpyinfo >/dev/null 2>&1; then
|
||||||
|
resolution=$(xdpyinfo 2>/dev/null | awk '/dimensions:/ {printf $2}')
|
||||||
|
else
|
||||||
|
resolution="Unknown"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
resolution=$(system_profiler SPDisplaysDataType |\
|
resolution=$(system_profiler SPDisplaysDataType |\
|
||||||
awk '/Resolution:/ {printf $2"x"$4" "}')
|
awk '/Resolution:/ {printf $2"x"$4" "}')
|
||||||
;;
|
;;
|
||||||
esac
|
|
||||||
|
|
||||||
[ -z "$resolution" ] && resolution="Unknown"
|
"*")
|
||||||
|
resolution="Unknown"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user