Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Inline themes in `config.kdl` are hot-reloaded by Zellij. If the active Omarchy

**Terminal and CLI:** cliamp, Cava, Fish, Foot live colors, fzf, Superfile, tmux, Zellij

**Games and media:** Heroic Games Launcher, Spotify using Spicetify, Steam
**Games and media:** Heroic Games Launcher, Spotify using Spicetify (default look, or the optional minimal [text](https://github.com/spicetify/spicetify-themes/tree/master/text) theme via the `spotify-text` plugin), Steam

### Omarchy Branding

Expand Down Expand Up @@ -313,6 +313,8 @@ spicetify restore backup apply
thpm run
```

`spotify-text` is installed disabled by default as an alternative to `spotify`. It applies the minimal [text](https://github.com/spicetify/spicetify-themes/tree/master/text) theme from spicetify-themes instead of the default styling. Enable only one Spotify plugin at a time; enabling one automatically disables the other.

### Obsidian Terminal is not changing

The plugin reads Obsidian's vault registry and common vault directories. For unusual layouts, pass the vault or plugin data file explicitly:
Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ bundled_plugins=(
10-gtk.sh
10-qt6ct.sh
10-spotify.sh
10-spotify-text.sh
10-superfile.sh
10-tmux.sh
10-vicinae.sh
Expand All @@ -61,6 +62,7 @@ bundled_plugins=(
default_disabled_plugins=(
10-branding.sh
11-discord-system24.sh
10-spotify-text.sh
10-zellij.sh
)

Expand Down
78 changes: 78 additions & 0 deletions theme-set.d/10-spotify-text.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env bash
source "${THPM_THEME_ENV:-$HOME/.local/share/thpm/lib/theme-env.sh}"

# Applies the spicetify "text" theme (a minimal, spotify-tui style look from
# https://github.com/spicetify/spicetify-themes/tree/master/text) with the
# current Omarchy colors. Alternative to the bundled spotify plugin — enable
# one or the other, not both.

THEME_DIR="$HOME/.config/spicetify/Themes/text"
USER_CSS_URL="https://raw.githubusercontent.com/spicetify/spicetify-themes/master/text/user.css"

if ! command -v spicetify >/dev/null 2>&1; then
skipped "Spicetify"
fi

ensure_text_theme() {
mkdir -p "$THEME_DIR"
if [ ! -f "$THEME_DIR/user.css" ]; then
curl -fsSL -o "$THEME_DIR/user.css" "$USER_CSS_URL" || skipped "text theme user.css (download failed)"
fi
}

create_dynamic_scheme() {
local accent
accent=$(extract_color "accent")
[ -n "$accent" ] || accent=$normal_magenta

cat > "$THEME_DIR/color.ini" << EOF
[omarchy]
accent = ${accent}
accent-active = ${accent}
accent-inactive = ${primary_background}
banner = ${accent}
border-active = ${accent}
border-inactive = ${normal_black}
header = ${bright_black}
highlight = ${normal_black}
main = ${primary_background}
notification = ${normal_blue}
notification-error = ${normal_red}
subtext = ${normal_white}
text = ${primary_foreground}
EOF
}

change_spicetify_theme() {
spicetify config current_theme text > /dev/null
spicetify config color_scheme omarchy > /dev/null
}

spotify_was_running=false
if pgrep -x "spotify" > /dev/null 2>&1; then
spotify_was_running=true
fi

ensure_text_theme
create_dynamic_scheme
change_spicetify_theme

if [ "$spotify_was_running" = true ]; then
spicetify apply > /dev/null 2>&1 &
else
setsid bash -c '
spicetify apply > /dev/null 2>&1 &

for i in {1..250}; do
if pgrep -x "spotify" > /dev/null 2>&1; then
sleep 0.2
killall -9 spotify > /dev/null 2>&1
exit 0
fi
sleep 0.1
done
' > /dev/null 2>&1 < /dev/null &
fi

success "Spotify text theme updated!"
exit 0
38 changes: 36 additions & 2 deletions thpm
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,34 @@ disable_conflicting_discord_plugin() {
done
}

disable_conflicting_spotify_plugin() {
local enabled_plugin="$1"
local conflicting_plugin
local hook
local hook_name
local disabled_hook

case "$enabled_plugin" in
spotify) conflicting_plugin="spotify-text" ;;
spotify-text) conflicting_plugin="spotify" ;;
*) return 0 ;;
esac

[[ -d "$HOOK_DIR" ]] || return 0
for hook in "$HOOK_DIR"/*.sh; do
[[ -f "$hook" ]] || continue
hook_name=$(basename "$hook")
hook_name=${hook_name%.sh}
hook_name=${hook_name#*-}
[[ "$hook_name" == "$conflicting_plugin" ]] || continue

disabled_hook="$hook.sample"
mv "$hook" "$disabled_hook"
printf '%sDisabled conflicting Spotify plugin: %s %s\n' "$(dot warn)" "$conflicting_plugin" "$(muted_text "($disabled_hook)")"
return 0
done
}

get_hook_list() {
enabled_hooks=()
disabled_hooks=()
Expand Down Expand Up @@ -456,7 +484,8 @@ post_enable() {
fi
fi
;;
"spotify")
"spotify"|"spotify-text")
disable_conflicting_spotify_plugin "$1"
if command -v spicetify >/dev/null 2>&1; then
spicetify apply
fi
Expand Down Expand Up @@ -505,6 +534,11 @@ post_disable() {
spicetify restore backup apply
fi
;;
"spotify-text")
if command -v spicetify >/dev/null 2>&1; then
spicetify restore
fi
;;
"steam")
adwaita_location=$HOME/.local/share/steam-adwaita
if [[ -x "$adwaita_location/install.py" ]]; then
Expand Down Expand Up @@ -1004,7 +1038,7 @@ doctor_check_plugin_specific() {
fi
;;
qt6ct) doctor_check_command qt6ct Qt6ct ;;
spotify)
spotify|spotify-text)
doctor_check_command spicetify Spicetify
doctor_check_dir "$HOME/.config/spicetify" "Spicetify config directory"
;;
Expand Down
1 change: 1 addition & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ bundled_plugins=(
10-gtk.sh
10-qt6ct.sh
10-spotify.sh
10-spotify-text.sh
10-superfile.sh
10-tmux.sh
10-vicinae.sh
Expand Down