Introduction

Volume change handler is here: amixer-popup.sh

Other usefull keys are for brightness control: two for display brightness, and two keys for keyboard backlight brightness. This article is about configuration of these four helpful keys.

Prerequisites

Keys are handled by window manager. In my case this is Notion.

All functions are implemented through applesmc module.

Window Manager is running without super-user privileges.

Solution

Notion config: cfg_multimedia_keys.lua

loaded by adding to «cfg_defbindings.lua» the line: dopath "cfg_multimedia_keys"

To make necessary files under /sys writable by the required user (the one who started WM), permissions and ownership is changed on the module loading.

File «/etc/modprobe.d/y-applesmc.conf» created with only two lines:
softdep applesmc post: y-applesmc
install y-applesmc /etc/modprobe.d/y-applesmc.conf.sh
and simple script «y-applesmc.conf.sh» provided. In the script fan speed is changed as well, it is not related to multimedia keys, skip it if not needed.

On awakening, display brightness set to maximum, though content of the corresponding brightness file under /sys does not change. No such behavior for keyboard backlight. In order to restore the brightness value: «/etc/pm/sleep.d/08_backlight.conf».