File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
crates/rs-os/rs-cross/try-notify Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff 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 ]]
1818name = " run2"
@@ -21,3 +21,8 @@ path = "src/run2.rs"
2121[[bin ]]
2222name = " run3"
2323path = " src/run3.rs"
24+
25+ # sound
26+ [[bin ]]
27+ name = " run4"
28+ path = " src/run4.rs"
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments