mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Pad the percent text to 3 chars with printf so " 5%", " 50%", and "100%" render at identical width in the JetBrainsMono monospace label. Previously the popup container resized between events because the label string varied between 2 and 4 characters, which caused the popup to visibly jump in width on consecutive brightness key presses. Builds on #5525, which made the percent values themselves step uniformly; this completes the loop by making the rendered popup match. Co-authored-by: Mateus Pegorim <14262063+Pegorim@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
516 B
Bash
Executable File
16 lines
516 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Display brightness level using SwayOSD on the current monitor.
|
|
# omarchy:args=<0-100>
|
|
# omarchy:examples=omarchy swayosd brightness 0 | omarchy swayosd brightness 50 | omarchy swayosd brightness 100
|
|
|
|
percent="$1"
|
|
|
|
progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
|
|
[[ $progress == "0.00" ]] && progress="0.01"
|
|
|
|
omarchy-swayosd-client \
|
|
--custom-icon display-brightness-symbolic \
|
|
--custom-progress "$progress" \
|
|
--custom-progress-text "$(printf '%3d%%' "$percent")"
|