#!/bin/sh # values for melete -- possibly if we query pulseaudio/pipewire instead we # would not need to encode values like these snd_card_num=0 node_num=0x21 # to save battery power, only output the white noise if earphones connected if grep -A4 "Node $node_num" "/proc/asound/card${snd_card_num}/codec#0" \ | grep 'Amp-Out vals: \[0x00 0x00\]' >/dev/null; then cvlc --quiet --loop ~/annex/media/sounds/R*.ogg & whitenoise=$! fi nmcli radio all off zenity --info --title="whitenoise" --text="whitenoise" nmcli radio all on if [ "x$whitenoise" != "x" ]; then kill $whitenoise fi