~sircmpwn/dotfiles

f037e6e88aa6dd68eaa044c8b7f80bb4b3a27ead — Drew DeVault 2 months ago 7a059df
Update custom_statusbar
1 files changed, 1 insertions(+), 25 deletions(-)

M bin/custom_statusbar
M bin/custom_statusbar => bin/custom_statusbar +1 -25
@@ 1,32 1,8 @@
#!/bin/sh
. ~/.config/stewdio.conf
while true
do
	listeners=$(curl -s https://$upstream/api/listeners)
	nlisteners=$(printf '%s' "$listeners" | jq -r '.named_listeners | length')
	listeners=$(printf '%s' "$listeners" | jq -r '.named_listeners | join(", ")')
	now_playing=$(curl -s https://$upstream/api/playing | jq -r '.artist + " - " + .title')
	kotd=$(kotd)
	ibus=$(ibus engine 2> /dev/null)
	time=$(date +"%A %Y-%m-%d %I:%M %p")
	time="$time $(date -u +"(%H:%M UTC)")"

	if [ "${ibus}" == "anthy" ]
	then
		ibus=" ⋯ JA"
	elif [ "${ibus}" == "Unikey" ]
	then
		ibus=" ⋯ VT"
	else
		ibus=""
	fi

	if [ "${nlisteners}" -gt 0 ]
	then
		printf "${kotd} ⋯ ♫ %s w/%s ⋯ %s%s" "${now_playing}" "${listeners}" "${time}" "${ibus}"
	else
		printf "${kotd} ⋯ ♫ %s ⋯ %s%s" "${now_playing}" "${time}" "${ibus}"
	fi
	printf "\n"
	printf "%s\n" "${time}"
	sleep 10
done