How to change sound level with visual indication in Unity


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?
unity pulseaudio
add a comment |Â
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?
unity pulseaudio
Unity as other Gnome-based desktops havedbus
and there is adbus
method, which you can call to change audio and the change ondbus
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
add a comment |Â
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?
unity pulseaudio
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
unity pulseaudio
asked Apr 17 at 20:29
Selivanov Pavel
1289
1289
Unity as other Gnome-based desktops havedbus
and there is adbus
method, which you can call to change audio and the change ondbus
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
add a comment |Â
Unity as other Gnome-based desktops havedbus
and there is adbus
method, which you can call to change audio and the change ondbus
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Unity as other Gnome-based desktops have
dbus
and there is adbus
method, which you can call to change audio and the change ondbus
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