Skip to content
Snippets Groups Projects
Commit 65c58503 authored by Florian Meissner's avatar Florian Meissner
Browse files

wait: factor out sink name

parent 682b9429
No related branches found
No related tags found
No related merge requests found
...@@ -22,8 +22,10 @@ args=( # set protocol to globalprotect - probably don't change this ...@@ -22,8 +22,10 @@ args=( # set protocol to globalprotect - probably don't change this
# --passwd-on-stdin # --passwd-on-stdin
# override routing for common servers # override routing for common servers
--resolve fsin.th-nuernberg.de:141.75.149.145 # but servers are not used anymore
--resolve fstest.th-nuernberg.de:141.75.149.143 # and anyway this setting has never worked
# --resolve fsin.th-nuernberg.de:141.75.149.145
# --resolve fstest.th-nuernberg.de:141.75.149.143
# --servercert 'pin-sha256:lm+C0Qgm7ZTPMLZ7KJlRLk5teQGc9qhmGfZavlRv3eQ=' # --servercert 'pin-sha256:lm+C0Qgm7ZTPMLZ7KJlRLk5teQGc9qhmGfZavlRv3eQ='
) )
......
#!/usr/bin/env fish #!/usr/bin/env fish
set AUDIO_CARD alsa_card.pci-0000_00_1b.0
set AUDIO_PROFILE output:analog-stereo+input:analog-stereo
set AUDIO_SINK_BASE (string replace card output $AUDIO_CARD)
set dB_to_vol (mktemp) set dB_to_vol (mktemp)
gcc -lpulse -o $dB_to_vol ~/scripts/helpers/wake/dB_to_volume.c || begin; echo 'gcc failed on dB_to_volume.c; status = '$status; exit 1; end; gcc -lpulse -o $dB_to_vol ~/scripts/helpers/wake/dB_to_volume.c || begin; echo 'gcc failed on dB_to_volume.c; status = '$status; exit 1; end;
...@@ -12,8 +19,8 @@ sudo rtcwake -m mem -u -t $(date +%s -d $_flag_when) ...@@ -12,8 +19,8 @@ sudo rtcwake -m mem -u -t $(date +%s -d $_flag_when)
# set to analog profile # set to analog profile
# also sink name changes with profile. TODO match only part of profile name # also sink name changes with profile. TODO match only part of profile name
pactl set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo pactl set-card-profile $AUDIO_CARD $AUDIO_PROFILE
set sink (pactl list sinks | string match --regex --groups-only 'Name:\s+(alsa_output.pci-0000_00_1b.0\S+)') set sink (pactl list sinks | string match --regex --groups-only 'Name:\s+('(string escape --style regex $AUDIO_SINK_BASE)'\S+)')
pactl set-default-sink $sink pactl set-default-sink $sink
mpv --loop-playlist $argv & mpv --loop-playlist $argv &
...@@ -22,7 +29,9 @@ mpv --loop-playlist $argv & ...@@ -22,7 +29,9 @@ mpv --loop-playlist $argv &
for i in (LC_NUMERIC= seq -40 0.4 0) #dB for i in (LC_NUMERIC= seq -40 0.4 0) #dB
pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo.3 ($dB_to_vol $i) set vol ($dB_to_vol $i)
echo $i '=>' $vol
pactl set-sink-volume $sink $vol
sleep $_flag_delta sleep $_flag_delta
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment