Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I change volume using the media keys there is a popping sound notification.

Sometimes I'm playing media, and I want to adjust the volume without sound notification.

keyboard shortcuts

I want to add Volume up, muted -> Shift + Audio raise volume shortcut.

How do I do it?

Binding Shift + Audio raise volume to amixer set Master 10%+ changes the volume, but doesn't display the visual indicator of volume change. volume change indicator

Looking at dbus-monitor shows different events:

Stock Volume up:

method call sender=:1.4 -> dest=:1.25 serial=2167 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=GetCapabilities
method return sender=:1.25 -> dest=:1.4 reply_serial=2167
   array [
      string "body"
      string "body-markup"
      string "icon-static"
      string "image/svg+xml"
      string "x-canonical-private-synchronous"
      string "x-canonical-append"
      string "x-canonical-private-icon-only"
      string "x-canonical-truncation"
      string "private-synchronous"
      string "append"
      string "private-icon-only"
      string "truncation"
   ]
method call sender=:1.4 -> dest=:1.25 serial=2168 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "gnome-settings-daemon"
   uint32 0
   string "notification-audio-volume-medium"
   string " "
   string ""
   array [
   ]
   array [
      dict entry(
         string "x-canonical-private-synchronous"
         variant             string "volume"
      )
      dict entry(
         string "value"
         variant             int32 61
       )
   ]
   int32 -1
method return sender=:1.25 -> dest=:1.4 reply_serial=2168
   uint32 0
signal sender=:1.49 -> dest=(null destination) serial=1119 path=/com/canonical/indicator/sound/menu; interface=com.canonical.dbusmenu; member=ItemsPropertiesUpdated
   array [
      struct {
         int32 3
         array [
            dict entry(
               string "x-canonical-ido-volume-level"
               variant                   double 61.5646
            )
         ]
      }
   ]
   array [
   ]

Then amixer set Master 10%+:

signal sender=:1.49 -> dest=(null destination) serial=1116 path=/com/canonical/indicator/sound/menu; interface=com.canonical.dbusmenu; member=ItemsPropertiesUpdated
   array [
      struct {
         int32 3
         array [
            dict entry(
               string "x-canonical-ido-volume-level"
               variant                   double 73.5641
            )
         ]
      }
   ]
   array [
   ]

It seems that Volume up also runs some command that checks capabilities and shows a volume indicator. Where can I call this command directly?

share|improve this question
    
I'm sure is somewhere in dbus. I need to check. –  Braiam Dec 4 '13 at 1:39
add comment

1 Answer 1

The sound notification you can disable it in the Sound preferences:

enter image description here

There isn't still an easy way to disable certain sound events. But you can use direct commands to the alsa server to do this:

amixer set Master 10%+ ## Increase the volume by 10%
amixer set Master 10%- ## Decrease the volume by 10%
amixer set Master toggle ## Sets mute on and off

Then you can create the shortcut hitting the + sign in the keyboard configuration. For people wondering why I didn't used pulseaudio, was because I don't use pulseaudio.

Pulseaudio requires more work, like:

 pactl set-source-mute 0 toggle
 pactl set-source-volume 0 +10
 pactl set-source-volume 0 -10

"This should work" for most of cases.

share|improve this answer
    
Currently if I press Shift + Audio raise volume nothing happens. I don't need to disable anything. I need to add new binding that adjusts volume without sound notification. –  Seppo Erviälä Aug 12 '13 at 22:53
    
Check again, you should create personalized shortcuts for doing so. –  Braiam Aug 12 '13 at 23:15
    
amixer is close, but it doesn't show the visual volume change indicator. pactl didn't work for me. I've added info to the question. –  Seppo Erviälä Aug 13 '13 at 0:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.