System Gen79 @ 2025-06-25-01:41:25 by jonas@monolith

This commit is contained in:
Jonas Röger 2025-06-25 01:41:26 +02:00
parent 14bf5380aa
commit b3646bc382

View File

@ -48,7 +48,23 @@ in {
requires = ["pipewire.service"]; requires = ["pipewire.service"];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = "${pkgs.noisetorch}/bin/noisetorch -i -t ${toString cfg.noisetorch-threshold}"; ExecStart = "${pkgs.writeShellScript "load-noisetorch" ''
set -euo pipefail
NOISETORCH="${pkgs.noisetorch}/bin/noisetorch"
WPCTL="${pkgs.wireplumber}/bin/wpctl"
GREP="${pkgs.gnugrep}/bin/grep"
AWK="${pkgs.gawk}/bin/awk"
HEAD="${pkgs.coreutils}/bin/head"
$NOISETORCH -i -t ${toString cfg.noisetorch-threshold};
sleep 2
FILTER_ID=$($WPCTL status | $GREP "NoiseTorch" | $AWK '{print $2}' | $HEAD -c-2)
if [ -n "$FILTER_ID" ]; then
$WPCTL set-default $FILTER_ID
else
echo "Noisetorch filter not found, skipping setting default source."
fi
''}";
ExecStop = "${pkgs.noisetorch}/bin/noisetorch -u"; ExecStop = "${pkgs.noisetorch}/bin/noisetorch -u";
RemainAfterExit = true; RemainAfterExit = true;
}; };