various fixes
This commit is contained in:
parent
24a3de9d6a
commit
3e2cc98337
10
bin/battery
10
bin/battery
@ -1,5 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
subprogram="$(command -v "$0")"
|
||||||
|
if ! nonzero "$subprogram" && ! test -e "$0"; then
|
||||||
|
printf "%s: can't find myself!\n" "$0"
|
||||||
|
exit 70 # sysexits(3) EX_SOFTWARE
|
||||||
|
else
|
||||||
|
subprogram="$0"
|
||||||
|
fi
|
||||||
|
|
||||||
# battery -> battery.linux battery.netbsd etc
|
# battery -> battery.linux battery.netbsd etc
|
||||||
subprogram="$0"."$(uname | lowercase)"
|
subprogram="$0"."$(uname | lowercase)"
|
||||||
|
|
||||||
@ -8,4 +16,4 @@ if ! command -v "$subprogram" >/dev/null 2>&1 && ! test -e "$subprogram"; then
|
|||||||
exit 70 # sysexits(3) EX_SOFTWARE
|
exit 70 # sysexits(3) EX_SOFTWARE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$subprogram" | exit 70 # sysexits(3) EX_SOFTWARE
|
"$subprogram" || exit 70 # sysexits(3) EX_SOFTWARE
|
||||||
|
4
bin/data
4
bin/data
@ -11,7 +11,7 @@ CPU_TEMP_FILES="/sys/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input
|
|||||||
CPU_TEMP_SCALE=1000
|
CPU_TEMP_SCALE=1000
|
||||||
|
|
||||||
# format for the date (by default in this script, ISO 8601)
|
# format for the date (by default in this script, ISO 8601)
|
||||||
DATE="date '+%Y-%m-%dT%T'"
|
DATE="date +%Y-%m-%dT%T"
|
||||||
|
|
||||||
DELIMITER=" || "
|
DELIMITER=" || "
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ PUBLIC_IP="$(get_public_ip)"
|
|||||||
|
|
||||||
printbar() {
|
printbar() {
|
||||||
printf "%b" "$(get_current_desktop)"
|
printf "%b" "$(get_current_desktop)"
|
||||||
printf "%b" $("$DATE")
|
printf "%b" $($DATE)
|
||||||
printf "%b" "$DELIMITER"
|
printf "%b" "$DELIMITER"
|
||||||
printf "%b" "BAT: $(battery)"
|
printf "%b" "BAT: $(battery)"
|
||||||
printf "%b" "$DELIMITER"
|
printf "%b" "$DELIMITER"
|
||||||
|
Loading…
Reference in New Issue
Block a user