The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
2

How to change the systems volume?

asked Jun 14 '12

NobbZ gravatar image

Hi there!

I am on a laptop that allows adjusting its volume only with softkeys. When using gnome or unity I can use these softkeys out of the box, is there any way to enable the keys in i3? Or at least have a "tray icon" where I can change the volume like you can with windows?

11 answers

Sort by » oldest newest most voted
5

answered Jul 11 '12

loblik gravatar image

I have amixer binded to multimedia keys and use i3status to watch current volume level.

bindsym XF86AudioRaiseVolume exec amixer -q set Master 2dB+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 2dB- unmute
bindsym XF86AudioMute exec amixer -q set Master toggle

Comments

Volume up and down didn't work for me for some reason. I used this from the Arch i3 forum thread: bindsym XF86AudioLowerVolume exec --no-startup-id amixer set Master 3%- bindsym XF86AudioRaiseVolume exec --no-startup-id amixer set Master 3%+

beitme gravatar imagebeitme (Oct 22 '13)edit

I changed last line to toggle also Headphones at the same time. Because just toggle master toggles off headphones but will not turn them back on later. bindsym XF86AudioMute exec amixer -q -D pulse set Master toggle

Sam73 gravatar imageSam73 (Sep 18 '14)edit

I had to use a percentage measure rather than `dB`. The `amixer` man page says that `dB` measures only work for devices which have dB information available. `amixer -q set Master 4%+ unmute` works fine for me on Debian Testing.

severin gravatar imageseverin (Oct 10 '14)edit
4

answered Apr 7 '13

Michael gravatar image

In case you are using PulseAudio:

bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 -- +10% && killall -SIGUSR1 i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -- -10% && killall -SIGUSR1 i3status

Killing i3status with SIGUSR1 will trigger an immediate refresh. This works with i3status ≥ v2.7.

Comments

perfect, works on a default crunchbang (waldorf) with i3 installed.

toby gravatar imagetoby (May 20 '13)edit

thanks for this

beitme gravatar imagebeitme (Oct 22 '13)edit

Thanks. (I had to use sink 1.) Also: `bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle`

I have been using this, but it just stopped working after my last yum update. I don't really understand how it works

Rojo gravatar imageRojo (Jul 23 '14)edit

I added "&& pactl set-sink-mute 0 0" to the command, to automatically unmute it when volume is adjusted! Works perfect.

cee gravatar imagecee (Aug 9 '14)edit
3

answered Jul 14 '12

bapt gravatar image

updated Jul 14 '12

Michael gravatar image

On FreeBSD:

bindsym XF86AudioRaiseVolume exec mixer vol +1
bindsym XF86AudioLowerVolume exec mixer vol -1
2

answered Jul 10 '12

leyouser gravatar image

I recommend volnoti. If you want to have an icon hovering in the center, and showing the current volume, as well as the changes, it is a lightweight solution.

BlockquoteVolnoti is a lightweight volume notification daemon for GNU/Linux and other POSIX operating systems. It is based on GTK+ and D-Bus and should work with any sensible window manager. The original aim was to create a volume notification daemon for lightweight window managers like LXDE or XMonad. It is known to work with a wide range of WMs, including GNOME, KDE, Xfce, LXDE, XMonad, i3 and many others. The source code is heavily based on the GNOME notification-daemon.

You can find it here: https://www.github.com/davidbrazdil/volnoti

For archlinux users: https://aur.archlinux.org/packages.php?ID=55159

Comments

With which audio systems does volnoti work? Is not included in the readme...

joepd gravatar imagejoepd (Jul 11 '12)edit
2

answered Oct 19 '14

Jens Erat gravatar image

updated Oct 19 '14

On systems with changing output device (for example headphones, docked and laptop speakers), you need to read the active sink before changing volume:

set $sink `pactl list short sinks | grep RUNNING | cut -f1`
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume $sink -- +10%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume $sink -- -10%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute $sink toggle

Comments

With `grep RUNNING` this method doesn't work when there's no sound playing. Is there any side-effect if I remove this part?

cemaleker gravatar imagecemaleker (Sep 5 '15)edit
2

answered Jun 16 '12

fernandotcl gravatar image

For PulseAudio, I recommend pa-applet. It displays a tray icon, allows you to control the volume level in a number of ways (including using the multimedia keys in your keyboard), and allows you to change the configuration (say, from built-in speakers to HDMI) with two clicks.

Comments

Works for me fine on Ubuntu 13.10. I've enabled it in ~/.i3/config: exec pa-applet Building it required: libglib2.0-dev libgtk-3-dev libnotify-dev libpulse-dev libx11-dev autoconf automake pkg-config

michaelc gravatar imagemichaelc (Nov 12 '13)edit

works great out of the box for me, though building it was a bit of a chore.

Avis gravatar imageAvis (Jul 14 '14)edit

awesome, thanks for the recco, works like a charm.

chadillac gravatar imagechadillac (Jul 28 '14)edit

I found this to be the easiest solution for me. sorry can't upvote

yulrizka gravatar imageyulrizka (Oct 24 '14)edit

A word of warning for Ubuntu 14.04+ users, when switching audio output the sound stops and can't be recovered with the applet, I recovered entering a normal Unity session and resigning output to a correct device. Dunno exactly what is going wrong sorry.

Ruben G gravatar imageRuben G (Mar 1 '15)edit
1

answered Jul 3 '12

That's what I do (alsa):

bindsym $ms+equal exec --no-startup-id /usr/bin/aumix -v +5
bindsym $ms+minus exec --no-startup-id /usr/bin/aumix -v -5
0

answered Jun 15 '12

I tried to use volwheel, but got some issues there. I was already using volumeicon-alsa, which works pretty good, although it launches the alsa-mixer terminal window for you to manage the volume.

volwheel seems in deed a better option (if you are doing this with the mouse and not with keyboard keys), but it looks like the popup is not recognized as a floating window, so opening it now shows a creepy tiled window. I wrote to the developers and let's hope there is a solution for this.

0

answered Jan 16 '14

NoMansEyes gravatar image

updated Jan 16 '14

I have run into a bizarre issue. When I mute the master volume with amixer it automatically mutes all of the other controls as well. But unmuting only affects the Master. So I can mute with

# amixer set Master toggle 

but to unmute I have to use

# amixer set Master unmute; amixer set Center unmute; amixer set Side unmute ... 

In the end I opted to just use the mute button to zero out the Master volume and then instead of unmuting I just turn the volume up from zero...

0

answered Dec 1 '12

For Fedora 18 beta, note the use of sset instead of set.

bindsym XF86AudioRaiseVolume exec amixer -q sset Master 5%+ unmute
bindsym XF86AudioLowerVolume  exec amixer -q sset Master 5%- unmute
bindsym XF86AudioMute exec amixer -q sset Master toggle

Comments

I had it to "master" instead of "Master". If I haven't seen it here I would have installed another WM because I was getting out of options. Thanks

demil133 gravatar imagedemil133 (Apr 21 '13)edit

Question Tools

3 followers

Stats

Asked: Jun 14 '12

Seen: 55,357 times

Last updated: Oct 19 '14