mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Matugen: Adjust cava's posthook
This commit is contained in:
+37
-1
@@ -4,7 +4,7 @@
|
||||
if [ "$#" -ne 1 ]; then
|
||||
# Print usage information to standard error.
|
||||
echo "Error: No application specified." >&2
|
||||
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox}" >&2
|
||||
echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox|cava}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -200,6 +200,42 @@ pywalfox)
|
||||
pywalfox update
|
||||
;;
|
||||
|
||||
cava)
|
||||
echo "🎨 Applying 'noctalia' theme to cava..."
|
||||
CONFIG_FILE="$HOME/.config/cava/config"
|
||||
|
||||
# Check if the config file exists.
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
# Check if [color] section exists
|
||||
if grep -q '^\[color\]' "$CONFIG_FILE"; then
|
||||
echo "[color] section found, checking theme setting..."
|
||||
|
||||
# Check if theme is already set to noctalia under [color]
|
||||
if sed -n '/^\[color\]/,/^\[/p' "$CONFIG_FILE" | grep -q '^theme = "noctalia"'; then
|
||||
echo "Theme already set to noctalia under [color], skipping modification."
|
||||
else
|
||||
# Check if theme line exists under [color] section
|
||||
if sed -n '/^\[color\]/,/^\[/p' "$CONFIG_FILE" | grep -q '^theme = '; then
|
||||
# Replace existing theme line under [color]
|
||||
sed -i '/^\[color\]/,/^\[/{s/^theme = .*/theme = "noctalia"/}' "$CONFIG_FILE"
|
||||
else
|
||||
# Add theme line after [color]
|
||||
sed -i '/^\[color\]/a theme = "noctalia"' "$CONFIG_FILE"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "[color] section not found, adding it with theme..."
|
||||
# Add [color] section with theme at the end of file
|
||||
echo "" >>"$CONFIG_FILE"
|
||||
echo "[color]" >>"$CONFIG_FILE"
|
||||
echo 'theme = "noctalia"' >>"$CONFIG_FILE"
|
||||
fi
|
||||
else
|
||||
echo "Error: cava config file not found at $CONFIG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
# Handle unknown application names.
|
||||
echo "Error: Unknown application '$APP_NAME'." >&2
|
||||
|
||||
@@ -219,7 +219,7 @@ Singleton {
|
||||
"path": "~/.config/cava/themes/noctalia"
|
||||
}
|
||||
],
|
||||
"postProcess": () => `pkill -USR1 cava`
|
||||
"postProcess": () => `${colorsApplyScript} cava`
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user