power menu, redshift, polybar
This commit is contained in:
18
.config/polybar/scripts/isrunning-service/README.md
Normal file
18
.config/polybar/scripts/isrunning-service/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Script: isrunning-service
|
||||
|
||||
A script that shows if a systemd service is running. It uses `journalctl` to get realtime output.
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
Make sure that your user is member of the group `systemd-journal` to read all events.
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/isrunning-service]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/isrunning-service.sh
|
||||
tail = true
|
||||
```
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
UNIT="docker.service"
|
||||
|
||||
journalctl --follow -o cat --unit $UNIT | while read -r; do
|
||||
if [ "$(systemctl is-active "$UNIT")" = "active" ]; then
|
||||
echo "#1"
|
||||
else
|
||||
echo "#2"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user