8

In "Settings->Window Manager" I can customize keyboard shortcuts for actions such as window tiling or maximizing and minimizing windows. There is no option to control the volume with keyboard, though. It is possible in Cinnamon which has a similar control panel for keys but I don't know how to do it in Xfce.

Hauke Laging
  • 90,279
yeti
  • 323

2 Answers2

12

I figured it out. Go to Settings->Keyboard->Application Shortcuts and bind the volume up and volume down keys you want to use to:

amixer set Master 5%+ 
amixer set Master 5%-

This will increase or decrease your volume by 5% depending on the key pressed.

yeti
  • 323
5

The answer maybe duplicate this

As for pulseaudio, use pactl command:

  • pactl -- set-sink-mute {SINK} toggle -- mute/unmute
  • pactl -- set-sink-volume {SINK} +10% -- increase volume by 10%
  • pactl -- set-sink-volume {SINK} +10% -- decrease volume by 10%

where {SINK} in name/number of active sink. To find its value, try pactl list short sinks. My output is

0   alsa_output.pci-0000_00_03.0.hdmi-stereo    module-alsa-card.c  s16le 2ch 44100Hz   SUSPENDED
1   alsa_output.pci-0000_00_1b.0.analog-stereo  module-alsa-card.c  s16le 2ch 44100Hz   RUNNING

we saw one SUSPENDED (0) versus one RUNNING (1) sink. So, use running sink's number in above commands

  • 1
    I ended up choosing this way because it's easier to work with if you want to change the volume of a device other than Master. I set the default audio device using pacmd set-default-sink $index and can use the same index to adjust volume. – Martin Andersson Sep 22 '18 at 17:52