pop-os / launcher

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

feat: add a toolkit crate for both client and pop-launcher-bin #111

Closed oknozor closed 2 years ago

oknozor commented 2 years ago

This PR add the crate pop-launcher-toolkit which mostly reexport types needed to write a pop-launcher client and allow to add global features.

Motivation

Using only the pop-launcher bring just the minimal set of features required to build a client. Unfortunately this is not enough to implement some features. Cosmic-launcher make use of both the pop-launcher and the pop-launcher-service crates, onagre use them all.

Since most client and plugin implementations will use more than the pop-launcher crate we might as well expose everything in a wrapper crate. It make things much easier for the developer and documentation is available in one place.

Changes

  1. Most of the configs related struct and utility functions are now public I am using this in onagre to get the plugin regex and highlight the search input that trigger the plugin activation. This unlock many cllient side features (switching between plugins with tab, displaying the icons before querying pop-launcher, dynamic plugin menu, a plugin config editor etc..).

  2. Added a "clone" feature This is a bit selfish but iced has some trait that requires Clone to send stuffs between threads, I guess other GUI libs have similar requirements. It's a pain to wrap everything in unit structs just to manually implement clone.

Dependecy graph (pop-launcher-bin)

image

Let me know what you think.