Announcement

Collapse
No announcement yet.

Mediacontroller hotkeys

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mediacontroller hotkeys

    Hello everyone!

    My problem: i use Kubuntu 18.04, I would like the music playback (mpd+cantata) from a keyboard to direct, but volumeup and volumedown option is not presented in the global shortcut keys, only play/pause, rewind/forward and stop option. Help please, how it is possible to solve this?

    Audio volume hotkeys not a solution, it regulates the capital volume, the media controller though the music player, this I need latter one.

    #2
    I'm sorry I have no answer on 18.04 bionic. But I can perhaps show others what I think your problem is.
    This shows the shortcuts on my 18.10 Cosmic install:
    Click image for larger version

Name:	media_controller_shortcuts.png
Views:	1
Size:	25.2 KB
ID:	644199
    On my 18.04 install the media volume down and up are not there.

    So, you could upgrade to 19.04.

    Maybe qdbus could be used... it can on 19.04 Disco! The trick is to have cantata running. I'm posting this on disco, let me submit this reply and reboot to bionic
    Regards, John Little

    Comment


      #3
      It didn't work on 18.04. I'm way out of my depth here, but I suspect that the mpd version on bionic does not support volume control. Cantata on 18.04 does not show the volume bars for me, indicating that mpd doesn't tell cantata that it can do volume control. The qdbus command I tried gave -0.01 for the volume property, and wouldn't let it be changed.

      In case you have no idea what I'm talking about, the DBUS is a messaging system used by many systems, and the qdbus command can send messages on the DBUS. It can be used to find out which messages are possible; qdbus on its own shows you the possible first level messages, then with those it'll show the next level, and so on till you've got a complete message. On 19.04 while cantata is running I can run these commands in a konsole (shell prompt is orange, command I type green, output red):
      Code:
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus | grep -i media[/COLOR]
      [color="red"]org.mpris.MediaPlayer2.cantata[/color]
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus org.mpris.MediaPlayer2.cantata[/color]
      [color="red"]/
      /cantata
      /org
      /org/mpris
      /org/mpris/MediaPlayer2[/color]
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus org.mpris.MediaPlayer2.cantata /org/mpris/MediaPlayer2[/color]
      [color="red"]property read bool org.mpris.MediaPlayer2.CanQuit
      property read bool org.mpris.MediaPlayer2.CanRaise[/color]
      [i]<lots of stuff snipped...>[/i]
      [color="red"]property readwrite double org.mpris.MediaPlayer2.Player.Volume[/color]
      [i]# find the media volume[/i]
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus org.mpris.MediaPlayer2.cantata /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Volume[/COLOR]
      [COLOR="red"]0.85[/COLOR]
      [i]# set the volume to half[/i]
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus org.mpris.MediaPlayer2.cantata /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Volume 0.5[/COLOR]
      [COLOR="darkorange"]john@myriam$[/COLOR] [COLOR="#008000"]qdbus org.mpris.MediaPlayer2.cantata /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Volume[/COLOR]
      [COLOR="red"]0.5[/COLOR]
      The idea was to set a global shortcut that runs a script with qdbus commands. Now if your cantata on 18.04 shows the volume bars in its interface, the qdbus approach might work. Otherwise you may have to build a more recent version of mpd, and possibly cantata.
      Regards, John Little

      Comment


        #4
        Originally posted by jlittle View Post
        I'm sorry I have no answer on 18.04 bionic. But I can perhaps show others what I think your problem is.
        This shows the shortcuts on my 18.10 Cosmic install:
        [ATTACH=CONFIG]8124[/ATTACH]
        On my 18.04 install the media volume down and up are not there.

        So, you could upgrade to 19.04.

        Maybe qdbus could be used... it can on 19.04 Disco! The trick is to have cantata running. I'm posting this on disco, let me submit this reply and reboot to bionic
        Often (but not always), configurable settings just aren't obvious; cryptic even. In the image above, have you ever just tried clicking in the blank Global field of Media volume down / Media volume up (or the right pointing >)to see if a fillable field appears?
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          The image above is for cosmic; it works fine. In bionic, there are no volume up and down entries, and I think that's the OP's problem.
          Regards, John Little

          Comment


            #6
            Thank you for the hints!

            On KDE Neon (based on ubuntu lts) it works, I believed it solvable on Bionic.

            Comment

            Working...
            X