diff options
author | Nicholas <nbnoll@eml.cc> | 2021-11-07 11:43:28 -0800 |
---|---|---|
committer | Nicholas <nbnoll@eml.cc> | 2021-11-07 11:43:28 -0800 |
commit | 0a1041044141ddbda0c67602e70fe8894e7430fd (patch) | |
tree | 1cba0e61e397f55218a90e04df5423f75dae4409 /bin/status | |
parent | 5d1e21d28a93415b66401d27a30ee8eb6b2b66a8 (diff) |
config changes for laptop
Diffstat (limited to 'bin/status')
-rwxr-xr-x | bin/status | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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 |