Help Wizard

Step 1

NEXT STEP

prev/play/next keys don't work in Lubuntu

Solved!

prev/play/next keys don't work in Lubuntu

Referrering this answer: http://askubuntu.com/a/372028/255935

 

I have Lubuntu 14.04 with Spotify 0.9.11.27.XXXXXXXXX. 

 

My previous, play and next keys don't work (nothing happends when I hit them and have Spotify running). When I test them in xev in a console, I get the following output:

 

KeyPress event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1991811, (-270,386), root:(390,412),
state 0x0, keycode 173 (keysym 0x1008ff16, XF86AudioPrev), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1991816, (-270,386), root:(390,412),
state 0x0, keycode 173 (keysym 0x1008ff16, XF86AudioPrev), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1992260, (-270,386), root:(390,412),
state 0x0, keycode 172 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1992262, (-270,386), root:(390,412),
state 0x0, keycode 172 (keysym 0x1008ff14, XF86AudioPlay), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1992794, (-270,386), root:(390,412),
state 0x0, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 48, synthetic NO, window 0x2c00001,
root 0xc7, subw 0x0, time 1992797, (-270,386), root:(390,412),
state 0x0, keycode 171 (keysym 0x1008ff17, XF86AudioNext), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

 so at least the computer seems to notice them.

 

Is this functionality dependent on some package included in Ubuntu, but not in Lubuntu?

Reply

Accepted Solutions
Marked as solution

After reading this, I got it working by doing the following:

 

1. In a terminal, run: sudo apt-get install mdbus2

 

2. Somewhere between <keyboard> and </keyboard> in ~/.config/openbox/lubuntu-rc.xml (you may need to have root privileges to edit this file, I don't know), add the following:

 

   <keybind key="XF86AudioPlay">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause</command>
     </action>
   </keybind>
   <keybind key="XF86AudioStop">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop</command>
     </action>
   </keybind>
   <keybind key="XF86AudioNext">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next</command>
     </action>
   </keybind>
   <keybind key="XF86AudioPrev">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous</command>
     </action>
   </keybind>

 Save and restart the computer (there might be a simpler way, I don't know), then will the hotkey buttons work.

View solution in original post

1 Reply
Marked as solution

After reading this, I got it working by doing the following:

 

1. In a terminal, run: sudo apt-get install mdbus2

 

2. Somewhere between <keyboard> and </keyboard> in ~/.config/openbox/lubuntu-rc.xml (you may need to have root privileges to edit this file, I don't know), add the following:

 

   <keybind key="XF86AudioPlay">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause</command>
     </action>
   </keybind>
   <keybind key="XF86AudioStop">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop</command>
     </action>
   </keybind>
   <keybind key="XF86AudioNext">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next</command>
     </action>
   </keybind>
   <keybind key="XF86AudioPrev">
     <action name="Execute">
       <command>dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous</command>
     </action>
   </keybind>

 Save and restart the computer (there might be a simpler way, I don't know), then will the hotkey buttons work.

Suggested posts