Thank you for your donation!


Instruction Guide Keyboard shortcuts for volume (macos only)
#1
Question 
Hi all and thank you to the developpers for making my daily music app.

I've searched a quicker way to raise/lower volume of mpd  when working on my computer (macos), thought of keyboard shortcuts that would do it while navigating/viewing the web browser app. Is there a way to do that ?


EDIT: Found some kind of a solution with Automator, so this is macos only. Automator is a stock app so no need to install any app. This solution is not ultra-responsive but I found it satisfying enough.

If you want to try it:
- Run Automator
- Create a new service, choosing "Execute AppleScript"
- Insert this little code below with the moodeaudio hostname of your installation (YourMoodeAudioHostName) and the command you want to map to a key (TheCommandYouWantToMap — see below)
- Choose Receives no input from any application
- save
- repeat for all the commands you want.
Code:
on run {input, parameters}
    do shell script "curl --ipv4 http://YourMoodeAudioHostName/command/?cmd=TheCommandYouWantToMap"
    return input
end run

I use 6 commands that match my apple apple keyboard media keys :
- lower volume (to 5 steps more, change the last number for your needs): .../command/?cmd=vol.sh%20dn%205
- raise volume (to 5 steps more, change the last number for your needs): .../command/?cmd=vol.sh%20up%205
- play/pause: .../command/?cmd=play
- next track: .../command/?cmd=next
- previous track: .../command/?cmd=previous
- mute/unmute: .../command/?cmd=vol.sh%20mute

Finally, map the services to keyboards keys in preferences / keyboard / shortcuts / services. Original media keys can be used with the addition of cmd(⌘) key or alt(⌥) key but note that you could also have to push fn key if you don't use standard f1 f2 etc keys.

Et voilà : )
Reply


Forum Jump: