Files
hyprdots/hypr/info

21 lines
1.2 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
i=1
mem_total=$(sed -nE 's_.*MemTotal:[[:space:]]*(.*) kB_\1_p' /proc/meminfo)
mem_total_mb=$((mem_total / 1024))
while [ $i -le 5 ]; do
mem=$(sed -nE 's_.*Active:[[:space:]]*(.*) kB_\1_p' /proc/meminfo)
mem="$((mem / 1024))"
temp=$(cat /sys/class/thermal/thermal_zone0/temp)
temp=$((temp / 1000))
bat_stats=$(cat /sys/class/power_supply/BAT0/status)
vol_stats=$(pamixer --get-mute)
charge=$(cat /sys/class/power_supply/BAT*/capacity)
[ "$bat_stats" = "Discharging" ] && bat_icon=🔋 || bat_icon=🔌
[ "$bat_stats" = "Discharging" ] && [ "$charge" -lt 20 ] && bat_icon="🪫"
[ "$vol_stats" = "true" ] && vol_icon=🔇 || vol_icon=🔊
notify-send -i "lol" "<----------(STATS)---------->" "🧠 CPU usage : $(top -ibn1 | sed -nE 's_%Cpu\(s\):(.*)us.*_\1_p' | cut -d' ' -f2-3) %\n🌡 Cpu Temp : $temp °C\n🔳 RAM : $mem MB / $mem_total_mb MB\n$bat_icon Battery : $charge (${bat_stats})\n☀ Brightness : $(light -G | cut -d'.' -f1)%\n$vol_icon Volume : $(pamixer --get-volume-human)\n🎵 $(pgrep -af mpvsocket >/dev/null && cut -d ">" -f1 /tmp/yt-music/current | cut -d":" -f2)" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1500 &
: $((i += 1))
sleep 1
done