Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
97a82c6
Add responsive theme backgrounds
acrogenesis Aug 31, 2026
8a173b4
Support responsive SVG viewports
acrogenesis Aug 31, 2026
fe4ec9b
Add fitted background backdrops
acrogenesis Aug 31, 2026
0757d68
Bound untrusted background rendering
acrogenesis Sep 1, 2026
268dbad
Harden background render cache invalidation and bounds
acrogenesis Sep 3, 2026
b5a2b0a
Document backgrounds.toml parser subset and cache bounds
acrogenesis Sep 3, 2026
cbdad80
Fix responsive wallpaper rendering and transitions
acrogenesis Sep 5, 2026
3d5b10a
Merge quattro into responsive background support
acrogenesis Oct 1, 2026
c55e232
Keep wallpaper transitions on resolved pixels and metadata
acrogenesis Oct 1, 2026
0ca0f5d
Sample transparent bar colors from each displayed composition
acrogenesis Oct 1, 2026
2418896
Skip symlinked background template outputs
acrogenesis Oct 1, 2026
8f8e1e7
Merge quattro into responsive background support
acrogenesis Oct 12, 2026
93e6fc4
Keep plugin popout state synchronized across screens
acrogenesis Oct 12, 2026
df17a9d
Recover wallpaper decode and resolver failures
acrogenesis Oct 12, 2026
90cd1bb
Keep wallpaper fallback and framing local to each screen
acrogenesis Oct 12, 2026
535f2e9
Recover wallpaper from themes with only SVG backgrounds
acrogenesis Oct 12, 2026
a32ff2b
Cancel superseded intro palettes before still transitions
acrogenesis Oct 12, 2026
ab117db
Exclude orphan variants from wallpaper recovery
acrogenesis Oct 12, 2026
d1fa301
Merge quattro bar updates into responsive backgrounds
acrogenesis Oct 21, 2026
63167ca
Keep notch coverage with combined bar startup
acrogenesis Oct 21, 2026
f0c3e17
Render staged wallpaper templates before selection
acrogenesis Oct 21, 2026
46902df
Invalidate SVG renders when artwork content changes
acrogenesis Oct 21, 2026
a7e00dc
Recover lock wallpapers after variant decoding failures
acrogenesis Oct 21, 2026
6be9086
Keep responsive render cache stable across temporary hardlinks
acrogenesis Oct 21, 2026
4361f3d
Merge quattro into responsive backgrounds
acrogenesis Oct 27, 2026
6dab169
Invalidate background picker caches after filter changes
acrogenesis Oct 27, 2026
17936dd
Keep wallpaper behavior tests without source assertions
acrogenesis Oct 27, 2026
b1e2da7
Preserve nested assets in responsive SVG renders
acrogenesis Oct 27, 2026
f6928c0
Consolidate wallpaper tests by area
acrogenesis Oct 27, 2026
e788c34
Preserve asset symlinks when hardlinks are unavailable
acrogenesis Oct 27, 2026
3cfdd67
Invalidate SVG caches from old asset copy behavior
acrogenesis Oct 27, 2026
8f1ac2a
Merge quattro into responsive backgrounds
acrogenesis Oct 28, 2026
f232b0b
Fix responsive wallpaper caches and per-screen cleanup
acrogenesis Oct 28, 2026
ae4fadf
Reuse edge samples for unchanged SVG renders
acrogenesis Oct 28, 2026
f169145
Keep per-screen plugin API ownership in private bar state
acrogenesis Oct 28, 2026
639ab6a
Merge current quattro and preserve responsive background handoffs
acrogenesis Nov 3, 2026
4ea9f3d
Invalidate theme previews for responsive SVG selection
acrogenesis Nov 3, 2026
e9f0c71
Refresh picker caches and wait for actual background readiness
acrogenesis Nov 3, 2026
5d394e6
Merge current quattro into feature/responsive-background-capability
acrogenesis Nov 20, 2026
5a4c9f5
Show theme switcher previews for template-only backgrounds
acrogenesis Nov 20, 2026
cdb612f
Merge current quattro into feature/responsive-background-capability
acrogenesis Nov 24, 2026
f41e005
Draw responsive wallpaper rasters at logical size
acrogenesis Nov 25, 2026
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
139 changes: 114 additions & 25 deletions bin/omarchy-bar-text-color
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ text_color=${3:-}
background_color=${4:-}
background_path=""
screen_size=""
scale="1"

