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 }
12
12
13
13
#
14
14
# cli usage:
15
- # - cargo run --bin rs-eth-scanner -- scan "http://abc.url" "0xxxxx" "deposit" "100"
15
+ # - cargo run -- --bin run2
16
16
#
17
17
[[bin ]]
18
18
name = " run2"
@@ -21,3 +21,8 @@ path = "src/run2.rs"
21
21
[[bin ]]
22
22
name = " run3"
23
23
path = " 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