power menu, redshift, polybar
This commit is contained in:
26
.config/polybar/scripts/info-docker/README.md
Normal file
26
.config/polybar/scripts/info-docker/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Script: info-docker
|
||||
|
||||
Shows the number of Docker containers in one of the states: `created`, `restarting`, `running`, `removing`, `paused`, `exited`, `dead`
|
||||
|
||||

|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
You have to add the `docker` command to the `/etc/sudoers` NOPASSWD of your user:
|
||||
|
||||
```ini
|
||||
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
|
||||
|
||||
```ini
|
||||
[module/info-docker]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/info-docker.sh
|
||||
interval = 60
|
||||
```
|
||||
9
.config/polybar/scripts/info-docker/info-docker.sh
Normal file
9
.config/polybar/scripts/info-docker/info-docker.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
STATUS="running exited dead"
|
||||
|
||||
for stat in $STATUS; do
|
||||
output="$output $(sudo docker ps -qf status="$stat" | wc -l) |"
|
||||
done
|
||||
|
||||
echo "|$output"
|
||||
BIN
.config/polybar/scripts/info-docker/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/info-docker/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 626 B |
Reference in New Issue
Block a user