pinwheel: Add container-status icon in waybar

This commit is contained in:
Alexander Heldt
2023-10-26 10:31:05 +02:00
parent 95545e4182
commit f40d0951ad

View File

@@ -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;
}