aboutsummaryrefslogtreecommitdiff
path: root/bin/status
diff options
context:
space:
mode:
Diffstat (limited to 'bin/status')
-rwxr-xr-xbin/status22
1 files changed, 11 insertions, 11 deletions
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