mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Foot term theming: Fix #475
This commit is contained in:
+9
-3
@@ -41,9 +41,15 @@ case "$APP_NAME" in
|
||||
# Check if the config file exists before trying to modify it.
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
# Remove any existing theme include line to prevent duplicates.
|
||||
sed -i '/themes/d' "$CONFIG_FILE"
|
||||
# Add the new theme include line to the end of the file.
|
||||
echo "include=~/.config/foot/themes/noctalia" >> "$CONFIG_FILE"
|
||||
sed -i '/include=.*themes/d' "$CONFIG_FILE"
|
||||
|
||||
if grep -q '^\[main\]' "$CONFIG_FILE"; then
|
||||
# Insert the include line after the existing [main] section header
|
||||
sed -i '/^\[main\]/a include=~/.config/foot/themes/noctalia' "$CONFIG_FILE"
|
||||
else
|
||||
# If [main] doesn't exist, create it at the beginning with the include
|
||||
sed -i '1i [main]\ninclude=~/.config/foot/themes/noctalia\n' "$CONFIG_FILE"
|
||||
fi
|
||||
else
|
||||
echo "Error: foot config file not found at $CONFIG_FILE" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user