1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-09 19:11:15 +02:00

statusbar/sxhkd: updated player interface and cleaned up

This commit is contained in:
2024-03-09 02:48:17 +01:00
parent 60a947a8a2
commit f862b777ec
9 changed files with 127 additions and 20 deletions

View File

@@ -2,5 +2,16 @@
icon="^b#282828^^c#dfdfdf^  ^d^ "
total=$(free -h | awk '/^Mem:/ {print $3/$2}')
percent=$(printf %3s $(printf %-4s $total | tr ' ' '0' | cut -c1-4 | sed -e 's/\.//g' | sed -e 's/^0//g') | tr ' ' ' ')%
echo "$icon$percent"
percent=$(printf %3s $(printf %-4s $total | tr ' ' '0' | cut -c1-4 | sed -e 's/\.//g' | sed -e 's/^0//g') | tr ' ' ' ')
if [ $percent -gt 75 ]
then
icon="^b#282828^^c#ff0000^  ^d^"
elif [ $percent -gt 50 ]
then
icon="^b#282828^^c#ffff00^  ^d^"
else
icon="^b#282828^^c#dfdfdf^  ^d^"
fi
echo "$icon"