Skip to content

Commit

Permalink
fixd 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanabx committed Apr 18, 2024
1 parent 94fdc92 commit fd58ef6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ impl From<zbus::Error> for ClientSetupError {
}

pub async fn server(containers: Vec<(String, ContainerType)>) -> Result<(), ServerError> {
let to_path =
Path::new(&env::var("HOME").unwrap()).join(Path::new(".cache/container-desktop-entries/"));
let home = match env::var("RUNTIME_DIRECTORY") {
Ok(h) => h,
Err(_) => {
log::error!("RUNTIME_DIRECTORY NOT FOUND. Make sure you're using the service!");
panic!()
}
};
let to_path = Path::new(&home).join(Path::new(".cache/container-desktop-entries/"));
for (container_name, container_type) in containers {
if container_type.not_supported() {
log::error!(
Expand Down Expand Up @@ -209,9 +215,9 @@ async fn set_up_client(
}
}
}
// let _ = fs::remove_dir_all(&to_path.join("applications"));
// let _ = fs::remove_dir_all(&to_path.join("icons"));
// let _ = fs::remove_dir_all(&to_path.join("pixmaps"));
let _ = fs::remove_dir_all(&to_path.join("applications"));
let _ = fs::remove_dir_all(&to_path.join("icons"));
let _ = fs::remove_dir_all(&to_path.join("pixmaps"));
Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions systemd/container-desktop-entries.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ After=desktop-entry-daemon.service
Type=simple
Environment="RUST_LOG=debug"
ExecStart=container-desktop-entries
RuntimeDirectory=container-desktop-entries
Slice=session.slice

[Install]
Expand Down

0 comments on commit fd58ef6

Please sign in to comment.