1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 18:38:00 +00:00

[polybar] Add new icons to task_manager

This commit is contained in:
Daniel Carrillo 2020-04-05 14:28:30 +02:00
parent 5ab17fe438
commit b60133df94

View File

@ -8,12 +8,15 @@ get_icon_by_name()
{
name=$(echo "$1" | tr '[:upper:]' '[:lower:]')
declare -A ICON_MAP=(
[firefox]=
[code]=
[tilix]=
[code]=
[firefox]=
[chromium]=
[nautilus]=
[gnome-calculator]=
[gnome-calendar]=
[eog]=
[keepassxc]=
)
if [ ${ICON_MAP[$name]+_} ]; then
@ -51,14 +54,14 @@ show_tasks()
print_task_name()
{
name=$(sed "${1}q;d" $STATUS_FILE | cut -f 1 -d " ")
name=$(sed "${1}q;d" $STATUS_FILE | cut -f 1 -d " " | tr '[:upper:]' '[:lower:]')
icon=$(get_icon_by_name "$name")
if [ -n "$icon" ]; then
name="$name "
fi
printf "%s%s" "$name" "$icon"
printf "%s%s" "${name^}" "$icon"
}
get_task_id()