![]() |
There's an xfce plugin
https://docs.xfce.org/panel-plugins/...o-plugin/start
This plugin has a settable option "Enable keyboard shortcuts for volume control" As noted in an earlier post, turning the knob generates X KeyPress events. https://github.com/lxqt/pavucontrol-qt doesn't say whether pavucontrol-qt has the equivalent feature. |
Did you try using /etc/acpi/acpi_handler.sh
From Gazl's post I linked before. Code:
test@magrathea:/$ cat /etc/acpi/acpi_handler.sh |
Still working on C program
Out of stubbornness I'm still trying to get a C program running. My first attempt had to run as superuser and opened /dev/input/event10. It turns out that this was the reason that the alsa library call to get the player_volume was returning incorrect values. Opening the device is probably a bad idea for other reasons, for example it might interfere with evdev. So I need to get a report of an event from some server. It seems you can't get it directly from evdev. You can undoubtedly get it from the X server. This requires coding a minimal Xlib program to read any KeyPress events, and I'm in the process of trying to figure out how to do this. It might be worth looking at the acpid source code to see how it does it.
|
It seems to be well-known that a standard method for handling volume
key events is to use window manager key bindings. I use fvwm; the following can be added to ~/.fvwm/.fvwm2rc: Key XF86AudioRaiseVolume A N exec amixer -q set Master 3%+ Key XF86AudioLowerVolume A N exec amixer -q set Master 3%- I got a C program working, by grabbing the volume adjust keys using Xlib. I used the Xlib input extension, so only events from the SoundBar are grabbed. They are consumed. It's might be possible to pass them on to the focus window; see https://stackoverflow.com/questions/46288251/ capture-button-events-in-xlib-then-passing-the-event-to-the-client However, the window manager probably consumes them, and there doesn't seem to be any reason to pass them on. My C program follows. Code:
/* |
All times are GMT -5. The time now is 07:15 AM. |