mirror of
				https://github.com/dcarrillo/dotfiles.git
				synced 2025-10-31 12:19:08 +00:00 
			
		
		
		
	[polybar] Show only icons on task_manager (just the leading letter if icon is missing)
This commit is contained in:
		| @@ -65,6 +65,7 @@ font-1 = "FontAwesome:size=16;2" | ||||
| font-2 = "Material Icons:size=16;1" | ||||
| font-3 = NotoSans-Regular:size=18:weight=bold;2 | ||||
| font-4 = NotoSans-Regular:size=18:weight=bold;-7 | ||||
| font-5 = "FontAwesome:size=21;2" | ||||
|  | ||||
| modules-left = taskslabel taskbar1 taskbar2 taskbar3 taskbar4 taskbar5 taskbar6 taskbar7 taskbar8 taskbar9 taskbar10 | ||||
| modules-center = custom_date | ||||
|   | ||||
| @@ -18,4 +18,4 @@ until pgrep -u "$(id -u)" -x polybar >/dev/null; do | ||||
|     sleep 0.5 | ||||
| done | ||||
|  | ||||
| ~/.config/polybar/scripts/task_manager --daemon 10 & | ||||
| ~/.config/polybar/scripts/task_manager --daemon 15 & | ||||
|   | ||||
| @@ -39,17 +39,24 @@ get_icon_by_name() | ||||
|     declare -A ICON_MAP=( | ||||
|         [tilix]= | ||||
|         [code]= | ||||
|         [firefox]= | ||||
|         [chromium]= | ||||
|         [nautilus]= | ||||
|         [firefox]= | ||||
|         [chromium]= | ||||
|         [nextcloud]= | ||||
|         [gnome-calculator]= | ||||
|         [gnome-calendar]= | ||||
|         [gnome-control-center]= | ||||
|         [eog]= | ||||
|         [nautilus]= | ||||
|         [keepassxc]= | ||||
|         [steam]= | ||||
|         [skype]= | ||||
|         [slack]= | ||||
|     ) | ||||
|  | ||||
|     if [ ${ICON_MAP[$name]+_} ]; then | ||||
|         echo "${ICON_MAP[$name]}" | ||||
|     else | ||||
|         echo "$name" | cut -c 1 | tr '[:lower:]' '[:upper:]' | ||||
|     fi | ||||
| } | ||||
|  | ||||
| @@ -57,6 +64,7 @@ show_tasks() | ||||
| { | ||||
|     max_tasks=$(grep -cE "^\[module/taskbar[0-9]+]" ~/.config/polybar/task_manager.ini) | ||||
|     wmctrl -lx | awk '{if ($2 > -1) print $3,$1}' \ | ||||
|                | sed -r 's/([0-9])\.([0-9])/\1\2/g' \ | ||||
|                | awk -F'.' '{ print $NF }' \ | ||||
|                | tail -"$max_tasks" | sort > $STATUS_FILE.current | ||||
|  | ||||
| @@ -89,7 +97,8 @@ print_task_name() | ||||
|         name="$name " | ||||
|     fi | ||||
|  | ||||
|     printf "%s%s" "${name^}" "$icon" | ||||
|     #echo "${name^}${icon}" | ||||
|     echo '%{T6}'"$icon"'%{T-}' | ||||
| } | ||||
|  | ||||
| get_active_window() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user