Add sink script
This commit is contained in:
parent
b06ca2b828
commit
e160aca31b
2 changed files with 16 additions and 0 deletions
|
@ -20,6 +20,10 @@ in {
|
|||
homeDirectory = "/home/${username}";
|
||||
stateVersion = "24.05";
|
||||
|
||||
file = {
|
||||
`/home/${username}/.scripts/audio/get-sink-name.sh`.source = ./home/scripts/audio/get-sink-name.sh;
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
alacritty
|
||||
cups
|
||||
|
|
12
config/home/scripts/audio/get-sink-name.sh
Normal file
12
config/home/scripts/audio/get-sink-name.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SINK=$(pactl get-default-sink)
|
||||
|
||||
if [ $SINK = "alsa_output.pci-0000_1f_00.3.analog-stereo" ]; then
|
||||
echo "Speakers"
|
||||
elif [ $SINK = "alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" ]; then
|
||||
echo "Headphones"
|
||||
else
|
||||
echo "-"
|
||||
fi
|
||||
|
Loading…
Reference in a new issue