Major update

main
kvj 2023-12-11 19:24:14 +01:00
parent 5c79830dfd
commit 0079f5021e
1 changed files with 23 additions and 1 deletions

24
dwm-bar
View File

@ -11,6 +11,28 @@ pkg_updates() {
fi fi
} }
music() {
ARTIST=$(playerctl metadata artist)
TRACK=$(playerctl metadata title)
#DURATION=$(playerctl metadata mpris:length | sed 's/.\{6\}$//')
STATUS=$(playerctl status)
if [ "$STATUS" = "Playing" ]; then
STATUS=""
else
STATUS=" 󰏤"
fi
if [ "$ARTIST" = "" ]; then
printf ""
else
printf "^c#656565^  "
printf "$STATUS "
printf "^c#d4d5d5^$ARTIST - $TRACK"
fi
}
weather() { weather() {
weather=$(curl -s wttr.in/Reda?format=1 | grep -o ".[0-9].*") weather=$(curl -s wttr.in/Reda?format=1 | grep -o ".[0-9].*")
printf "^c#656565^  " printf "^c#656565^  "
@ -44,6 +66,6 @@ while true; do
[ $interval == 0 ] || [ $(($interval % 3600)) == 0 ] && updates=$(pkg_updates) [ $interval == 0 ] || [ $(($interval % 3600)) == 0 ] && updates=$(pkg_updates)
interval=$((interval + 1)) interval=$((interval + 1))
sleep 1 && xsetroot -name "$(update_icon) $updates $(weather) $(cpu) $(mem) $(clock)" sleep 1 && xsetroot -name "$(music) $(update_icon) $updates $(weather) $(cpu) $(mem) $(clock)"
done done