Audio notification with amixer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Audio notification with amixer

Pétùr
Hi,

I use amixer to change audio volume. I have a notification when I use
the multimedia keys of my keyboard but not when I bind the amixer
command to another shortcut.

For example: "amixer -q set Master 5%+ unmute" is binded both to one of
the multimedia key and to Ctrl+PageUp. I have the two shortcuts in xfce
settings manager but I only have notifications for the multimedia key.

I believe xfce4-volumed is no longer active and that
xfce4-pulseaudio-plugin is the new replacement. I have
xfce4-pulseaudio-plugin installed.

How can I have audio notifications for keyboard shortcuts other than
multimedia keys?

Pétùr

_______________________________________________
Xfce mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce
http://www.xfce.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio notification with amixer

Pétùr
Le 02/07/2017 à 20:03, Pétùr a écrit :

> Hi,
>
> I use amixer to change audio volume. I have a notification when I use
> the multimedia keys of my keyboard but not when I bind the amixer
> command to another shortcut.
>
> For example: "amixer -q set Master 5%+ unmute" is binded both to one of
> the multimedia key and to Ctrl+PageUp. I have the two shortcuts in xfce
> settings manager but I only have notifications for the multimedia key.
>
> I believe xfce4-volumed is no longer active and that
> xfce4-pulseaudio-plugin is the new replacement. I have
> xfce4-pulseaudio-plugin installed.
>
> How can I have audio notifications for keyboard shortcuts other than
> multimedia keys?
>
> Pétùr
>


No one?

TL;DR: I try to have notifications for keyboard shortcuts binded to
amixer commands.
_______________________________________________
Xfce mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce
http://www.xfce.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio notification with amixer

jEsuSdA 8)-2
El 11/07/17 a las 16:00, Pétùr escribió:

> Le 02/07/2017 à 20:03, Pétùr a écrit :
>> Hi,
>>
>> I use amixer to change audio volume. I have a notification when I use
>> the multimedia keys of my keyboard but not when I bind the amixer
>> command to another shortcut.
>>
>> For example: "amixer -q set Master 5%+ unmute" is binded both to one of
>> the multimedia key and to Ctrl+PageUp. I have the two shortcuts in xfce
>> settings manager but I only have notifications for the multimedia key.
>>
>> I believe xfce4-volumed is no longer active and that
>> xfce4-pulseaudio-plugin is the new replacement. I have
>> xfce4-pulseaudio-plugin installed.
>>
>> How can I have audio notifications for keyboard shortcuts other than
>> multimedia keys?
>>
>> Pétùr
>>
>
> No one?


If you want to have notification, then try to create a script or a
command line adding the notify-send instruction.

Something like that:

notify-send " " -h int:value:80 -i audio-volume-high


You can get the actual volume using "amixer get Master". And you can
extract the volume percent with something like that:

  amixer get Master | awk '$0~/%/{print $5}' | tr -d '[]%'


#!/bin/bash

# So, you can make a script getting the volume:

VOLUME=`amixer get Master | awk '$0~/%/{print $5}' | tr -d '[]%'`

# Calculate the new volume:

NEWVOLUME= `expr $VOLUME + 5`

# Increase the volume:

amixer -q set Master 5%+ unmute

# Notify the change:

notify-send " " -h int:value:$NEWVOLUME -i audio-volume-high

# and thats all!!


I hope to help you. ;)





_______________________________________________
Xfce mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce
http://www.xfce.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Audio notification with amixer

jEsuSdA 8)-2
El 12/07/17 a las 21:58, jEsuSdA 8) escribió:

>
> #!/bin/bash
>
> # So, you can make a script getting the volume:
>
> VOLUME=`amixer get Master | awk '$0~/%/{print $5}' | tr -d '[]%'`
>
> # Calculate the new volume:
>
> NEWVOLUME= `expr $VOLUME + 5`
>
> # Increase the volume:
>
> amixer -q set Master 5%+ unmute
>
> # Notify the change:
>
> notify-send " " -h int:value:$NEWVOLUME -i audio-volume-high
>
> # and thats all!!
>

... obviously, do the same decreasing volume, changing the "+" by "-"
and the "-i audio-volume-high" for "-i audio-volume-low" (or other icon) ;)
_______________________________________________
Xfce mailing list
[hidden email]
https://mail.xfce.org/mailman/listinfo/xfce
http://www.xfce.org
Loading...