From 0a1041044141ddbda0c67602e70fe8894e7430fd Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sun, 7 Nov 2021 11:43:28 -0800 Subject: config changes for laptop --- bin/status | 22 +++++++++++----------- bin/updatedirs | 3 +-- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/status b/bin/status index bca791a..67c0ff6 100755 --- a/bin/status +++ b/bin/status @@ -7,7 +7,7 @@ cpu() { } mail() { - NEWMAIL=$(expr $(ls -1 ~/mail/*/INBOX/new | wc -l) - 7) + NEWMAIL=$(expr $(ls -1 ~/mail/*/INBOX/new | wc -l) - 5) if [ "${NEWMAIL%% *}" -eq 0 ]; then printf " (%s)" "${NEWMAIL%% *}" @@ -17,8 +17,8 @@ mail() { } battery() { - CHARGE=$(cat /sys/class/power_supply/BAT0/capacity) - STATUS=$(cat /sys/class/power_supply/BAT0/status) + CHARGE=$(cat /sys/class/power_supply/BAT1/capacity) + STATUS=$(cat /sys/class/power_supply/BAT1/status) if [ "$STATUS" = "Charging" ]; then printf " %s%%" "$CHARGE" else @@ -35,16 +35,17 @@ battery() { } volume() { - VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/") + VOL=$(pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}') + VOL=${VOL::-1} if [ "$VOL" -eq 0 ]; then - printf "🔇" + printf "" elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "🔈%s%%" "$VOL" + printf "%s%%" "$VOL" elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "🔉%s%%" "$VOL" + printf "%s%%" "$VOL" else - printf "🔊%s%%" "$VOL" + printf "%s%%" "$VOL" fi } @@ -71,8 +72,7 @@ ipaddr() { dostatus() { # xsetroot -name "$VOL│$MEM│$IP│$CPU│$NML│$WTR│$TIM" - xsetroot -name "$VOL│$BAT│$MEM│$IP│$CPU│$NML│$WTR│$TIM" - # echo "$VOL│$BAT│$MEM│$IP│$CPU│$NML│$WTR│$TIM" + exec xsetroot -name "$VOL│$BAT│$MEM│$IP│$CPU│$NML│$WTR│$TIM" } # signal handlers @@ -146,6 +146,6 @@ do refresh_cpu refresh_mail refresh_time - dostatus + dostatus & sleep 1m & wait $! done diff --git a/bin/updatedirs b/bin/updatedirs index 1ec2e25..cde7a6b 100755 --- a/bin/updatedirs +++ b/bin/updatedirs @@ -1,8 +1,7 @@ #!/bin/python - import os -ROOT = "/home/nolln/root" +ROOT = "/home/nolln/u" SRCS = ["src", "sys"] BUILD = ".build" TEST = ".test" -- cgit v1.2.1