colors-apply.sh: check if cava runs with stdin to prevent cava crashes

This commit is contained in:
Ly-sec
2025-12-05 08:40:45 +01:00
parent 554e911117
commit d5f99258fc
3 changed files with 12 additions and 6 deletions
+11 -4
View File
@@ -234,11 +234,18 @@ cava)
THEME_MODIFIED=true
fi
# Reload cava if it's running
# Reload cava if it's running, but only if it's not using stdin config
# (CavaService manages Cava via stdin, and reloading would cause it to read the config file)
if pgrep -f cava >/dev/null; then
echo "Reloading cava configuration..."
pkill -USR1 cava
echo "Cava reloaded successfully"
# Check if Cava is running with -p /dev/stdin (managed by CavaService)
if pgrep -af cava | grep -q -- "-p.*stdin"; then
echo "Cava is managed by CavaService (stdin config), skipping reload signal."
echo "✅ Theme file updated. CavaService will use the theme on next restart."
else
echo "Reloading cava configuration..."
pkill -USR1 cava
echo "✅ Cava reloaded successfully"
fi
else
if [ "$THEME_MODIFIED" = true ]; then
echo "✅ Configuration updated. Start cava to see the changes."
-1
View File
@@ -51,7 +51,6 @@ NBox {
Layout.fillWidth: true
spacing: Style.marginS
Item {
Layout.preferredWidth: Style.marginS
}
+1 -1
View File
@@ -36,7 +36,7 @@ Item {
// Clear canvas when not rendering
onRenderingActiveChanged: {
if (!renderingActive) {
if (!renderingActive && canvas.available) {
var ctx = canvas.getContext("2d");
if (ctx)
ctx.reset();