Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
luxluth committed Dec 14, 2024
1 parent 5f4a2c2 commit 899c7a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use freedesktop_desktop_entry::{get_languages_from_env, DesktopEntry};
use std::process::Command;
use std::{path::PathBuf, process::Command};
use tracing::debug;

#[derive(Debug, Clone)]
Expand All @@ -9,6 +9,7 @@ pub struct AppEntry {
pub icon: String,
pub name: String,
pub description: String,
pub _path: PathBuf,
}

const PATTERNS: [&str; 13] = [
Expand Down Expand Up @@ -45,7 +46,7 @@ pub fn collect_apps() -> Vec<AppEntry> {
freedesktop_desktop_entry::Iter::new(freedesktop_desktop_entry::default_paths())
.into_iter()
.filter_map(|p| {
if let Ok(entry) = DesktopEntry::from_path(p, Some(&locales)) {
if let Ok(entry) = DesktopEntry::from_path(p.clone(), Some(&locales)) {
return Some(AppEntry {
exec: entry.exec().unwrap_or_default().to_string(),
need_terminal: entry.terminal(),
Expand All @@ -55,6 +56,7 @@ pub fn collect_apps() -> Vec<AppEntry> {
.to_string(),
name: entry.name(&locales).unwrap_or_default().to_string(),
description: entry.comment(&locales).unwrap_or_default().to_string(),
_path: p,
});
}

Expand Down

0 comments on commit 899c7a1

Please sign in to comment.