1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 17:28:01 +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:]') name=$(echo "$1" | tr '[:upper:]' '[:lower:]')
declare -A ICON_MAP=( declare -A ICON_MAP=(
[firefox]=
[code]=
[tilix]= [tilix]=
[code]=
[firefox]=
[chromium]=
[nautilus]= [nautilus]=
[gnome-calculator]= [gnome-calculator]=
[gnome-calendar]= [gnome-calendar]=
[eog]=
[keepassxc]=
) )
if [ ${ICON_MAP[$name]+_} ]; then if [ ${ICON_MAP[$name]+_} ]; then
@ -51,14 +54,14 @@ show_tasks()
print_task_name() 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") icon=$(get_icon_by_name "$name")
if [ -n "$icon" ]; then if [ -n "$icon" ]; then
name="$name " name="$name "
fi fi
printf "%s%s" "$name" "$icon" printf "%s%s" "${name^}" "$icon"
} }
get_task_id() get_task_id()