feat(service): prefer recently/often used applications in search

This commit is contained in:
Thomas Ruprecht 2022-11-01 22:41:23 +01:00 committed by GitHub
parent f382690b28
commit 4eef0caae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 225 additions and 25 deletions

View file

@ -110,6 +110,15 @@ pub struct PluginSearchResult {
pub window: Option<(Generation, Indice)>,
}
impl PluginSearchResult {
pub fn cache_identifier(&self) -> Option<String> {
// the exec field may clash in multiple search results as the arguments
// are cut from the string
// self.exec.to_owned().unwrap_or_else(|| self.name.to_owned())
self.exec.as_ref().map(|_| self.name.to_owned())
}
}
// Sent to the input pipe of the launcher service, and disseminated to its plugins.
#[derive(Debug, Deserialize, Serialize, Clone)]
pub enum Request {