1
0

fix streq references

This commit is contained in:
dtb 2023-12-19 00:16:49 -07:00
parent 34a4c48a06
commit 3e77b69e66
4 changed files with 7 additions and 7 deletions

2
.gitignore vendored
View File

@ -6,6 +6,6 @@ nonzero/nonzero
roll/roll
simexec/simexec
str/str
streq/streq
strcmp/strcmp
sysexits/sysexits
sysexits/sysexits.h

View File

@ -18,7 +18,7 @@ date; printf "Current level: %d%%\n" "$current_level"
while true; do
current_level="$(battery)"
date; if ! streq "$current_level" "$previous_level"; then
date; if ! strcmp "$current_level" "$previous_level"; then
printf '%s: %s%% -> %s%%\n' "$(
test "$current_level" -lt "$previous_level" \
&& printf 'Discharged' \

View File

@ -20,7 +20,7 @@ DELIMITER=" || "
INTERVAL=1
get_cpu_temp() {
if streq "$(uname)" "Linux"; then
if strcmp "$(uname)" "Linux"; then
RETVAL=""
# iterate over files, adjust, print out "%dC "
for file in $CPU_TEMP_FILES;
@ -32,7 +32,7 @@ get_cpu_temp() {
printf "%b" "$RETVAL" \
| python -c "from sys import stdin; print(stdin.read().rstrip() + '\n')"
return
elif streq "$(uname)" "NetBSD"; then
elif strcmp "$(uname)" "NetBSD"; then
printf "%bC" "$(envstat -s coretemp0:'cpu0 temperature' \
| sed 1,2d \
| cut -d ':' -f 2 \
@ -59,7 +59,7 @@ get_current_desktop() {
}
get_memory_usage() {
if streq "$(uname)" "Linux"; then
if strcmp "$(uname)" "Linux"; then
printf "%b" \
"$(free | head -n 2 | tail -n 1 \
| awk '{print $3 " used / " $2 " total"}')"
@ -101,7 +101,7 @@ str isvalue "$CPU_TEMP_FILES" \
while true; do
printbar
sleep "$INTERVAL"
if streq $(date +'%S') 00; then
if strcmp $(date +'%S') 00; then
# every minute
PUBLIC_IP="$(ifpublic)"
fi

View File

@ -15,7 +15,7 @@ argv0="$0"
VOLUME_TMP_FILE="$HOME/.volume-previous"
if streq "$(uname)" NetBSD; then
if uname | xargs strcmp NetBSD; then
VOLUME_SYSTEM=netbsd
elif command -v pactl >/dev/null 2>&1; then
VOLUME_SYSTEM=pulseaudio