mirror of https://github.com/MedzikUser/imgurs
add clipboard
This commit is contained in:
parent
86397d5e23
commit
39f1debdd2
|
@ -2,5 +2,3 @@
|
||||||
# will have compiled files and executables
|
# will have compiled files and executables
|
||||||
/debug
|
/debug
|
||||||
/target
|
/target
|
||||||
|
|
||||||
Cargo.lock
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,6 +31,7 @@ clap_complete = "3.0.5"
|
||||||
anyhow = "1.0.53"
|
anyhow = "1.0.53"
|
||||||
better-panic = "0.3.0"
|
better-panic = "0.3.0"
|
||||||
validator = "0.14.0"
|
validator = "0.14.0"
|
||||||
|
arboard = "2.0.1"
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
version = "3.0.13"
|
version = "3.0.13"
|
||||||
|
|
|
@ -11,6 +11,7 @@ use chrono::{prelude::DateTime, Utc};
|
||||||
use log::info;
|
use log::info;
|
||||||
use notify_rust::Notification;
|
use notify_rust::Notification;
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
use arboard::Clipboard;
|
||||||
|
|
||||||
pub fn print_image_info(i: ImageInfo, notify: bool) {
|
pub fn print_image_info(i: ImageInfo, notify: bool) {
|
||||||
let d = UNIX_EPOCH + Duration::from_secs(i.data.datetime.try_into().unwrap());
|
let d = UNIX_EPOCH + Duration::from_secs(i.data.datetime.try_into().unwrap());
|
||||||
|
@ -54,5 +55,8 @@ pub fn print_image_info(i: ImageInfo, notify: bool) {
|
||||||
.body(&format!("Uploaded {}", i.data.link))
|
.body(&format!("Uploaded {}", i.data.link))
|
||||||
.show()
|
.show()
|
||||||
.expect("send notification");
|
.expect("send notification");
|
||||||
|
|
||||||
|
let mut clipboard = Clipboard::new().unwrap();
|
||||||
|
clipboard.set_text(i.data.link.into()).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue