mirror of
https://github.com/JakeStanger/ironbar.git
synced 2024-11-24 00:27:41 +03:00
Merge pull request #210 from christoph00/XDG_DATA_DIRS
Find Additional Applications dirs in XDG_DATA_DIR
This commit is contained in:
commit
f8d8c06300
@ -1,5 +1,6 @@
|
||||
use lazy_static::lazy_static;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Mutex;
|
||||
@ -27,6 +28,14 @@ fn find_application_dirs() -> Vec<PathBuf> {
|
||||
PathBuf::from("/var/lib/flatpak/exports/share/applications"), // flatpak apps
|
||||
];
|
||||
|
||||
let xdg_dirs = env::var_os("XDG_DATA_DIRS");
|
||||
if let Some(xdg_dirs) = xdg_dirs {
|
||||
for mut xdg_dir in env::split_paths(&xdg_dirs).map(PathBuf::from) {
|
||||
xdg_dir.push("applications");
|
||||
dirs.push(xdg_dir);
|
||||
}
|
||||
}
|
||||
|
||||
let user_dir = dirs::data_local_dir(); // user installed apps
|
||||
if let Some(mut user_dir) = user_dir {
|
||||
user_dir.push("applications");
|
||||
|
Loading…
Reference in New Issue
Block a user