Moode Forum
[SOLVED] Controlling moode from PC (keyboard shortcuts) - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [SOLVED] Controlling moode from PC (keyboard shortcuts) (/showthread.php?tid=4147)



Controlling moode from PC (keyboard shortcuts) - vgnmnky - 08-22-2021

Hi

For a while, I've used Cantata (on my Linux KDE Plasma PC).  With Cantata connected to the (moode) mpd server, I can set up keyboard shortcuts to control volume etc, using Canata's built in commands. This was all fine, but recently it seems like the changes in volume, while showing in Cantata (and audibly) are not reflected in the volume shown in the moode gui.  Strangely, the db levels do update immediately.

Is there a way to have the gui reflect mpd volume changes not directly made by the moode gui?

Leading from that, I saw that you could send commands directly to moode.  This would be the ideal solution.  I created a custom command/url keyboard shortcut in Plasma for volume up, with http://moode/command?cmd=vol.sh up 1 

This works.  The volume audibly increases, and it's showing in the moode gui.  But the shortcut handler in Plasma opens a new tab in my default browser each time.  I've been looking into xdg-mime (for text/html), etc, but it's a bit beyond me.  I know I could set it to open something other than my browser when running the shortcut command, but I don't know what.  Ideally, nothing, as it changes the volume anyway!

Guidance appreciated!

Thanks


RE: Controlling moode from PC (keyboard shortcuts) - TheOldPresbyope - 08-22-2021

@vgnmnky

You can post HTTP queries to moOde's server from the command line.

Here's an example which lowers the volume 30 units using the curl command

Code:
curl -G --data-urlencode 'cmd=vol.sh dn 30' http://moode.local/command/

the --data-urlencode option takes care of encoding special characters; here it will encode those spaces in the query as '%20'.

Here's another example; this one stops moOde playing the current track

Code:
curl -G --data-urlencode 'cmd=stop' http://moode.local/command/



Regards,
Kent


RE: Controlling moode from PC (keyboard shortcuts) - vgnmnky - 08-22-2021

Thank you! Just tried that in my custom keyboard shortcuts, and it all seems to work as I wanted.


RE: Controlling moode from PC (keyboard shortcuts) - TheOldPresbyope - 08-22-2021

Great! Then please go back to your original post and change the "PROBLEM" prefix to "SOLVED".

Regards,
Kent