Skip to content

Commit

Permalink
fix: I do not know why filewatcher stop zbus
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 15, 2023
1 parent 5d7b586 commit a801cf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xdg-desktop-portal-luminous"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

[workspace]
Expand Down
22 changes: 15 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,26 @@ async fn main() -> anyhow::Result<()> {
.build()
.await?;

tokio::spawn(async move {
let Ok(home) = std::env::var("HOME") else {
return;
};
if let Ok(home) = std::env::var("HOME") {
let config_path = std::path::Path::new(home.as_str())
.join(".config")
.join("xdg-desktop-portal-luminous");
if let Err(e) = async_watch(config_path, conn).await {
tracing::info!("Maybe file is not exist, error: {e}");
if config_path.exists() && config_path.is_dir() {
tokio::spawn(async move {
let Ok(home) = std::env::var("HOME") else {
return;
};
let config_path = std::path::Path::new(home.as_str())
.join(".config")
.join("xdg-desktop-portal-luminous");
if let Err(e) = async_watch(config_path, conn).await {
tracing::info!("Maybe file is not exist, error: {e}");
}
});
}
});
};

pending::<()>().await;

Ok(())
}

0 comments on commit a801cf2

Please sign in to comment.