03-23-2021, 07:57 PM 
(This post was last modified: 03-23-2021, 09:17 PM by ab1jx.
 Edit Reason: wip
)
		
	
	
		This turns it off but it stays off when you unplug the headphones:
So you could script turning it on and off but at least you get privacy.
For manual control a couple quick scripts. Headphones stay on until you unplug them.
Create them with your favorite editor someplace in your path, sudo may be required:
Alsamixer reads the state of the speaker switch but can't change it. amixer is in alsa-utils.
Until somebody moves it here's a linked image to a block diagram. Datasheets are easy to find by searching.
![[Image: INrljx6.gif]](https://i.imgur.com/INrljx6.gif) 
	
	
	
	
	
Code:
amixer -c0 cset numid=28 0
numid=28,iface=MIXER,name='Speaker Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=offFor manual control a couple quick scripts. Headphones stay on until you unplug them.
Create them with your favorite editor someplace in your path, sudo may be required:
Code:
cat spon
#!/bin/bash
# Turn laptop speakers (always card 0) on
amixer -q -c0 cset numid=28 on &> /dev/null
cat spoff
!/bin/bash
# Turn laptop speakers (always card 0) off
amixer -q -c0 cset numid=28 0 &> /dev/null
chmod +x sp*Alsamixer reads the state of the speaker switch but can't change it. amixer is in alsa-utils.
Until somebody moves it here's a linked image to a block diagram. Datasheets are easy to find by searching.
![[Image: INrljx6.gif]](https://i.imgur.com/INrljx6.gif) 
	


