XanClic / krunner-mpd

A KRunner (DBus) module for controlling MPD
2 stars 0 forks source link

Add oneshot mode #3

Closed XanClic closed 6 years ago

XanClic commented 6 years ago

It’s probably the better idea to keep the service resident, but maybe it is easy enough to adjust the .desktop file so that the plugin is launched by krunner on every query and let the script itself exit once a response has been sent. (Originally suggested in issue #1.)

XanClic commented 6 years ago

I’m closing this issue after more deliberation. Being in one-shot mode would mean that every time a query is sent, the following would happen:

  1. krunner looks for the service, cannot find it
  2. krunner launches the service
  3. krunner waits for it to appear on D-Bus
  4. Meanwhile, the service starts up, parses configuration, connects to MPD, exports the D-Bus interface and enters its main loop, waiting for krunner’s request
  5. krunner sees the service appear, sends the query via D-Bus
  6. The service receives the request, submits a new one to MPD, receives the response, submits a response to krunner, then exits
  7. krunner receives the response and emits it

That is all a bit too much and it seems clear that this is not how things are supposed to work. It’s not like krunner can launch the script, pass the query through the command line and receive the respone over stdout; the whole D-Bus concept basically implies that the plugin process is supposed to stay resident.