Files
omarchy/bin/omarchy-theme-set
Lucas Goossen 7a7266aed0 Theme support for Cursor (#2015)
* Imitating VSCode omarchy-theme-set

* Changed VSCode theme setter take arguments to Cursor theme setter could call it.

* All omarchy commands are in path

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: @adelplace
2025-10-06 21:49:44 +02:00

40 lines
937 B
Bash
Executable File

#!/bin/bash
if [[ -z $1 && $1 != "CNCLD" ]]; then
echo "Usage: omarchy-theme-set <theme-name>"
exit 1
fi
THEMES_DIR="$HOME/.config/omarchy/themes/"
CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme"
THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
THEME_PATH="$THEMES_DIR/$THEME_NAME"
# Check if the theme entered exists
if [[ ! -d "$THEME_PATH" ]]; then
echo "Theme '$THEME_NAME' does not exist in $THEMES_DIR"
exit 1
fi
# Update theme symlinks
ln -nsf "$THEME_PATH" "$CURRENT_THEME_DIR"
# Change background with theme
omarchy-theme-bg-next
# Restart components to apply new theme
omarchy-restart-waybar
omarchy-restart-swayosd
hyprctl reload
pkill -SIGUSR2 btop
makoctl reload
# Change gnome, browser, vscode, cursor themes
omarchy-theme-set-terminal
omarchy-theme-set-gnome
omarchy-theme-set-eza
omarchy-theme-set-browser
omarchy-theme-set-vscode
omarchy-theme-set-cursor