updated scripts and waybar

This commit is contained in:
2025-08-18 19:31:04 +02:00
parent 6e647070d8
commit 01f7b4fb8e
20 changed files with 305 additions and 268 deletions

View File

@@ -1,18 +1,20 @@
#!/bin/bash
PID_FILE="/tmp/gpu-screen-recorder.pid"
FORMAT_RECORDING="<span size='large'></span>"
FORMAT_STOPPED="<span size='large'></span>"
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null; then
echo '{"text": "Replay", "tooltip": "Replay running", "class": "recording"}'
echo "{\"text\": \"$FORMAT_RECORDING\", \"tooltip\": \"Replay running\", \"class\": \"recording\"}"
else
# The process is not running, but the PID file exists.
# This can happen if the process crashed.
# We'll remove the stale PID file.
rm "$PID_FILE"
echo '{"text": "Replay", "tooltip": "Replay paused"}'
echo "{\"text\": \"$FORMAT_STOPPED\", \"tooltip\": \"Replay paused\"}"
fi
else
echo '{"text": "Replay", "tooltip": "Replay paused"}'
echo "{\"text\": \"$FORMAT_STOPPED\", \"tooltip\": \"Replay paused\"}"
fi