diff --git a/.config/newm/config.py b/.config/newm/config.py index d66af8c..51afbdd 100644 --- a/.config/newm/config.py +++ b/.config/newm/config.py @@ -6,6 +6,9 @@ import time import logging import psutil import subprocess +import docker + +docker_client = docker.from_env() from newm.layout import Layout from newm.helper import BacklightManager, WobRunner, PaCtl @@ -246,6 +249,11 @@ def right_text() -> str: return " | ".join([unread_emails(), cpu_usage(), mem_usage(), battery_status()]) +def display_docker() -> str: + containers = docker_client.containers.list(sparse=True) + return f" {len(containers)}" + + def get_time() -> str: return time.strftime("%a %Y-%m-%d %X")