shift 4 2>/dev/null || true
while (($# > 0)); do
if [[ $1 == "--background" || $1 == "--screen" || $1 == "--scale" ]] && (( $# < 2 )); then
printf '%s\n' "$text_color"
exit 0
fi
case "$1" in
--background)
background_path=${2:-}
Expand All @@ -23,6 +28,10 @@ while (($# > 0)); do
screen_size=${2:-}
shift 2
;;
--scale)
scale=${2:-}
shift 2
;;
*)
shift
;;
Expand Down Expand Up @@ -72,27 +81,84 @@ valid_hex "$text_color" || fallback
valid_hex "$background_color" || fallback
[[ $position =~ ^(top|bottom|left|right)$ ]] || fallback
[[ $bar_size =~ ^[0-9]+$ ]] || fallback
omarchy-cmd-present magick || fallback

if [[ -z $background_path ]]; then
background_path=$(readlink -f "$HOME/.local/state/omarchy/current/background" 2>/dev/null || true)
fi
[[ -f $background_path ]] || fallback
[[ $scale =~ ^[0-9]+([.][0-9]+)?$ ]] || fallback
awk -v scale="$scale" 'BEGIN { exit !(scale > 0 && scale <= 10) }' || fallback

if [[ -z $screen_size ]]; then
if omarchy-cmd-present hyprctl && omarchy-cmd-present jq; then
screen_size=$(hyprctl monitors -j 2>/dev/null | jq -r '.[0] | "\(.width)x\(.height)"' 2>/dev/null || true)
fi
# hyprctl reports the raw mode resolution; an odd transform (90/270 degree
# rotation) swaps the logical axes the shell renders with, so swap here too.
screen_size=$(hyprctl monitors -j 2>/dev/null |
jq -r '.[0] | if ((.transform // 0) % 2) == 1 then "\(.height)x\(.width)" else "\(.width)x\(.height)" end' 2>/dev/null || true)
fi
[[ $screen_size =~ ^([0-9]+)x([0-9]+)$ ]] || fallback

screen_width=${BASH_REMATCH[1]}
screen_height=${BASH_REMATCH[2]}
((screen_width > 0 && screen_height > 0 && bar_size > 0)) || fallback

# Only the bar strip's mean colour is needed, so sample on a canvas no wider than
# 1920 px; a 6K or 8K screen would otherwise add a full-size intermediate image.
# The resolver picks the per-screen variant and render metadata so the sampled
# pixels match what the shell actually paints on this screen.
sample_path=""
fill="crop"
backdrop="solid"
focal_x="0.5"
focal_y="0.5"
fill_color="$background_color"
resolver_args=(--screen "${screen_width}x${screen_height}" --fields)
[[ -n $background_path ]] && resolver_args+=(--canonical "$background_path")

if resolved=$(omarchy-theme-bg-resolve "${resolver_args[@]}" 2>/dev/null); then
while IFS=$'\t' read -r key value; do
case "$key" in
path)
sample_path="$value"
;;
fill)
[[ $value =~ ^(crop|fit|center|tile)$ ]] && fill="$value"
;;
fill_color)
[[ $value =~ ^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$ ]] && fill_color="$value"
;;
backdrop)
[[ $value == "blur" ]] && backdrop="$value"
;;
focal_x | focal_y)
if [[ $value =~ ^(0([.][0-9]+)?|1([.]0+)?)$ ]]; then
if [[ $key == "focal_x" ]]; then
focal_x="$value"
else
focal_y="$value"
fi
fi
;;
esac
done <<<"$resolved"
Comment thread
acrogenesis marked this conversation as resolved.
Resolved
fi

# Resolver missing or failed: sample the canonical background as before.
if [[ ! -f $sample_path ]]; then
if [[ -z $background_path ]]; then
background_path=$(readlink -f "$HOME/.local/state/omarchy/current/background" 2>/dev/null || true)
fi
[[ -f $background_path && ${background_path,,} != *.svg ]] || fallback
sample_path="$background_path"
fill="crop"
backdrop="solid"
focal_x="0.5"
focal_y="0.5"
fi

# Video wallpapers always use an aspect crop in BackgroundMedia. Sample their
# first frame with the same geometry, regardless of still-image metadata.
if [[ ${sample_path,,} =~ \.(mp4|m4v|mov|webm|mkv|avi)$ ]]; then
fill="crop"
fi

