I use the line in connection on my desktop to route audio for sources other than my PC to the speaker system attached to my computer. For whatever reason, this is still annoyingly cumbersome, even in 2018. For years, I’ve done this by using Alsamixer, a command line mixer. This is fine enough, I guess, but I wanted something a bit more intuitive. The finished result shows the screen popup below, and is triggered by a key combination that executes a script.
To duplicate this on your system, you’ll need a copy of the script from my github. Once you have it, open Settings, Devices, and then select Keyboard:
Scroll all the way down to the bottom of the keyboard shortcuts, and select the “+” to create a new shortcut.
As you can see, I’ve already got a couple of custom keyboard shortcuts there. I’ll show you how to create one to mute your line in input using the keyboard. Once you click the “+”, the screen below will appear. You’ll want to select your own keyboard shortcut, and ensure you’re using the correct path to the script.
Below is a copy of the script:
OUT=$(amixer sset Line toggle)
RESULT=$(echo $OUT | grep "Left:" | cut -d'[' -f4 | cut -d ']' -f 1)
#notify-send pulls icons from /usr/share/icons/gnome/32x32
notify-send "Toggling Line In" "Line in is now: $RESULT" -i audio-volume-low
In order for this to work, you may need to ensure that Loopback is enabled. The easiest way to do this is to install the alsa-utils package, and run Alsamixer to enable it.