Files
arthur-os/bin/omarchy-swayosd-brightness
T

16 lines
499 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 "${percent}%"