Extract omarchy-swayosd-client

So we don't have to manually compose it every time
This commit is contained in:
David Heinemeier Hansson
2026-04-22 13:04:30 +02:00
parent ed9ecccb21
commit edf7067797
8 changed files with 20 additions and 27 deletions
+2 -7
View File
@@ -2,15 +2,11 @@
# Switch between audio outputs while preserving the mute status. By default mapped to Super + Mute.
focused_monitor=$(omarchy-hyprland-monitor-focused)
sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]')
sinks_count=$(echo "$sinks" | jq '. | length')
if (( sinks_count == 0 )); then
swayosd-client \
--monitor "$focused_monitor" \
--custom-message "No audio devices found"
omarchy-swayosd-client --custom-message "No audio devices found"
exit 1
fi
@@ -60,7 +56,6 @@ if [[ $next_sink_name != $current_sink_name ]]; then
pactl set-default-sink "$next_sink_name"
fi
swayosd-client \
--monitor "$focused_monitor" \
omarchy-swayosd-client \
--custom-message "$next_sink_description" \
--custom-icon "$next_sink_volume_icon"
+1 -1
View File
@@ -5,5 +5,5 @@
if omarchy-hw-match "XPS"; then
omarchy-cmd-mic-mute-xps
else
swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" --input-volume mute-toggle
omarchy-swayosd-client --input-volume mute-toggle
fi
+1 -2
View File
@@ -38,7 +38,6 @@ if [[ -e /sys/class/leds/platform::micmute/brightness ]]; then
done
fi
swayosd-client \
--monitor "$(omarchy-hyprland-monitor-focused)" \
omarchy-swayosd-client \
--custom-message "$osd_message" \
--custom-icon "$osd_icon"
+1 -2
View File
@@ -8,8 +8,7 @@ percent="$1"
progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"
swayosd-client \
--monitor "$(omarchy-hyprland-monitor-focused)" \
omarchy-swayosd-client \
--custom-icon display-brightness \
--custom-progress "$progress" \
--custom-progress-text "${percent}%"
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
# Wrapper for swayosd-client that targets the currently focused monitor.
exec swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" "$@"
+1 -2
View File
@@ -8,8 +8,7 @@ percent="$1"
progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')"
[[ $progress == "0.00" ]] && progress="0.01"
swayosd-client \
--monitor "$(omarchy-hyprland-monitor-focused)" \
omarchy-swayosd-client \
--custom-icon keyboard-brightness \
--custom-progress "$progress" \
--custom-progress-text "${percent}%"
-1
View File
@@ -1,7 +1,6 @@
#!/bin/bash
STATE_CONF="$HOME/.local/state/omarchy/toggles/hypr/touchpad-disabled.conf"
osdclient="swayosd-client --monitor $(omarchy-hyprland-monitor-focused)"
device="$(omarchy-hw-touchpad)"