On 23 January 2012 19:14, Duncan Bayne
<address@hidden> wrote:
Hi All,
Beginner question here: I am using amixer to control the sound volume
via accelerator keys, using the following:
(define-key *top-map* (kbd "XF86AudioRaiseVolume") "exec amixer set
Master 5+ | grep '%'")
(define-key *top-map* (kbd "XF86AudioLowerVolume") "exec amixer set
Master 5- | grep '%'")
(define-key *top-map* (kbd "XF86AudioMute") "exec amixer set Master
toggle | grep '%'")
When run from console the output looks like this:
address@hidden ~ $ amixer set Master 5- | grep '%'
Mono: Playback 59 [92%] [-5.00dB] [on]
I'd like to display that to the user to notify them of the new volume
setting, using the StumpWM print function or similar.
Could someone please point me in the right direction here? I suspect
this is a reasonably common thing, so perhaps I'm just failing to find
some documentation ...
Try something like
(defcommand raise-volume () ()
"Raise volume via amixer"
(message (run-shell-command "amixer set Master 5+ | grep '\[*%\]'" t)))