mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 20:29:24 +00:00
Reuse the new omarchy-theme-set in omarchy-theme-next
This commit is contained in:
@ -30,22 +30,5 @@ NEXT_INDEX=$(((INDEX + 1) % TOTAL))
|
|||||||
NEW_THEME=${THEMES[$NEXT_INDEX]}
|
NEW_THEME=${THEMES[$NEXT_INDEX]}
|
||||||
NEW_THEME_NAME=$(basename "$NEW_THEME")
|
NEW_THEME_NAME=$(basename "$NEW_THEME")
|
||||||
|
|
||||||
# Set current theme
|
omarchy-theme-set $NEW_THEME_NAME
|
||||||
ln -nsf "$HOME/.config/omarchy/backgrounds/$NEW_THEME_NAME" "$HOME/.config/omarchy/current/backgrounds"
|
|
||||||
ln -nsf "$NEW_THEME" "$HOME/.config/omarchy/current/theme"
|
|
||||||
|
|
||||||
# Touch alacritty config to pickup the changed theme
|
|
||||||
touch "$HOME/.config/alacritty/alacritty.toml"
|
|
||||||
|
|
||||||
# Restart for new theme
|
|
||||||
pkill -SIGUSR2 waybar
|
|
||||||
makoctl reload
|
|
||||||
hyprctl reload
|
|
||||||
|
|
||||||
# Set new background
|
|
||||||
ln -nsf $(find "$HOME/.config/omarchy/current/backgrounds/" -type f | head -n 1) "$HOME/.config/omarchy/current/background"
|
|
||||||
pkill -x swaybg
|
|
||||||
setsid swaybg -i "$HOME/.config/omarchy/current/background" -m fill &
|
|
||||||
|
|
||||||
# Notify of the new theme
|
|
||||||
notify-send "Theme changed to $NEW_THEME_NAME" -t 2000
|
notify-send "Theme changed to $NEW_THEME_NAME" -t 2000
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
# omarchy-theme-set: Set a theme, specified by its name.
|
# omarchy-theme-set: Set a theme, specified by its name.
|
||||||
# Usage: omarchy-theme-set <theme-name>
|
# Usage: omarchy-theme-set <theme-name>
|
||||||
|
|
||||||
THEMES_DIR="$HOME/.config/omarchy/themes/"
|
|
||||||
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
|
|
||||||
|
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
echo "Usage: omarchy-theme-set <theme-name>" >&2
|
echo "Usage: omarchy-theme-set <theme-name>" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
THEMES_DIR="$HOME/.config/omarchy/themes/"
|
||||||
|
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
|
||||||
|
|
||||||
THEME_NAME="$1"
|
THEME_NAME="$1"
|
||||||
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
THEME_PATH="$THEMES_DIR/$THEME_NAME"
|
||||||
BACKGROUND_PATH="$HOME/.config/omarchy/backgrounds/$THEME_NAME"
|
BACKGROUND_PATH="$HOME/.config/omarchy/backgrounds/$THEME_NAME"
|
||||||
@ -39,9 +39,5 @@ if [[ -n "$first_bg" ]]; then
|
|||||||
ln -nsf "$first_bg" "$HOME/.config/omarchy/current/background"
|
ln -nsf "$first_bg" "$HOME/.config/omarchy/current/background"
|
||||||
pkill -x swaybg
|
pkill -x swaybg
|
||||||
setsid swaybg -i "$HOME/.config/omarchy/current/background" -m fill &
|
setsid swaybg -i "$HOME/.config/omarchy/current/background" -m fill &
|
||||||
else
|
|
||||||
# Background does not exist for this theme - fallback to solid black.
|
|
||||||
rm -f "$HOME/.config/omarchy/current/background"
|
|
||||||
pkill -x swaybg
|
|
||||||
setsid swaybg -c '#000000' &
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user