You are not logged in.

#1 2016-10-15 15:31:42

nlern
Member
From: West Bengal, India
Registered: 2015-06-29
Posts: 51

[SOLVED] How to get Ubuntu-like Volume Notifications

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

#2 2016-10-15 16:40:09

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

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

#3 2016-10-15 21:14:45

NoSuck
Member
Registered: 2015-03-04
Posts: 157
Website

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

Bgc1954's solution is easiest.

If you feel like having a fun Saturday night, you could write a shell script that uses osd_cat to show volume level.

Offline

#4 2016-10-16 02:22:47

frank604
Member
From: BC, Canada
Registered: 2011-04-20
Posts: 1,212

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

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

#5 2016-10-16 07:05:16

nlern
Member
From: West Bengal, India
Registered: 2015-06-29
Posts: 51

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

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

#6 2016-10-16 07:10:49

nlern
Member
From: West Bengal, India
Registered: 2015-06-29
Posts: 51

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

I'm also marking the thread SOLVED as my main problem of getting notifications on volume change is solved.

Offline

#7 2016-10-16 07:18:16

frank604
Member
From: BC, Canada
Registered: 2011-04-20
Posts: 1,212

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

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

#8 2016-10-16 07:29:25

nlern
Member
From: West Bengal, India
Registered: 2015-06-29
Posts: 51

Re: [SOLVED] How to get Ubuntu-like Volume Notifications

Oh I see.  Thank you for the clarification.

Offline

Board footer

Powered by FluxBB