🧹 restructure layout

This commit is contained in:
Moritz Böhme 2022-07-15 13:11:54 +02:00
parent 40c2a5fb29
commit 268374ad58
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
115 changed files with 2641 additions and 2085 deletions

View file

@ -0,0 +1,24 @@
{ pkgs }:
pkgs.writeShellApplication {
name = "cycle_sinks";
runtimeInputs = with pkgs; [ pulseaudio ];
text = ''
# get the default sink
default_sink="$(pactl info | grep -e "Default Sink:" | awk '{print $3}')"
echo "current default: $default_sink"
# get the sinks
sinks="$(pactl list sinks short | awk '{print $2}')"
# filter out the default sink
not_active="$(echo "$sinks" | grep -v -e "$default_sink")"
# get the sink after the dafault one
next_sink="$(echo -e "$sinks\n$not_active" | grep -e "$default_sink" -A 1 | tail -n 1 )"
# set the new default-sink
pactl set-default-sink "$next_sink"
echo "new default: $next_sink"
'';
}