diff --git a/hosts/pinwheel/modules/waybar/default.nix b/hosts/pinwheel/modules/waybar/default.nix index 5e2b403..14eea5e 100644 --- a/hosts/pinwheel/modules/waybar/default.nix +++ b/hosts/pinwheel/modules/waybar/default.nix @@ -94,6 +94,13 @@ let bluetoothctl power off >> /dev/null fi ''; + + container-status = pkgs.writeShellScript "container-status" '' + RUNNING=$(docker ps -q | wc -l) + if [ "$RUNNING" -gt 0 ]; then + echo "{ \"text\": \"\", \"tooltip\": \"containers running: $RUNNING\", \"class\": \"running\" }" + fi + ''; in { home-manager.users.alex = { @@ -114,6 +121,7 @@ in modules-right = [ "custom/work-vpn-status" "custom/spotify" + "custom/container-status" "custom/dunst" "custom/mullvad" "bluetooth" @@ -135,6 +143,12 @@ in tooltip = false; }; + "custom/container-status" = { + exec = "${container-status}"; + return-type = "json"; + interval = 1; + }; + "custom/dunst" = { exec = notifications-status; on-click-right = "${pkgs.dunst}/bin/dunstctl set-paused toggle"; @@ -258,6 +272,11 @@ in color: #${config.lib.colors.warning}; } + #custom-container-status.running { + color: #${config.lib.colors.warning}; + font-size: 30px; + } + #clock { margin-right: 10px; }