-
Notifications
You must be signed in to change notification settings - Fork 2
/
button.rs
27 lines (26 loc) · 1 KB
/
button.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use win_toast_notify::{WinToastNotify, Action, ActivationType};
fn main() {
WinToastNotify::new()
.set_actions(vec![
Action {
activation_type: ActivationType::Protocol,
action_content: "Url".to_string(),
arguments: "https://www.google.com/".to_string(),
image_url: None
},
Action {
activation_type: ActivationType::Protocol,
action_content: "File".to_string(),
arguments: r"C:\Windows\Web\Screen\img104.jpg".to_string(),
image_url: None
},
Action {
activation_type: ActivationType::Protocol,
action_content: "Folder".to_string(),
arguments: r"$env:USERPROFILE\Downloads".to_string(), // PowerShell supports using environment variables
image_url: None
}
])
.show()
.expect("Failed to show toast notification");
}