blob: d1cba4174fcd5f255a308bfd30e1c5f052e0b36d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/sh
pkgCount() {
xbps-query -l | wc -l
}
pkgUpdates() {
updates=$(xbps-install -S -un | cut -d' ' -f2 | sort | uniq -c | xargs)
if [ -z "$updates" ]; then
echo "Fully Updated"
else
echo " $updates""s"
fi
}
battery() {
cat /sys/class/power_supply/BAT1/capacity
}
cpu() {
grep -o "^[^ ]*" /proc/loadavg
}
disk() {
df -hl | awk '/^\/dev\/sd[ab]/ { sum+=$5 } END { print sum }'
}
ram() {
printf "%.0f\n" $(free -m | grep Mem | awk '{print ($3/$2)*100}')
}
backlight() {
printf "%.0f\n" $(xbacklight -get)
}
wifi() {
case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in
up) printf "" ;;
down) printf "" ;;
esac
}
"$@"
|