Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hhstore committed Mar 27, 2024
1 parent 40ffa84 commit a679e67
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/rs-os/rs-cross/try-notify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chrono = { version = "0.4", optional = true }

#
# cli usage:
# - cargo run --bin rs-eth-scanner -- scan "http://abc.url" "0xxxxx" "deposit" "100"
# - cargo run -- --bin run2
#
[[bin]]
name = "run2"
Expand All @@ -21,3 +21,8 @@ path = "src/run2.rs"
[[bin]]
name = "run3"
path = "src/run3.rs"

# sound
[[bin]]
name = "run4"
path = "src/run4.rs"
20 changes: 20 additions & 0 deletions crates/rs-os/rs-cross/try-notify/src/run4.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#![allow(unused_must_use)]

use notify_rust::Notification;

#[cfg(target_os = "macos")]
static SOUND: &str = "Submarine";

#[cfg(all(unix, not(target_os = "macos")))]
static SOUND: &str = "message-new-instant";

#[cfg(target_os = "windows")]
static SOUND: &str = "Mail";

fn main() {
Notification::new()
.summary("notification with sound")
.sound_name(SOUND)
.show()
.unwrap();
}

0 comments on commit a679e67

Please sign in to comment.