Tip: Multimedia buttons under i3

251 views
Skip to first unread message

Jon Solworth

unread,
Dec 29, 2016, 3:57:53 PM12/29/16
to qubes-users
I'm at Chaos Computer Congress, and Qubes has a table. I got some help from them with the multimedia buttons for i3. Specifically, I configured the brightness and sound controls, but not the multimedia player controls because the player is not in Dom0 (where the i3 exec runs)

To get this working in dom0 install some software:

sudo qubes-dom0-update pulseaudio-utils
sudo qubes-dom0-update xbacklight

Then add the following lines to .config/i3

# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle # mute sound

# Sreen brightness controls
bindsym XF86MonBrightnessUp exec xbacklight -inc 20 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 20 # decrease screen brightness


that's it,
Jon


Chris Laprise

unread,
Dec 30, 2016, 2:48:38 PM12/30/16
to Jon Solworth, qubes-users
When you know about the dbus interface that media players use, its
pretty easy to control a designated 'media' VM from dom0. In KDE, I went
into System-settings, Shortcuts and defined a new group under Custom.
Then I added entries with commands like:

qvm-run Media 'dbus-send --print-reply
--dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2
org.mpris.MediaPlayer2.Player.Next'

The above will send rhythmbox to the next track. The first argument
after 'dest=' specifies the player program.

There may also be a way to do this by injecting keypresses (or
forwarding them) into VMs; this could have the effect of controlling
whichever player is currently active. Also, I have seen a technique that
looks at the list of interfaces under 'org.mpris.MediaPlayer2.*' and
passes the commands to the first (or last) program it finds.

Chris
Reply all
Reply to author
Forward
0 new messages