Plex-htpc script control?

Hi, I’m new to plex-htpc, and while it looks exactly like what I want out of a media player, I’m trying to get it hooked into my previous PlexMediaPlayer(?)-based set-up.

This is on Ubuntu 24.04, for the record.

Specifically, I’d like to control it through a series of shell scripts that I have hooked up to keyboard shortcuts: one to launch plex-htpc, and one to shut it down if it’s running. (For the latter, I’m potentially able to find the pid for the application and send a kill command to it, but I figure it would be worth checking if there’s a better way to go about it.)

Is there a way to invoke the plex-htpc command such that it shuts down a running instance of the application? Or: are there command-line options for plex-htpc at all?

Thanks!

[For clarity, the keyboard shortcuts are hooked up to buttons on my remote, such that “yellow button = start plex”, “green button = start steam”, “blue button = close plex or steam if either is running.” I’m not interested in changing this workflow if I don’t need to.]

Server Version#:
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

Look at Better Touch Tool.
Even if you don’t want to use it, you might be able to find the command syntax you’re looking for.