This repository was archived by the owner on Feb 16, 2025. It is now read-only.
File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,14 @@ impl From<zbus::Error> for ClientSetupError {
35
35
}
36
36
37
37
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/" ) ) ;
40
46
for ( container_name, container_type) in containers {
41
47
if container_type. not_supported ( ) {
42
48
log:: error!(
@@ -209,9 +215,9 @@ async fn set_up_client(
209
215
}
210
216
}
211
217
}
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" ) ) ;
215
221
Ok ( ( ) )
216
222
}
217
223
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ After=desktop-entry-daemon.service
7
7
Type =simple
8
8
Environment ="RUST_LOG=debug"
9
9
ExecStart =container-desktop-entries
10
+ RuntimeDirectory =container-desktop-entries
10
11
Slice =session.slice
11
12
12
13
[Install]
You can’t perform that action at this time.
0 commit comments