[Bin] Set default soundcard in autostart

This commit is contained in:
Lucien Cartier-Tilet 2021-01-09 19:16:08 +01:00
parent a7db109206
commit bc7f7e3182
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 8 additions and 0 deletions

View File

@ -66,10 +66,18 @@ mpc stop &
xwallpaper --zoom (cat $HOME/.cache/wallpaper) &
#+end_example
I also have an external sound card, a Scarlet 2i2 G3, that I would like to use as my default audio output. However, it might not be always connected, hence the following code:
#+NAME: default-soundcard
#+BEGIN_SRC fish :tangle no
set SOUNDCARD "alsa_output.usb-Focusrite_Scarlett_2i2_USB_Y8KJ6NH094EF1C-00.analog-stereo"
pactl list short sinks | grep $SOUNDCARD 2&> /dev/null && pactl set-default-sink $SOUNDCARD
#+END_SRC
#+BEGIN_SRC fish :noweb yes
set -l PATH $PATH /usr/lib/xfce-polkit
<<autostart-gen()>>
<<default-soundcard>>
#+END_SRC
* cli utilities