How to change sound level with visual indication in Unity

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I am using Ubuntu 16.04 with Unity desktop, sound system is pulseaudio.



I want to have custom shortcuts to change volume, in addition to media keys "audio lower/audio upper".



I created custom shortcuts that call commands pactl set-sink-volume 0 -5% and pactl set-sink-volume 0 +5%. But unlike media keys, this shortcuts change volume without visual indication.



What is command to change volume and display it's visual level indication, like it works with media keys?










share|improve this question





















  • Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
    – Sergiy Kolodyazhnyy
    Apr 17 at 21:40










  • Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
    – Martin W
    Apr 17 at 22:52














up vote
0
down vote

favorite












I am using Ubuntu 16.04 with Unity desktop, sound system is pulseaudio.



I want to have custom shortcuts to change volume, in addition to media keys "audio lower/audio upper".



I created custom shortcuts that call commands pactl set-sink-volume 0 -5% and pactl set-sink-volume 0 +5%. But unlike media keys, this shortcuts change volume without visual indication.



What is command to change volume and display it's visual level indication, like it works with media keys?










share|improve this question





















  • Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
    – Sergiy Kolodyazhnyy
    Apr 17 at 21:40










  • Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
    – Martin W
    Apr 17 at 22:52












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using Ubuntu 16.04 with Unity desktop, sound system is pulseaudio.



I want to have custom shortcuts to change volume, in addition to media keys "audio lower/audio upper".



I created custom shortcuts that call commands pactl set-sink-volume 0 -5% and pactl set-sink-volume 0 +5%. But unlike media keys, this shortcuts change volume without visual indication.



What is command to change volume and display it's visual level indication, like it works with media keys?










share|improve this question













I am using Ubuntu 16.04 with Unity desktop, sound system is pulseaudio.



I want to have custom shortcuts to change volume, in addition to media keys "audio lower/audio upper".



I created custom shortcuts that call commands pactl set-sink-volume 0 -5% and pactl set-sink-volume 0 +5%. But unlike media keys, this shortcuts change volume without visual indication.



What is command to change volume and display it's visual level indication, like it works with media keys?







unity pulseaudio






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 17 at 20:29









Selivanov Pavel

1289




1289











  • Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
    – Sergiy Kolodyazhnyy
    Apr 17 at 21:40










  • Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
    – Martin W
    Apr 17 at 22:52
















  • Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
    – Sergiy Kolodyazhnyy
    Apr 17 at 21:40










  • Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
    – Martin W
    Apr 17 at 22:52















Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
– Sergiy Kolodyazhnyy
Apr 17 at 21:40




Unity as other Gnome-based desktops have dbus and there is a dbus method, which you can call to change audio and the change on dbus tells Unity to show the popup. But it's been awhile since I've used Unity. If I get around to using Unity again or dig out my old scrips, I'll post an answer some time. Otherwise, Martin's answer is good enough to get the job done.
– Sergiy Kolodyazhnyy
Apr 17 at 21:40












Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
– Martin W
Apr 17 at 22:52




Interesting. I know that PulseAudio clients control the server though DBus. Gnome/Unity heavily use the DBus so it would not surprise me to learn that there is a way to trigger the media OSD by DBus, but I don't know it.
– Martin W
Apr 17 at 22:52










1 Answer
1






active

oldest

votes

















up vote
1
down vote













You should able to map XF86AudioLowerVolume and XF86AudoRaiseVolume to whatever custom key sequences you wish using the usual keymapping configuation tool, in addition to your already dedicated media keys. There is no restriction on a unique mapping.



Another possible command line solution is to use xdotool This tool lets you simulate keyboard input using the X11 XTEST extension. E.g. after installing the package, you should be able to use the commands:



xdotool key XF86AudioLowerVolume



and



xdotool key XF86AudioRaiseVolume



to do what you want.






share|improve this answer




















  • That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
    – Selivanov Pavel
    Apr 18 at 0:15











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025929%2fhow-to-change-sound-level-with-visual-indication-in-unity%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













You should able to map XF86AudioLowerVolume and XF86AudoRaiseVolume to whatever custom key sequences you wish using the usual keymapping configuation tool, in addition to your already dedicated media keys. There is no restriction on a unique mapping.



Another possible command line solution is to use xdotool This tool lets you simulate keyboard input using the X11 XTEST extension. E.g. after installing the package, you should be able to use the commands:



xdotool key XF86AudioLowerVolume



and



xdotool key XF86AudioRaiseVolume



to do what you want.






share|improve this answer




















  • That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
    – Selivanov Pavel
    Apr 18 at 0:15















up vote
1
down vote













You should able to map XF86AudioLowerVolume and XF86AudoRaiseVolume to whatever custom key sequences you wish using the usual keymapping configuation tool, in addition to your already dedicated media keys. There is no restriction on a unique mapping.



Another possible command line solution is to use xdotool This tool lets you simulate keyboard input using the X11 XTEST extension. E.g. after installing the package, you should be able to use the commands:



xdotool key XF86AudioLowerVolume



and



xdotool key XF86AudioRaiseVolume



to do what you want.






share|improve this answer




















  • That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
    – Selivanov Pavel
    Apr 18 at 0:15













up vote
1
down vote










up vote
1
down vote









You should able to map XF86AudioLowerVolume and XF86AudoRaiseVolume to whatever custom key sequences you wish using the usual keymapping configuation tool, in addition to your already dedicated media keys. There is no restriction on a unique mapping.



Another possible command line solution is to use xdotool This tool lets you simulate keyboard input using the X11 XTEST extension. E.g. after installing the package, you should be able to use the commands:



xdotool key XF86AudioLowerVolume



and



xdotool key XF86AudioRaiseVolume



to do what you want.






share|improve this answer












You should able to map XF86AudioLowerVolume and XF86AudoRaiseVolume to whatever custom key sequences you wish using the usual keymapping configuation tool, in addition to your already dedicated media keys. There is no restriction on a unique mapping.



Another possible command line solution is to use xdotool This tool lets you simulate keyboard input using the X11 XTEST extension. E.g. after installing the package, you should be able to use the commands:



xdotool key XF86AudioLowerVolume



and



xdotool key XF86AudioRaiseVolume



to do what you want.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 17 at 21:29









Martin W

74238




74238











  • That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
    – Selivanov Pavel
    Apr 18 at 0:15

















  • That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
    – Selivanov Pavel
    Apr 18 at 0:15
















That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
– Selivanov Pavel
Apr 18 at 0:15





That's an ingenious workaround, but it doesn't work for me :( From console xdotool works fine, volume is changed and indication appears. But when I assign this command to hotkey, nothing happens :( I tried using full path /usr/bin/xdotool and even made a wrapper script to see what's going on, but script shows that the command worked fine and returned 0. I think this is some Unity bug, that disallows global hotkey handling while other global hotkey is processed.
– Selivanov Pavel
Apr 18 at 0:15


















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025929%2fhow-to-change-sound-level-with-visual-indication-in-unity%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

`kcmshell` modules relation with `/usr/share/applications`

How to enroll fingerprints to Ubuntu 17.10 with VFS491