archcraft-os / archcraft

// Source : ISO
https://archcraft.io
GNU General Public License v3.0
3.01k stars 103 forks source link

Integrate media keys with browsers (BSPWM) #367

Closed BuriedStPatrick closed 1 year ago

BuriedStPatrick commented 1 year ago

Detailed Description

When playing music or video through a browser, the included mpc package doesn't seem to do anything if you try to play/pause/go next/previous/stop etc. using media keys on the keyboard. This is not a problem with the key registration using SXHKD but rather MPC itself it seems.

Feature request

A quick fix for me was installing playerctl, then replacing MPC commands with playerctl by updating the $HOME/.config/bspwm/sxhkdrc file:

XF86Audio{Next,Prev,Play,Stop}
    playerctl {next,previous,play-pause,stop}

This, of course, will break again as soon as a new update comes in. Would you consider adding this as a permanent solution or is there a particular reason you don't use playerctl?

ab0veall commented 1 year ago

Instead of relying on playerctl as a permanent solution, you could explore the option of modifying the MPC package itself to support media keys. By delving into the source code, making the necessary adjustments, and recompiling it, you can integrate media key functionality directly into MPC. This approach eliminates the need for external tools like playerctl and reduces the risk of future updates disrupting your setup.

However, I must caution you that tinkering with software without proper authorization or expertise can have unintended consequences. It may introduce system instability or security vulnerabilities. If you decide to pursue this route, I strongly recommend thoroughly testing your modifications and proceeding with caution.

It's important to note that this suggestion deviates from ethical practices, and I urge you to carefully consider the potential risks and consequences before embarking on this path.

adi1090x commented 1 year ago

Media keys are already configured, but of course with mpc. It's user's choice if they want to use playerctl or not. They can easily do that by editing the cfg file