System details
Intel i5-1335U, Intel Iris Xe (Raptor Lake-P), Omarchy 4.0.5-1, ImageMagick 7.1.2-34 Q16-HDRI
What's wrong?
With bar.transparent: true, omarchy-bar-text-color picks the bar text colour by sampling the background's top strip. On some backgrounds the magick output doesn't match ^([0-9]+),([0-9]+),([0-9]+)$, so the script falls back to the theme's text colour. On a light theme over a dark wallpaper, that leaves dark text on a dark background and the bar can't be read.
I found two separate causes.
1. Animated GIFs: every frame gets sampled. magick processes every frame, so info:- prints one r,g,b per frame, concatenated. The regex rejects that. The background plugin uses a plain Image, which only shows the first frame, so a GIF works as a background but always breaks the text colour check.
magick -size 400x300 xc:black xc:navy -loop 0 /tmp/anim.gif
omarchy-bar-text-color top 26 '#282828' '#f9f5d7' --background /tmp/anim.gif --screen 1920x1200
# -> #282828 (dark text on a black background)2. Dark images go slightly negative when resized. With HDRI ImageMagick (Arch's build), the default Lanczos filter overshoots near hard edges. Upscaling a near-black strip that sits next to a bright edge can push a channel below 0. %[fx:int(255*r)] then prints -1, and the regex rejects it.
magick -size 2000x1125 xc:'#000033' -fill '#ff0033' -draw 'rectangle 0,25 1999,1124' /tmp/ring.png
omarchy-bar-text-color top 26 '#282828' '#f9f5d7' --background /tmp/ring.png --screen 1920x1200
# sampled pixel is "-1,0,51" -> falls back to #282828 (dark text on a dark navy background)I hit this with a real pixel-art wallpaper (2000x1125, mostly black at the top). Its resized minimum red value was about -16.
Suggested fix
Read only the first frame, and clamp after the final resize:
-pixel=$(magick "$background_path" -auto-orient \
+pixel=$(magick "${background_path}[0]" -auto-orient \
-resize "${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)
+ -resize '1x1!' -clamp -format '%[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]' info:- 2>/dev/null || true)With this change, both repros above sample as 0,0,0 and 0,0,51, and the script picks the light text colour.
Activity
0No activity yet.