# Resolve against the real display before bounding the sampling canvas. Native
# center/tile sizes shrink by the same ratio, preserving the displayed framing.
sample_scale=1
if ((screen_width > 1920)); then
sample_scale=$(awk -v width="$screen_width" 'BEGIN { print 1920 / width }')
screen_height=$(((screen_height * 1920 + screen_width - 1) / screen_width))
bar_size=$(((bar_size * 1920 + screen_width - 1) / screen_width))
screen_width=1920
Expand All @@ -117,25 +183,48 @@ right)
;;
esac

# Sample the first frame only. Without the selector a video background makes
# ImageMagick decode the whole file and emit one value per frame, and the match
# below then fails into the fallback colour. Let JPEG decode at about canvas size
# and box-scale to the canvas, so a 6K or 8K photo fits the limit without a
# second full-size resize buffer. Box scaling still averages every source pixel;
# point sampling would alias on fine stripes and pick the wrong text color. Do
# not let an oversized image spill its pixel cache into a memory map or /tmp (a
# tmpfs on Omarchy); fall back to the configured text color when the bounded
# sample cannot finish cheaply.
screen="${screen_width}x${screen_height}"
sample_format='%[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]'

# Compose the same viewport as WallpaperImage before extracting the bar strip.
# Only the crop foreground uses focal offsets; the blurred cover stays centered.
cover=(-define jpeg:size="$screen" "$sample_path[0]" -auto-orient -scale "${screen}^")
composition=()
if [[ $fill != "crop" ]]; then
composition=(-size "$screen" "xc:$fill_color")
if [[ $backdrop == "blur" ]]; then
# Qt uses a subdued cover copy over the solid tint. Approximate its blur
# for contrast sampling; retain the same 35% opacity and full geometry.
blur_radius=$(awk -v ratio="$sample_scale" 'BEGIN { print 40 * ratio }')
composition+=(\( "${cover[@]}" -gravity center -extent "$screen" -blur "0x$blur_radius" -alpha set -channel A -evaluate multiply 0.35 +channel \) -compose Over -composite)
fi
fi

native_percent=$(awk -v scale="$scale" -v ratio="$sample_scale" 'BEGIN { printf "%.6f%%", scale * ratio * 100 }')
case "$fill" in
fit)
composition+=(\( -define jpeg:size="$screen" "$sample_path[0]" -auto-orient -scale "$screen" \) -gravity center -compose Over -composite)
;;
center)
composition+=(\( "$sample_path[0]" -auto-orient -resize "$native_percent" \) -gravity center -compose Over -composite)
;;
tile)
# Resize the source tile to physical pixels before tiling on HiDPI screens.
composition+=(\( "$sample_path[0]" -auto-orient -resize "$native_percent" -write mpr:tile +delete -size "$screen" tile:mpr:tile \) -compose Over -composite)
;;
*)
composition=("${cover[@]}" -gravity NorthWest
-crop "${screen}+%[fx:max(0,round((w-$screen_width)*$focal_x))]+%[fx:max(0,round((h-$screen_height)*$focal_y))]" +repage)
;;
esac
# The transparent wallpaper layer is displayed over the compositor's black base.
pixel=$(MAGICK_MEMORY_LIMIT=512MiB \
MAGICK_MAP_LIMIT=0 \
MAGICK_DISK_LIMIT=0 \
MAGICK_TIME_LIMIT=5 \
MAGICK_THREAD_LIMIT=2 \
timeout --kill-after=1s 5s magick -define jpeg:size="${screen_width}x${screen_height}" "$background_path[0]" -auto-orient \
-scale "${screen_width}x${screen_height}^" \
-gravity center -extent "${screen_width}x${screen_height}" \
-gravity NorthWest -crop "$crop" +repage \
-resize '1x1!' -format '%[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]' info:- 2>/dev/null || true)
timeout --kill-after=1s 5s magick "${composition[@]}" -gravity NorthWest -crop "$crop" +repage \
-background black -alpha remove -alpha off -resize '1x1!' -format "$sample_format" info:- 2>/dev/null || true)
[[ $pixel =~ ^([0-9]+),([0-9]+),([0-9]+)$ ]] || fallback

