Files
omarchycn/bin/omarchy-plymouth-set-by-theme
T
David Heinemeier HanssonandClaude Fable 5 afa2839a5a Rename bg/fg palette keys to background/foreground
The canonical colors.toml keys are now background/foreground, including
all permutations (dark_background, darker_background, lighter_background,
dark_foreground, light_foreground, bright_foreground). The old short
names are gone entirely, not kept as aliases; legacy alacritty-generated
themes still resolve through the ANSI color0/color7 fallback.

Theme files are also regrouped: accent/selection/muted first, then the
backgrounds, then the foregrounds, then the named colors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 16:24:51 -07:00

58 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Set the Plymouth boot theme from an Omarchy theme
# omarchy:args=<theme-name>
# omarchy:requires-sudo=true
# Resolve a theme by name and apply its unlock.png + colors.toml as the
# Plymouth boot screen via omarchy-plymouth-set.
if (( $# != 1 )); then
echo "Usage: omarchy-plymouth-set-by-theme <theme-name>" >&2
exit 1
fi
theme=$1
if [[ -d ~/.config/omarchy/themes/$theme ]]; then
theme_dir=~/.config/omarchy/themes/$theme
else
theme_dir="$OMARCHY_PATH/themes/$theme"
fi
theme_color() {
local key="$1"
local fallback="$2"
awk -F= -v key="$key" -v fallback="$fallback" '
function clean(raw) {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", raw)
if (raw ~ /^"/) {
sub(/^"/, "", raw)
sub(/".*$/, "", raw)
}
return raw
}
{
field = $1
gsub(/^[[:space:]]+|[[:space:]]+$/, "", field)
if (field == key) {
print clean($2)
found = 1
exit
}
if (field == fallback) fallback_value = clean($2)
}
END {
if (!found && fallback_value != "") print fallback_value
}
' "$theme_dir/colors.toml"
}
bg=$(theme_color background)
text=$(theme_color foreground)
exec omarchy-plymouth-set "$bg" "$text" "$theme_dir/unlock.png"