summaryrefslogtreecommitdiff
path: root/sway/status.sh
blob: 6bbbd63df004ba65837bef1357417be48a978e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh


temp() {
       find /sys/class/thermal -type l -name 'thermal_zone*' | \
       while read -r zone
       do
               printf "%s °C " "$(( $(cat ${zone}/temp) / 1000 ))"
       done
}
bat="BAT $(cat /sys/class/power_supply/BAT*/capacity | tr '\n' ' ')"
time="$(date '+KW %W %a %Y-%m-%d %H:%M')"


echo "| $(temp)| ${bat}| ${time} |"