1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

Added docker count to Polybar

This commit is contained in:
Ryan Kes 2020-03-08 14:50:56 +01:00
parent a26bd5133a
commit f63b278aef
2 changed files with 17 additions and 2 deletions

View File

@ -48,7 +48,7 @@ monitor = ${env:MONITOR:eDP1}
modules-left = bspwm modules-left = bspwm
modules-center = battery0 battery1 wlan bluetooth modules-center = battery0 battery1 wlan bluetooth
modules-right = updates-arch-combined xbacklight volume memory cpu temperature filesystem mail rss github date modules-right = updates-arch-combined xbacklight volume memory cpu temperature filesystem docker mail rss github date
tray-position = right tray-position = right
@ -58,7 +58,7 @@ monitor = ${env:MONITOR:DP-1}
modules-left = bspwm modules-left = bspwm
modules-center = player-mpris-tail modules-center = player-mpris-tail
modules-right = eth bluetooth updates-arch-combined volume memory cpu temperature filesystem mail rss github date modules-right = eth bluetooth updates-arch-combined volume memory cpu temperature filesystem docker mail rss github date
tray-position = right tray-position = right
@ -414,6 +414,12 @@ exec = /bin/sh ~/.local/bin/mailcount
click-left = alacritty -e neomutt click-left = alacritty -e neomutt
click-middle = mailsync & click-middle = mailsync &
[module/docker]
type = custom/script
exec = dockerstatus
interval = 1
label =  %output%
[settings] [settings]
screenchange-reload = true screenchange-reload = true
;compositing-background = xor ;compositing-background = xor

View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
count=$(docker ps -q | wc -l)
if [ ! "$count" -eq 0 ]; then
echo "$count"
else
echo ""
fi