nesto/icons.sh

31 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
_nesto_dir="$(dirname $(readlink -f $0))"
source "$_nesto_dir/types.sh"
Array clock_anim=(🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧)
Map status_icons=([running]=[stopped]=[template]="☢️ " [other]="✔️☑️🔘⚪⚫🔴🔵🔺🔻🔸🔹🔶🔷🔳🔲▪️▫️◾◽◼️⬛⬜☢️📻⏰⌛️⏳📡🔋🔌💡💰🔧🔑✉️📩📨📧💌📥📤📦📜📃📄📑📊📈📉📆📅📇📋📁📂📰📓📔📚📖🔖🔗📎📐📏📌📍📝🔍🔎🔏🔐🔒🔓🎭🎨🎬🎤🎧🎼🎹🎷🎺🎸🎻🎲♟🎯🎮🔈🔇🔉🔊🔔🔕📣📢💬💭♠️♣️♥️♦️" )
Map status_colors=([running]=$c_green [stopped]=$c_dark$c_red [template]=$c_yellow )
spinning=""
s=1
spinner()
{
s=$[$s+1]
local i=$[$s%100]
if [[ -n $spinning ]]
then
if [[ $i == 0 ]]
then
printf "${clock_anim[$1]} $s\r"
[[ $1 < ${#clock_anim[@]} ]] && spinner $[$1+1] || spinner 1
else
spinner $1
fi
fi
}
spinning=true
spinner