Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit fd58ef6

Browse files
committed
fixd 2
1 parent 94fdc92 commit fd58ef6

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Diff for: src/server.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ impl From<zbus::Error> for ClientSetupError {
3535
}
3636

3737
pub async fn server(containers: Vec<(String, ContainerType)>) -> Result<(), ServerError> {
38-
let to_path =
39-
Path::new(&env::var("HOME").unwrap()).join(Path::new(".cache/container-desktop-entries/"));
38+
let home = match env::var("RUNTIME_DIRECTORY") {
39+
Ok(h) => h,
40+
Err(_) => {
41+
log::error!("RUNTIME_DIRECTORY NOT FOUND. Make sure you're using the service!");
42+
panic!()
43+
}
44+
};
45+
let to_path = Path::new(&home).join(Path::new(".cache/container-desktop-entries/"));
4046
for (container_name, container_type) in containers {
4147
if container_type.not_supported() {
4248
log::error!(
@@ -209,9 +215,9 @@ async fn set_up_client(
209215
}
210216
}
211217
}
212-
// let _ = fs::remove_dir_all(&to_path.join("applications"));
213-
// let _ = fs::remove_dir_all(&to_path.join("icons"));
214-
// let _ = fs::remove_dir_all(&to_path.join("pixmaps"));
218+
let _ = fs::remove_dir_all(&to_path.join("applications"));
219+
let _ = fs::remove_dir_all(&to_path.join("icons"));
220+
let _ = fs::remove_dir_all(&to_path.join("pixmaps"));
215221
Ok(())
216222
}
217223

Diff for: systemd/container-desktop-entries.service

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ After=desktop-entry-daemon.service
77
Type=simple
88
Environment="RUST_LOG=debug"
99
ExecStart=container-desktop-entries
10+
RuntimeDirectory=container-desktop-entries
1011
Slice=session.slice
1112

1213
[Install]

0 commit comments

Comments
 (0)