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 2012-06-14 10:36:14 +0000

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?

edit retag flag offensive close merge delete

11 answers

Sort by » oldest newest most voted
5

answered 2012-07-11 22:35:32 +0000

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
edit flag offensive delete link more

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 ( 2013-10-22 23:52:06 +0000 )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 ( 2014-09-18 09:37:15 +0000 )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 ( 2014-10-10 15:54:42 +0000 )edit
4

answered 2013-04-07 18:14:59 +0000

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.

edit flag offensive delete link more

Comments

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

toby gravatar imagetoby ( 2013-05-20 20:10:22 +0000 )edit

thanks for this

beitme gravatar imagebeitme ( 2013-10-22 23:55:56 +0000 )edit

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

S. Christoffer Eliesen gravatar imageS. Christoffer Eliesen ( 2013-10-27 10:25:01 +0000 )edit

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 ( 2014-07-23 21:55:23 +0000 )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 ( 2014-08-09 10:42:30 +0000 )edit
3

answered 2012-07-14 12:55:56 +0000

bapt gravatar image

updated 2012-07-14 20:54:57 +0000

Michael gravatar image

On FreeBSD:

bindsym XF86AudioRaiseVolume exec mixer vol +1
bindsym XF86AudioLowerVolume exec mixer vol -1
edit flag offensive delete link more
2

answered 2012-07-10 20:41:35 +0000

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

edit flag offensive delete link more

Comments

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

joepd gravatar imagejoepd ( 2012-07-11 17:09:01 +0000 )edit
2

answered 2014-10-19 15:18:01 +0000

Jens Erat gravatar image

updated 2014-10-19 15:23:03 +0000

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
edit flag offensive delete link more

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 ( 2015-09-05 04:52:15 +0000 )edit
2

answered 2012-06-16 01:28:02 +0000

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.

edit flag offensive delete link more

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 ( 2013-11-12 17:55:36 +0000 )edit

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

Avis gravatar imageAvis ( 2014-07-14 15:07:54 +0000 )edit

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

chadillac gravatar imagechadillac ( 2014-07-28 14:12:22 +0000 )edit

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

yulrizka gravatar imageyulrizka ( 2014-10-24 09:17:45 +0000 )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 ( 2015-03-01 09:04:18 +0000 )edit
1

answered 2012-07-03 20:08:49 +0000

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
edit flag offensive delete link more
0

answered 2012-06-15 04:19:24 +0000

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.

edit flag offensive delete link more
0

answered 2014-01-16 01:50:30 +0000

NoMansEyes gravatar image

updated 2014-01-16 02:01:50 +0000

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...

edit flag offensive delete link more
0

answered 2012-12-01 17:27:05 +0000

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
edit flag offensive delete link more

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 ( 2013-04-21 03:07:47 +0000 )edit

Question Tools

3 followers

Stats

Asked: 2012-06-14 10:36:14 +0000

Seen: 55,368 times

Last updated: Oct 19 '14