/ de-omarchy / bin / omarchy-theme-remove
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
39 lines · 1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

# omarchy:summary=Remove a user-installed theme
# omarchy:args=[theme-name]
# omarchy:examples=omarchy theme remove "Tokyo Night"

if [[ -z $1 ]]; then
  mapfile -t extra_themes < <(find ~/.config/omarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n')

  if (( ${#extra_themes[@]} > 0 )); then
    mapfile -t extra_themes < <(printf '%s\n' "${extra_themes[@]}" | sort)
    THEME_NAME=$(omarchy-menu-select "Remove extra theme" "${extra_themes[@]}" -- --width 520 --maxheight 520)
  else
    echo "No extra themes installed."
    exit 1
  fi
else
  THEME_NAME="$1"
fi

THEMES_DIR="$HOME/.config/omarchy/themes"
THEME_PATH="$THEMES_DIR/$THEME_NAME"

# Ensure a theme was set
if [[ -z $THEME_NAME ]]; then
  exit 1
fi

# Check if theme exists before attempting removal
if [[ ! -d $THEME_PATH ]]; then
  echo "Error: Theme '$THEME_NAME' not found."
  exit 1
fi

# Now remove the theme directory for THEME_NAME
rm -rf "$THEME_PATH"
omarchy-notification-send "Theme removed" "$THEME_NAME" || true
echo "Removed $THEME_NAME"