Extract omarchy-swayosd-client
So we don't have to manually compose it every time
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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}%"
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Wrapper for swayosd-client that targets the currently focused monitor.
|
||||
|
||||
exec swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" "$@"
|
||||
@@ -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,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)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user