diff --git a/bin/battery b/bin/battery index 93ed99c..17eb0bc 100755 --- a/bin/battery +++ b/bin/battery @@ -1,5 +1,13 @@ #!/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 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 fi -"$subprogram" | exit 70 # sysexits(3) EX_SOFTWARE +"$subprogram" || exit 70 # sysexits(3) EX_SOFTWARE diff --git a/bin/data b/bin/data index c64c756..98cf4f5 100755 --- a/bin/data +++ b/bin/data @@ -11,7 +11,7 @@ CPU_TEMP_FILES="/sys/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input CPU_TEMP_SCALE=1000 # format for the date (by default in this script, ISO 8601) -DATE="date '+%Y-%m-%dT%T'" +DATE="date +%Y-%m-%dT%T" DELIMITER=" || " @@ -88,7 +88,7 @@ PUBLIC_IP="$(get_public_ip)" printbar() { printf "%b" "$(get_current_desktop)" - printf "%b" $("$DATE") + printf "%b" $($DATE) printf "%b" "$DELIMITER" printf "%b" "BAT: $(battery)" printf "%b" "$DELIMITER"