summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2018-04-26 19:07:56 (EDT)
committer P. J. McDermott <pj@pehjota.net>2018-04-26 19:07:56 (EDT)
commit02ad576f3236b4973aeed906a8a9b08753035196 (patch)
treeca1071c88669a1c979801878ad9b30a7db158dff
parentcea1e7fc49644c9dcc337663503c0b76a73a05af (diff)
downloadfluxbox-02ad576f3236b4973aeed906a8a9b08753035196.zip
fluxbox-02ad576f3236b4973aeed906a8a9b08753035196.tar.gz
fluxbox-02ad576f3236b4973aeed906a8a9b08753035196.tar.bz2
bin/hwmon: Make labels optional
-rwxr-xr-xbin/hwmon18
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/hwmon b/bin/hwmon
index 099ca2b..5fb2047 100755
--- a/bin/hwmon
+++ b/bin/hwmon
@@ -170,15 +170,17 @@ print_sensor()
printf ' '
i=$((${i} + 1))
done
- printf '%s:' "${label}"
- i=${#label}
- while [ ${i} -lt ${len} ]; do
- printf ' '
- i=$((${i} + 1))
- done
+ case "${label}" in ?*)
+ printf '%s: ' "${label}"
+ i=${#label}
+ while [ ${i} -lt ${len} ]; do
+ printf ' '
+ i=$((${i} + 1))
+ done
+ esac
case "${cr}" in
- 1) printf ' %s\r' "${value}";;
- 0) printf ' %s\n' "${value}";;
+ 1) printf '%s\r' "${value}";;
+ 0) printf '%s\n' "${value}";;
esac
return 0