You are not logged in.
Hello all, I've recently re-installed Arch Linux (64 bit) on my PC with LXDE. Then I installed alsa-utils to configure ALSA, and to get notifications libnotify alongwith notify-osd notification server, as outlined in the wiki. I also installed obkey from AUR to easily modify LXDE keyboard shortcuts. Now I wanted to set keyboard shortcuts for changing volume level or toggling volume. I learned following commands to do so and assigned appropriate keyboard shortcuts (keyboard multimedia volume keys ) to it through obkey.
amixer sset Master 2%+ // Increase volume by 2 %
amixer sset Master 2%- // Decrease volume by 2 %
amixer sset Master toggle // Mute or Unmute sound
Then I wanted to get notifications when issuing these commands. In this respected I came up with following command for muting only and had to assign it with same key as for toggle sound command.
notify-send 'Volume Muted' --icon=audio-volume-muted
I have Ubuntu installed in the same PC. In Ubuntu when I change volume level through keyboard volume keys, I get notifications with audio-volume icon (more precisely, audio-volume-{low,medium,high} according to volume level) along with a gauge showing indication of volume level.
I want to mimic this behavior in my Arch OS. Can anybody help me in doing so?
Thanks in advance.
Edit: Marked thread as solved.
Last edited by nlern (2016-10-16 07:11:55)
Offline
If you're interested in a simpler way to do this you can install volumeicon from the community repo. It puts an icon in your tray and then has options for assigning volume keys and showing notification. There are other packages as well but I found this to be the best option for me running openbox and fbpanel.
Last edited by bgc1954 (2016-10-15 16:41:02)
Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz
Offline
I use a script I found long ago. https://github.com/frank604/scripts/blob/master/vol.sh
Modify as you wish. Usage is quite simple and I think this hits the mark quite perfectly for what you wanted.
Edit: if you need help adapting it to your use case, just holla~~
Last edited by frank604 (2016-10-16 02:23:24)
Offline
Thanks guys for your kind suggestions. I found frank604's script particularly interesting. Thank you frank604 for such a nice script. I've downloaded the script and tested it and it works just the way I wanted! I just changed the increment in the script to 2% and reassigned my volume keys according to this script.
Also frank604, it would be very helpful if you please help me more in understanding the script. If I run the script without any arguments I get following output
$ ./vol.sh
usage: ./vol.sh {up|down|mute} [increment]
I don't understand what the [increment] part is for. I thought it was to change the step size for up/down command and so I tried to lower volume by 10% using following command.
$ ./vol.sh down 10%
But I found that volume lowered by just 2%, which is the increment value in the script. So can you clarify how does the increment works?
Offline
I'm also marking the thread SOLVED as my main problem of getting notifications on volume change is solved.
Offline
I can't take the credit on the script. It was found online somewhere. I just know it matched what you were seeking. It is just up|down|mute. The increment, I assume, is by how much up or down that was set in the script on line 5 for 'increment='
Offline
Oh I see. Thank you for the clarification.
Offline