#!/bin/sh set -eu # Loaded from ~/.config/environment.d/50-defaults.conf or a local override VOLUME="${DEFAULT_VOLUME:?unset, check ~/.config/environment.d/}" i=0 while ! wpctl status >/dev/null 2>&1; do i=$((i + 1)) if [ "$i" -ge 20 ]; then echo "no PipeWire sink after 10s" >&2 exit 1 fi sleep 0.5 done wpctl set-volume @DEFAULT_AUDIO_SINK@ "$VOLUME%" wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 echo "Set volume to $VOLUME%"