App launcher

[skip ci]
This commit is contained in:
Aleksander
2025-12-23 19:17:51 +01:00
parent 1b4c2a9006
commit 2d40b8ac00
18 changed files with 400 additions and 84 deletions

View File

@@ -3,6 +3,7 @@ use gtk::traits::IconThemeExt;
use serde::{Deserialize, Serialize};
// compatibility with wayvr-ipc
// TODO: remove this after we're done with the old wayvr-dashboard and use DesktopEntry instead
#[derive(Debug, Deserialize, Serialize)]
pub struct DesktopFile {
pub name: String,
@@ -13,7 +14,6 @@ pub struct DesktopFile {
}
#[derive(Debug, Clone)]
#[allow(dead_code)] // TODO: remove this
pub struct DesktopEntry {
pub exec_path: String,
pub exec_args: Vec<String>,
@@ -140,3 +140,15 @@ pub fn find_entries() -> anyhow::Result<Vec<DesktopEntry>> {
Ok(res)
}
impl DesktopEntry {
pub fn to_desktop_file(&self) -> DesktopFile {
DesktopFile {
categories: self.categories.clone(),
exec_args: self.exec_args.clone(),
exec_path: self.exec_path.clone(),
icon: self.icon_path.clone(),
name: self.app_name.clone(),
}
}
}