sample=$(printf '#%02x%02x%02x' "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}")
Expand Down
9 changes: 5 additions & 4 deletions bin/omarchy-menu-images
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ cache_key=$(printf '%s' "$image_dirs_env" | md5sum | cut -d ' ' -f 1)
rows_cache_file="$cache_dir/$cache_key.rows"
rows_signature_file="$cache_dir/$cache_key.signature"
rows_fast_signature_file="$cache_dir/$cache_key.fast-signature"
rows_signature="v4"$'\n'
rows_fast_signature="v4"$'\n'
rows_signature="v5"$'\n'
rows_fast_signature="v5"$'\n'
rows_cacheable=true
rows_cache_hit=false
image_files=()
Expand All @@ -142,7 +142,8 @@ else
image_signature=$(stat -Lc '%s:%Y' "$image") || continue
rows_signature+="$image:$image_signature"$'\n'
done < <(find -L "$dir" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \
! -name '*@*' \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' -o -iname '*.svg' \
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
-o -iname '*.mp4' -o -iname '*.m4v' -o -iname '*.mov' -o -iname '*.webm' -o -iname '*.mkv' -o -iname '*.avi' \) \
-print0 2>/dev/null | sort -z)
fi
Expand Down Expand Up @@ -184,7 +185,7 @@ generate_thumbnail() {
# stalled file must not hold it shut. A failed run drops the row.
thumbnail_command=(timeout -k 5 10 ffmpegthumbnailer -i "$image" -o "$tmp" -s 1536 -q 8)
else
thumbnail_command=(env VIPS_CONCURRENCY=1 vipsthumbnail "$image" --size 1536x864 --smartcrop=centre --path "$tmp[Q=82,strip]")
thumbnail_command=(env VIPS_CONCURRENCY=1 timeout --kill-after=2 30 vipsthumbnail "$image" --size 1536x864 --smartcrop=centre --path "$tmp[Q=82,strip]")
fi

# Close the lock fd for the converter: an orphaned or hung child must not
Expand Down
4 changes: 2 additions & 2 deletions bin/omarchy-theme-bg-boot-intro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resolve_intro() {
background=$(readlink -f "${1:-$current_background_link}" 2>/dev/null) || return 1
[[ -f $background ]] || return 1
case ${background,,} in
*.jpg | *.jpeg | *.png | *.bmp | *.webp) ;;
*.jpg | *.jpeg | *.png | *.bmp | *.webp | *.svg) ;;
*) return 1 ;;
esac

Expand Down Expand Up @@ -59,7 +59,7 @@ prepare_theme_intro() {
else
mapfile -d '' -t names < <(
find -L "$OMARCHY_PATH/themes/$theme/backgrounds" "$HOME/.config/omarchy/themes/$theme/backgrounds" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.bmp' -o -iname '*.webp' \) -printf '%f\0' 2>/dev/null | sort -zu
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.bmp' -o -iname '*.webp' -o -iname '*.svg' \) ! -name '*@*' -printf '%f\0' 2>/dev/null | sort -zu
)
(( ${#names[@]} > 0 )) || return 0
name=${names[0]}
Expand Down
2 changes: 1 addition & 1 deletion bin/omarchy-theme-bg-current
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BACKGROUND_PATH=$(readlink -f "$HOME/.local/state/omarchy/current/background" 2>/dev/null)

if [[ -n $BACKGROUND_PATH ]]; then
basename -- "$BACKGROUND_PATH" | perl -pe 's/\.[^.\n]+$//; s/^\d+-//; s/-/ /g; s/\b(\w)/\U$1/g'
basename -- "$BACKGROUND_PATH" | perl -pe 's/\.[^.\n]+$//; s/@[^@]+$//; s/^\d+-//; s/-/ /g; s/\b(\w)/\U$1/g'
else
echo "Unknown"
fi
3 changes: 2 additions & 1 deletion bin/omarchy-theme-bg-next
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CURRENT_BACKGROUND_LINK="$HOME/.local/state/omarchy/current/background"

mapfile -d '' -t BACKGROUNDS < <(
find -L "$USER_BACKGROUNDS_PATH" "$THEME_BACKGROUNDS_PATH" -maxdepth 1 -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' \
! -name '*@*' \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.webp' -o -iname '*.svg' \
-o -iname '*.mp4' -o -iname '*.m4v' -o -iname '*.mov' -o -iname '*.webm' -o -iname '*.mkv' -o -iname '*.avi' \) \
-print0 2>/dev/null | sort -z
)
Expand Down
Loading