Skip to content

Commit a679e67

Browse files
committed
update
1 parent 40ffa84 commit a679e67

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

crates/rs-os/rs-cross/try-notify/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ chrono = { version = "0.4", optional = true }
1212

1313
#
1414
# cli usage:
15-
# - cargo run --bin rs-eth-scanner -- scan "http://abc.url" "0xxxxx" "deposit" "100"
15+
# - cargo run -- --bin run2
1616
#
1717
[[bin]]
1818
name = "run2"
@@ -21,3 +21,8 @@ path = "src/run2.rs"
2121
[[bin]]
2222
name = "run3"
2323
path = "src/run3.rs"
24+
25+
# sound
26+
[[bin]]
27+
name = "run4"
28+
path = "src/run4.rs"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![allow(unused_must_use)]
2+
3+
use notify_rust::Notification;
4+
5+
#[cfg(target_os = "macos")]
6+
static SOUND: &str = "Submarine";
7+
8+
#[cfg(all(unix, not(target_os = "macos")))]
9+
static SOUND: &str = "message-new-instant";
10+
11+
#[cfg(target_os = "windows")]
12+
static SOUND: &str = "Mail";
13+
14+
fn main() {
15+
Notification::new()
16+
.summary("notification with sound")
17+
.sound_name(SOUND)
18+
.show()
19+
.unwrap();
20+
}

0 commit comments

Comments
 (0)