initial commit

This commit is contained in:
2024-06-11 21:08:44 +02:00
commit d8433ffbd8
391 changed files with 37223 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# systemctl
Show systemctl service status, allows to toggle status with left click.
Accepts the same service names as systemctl eg. "redis" or "docker".
![](systemctl.png)
# Config
```
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=docker
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=redis
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=postgresql
```

View File

@@ -0,0 +1,17 @@
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=docker
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=redis
[systemctl]
command=$SCRIPT_DIR/systemctl
interval=once
markup=pango
instance=postgresql

View File

@@ -0,0 +1,31 @@
#!/bin/bash
# The service we want to check or toggle (according to systemctl)
SERVICE=$BLOCK_INSTANCE
# Colors to display
INACTIVE_COLOR=#888888
ACTIVE_COLOR=#22BB22
# Exact string to display
ACTIVE="<span foreground=\"$ACTIVE_COLOR\">$SERVICE</span>"
INACTIVE="<span foreground=\"$INACTIVE_COLOR\"><s>$SERVICE</s></span>"
if [ "$( systemctl is-active "$SERVICE" )" != "active" ]
then
if [ "$BLOCK_BUTTON" == '1' ]
then
if systemctl start "$SERVICE"
then
echo "$ACTIVE"
fi
fi
echo "$INACTIVE"
else
if [ "$BLOCK_BUTTON" == '1' ]
then
if systemctl stop "$SERVICE"
then
echo "$INACTIVE"
fi
fi
echo "$ACTIVE"
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB