mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-29 17:12:04 +00:00
foot: fix theming when no config exists - foot does not create a config by default.
This commit is contained in:
+12
-5
@@ -43,8 +43,18 @@ case "$APP_NAME" in
|
||||
echo "🎨 Applying 'noctalia' theme to foot..."
|
||||
CONFIG_FILE="$HOME/.config/foot/foot.ini"
|
||||
|
||||
# Check if the config file exists before trying to modify it.
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
# Check if the config file exists, create it if it doesn't.
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo "Config file not found, creating $CONFIG_FILE..."
|
||||
# Create the config directory if it doesn't exist
|
||||
mkdir -p "$(dirname "$CONFIG_FILE")"
|
||||
# Create the config file with the noctalia theme
|
||||
cat > "$CONFIG_FILE" << 'EOF'
|
||||
[main]
|
||||
include=~/.config/foot/themes/noctalia
|
||||
EOF
|
||||
echo "Created new config file with noctalia theme."
|
||||
else
|
||||
# Check if theme is already set to noctalia
|
||||
if grep -q "include=~/.config/foot/themes/noctalia" "$CONFIG_FILE"; then
|
||||
echo "Theme already set to noctalia, skipping modification."
|
||||
@@ -59,9 +69,6 @@ case "$APP_NAME" in
|
||||
sed -i '1i [main]\ninclude=~/.config/foot/themes/noctalia\n' "$CONFIG_FILE"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Error: foot config file not found at $CONFIG_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user