Initial
This commit is contained in:
commit
c8734e660a
392 changed files with 21043 additions and 0 deletions
25
.config/waybar/custom/containers-monitor.sh
Normal file
25
.config/waybar/custom/containers-monitor.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
IFS=$'\n'
|
||||
|
||||
docker_containers=($(docker ps --format "{{ .Names }}\t{{ .Status }}" | column -t))
|
||||
n="${#docker_containers[@]}"
|
||||
|
||||
podman_containers=($(podman ps --format "{{ .Names }}\t{{ .Status }}" | column -t))
|
||||
n=$((n + "${#docker_containers[@]}"))
|
||||
|
||||
tooltip="Containers:"
|
||||
for con in "${docker_containers[@]}";
|
||||
do
|
||||
tooltip="$tooltip\n$con"
|
||||
done
|
||||
|
||||
for con in "${podman_containers[@]}";
|
||||
do
|
||||
tooltip="$tooltip\n$con"
|
||||
done
|
||||
|
||||
if [[ n -gt 0 ]]
|
||||
then
|
||||
echo "{\"class\": \"running\", \"text\": \"$n\", \"tooltip\": \"$tooltip\"}"
|
||||
exit
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue