Advertisement
metalx1000

PulseAudio change device name

Jan 26th, 2023
1,268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.21 KB | None | 0 0
  1. #get output device name
  2. pacmd list-sinks | grep name: | awk '{print $2}' | sed 's/<//g;s/>//g'
  3.  
  4. #get input device name
  5. pacmd list-sources | grep name: | awk '{print $2}' | sed 's/<//g;s/>//g'
  6.  
  7. #update device name
  8. pacmd 'update-source-proplist <device name> device.description="<NEW NAME>"'
  9.  
  10. #example
  11. pacmd 'update-source-proplist alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00.mono-fallback device.description="USB MIC"'
  12.  
  13. #add to config file
  14. vim  ~/.config/pulse/default.pa
  15. .include /etc/pulse/default.pa
  16. update-sink-proplist alsa_output.usb-Jieli_Technology_USB_Composite_Device_425030463632320A-01.analog-stereo device.description="Sound_Bar"
  17. update-sink-proplist alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo device.description="USB HEADSET"
  18. update-sink-proplist alsa_output.pci-0000_00_1f.3.analog-stereo device.description="Internal Sound"
  19. update-source-proplist alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00.mono-fallback device.description="USB MIC"
  20.  
  21. #Using FZF
  22. device="$(pacmd list-sources | grep name: | awk '{print $2}' | sed 's/<//g;s/>//g'|fzf --prompt="Select Device: ")"
  23. read -p "Enter New Name: " name
  24. pacmd "update-source-proplist $device device.description=\"$name\""
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement