Skip to content

Commit

Permalink
fix: directory handling was off
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanabx committed Apr 27, 2024
1 parent 640cd7b commit e3d2b6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion profile.d/desktop-entry-daemon.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# set XDG_DATA_DIRS to include desktop-entry-daemon installations
export XDG_DATA_DIRS
XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.cache/desktop-entry-daemon/:$XDG_RUNTIME_DIR/desktop-entry-daemon/session/:$XDG_RUNTIME_DIR/desktop-entry-daemon/proc/"
XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.cache/desktop-entry-daemon/:$XDG_RUNTIME_DIR/desktop-entry-daemon/session/:$XDG_RUNTIME_DIR/desktop-entry-daemon/process/"
12 changes: 4 additions & 8 deletions src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ fn app_exists(id: &str) -> bool {

pub fn get_dirs() -> (PathBuf, PathBuf, PathBuf, PathBuf) {
let home_str = env::var("HOME").unwrap();
let proc_dir_str = env::var("RUNTIME_DIRECTORY").unwrap_or(format!(
"/run/user/{}/desktop-entry-daemon/proc/",
let runtime_dir = env::var("RUNTIME_DIRECTORY").unwrap_or(format!(
"/run/user/{}/desktop-entry-daemon/",
env::var("UID").unwrap_or("1000".to_string())
));
let proc_dir = Path::new(&proc_dir_str);
let proc_dir = &Path::new(&runtime_dir).join("process");
if !proc_dir.exists() {
log::warn!(
"proc_dir {} does not exist! creating directory...",
Expand All @@ -53,11 +53,7 @@ pub fn get_dirs() -> (PathBuf, PathBuf, PathBuf, PathBuf) {
let _ = fs::create_dir(proc_dir.join(Path::new("applications")));
let _ = fs::create_dir(proc_dir.join(Path::new("icons")));

let session_dir_str = env::var("RUNTIME_DIRECTORY").unwrap_or(format!(
"/run/user/{}/desktop-entry-daemon/session/",
env::var("UID").unwrap_or("1000".to_string())
));
let session_dir = Path::new(&session_dir_str);
let session_dir = &Path::new(&runtime_dir).join("session");
if !session_dir.exists() {
log::warn!(
"session_dir {} does not exist! creating directory...",
Expand Down

0 comments on commit e3d2b6d

Please sign in to comment.