Our great sponsors
-
playerctl
🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Without knowing what your distribution or at least DE is, I can only recommend actkbd (or, if you know how to program, interception tools)
Now on to what to run when actkbd receives the keycode. On Linux, your music players are controlled with an interface called MPRIS. It's described here: https://specifications.freedesktop.org/mpris-spec/latest/ and there's a simple CLI implementation called playerctl. To use it from actkbd, you will have to connect to your user's session bus, most likely with something like machinectl shell --uid=YOUR_USER -- playerctl pause .