notifications - use notify-send

This commit is contained in:
Gregory 2020-06-10 15:21:37 -04:00
parent 91edc11572
commit d8ef67c12f
No known key found for this signature in database
GPG key ID: 2E44FAEEDC94B1E2
4 changed files with 35 additions and 252 deletions

277
Cargo.lock generated
View file

@ -56,12 +56,6 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42"
[[package]]
name = "bitflags"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
[[package]]
name = "bitflags"
version = "1.2.1"
@ -79,12 +73,6 @@ dependencies = [
"constant_time_eq",
]
[[package]]
name = "block"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
[[package]]
name = "block-buffer"
version = "0.7.3"
@ -142,17 +130,6 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"
[[package]]
name = "chrono"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2"
dependencies = [
"num-integer",
"num-traits",
"time",
]
[[package]]
name = "clap"
version = "3.0.0-beta.1"
@ -160,7 +137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "860643c53f980f0d38a5e25dfab6c3c93b2cb3aa1fe192643d17a293c6c41936"
dependencies = [
"atty",
"bitflags 1.2.1",
"bitflags",
"clap_derive",
"indexmap",
"lazy_static",
@ -181,8 +158,8 @@ dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -229,16 +206,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "dbus"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b17a12ffaff26515889b006fc029493a3e340366a137c13cec2cdd545ea3b8"
dependencies = [
"libc",
"libdbus-sys",
]
[[package]]
name = "digest"
version = "0.8.1"
@ -258,17 +225,6 @@ dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
dependencies = [
"libc",
"redox_users",
"winapi 0.3.8",
]
[[package]]
name = "dirs"
version = "2.0.2"
@ -344,7 +300,7 @@ version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
dependencies = [
"bitflags 1.2.1",
"bitflags",
"fuchsia-zircon-sys",
]
@ -450,7 +406,6 @@ dependencies = [
"json",
"mime",
"mime-db",
"notify-rust",
"once_cell",
"pest",
"pest_derive",
@ -627,7 +582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86d66d380c9c5a685aaac7a11818bdfa1f733198dfd9ec09c70b762cd12ad6f"
dependencies = [
"arrayvec 0.4.12",
"bitflags 1.2.1",
"bitflags",
"cfg-if",
"rustc_version",
"ryu",
@ -640,15 +595,6 @@ version = "0.2.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
[[package]]
name = "libdbus-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc12a3bc971424edbbf7edaf6e5740483444db63aa8e23d3751ff12a30f306f0"
dependencies = [
"pkg-config",
]
[[package]]
name = "log"
version = "0.4.8"
@ -658,27 +604,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "mac-notification-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dfb6b71a9a89cd38b395d994214297447e8e63b1ba5708a9a2b0b1048ceda76"
dependencies = [
"cc",
"chrono",
"dirs 1.0.5",
"objc-foundation",
]
[[package]]
name = "malloc_buf"
version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
dependencies = [
"libc",
]
[[package]]
name = "maplit"
version = "1.0.2"
@ -802,36 +727,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "notify-rust"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "144acee6a0543dc74893e4b8a33936b5b0a94cc2d4ab024afd0c6daff7afc3c0"
dependencies = [
"dbus",
"mac-notification-sys",
"winrt-notification",
]
[[package]]
name = "num-integer"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.13.0"
@ -842,35 +737,6 @@ dependencies = [
"libc",
]
[[package]]
name = "objc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
dependencies = [
"malloc_buf",
]
[[package]]
name = "objc-foundation"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
dependencies = [
"block",
"objc",
"objc_id",
]
[[package]]
name = "objc_id"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
dependencies = [
"objc",
]
[[package]]
name = "once_cell"
version = "1.4.0"
@ -889,7 +755,7 @@ version = "0.10.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd"
dependencies = [
"bitflags 1.2.1",
"bitflags",
"cfg-if",
"foreign-types",
"lazy_static",
@ -956,8 +822,8 @@ dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -987,8 +853,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10b4b44893d3c370407a1d6a5cfde7c41ae0478e31c516c85f67eb3adc51be6d"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -1023,8 +889,8 @@ checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
"version_check",
]
@ -1035,8 +901,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
"syn-mid",
"version_check",
]
@ -1047,15 +913,9 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
dependencies = [
"unicode-xid 0.2.0",
"unicode-xid",
]
[[package]]
name = "quote"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
[[package]]
name = "quote"
version = "1.0.7"
@ -1225,7 +1085,7 @@ version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535"
dependencies = [
"bitflags 1.2.1",
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
@ -1273,8 +1133,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -1354,33 +1214,6 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strum"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca6e4730f517e041e547ffe23d29daab8de6b73af4b6ae2a002108169f5e7da"
[[package]]
name = "strum_macros"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3384590878eb0cab3b128e844412e2d010821e7e091211b9d87324173ada7db8"
dependencies = [
"quote 0.3.15",
"syn 0.11.11",
]
[[package]]
name = "syn"
version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
dependencies = [
"quote 0.3.15",
"synom",
"unicode-xid 0.0.4",
]
[[package]]
name = "syn"
version = "1.0.31"
@ -1388,8 +1221,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"unicode-xid 0.2.0",
"quote",
"unicode-xid",
]
[[package]]
@ -1399,17 +1232,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
name = "synom"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
dependencies = [
"unicode-xid 0.0.4",
"quote",
"syn",
]
[[package]]
@ -1460,8 +1284,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -1500,8 +1324,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
]
[[package]]
@ -1600,12 +1424,6 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
[[package]]
name = "unicode-xid"
version = "0.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
[[package]]
name = "unicode-xid"
version = "0.2.0"
@ -1679,8 +1497,8 @@ dependencies = [
"lazy_static",
"log",
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
"wasm-bindgen-shared",
]
@ -1702,7 +1520,7 @@ version = "0.2.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3"
dependencies = [
"quote 1.0.7",
"quote",
"wasm-bindgen-macro-support",
]
@ -1713,8 +1531,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92"
dependencies = [
"proc-macro2",
"quote 1.0.7",
"syn 1.0.31",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -1787,28 +1605,6 @@ dependencies = [
"winapi 0.3.8",
]
[[package]]
name = "winrt"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e30cba82e22b083dc5a422c2ee77e20dc7927271a0dc981360c57c1453cb48d"
dependencies = [
"winapi 0.3.8",
]
[[package]]
name = "winrt-notification"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c31a65da50d792c6f9bd2e3216249566c4fb1d2d34f9b7d2d66d2e93f62a242"
dependencies = [
"strum",
"strum_macros",
"winapi 0.3.8",
"winrt",
"xml-rs",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
@ -1831,18 +1627,9 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "362780d5ed4fcb81db6460966be8cd691e48419caa84bb8a81063d2abdab7082"
dependencies = [
"dirs 2.0.2",
"dirs",
"glob",
"mime",
"nom",
"unicase",
]
[[package]]
name = "xml-rs"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1945e12e16b951721d7976520b0832496ef79c31602c7a29d950de79ba74621"
dependencies = [
"bitflags 0.9.1",
]

View file

@ -22,7 +22,6 @@ once_cell = "1.4.0"
regex = { version = "1.3.9", default-features = false, features = ["std"] }
mime-db = "0.1.5"
atty = "0.2.14"
notify-rust = "4.0.0"
confy = "0.4.0"
serde = "1.0.111"
xdg-mime = "0.3.0"

View file

@ -7,8 +7,6 @@ pub enum Error {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Notify(#[from] notify_rust::error::Error),
#[error(transparent)]
Xdg(#[from] xdg::BaseDirectoriesError),
#[error(transparent)]
Config(#[from] confy::ConfyError),

View file

@ -56,10 +56,9 @@ fn main() -> Result<()> {
match (res, atty::is(atty::Stream::Stdout)) {
(Err(e), true) => eprintln!("{}", e),
(Err(e), false) => {
notify_rust::Notification::new()
.summary("handlr error")
.body(&e.to_string())
.show()?;
std::process::Command::new("notify-send")
.args(&["handlr error", &e.to_string()])
.spawn()?;
}
_ => {}
};