pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
228 stars 45 forks source link

Introduce an optional "history" attribute in plugin config. #110

Closed oknozor closed 2 years ago

oknozor commented 2 years ago

Hello,

I am working on onagre these days, and I was wondering if you would accept adding an optional history attribute to plugin config. The idea is to indicate that the client must display user history for the plugin when the plugin gets activated but no request was send to pop-launcher yet.

Example :

config:

(
    name: "Desktop Entries",
    description: "Query applications by their .desktop entries",
    bin: (path: "desktop-entries"),
    icon: Name("new-window-symbolic"),
    history: true
)

When there is not user input the client should display history for the current plugin. It would be the client responsibility to store the history and launch these entries ( currently onagre just send and Search request followed by Acivate(0)).

image

Use pop-launcher response when it's available : image

Motivation

History is useful for some plugins like desktop-entry, web, terminal, calc, on the other hand, displaying a history for files, recent does not make sense.

This was already implemented in onagre but I am now trying to remove all the custom external command stuff and rely on exclusively pop-launcher plugins configuration.

Without this flag directly available in the plugin config I need to define some external configuration to get the desired behavior for a plugin. This means forcing the user to maintain a separate config and edit this whenever they install a new plugin.

I don't now I this would be useful for cosmic and other available client . Maybe you already handle this in a different way ?

Let me know if this would be ok for you and I'll send a PR.