-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
491 additions
and
14 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use anyhow::Result; | ||
use ashpd::desktop::background::Background; | ||
|
||
pub async fn set_autostart(autostart: bool, params: Vec<String>) -> Result<()> { | ||
let request = Background::request() | ||
.command(params) | ||
.auto_start(autostart); | ||
|
||
match request.send().await.and_then(|r| r.response()) { | ||
Ok(response) => { | ||
println!("enable autostart response {:?}", response); | ||
return Ok(()); | ||
} | ||
Err(err) => { | ||
println!("error enabling autostart {}", err); | ||
return Err(anyhow::anyhow!( | ||
"error enabling autostart {}", | ||
err | ||
)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[cfg_attr(target_os = "linux", path = "linux.rs")] | ||
#[cfg_attr(target_os = "windows", path = "unimplemented.rs")] | ||
#[cfg_attr(target_os = "macos", path = "unimplemented.rs")] | ||
mod autostart; | ||
pub use autostart::*; |
3 changes: 3 additions & 0 deletions
3
apps/desktop/desktop_native/core/src/autostart/unimplemented.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub async fn set_autostart(autostart: bool, params: Vec<String>) -> Result<()> { | ||
unimplemented!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters