mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
83 lines
2.8 KiB
Bash
Executable File
83 lines
2.8 KiB
Bash
Executable File
#!/usr/bin/env -S bash
|
|
|
|
|
|
# Ensure exactly one argument is provided.
|
|
if [ "$#" -ne 1 ]; then
|
|
# Print usage information to standard error.
|
|
echo "Error: No application specified." >&2
|
|
echo "Usage: $0 {kitty|ghostty|foot|fuzzell|pywalfox}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
APP_NAME="$1"
|
|
|
|
# --- Apply theme based on the application name ---
|
|
case "$APP_NAME" in
|
|
kitty)
|
|
echo "🎨 Applying 'noctalia' theme to kitty..."
|
|
kitty +kitten themes --reload-in=all noctalia
|
|
;;
|
|
|
|
ghostty)
|
|
echo "🎨 Applying 'noctalia' theme to ghostty..."
|
|
CONFIG_FILE="$HOME/.config/ghostty/config"
|
|
# 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 '/theme/d' "$CONFIG_FILE"
|
|
# Add the new theme include line to the end of the file.
|
|
echo "theme = noctalia" >> "$CONFIG_FILE"
|
|
pkill -SIGUSR2 ghostty
|
|
else
|
|
echo "Error: foot config file not found at $CONFIG_FILE" >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
|
|
foot)
|
|
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
|
|
# 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"
|
|
else
|
|
echo "Error: foot config file not found at $CONFIG_FILE" >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
|
|
fuzzell)
|
|
echo "🎨 Applying 'noctalia' theme to fuzzell..."
|
|
CONFIG_FILE="$HOME/.config/fuzzel/fuzzel.ini"
|
|
|
|
# Check if the config file exists.
|
|
if [ -f "$CONFIG_FILE" ]; then
|
|
# Remove any existing theme include line.
|
|
sed -i '/themes/d' "$CONFIG_FILE"
|
|
# Add the new theme include line.
|
|
echo "include=~/.config/fuzzel/themes/noctalia" >> "$CONFIG_FILE"
|
|
else
|
|
echo "Error: fuzzell config file not found at $CONFIG_FILE" >&2
|
|
exit 1
|
|
fi
|
|
;;
|
|
|
|
pywalfox)
|
|
echo "🎨 Updating pywalfox themes..."
|
|
pywalfox update
|
|
;;
|
|
|
|
*)
|
|
# Handle unknown application names.
|
|
echo "Error: Unknown application '$APP_NAME'." >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo "✅ Command sent for $APP_NAME."
|
|
|
|
# lines.push("post_hook = \"grep -q '^theme *= *' ~/.config/ghostty/config; and sed -i 's/^theme *= *.*/theme = noctalia/' ~/.config/ghostty/config; or echo 'theme = noctalia' >> ~/.config/ghostty/config; and pkill -SIGUSR2 ghostty\"") |