dotfiles/files/%HOME/.config/sway/status.sh
2022-12-16 14:23:28 +01:00

16 lines
882 B
Bash
Executable file

#!/bin/sh
uptimef=$(uptime | cut -d ',' -f1 | cut -d ' ' -f4,5)
datef=$(date "+%a %F %H:%M:%S")
linux_version=$(uname -r | cut -d '-' -f1)
battery_status=$(cat /sys/class/power_supply/BAT0/status)
battery_percent=$(cat /sys/class/power_supply/BAT0/capacity)
#audio_volume=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))
audio_volume=$(pamixer --get-volume)%
disk_usage=$(df -kh / | grep dev | awk '{print $5}')
mem_used=$(free | awk '/Mem/{printf("%.2f%"), $3/$2*100}')
local_ip=$(ip addr show wlp58s0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')
# 💎 💻 💡 🔌 ⚡ 📁 \|
printf "📁 %3s | 💎 %7s | 💻 %s | 📶 %s | 🐧 %7s | 🔋 %7s | 🔉 %4s | %s\n" \
"$disk_usage" "$mem_used" "$uptimef" "$local_ip" "$linux_version" "$battery_percent% ($battery_status)" "$audio_volume" "$datef"
sleep 1