no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | scripts:i3:volume [2022-06-03 20:45] (current) – created Tony | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Volume Control Using i3 ====== | ||
+ | |||
+ | |||
+ | ===== Change system volume/mute from media controls ===== | ||
+ | |||
+ | For muting, using ALSA to mute the Master output is a safe bet. | ||
+ | |||
+ | < | ||
+ | </ | ||
+ | To adjust system volume, I have done this in 2 main ways: | ||
+ | |||
+ | |||
+ | ==== Using Pulseaudio ==== | ||
+ | |||
+ | |||
+ | Here, you can change how much you want to adjust the volume by (eg: 1%), and the sink number (eg: 2). | ||
+ | |||
+ | For example, I had the regular volume buttons change the 2nd sink volume, which is my USB DAC, and ' | ||
+ | |||
+ | < | ||
+ | bindsym XF86AudioLowerVolume exec "pactl set-sink-volume 2 -1%" | ||
+ | </ | ||
+ | |||
+ | ==== Using ALSA ==== | ||
+ | |||
+ | |||
+ | This will change the volume of whatever output device is selected as default. I have found a slight glitch, if you adjust volume too fast, the left and right channels may imbalance. In this case, bring the volume down to 0, then back up. | ||
+ | |||
+ | < | ||
+ | bindsym XF86AudioLowerVolume exec " | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== New method from Fedora config ==== | ||
+ | |||
+ | I saw this on Fedora git, and it works better. Use this. It doesn' | ||
+ | |||
+ | # Use pactl to adjust volume in PulseAudio. | ||
+ | set $refresh_i3status killall -SIGUSR1 i3status | ||
+ | bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status | ||
+ | bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status | ||
+ | bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status | ||
+ | bindsym $mod+XF86AudioMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status | ||