2025-07-15 14:17:04 +10:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# omarchy-theme-set: Set a theme, specified by its name.
|
|
|
|
# Usage: omarchy-theme-set <theme-name>
|
|
|
|
|
|
|
|
if [[ -z "$1" ]]; then
|
|
|
|
echo "Usage: omarchy-theme-set <theme-name>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2025-07-14 21:36:15 -07:00
|
|
|
THEMES_DIR="$HOME/.config/omarchy/themes/"
|
|
|
|
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
|
|
|
|
|
2025-07-15 14:17:04 +10:00
|
|
|
THEME_NAME="$1"
|
|
|
|
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
2025-07-16 22:32:35 -07:00
|
|
|
|
2025-07-15 14:17:04 +10:00
|
|
|
# Check if the theme entered exists
|
|
|
|
if [[ ! -d "$THEME_PATH" ]]; then
|
|
|
|
echo "Theme '$THEME_NAME' does not exist in $THEMES_DIR" >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Update theme symlinks
|
|
|
|
ln -nsf "$THEME_PATH" "$CURRENT_THEME_DIR"
|
|
|
|
|
2025-07-16 21:48:14 -07:00
|
|
|
# Change gnome modes
|
2025-07-17 14:15:55 -07:00
|
|
|
if [[ -f ~/.config/omarchy/current/theme/light.mode ]]; then
|
2025-07-16 21:48:14 -07:00
|
|
|
gsettings set org.gnome.desktop.interface color-scheme "prefer-light"
|
|
|
|
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita"
|
|
|
|
else
|
|
|
|
gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
|
|
|
|
gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"
|
|
|
|
fi
|
|
|
|
|
2025-07-15 14:17:04 +10:00
|
|
|
# Trigger alacritty config reload
|
|
|
|
touch "$HOME/.config/alacritty/alacritty.toml"
|
|
|
|
|
2025-07-17 16:33:36 -07:00
|
|
|
# Trigger btop config reload
|
|
|
|
pkill -SIGUSR2 btop
|
|
|
|
|
2025-07-15 14:17:04 +10:00
|
|
|
# Restart components to apply new theme
|
2025-07-19 15:11:52 -05:00
|
|
|
pkill -SIGUSR2 waybar
|
2025-07-15 14:17:04 +10:00
|
|
|
makoctl reload
|
|
|
|
hyprctl reload
|
|
|
|
|
|
|
|
# Set new background
|
2025-07-17 16:56:13 -07:00
|
|
|
"$HOME/.local/share/omarchy/bin/omarchy-theme-bg-next"
|