mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 19:48:01 +00:00
[polybar] Add docker module and fix font issues
This commit is contained in:
parent
336bb86b35
commit
194c9f125a
@ -58,17 +58,18 @@ fixed-center = true
|
||||
background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
|
||||
font-0 = "Droid Sans Mono:size=16:antialias=true;1"
|
||||
font-0 = "RobotoMono-Regular:size=16:antialias=true;1"
|
||||
; https://fontawesome.com/cheatsheet/free
|
||||
font-1 = "FontAwesome:size=16:antialias=true;2"
|
||||
font-2 = "Material Icons:size=16:antialias=true;1"
|
||||
font-3 = NotoSans-Regular:size=18:weight=bold:antialias=true;2
|
||||
font-4 = NotoSans-Regular:size=28:weight=bold:antialias=true;-12
|
||||
font-3 = "NotoSans-Regular:size=18:weight=bold:antialias=true;2"
|
||||
font-4 = "NotoSans-Regular:size=28:weight=bold:antialias=true;-12"
|
||||
font-5 = "FontAwesome:size=21:antialias=true;4"
|
||||
font-6 = "Font Awesome 5 Brands-Regular-400:size=32:antialias=true;1"
|
||||
|
||||
modules-left = polywins
|
||||
modules-center = custom_date
|
||||
modules-right = updates cpu_bar memory_bar vpn network_usage alsa_bar
|
||||
modules-right = updates cpu_bar memory_bar docker vpn network_usage alsa_bar
|
||||
|
||||
cursor-click = pointer
|
||||
cursor-scroll = ns-resize
|
||||
|
@ -174,3 +174,10 @@ label-charging = %percentage%%
|
||||
format-discharging = <label-discharging>
|
||||
label-discharging = %percentage%%
|
||||
label-full =
|
||||
|
||||
[module/docker]
|
||||
type = custom/script
|
||||
exec = ~/.config/polybar/scripts/docker
|
||||
exec-if = docker ps -q
|
||||
interval = 30
|
||||
label = "%output%"
|
||||
|
24
.config/polybar/scripts/docker
Executable file
24
.config/polybar/scripts/docker
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
declare -A STATUS=(
|
||||
[running]=#43A047
|
||||
[exited]=#A14242
|
||||
[restarting]=#E53935
|
||||
[dead]=#E53935
|
||||
[created]=#1A4F76
|
||||
[paused]=#654321
|
||||
[removing]=#8E6995
|
||||
)
|
||||
|
||||
output=""
|
||||
containers=$(docker ps --all --format="{{.State}}")
|
||||
if [ "$(echo "$containers" | wc -l)" -gt 0 ]; then
|
||||
for status in "${!STATUS[@]}"; do
|
||||
count=$(echo "$containers" | grep -c "$status")
|
||||
if [ "$count" -gt 0 ]; then
|
||||
output="$output %{F${STATUS[$status]}}$count%{F-}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "$output"
|
@ -58,9 +58,9 @@ while true; do
|
||||
output=" 0.01 0.01"
|
||||
fi
|
||||
|
||||
echo "$icon $output"
|
||||
echo "$icon$output"
|
||||
else
|
||||
echo "$icon -- --"
|
||||
echo "$icon-- --"
|
||||
fi
|
||||
|
||||
echo "$current_values">$COUNTER_FILE
|
||||
|
Loading…
Reference in New Issue
Block a user