]> git.r.bdr.sh - rbdr/dotfiles/blob - config/sway/status.sh
Add server dnf
[rbdr/dotfiles] / config / sway / status.sh
1 bat_capacity=$(cat /sys/class/power_supply/macsmc-battery/capacity)
2 bat_status=$(cat /sys/class/power_supply/macsmc-battery/status)
3 datestr=$(date +'%Y-%m-%d %H:%M:%S')
4 drive=$(df -h / --output=avail | tail -n 1 | awk '{$1=$1};1')
5 wifi_status=$(nmcli -t -f IN-USE,BARS,SSID dev wifi | rg '^\*')
6 wifi_bars=$(echo ${wifi_status} | cut -d':' -f 2)
7 wifi_ssid=$(echo ${wifi_status} | cut -d':' -f 3)
8
9 echo "${wifi_bars} ${wifi_ssid} | ${drive} | ${bat_capacity}% [${bat_status:0:1}] | ${datestr}"