2

I run AIMP audio player with wine and can not use special multimedia keys like play/pause, next/prev.

IS there any way to make them work with wine?

For example: Fn+F9, Fn+f10, Fn+F8...

CodeGust
  • 141
  • 6

1 Answers1

1

With KDE 5, you can open the settings panel of kde systemsettings5 then under Shortcuts select Custom Shortcuts, right click on the panel of the the middle where the shortcuts are listed and select New > Global Shortcut > Command/URL keep the new entry checked (active) on the right panel select Trigger pane then click None then press the key you want to assign to let say pause then under Action pane put the following in the box then click apply to save the settings.

/usr/bin/wine "C:\\Program Files (x86)\\AIMP\\AIMP.exe" /next

Adapt the path if you use different location for wine or AIMP.exe

Repeat the operation for the rest of the actions, here are the proper commands

/usr/bin/wine "C:\\Program Files (x86)\\AIMP\\AIMP.exe" /play
/usr/bin/wine "C:\\Program Files (x86)\\AIMP\\AIMP.exe" /pause
/usr/bin/wine "C:\\Program Files (x86)\\AIMP\\AIMP.exe" /prev
/usr/bin/wine "C:\\Program Files (x86)\\AIMP\\AIMP.exe" /stop

Here is a video demonstrating how to add custom shortcuts in KDE

You may experience a little delay because of how the app is instructed to pause/play etc... but this should not be a big issue.

Shortcuts can be customized on the AIMP app itself but it will only work when the app is active.

Note that if you assign your true media key to this purpose they won't work anymore on linux native applications or you can make them work on both by executing 2 commands separated by ; or you can execute a script that check if AIMP is running and do the proper action from there.

intika
  • 13,920
  • 7
  • 41
  • 79
  • 1
    Thank you! that works great. Too bad if a wine app can't react to native global media shotcuts. I noticed that when gwenview and VLC both opened the priority goes to VLC and if VLC isn't opened, then for some reason gewnview slideshow starts (even though there are no shortcut for it anywhere). Would be nice if I could add wine to the list of media-keys listeners. – CodeGust Nov 11 '19 at 13:59
  • I'm struggling to make the true media keys work for both the wine application and still working under regular linux applications. any hints on how you do this? what would I need to call as a second command? – skjerns Mar 02 '23 at 19:12