mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
25 lines
917 B
Bash
Executable File
25 lines
917 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=List themes with preview image paths (tab-separated: name\tslug\tpreview)
|
|
# omarchy:hidden=true
|
|
|
|
omarchy-theme-list 2>/dev/null | while IFS= read -r name; do
|
|
[[ -n $name ]] || continue
|
|
slug=$(printf '%s' "$name" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
|
|
preview=""
|
|
for base in "$HOME/.config/omarchy/themes" "$OMARCHY_PATH/themes"; do
|
|
[[ -d $base/$slug ]] || continue
|
|
for ext in png jpg jpeg webp; do
|
|
if [[ -f $base/$slug/preview.$ext ]]; then
|
|
preview="$base/$slug/preview.$ext"
|
|
break 2
|
|
fi
|
|
done
|
|
if [[ -z $preview && -d $base/$slug/backgrounds ]]; then
|
|
preview=$(find -L "$base/$slug/backgrounds" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) 2>/dev/null | sort | head -n1)
|
|
[[ -n $preview ]] && break
|
|
fi
|
|
done
|
|
printf '%s\t%s\t%s\n' "$name" "$slug" "$preview"
|
|
done
|