chezmoi/dot_dotfiles/polybar/polybar-scripts/polybar-scripts/info-docker
2021-02-25 09:38:16 +01:00
..
screenshots Updated polybar-scripts. 2021-02-25 09:38:16 +01:00
info-docker.sh Updated polybar-scripts. 2021-02-25 09:38:16 +01:00
README.md Updated polybar-scripts. 2021-02-25 09:38:16 +01:00

Script: info-docker

Shows the number of Docker containers in one of the states: created, restarting, running, removing, paused, exited, dead

info-docker

Configuration

You have to add the docker command to the /etc/sudoers NOPASSWD of your user:

user ALL=(ALL) NOPASSWD: /usr/bin/docker ps -qf status=running
user ALL=(ALL) NOPASSWD: /usr/bin/docker ps -qf status=exited
user ALL=(ALL) NOPASSWD: /usr/bin/docker ps -qf status=dead

Module

[module/info-docker]
type = custom/script
exec = ~/polybar-scripts/info-docker.sh
interval = 60