improv: desktop entries update

This commit is contained in:
wiiznokes 2024-07-13 01:13:17 +02:00 • committed by GitHub
parent ab7a71a057
commit 172532056b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 559 additions and 663 deletions

View file

@ -2,34 +2,33 @@
name = "pop-launcher-service"
version= "1.2.3"
license = "MPL-2.0"
edition = "2018"
edition.workspace = true
[dependencies]
anyhow = "1.0.82"
anyhow.workspace = true
async-oneshot = "0.5.9"
async-trait = "0.1.80"
dirs = "5.0.1"
futures = "0.3.30"
dirs.workspace = true
futures.workspace = true
futures_codec = "0.4.1"
gen-z = "0.1.0"
num_cpus = "1.16.0"
pop-launcher = { path = "../" }
regex = "1.10.4"
ron = "0.8.1"
serde = { version = "1.0.198", features = ["derive"] }
serde_json = "1.0.116"
regex.workspace = true
ron.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with = "3.7.0"
slab = "0.4.9"
strsim = "0.11.1"
toml = "0.8.12"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["std", "fmt", "env-filter"] }
flume = "0.11.0"
toml.workspace = true
tracing.workspace = true
flume.workspace = true
[dependencies.tokio]
version= "1.37.0"
workspace = true
features = ["io-std", "process", "rt"]
[dependencies.tokio-stream]
version= "0.1.15"
workspace = true
features = ["io-util"]

View file

@ -225,7 +225,6 @@ impl<O: futures::Sink<Response> + Unpin> Service<O> {
})
.await;
}
// Report the plugin as finished and remove it from future polling
PluginResponse::Deactivate => {
self.finished(plugin).await;

View file

@ -91,7 +91,7 @@ impl Default for PluginPriority {
}
pub fn load(source: &Path, config_path: &Path) -> Option<(PathBuf, PluginConfig, Option<Regex>)> {
if let Ok(config_bytes) = std::fs::read_to_string(&config_path) {
if let Ok(config_bytes) = std::fs::read_to_string(config_path) {
let config = match ron::from_str::<PluginConfig>(&config_bytes) {
Ok(config) => config,
Err(why) => {
@ -114,11 +114,7 @@ pub fn load(source: &Path, config_path: &Path) -> Option<(PathBuf, PluginConfig,
return None;
};
let regex = config
.query
.regex
.as_ref()
.and_then(|p| Regex::new(&*p).ok());
let regex = config.query.regex.as_ref().and_then(|p| Regex::new(p).ok());
return Some((exec, config, regex));
}

View file

@ -110,10 +110,9 @@ impl ExternalPlugin {
futures::pin_mut!(responder);
futures::pin_mut!(trip);
let _ = futures::future::select(responder, trip)
futures::future::select(responder, trip)
.await
.factor_first()
.0;
.factor_first();
// Ensure that a task that was searching sends a finished signal if it dies.
if searching.swap(false, Ordering::SeqCst) {
@ -161,7 +160,7 @@ impl ExternalPlugin {
if let Some(stdin) = child.stdin.as_mut() {
if let Ok(mut serialized) = serde_json::to_vec(event) {
serialized.push(b'\n');
let _ = stdin.write_all(&serialized).await?;
stdin.write_all(&serialized).await?;
tracing::debug!("{}: sent message to external process", self.name());
}

View file

@ -5,8 +5,6 @@ pub mod config;
pub(crate) mod external;
pub mod help;
pub use external::load;
pub use self::config::{PluginConfig, PluginPriority, PluginQuery};
pub use self::external::ExternalPlugin;
pub use self::help::HelpPlugin;

View file

@ -48,7 +48,9 @@ impl PartialEq for Priority {
impl Eq for Priority {}
impl PartialOrd for Priority {
#[allow(clippy::non_canonical_partial_ord_impl)]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
// todo: what is going on here ?
(
other.plugin_priority,
self.compute_value(other),