Keyboard Volume Control for Sound

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
feist
White ninja
White ninja
Posts: 24
Joined: 27 Dec 2013, 02:02
Distribution: Porteus Kiosk 4.7.0
Location: USA

Keyboard Volume Control for Sound

Post#1 by feist » 13 Oct 2018, 23:08

Hello All,

Keyboard volume controls are not supported by default in the latest Porteus Kiosk 4.7.0. If you would like to enable keyboard volume controls, you will need to modify rc.xml to support these special keys.

The file rc.xml is in the 003-settings.xzm module and can be found at the /etc/xdg/openbox/ location once unsquashed:
/etc/xdg/openbox/rc.xml

Modify rc.xml by adding the following code in between the <keyboard> ... </keyboard> tags:

Code: Select all

		<!-- Keybindings for Media Keys -->
		<keybind key="XF86AudioMute">
			<action name="Execute">
				<command>amixer -M sset Master toggle</command>
			</action>
		</keybind>
		<keybind key="XF86AudioRaiseVolume">
			<action name="Execute">
				<command>bash -c "amixer -M sset Master 2%+ unmute; amixer -c 0 set Speaker unmute; amixer -c 0 set Headphone unmute"</command>
			</action>
		</keybind>
		<keybind key="XF86AudioLowerVolume">
			<action name="Execute">
				<command>bash -c "amixer -M sset Master 2%- unmute; amixer -c 0 set Speaker unmute; amixer -c 0 set Headphone unmute"</command>
			</action>
		</keybind>
Package everything back together, make a new ISO, and burn to your hard drive.

There are other keyboard bindings that can be found here if you have other special keys like calculator, internet, email, and so on:
http://wiki.linuxquestions.org/wiki/XF8 ... rd_symbols

For those wondering why I keep unmuting everything, it seems ALSA has some weird behavior that when you mute the Master control, it also mutes whatever other controls that are active like Speaker or Headphone if those devices are plugged in. When you unmute the Master control, the Speaker or Headphone control stays muted so that your sound is broken. I had to use bash to execute the additional commands as well because without the bash, only the first command would process for some reason.

I found this link helpful in my quest:
https://askubuntu.com/questions/872014/ ... snt-unmute

Cheers!

Locked