I was unsatisfed with all the music players for Android, as none of them had the flexability of the mpc, mpd, and ncmpcpp workflow.

So I started using that on Termux, then I was bored, and found out about the termux-notification command. Setting that script was pretty stright forward. Do keep in mind that this does require the termux-api app.

There are two notifications types “default” and “media”. Default gives you 3 button which you could customize the text and function of. Media givesbyou those 4 media buttons, and i think it interacts with Android’s media shenanigans.

Anyway, I needed more than 4 buttons, so I thought of the following features: if you press pasue/play while the mpd is already paused/playing you’ll get another notification with an alt menu. Sadly I couldn’t implement it correctly, as switching between the notifications kept spawning instances of “mpc current –wait” that I didn’t know how to get rid of. So that remains a project for later.

Other cool shit you can do with termux-api:

  • Turn the phone’s torch on and off.
  • Get data from phone sensors (i think there’s a sensor for when headphones are plugged in/off which would be useful for me).

Todo:

  • Implement the alt menu, to give me options such as adding artists, albums, playists and stuff. I thunk i’ll just go with shell command execution. If you use the “$REPLY” variable in your notification actions, you can enter arbitraty text and process it in termux.
  • Upload this thing to codeberg lol.

#tech, #termux, #music, #musicmanagement, #musicdatabase, #mpd, #musicplayerdaemon, #android