mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 10:30:44 +02:00
audio: add script to fzf change audio output
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#media-session.enable = true;
|
#media-session.enable = true;
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
(pkgs.callPackage ../../modules/scripts/changeAudioOutput.nix {})
|
||||||
kdePackages.okular
|
kdePackages.okular
|
||||||
kdePackages.dolphin
|
kdePackages.dolphin
|
||||||
pulseaudio # sound server
|
pulseaudio # sound server
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
writeShellApplication,
|
||||||
|
fzf,
|
||||||
|
pactl,
|
||||||
|
jq,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
writeShellApplication {
|
||||||
|
name = "custom-changeAudioOutput";
|
||||||
|
runtimeInputs = [
|
||||||
|
fzf
|
||||||
|
pactl
|
||||||
|
jq
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
$select=pactl -f json list sinks | jq -r '.[].name' | fzf
|
||||||
|
if [[ -n "$select" ]]; then
|
||||||
|
pactl set-default-sink $select
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user