Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compare OnlyShowIn to XDG_CURRENT_DESKTOP #145

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,17 @@ pub fn menu_control_padding() -> Padding {
impl CosmicAppLibrary {
pub fn load_apps(&mut self) {
let locale = self.locale.as_deref();
let xdg_current_desktop = std::env::var("XDG_CURRENT_DESKTOP").ok();
self.all_entries = cosmic::desktop::load_applications_filtered(locale, |entry| {
entry.exec().is_some() && !entry.no_display()
entry.exec().is_some()
&& !entry.no_display()
&& xdg_current_desktop
.as_ref()
.zip(entry.only_show_in())
.map(|(xdg_current_desktop, only_show_in)| {
only_show_in.contains(xdg_current_desktop)
})
.unwrap_or(true)
})
.into_iter()
.map(Arc::new)
Expand Down
Loading