From 1767bc2a9d1921ae09bad46cdfad6f3f13dfcb8b Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 5 Jul 2023 14:38:48 -0400 Subject: [PATCH] update notifications applet with clear button, and times --- Cargo.lock | 501 ++++++++++-------- cosmic-applet-notifications/Cargo.toml | 5 + cosmic-applet-notifications/i18n.toml | 4 + .../i18n/en/cosmic_applet_notifications.ftl | 3 + cosmic-applet-notifications/src/localize.rs | 47 ++ cosmic-applet-notifications/src/main.rs | 94 +++- 6 files changed, 411 insertions(+), 243 deletions(-) create mode 100644 cosmic-applet-notifications/i18n.toml create mode 100644 cosmic-applet-notifications/i18n/en/cosmic_applet_notifications.ftl create mode 100644 cosmic-applet-notifications/src/localize.rs diff --git a/Cargo.lock b/Cargo.lock index eefde4c5..2ff9ded7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "apply" @@ -163,9 +163,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ "concurrent-queue", "event-listener", @@ -181,7 +181,7 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand 1.9.0", + "fastrand", "futures-lite", "slab", ] @@ -253,7 +253,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -270,7 +270,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -419,7 +419,7 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand 1.9.0", + "fastrand", "futures-lite", "log", ] @@ -476,7 +476,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -793,11 +793,24 @@ dependencies = [ name = "cosmic-applet-notifications" version = "0.1.0" dependencies = [ + "anyhow", + "bytemuck", "cosmic-applet", + "cosmic-notifications-config", + "cosmic-notifications-util", "cosmic-time", - "icon-loader", + "i18n-embed", + "i18n-embed-fl", "libcosmic", - "nix 0.24.3", + "nix 0.26.2", + "ron", + "rust-embed", + "rust-embed-utils", + "sendfd", + "tokio", + "tracing", + "tracing-subscriber", + "zbus", ] [[package]] @@ -857,17 +870,17 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=e39748e#e39748e1312d74ab8b4c26f4813b858413500b59" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=f0cfe09#f0cfe0973376b31fba4a726a35633a8e39e9319e" dependencies = [ "cosmic-protocols", - "smithay-client-toolkit 0.17.0 (git+https://github.com/smithay/client-toolkit?rev=c9940f4)", + "smithay-client-toolkit 0.17.0", "wayland-client 0.30.2", ] [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -881,7 +894,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "quote", "syn 1.0.109", @@ -895,11 +908,29 @@ dependencies = [ "bitflags 1.3.2", "derive_builder", "procfs", - "time 0.3.23", + "time 0.3.22", "zbus", "zvariant", ] +[[package]] +name = "cosmic-notifications-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-notifications#46eac27342f11b46fa2b3f25cd9b0d22bbc34eae" +dependencies = [ + "cosmic-config", + "serde", +] + +[[package]] +name = "cosmic-notifications-util" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-notifications#46eac27342f11b46fa2b3f25cd9b0d22bbc34eae" +dependencies = [ + "bytemuck", + "serde", +] + [[package]] name = "cosmic-panel-button" version = "0.1.0" @@ -926,12 +957,12 @@ dependencies = [ [[package]] name = "cosmic-protocols" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=e39748e#e39748e1312d74ab8b4c26f4813b858413500b59" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=f0cfe09#f0cfe0973376b31fba4a726a35633a8e39e9319e" dependencies = [ "bitflags 1.3.2", "wayland-backend", "wayland-client 0.30.2", - "wayland-protocols 0.30.1", + "wayland-protocols 0.30.0", "wayland-scanner 0.30.1", "wayland-server", ] @@ -958,7 +989,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "anyhow", "cosmic-config", @@ -1115,12 +1146,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.1", + "darling_macro 0.20.1", ] [[package]] @@ -1139,16 +1170,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -1164,23 +1195,23 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.1", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] name = "dashmap" -version = "5.5.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" +checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.12.3", "lock_api", "once_cell", "parking_lot_core 0.9.8", @@ -1273,10 +1304,10 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d" dependencies = [ - "darling 0.20.3", + "darling 0.20.1", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -1356,7 +1387,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -1415,7 +1446,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -1446,9 +1477,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" [[package]] name = "errno" @@ -1498,9 +1529,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "exr" -version = "1.7.0" +version = "1.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e481eb11a482815d3e9d618db8c42a93207134662873809335a92327440c18" +checksum = "85a7b44a196573e272e0cf0bcf130281c71e9a0c67062954b3323fd364bfdac9" dependencies = [ "bit_field", "flume", @@ -1527,12 +1558,6 @@ dependencies = [ "instant", ] -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - [[package]] name = "fdeflate" version = "0.3.0" @@ -1791,7 +1816,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand 1.9.0", + "fastrand", "futures-core", "futures-io", "memchr", @@ -1808,7 +1833,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -1965,9 +1990,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.12.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762" dependencies = [ "js-sys", "slotmap", @@ -2174,7 +2199,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "toml 0.7.6", + "toml 0.7.5", "unic-langid", ] @@ -2217,7 +2242,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.26", + "syn 2.0.23", "unic-langid", ] @@ -2260,7 +2285,7 @@ dependencies = [ [[package]] name = "iced" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "iced_accessibility", "iced_core", @@ -2275,7 +2300,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "accesskit", "accesskit_unix", @@ -2284,14 +2309,14 @@ dependencies = [ [[package]] name = "iced_core" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "bitflags 1.3.2", "iced_accessibility", "instant", "log", "palette", - "smithay-client-toolkit 0.17.0 (git+https://github.com/smithay/client-toolkit?rev=c9940f4)", + "smithay-client-toolkit 0.17.0", "thiserror", "twox-hash", ] @@ -2299,7 +2324,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.6.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "futures", "iced_core", @@ -2312,7 +2337,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2329,7 +2354,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2341,19 +2366,19 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "iced_accessibility", "iced_core", "iced_futures", - "smithay-client-toolkit 0.17.0 (git+https://github.com/smithay/client-toolkit?rev=c9940f4)", + "smithay-client-toolkit 0.17.0", "thiserror", ] [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "enum-repr", "float-cmp", @@ -2364,18 +2389,18 @@ dependencies = [ "iced_style", "itertools 0.10.5", "raw-window-handle", - "smithay-client-toolkit 0.17.0 (git+https://github.com/smithay/client-toolkit?rev=c9940f4)", + "smithay-client-toolkit 0.17.0", "smithay-clipboard", "thiserror", "tracing", "wayland-backend", - "wayland-protocols 0.30.1", + "wayland-protocols 0.30.0", ] [[package]] name = "iced_style" version = "0.8.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "iced_core", "once_cell", @@ -2385,7 +2410,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "bytemuck", "cosmic-text", @@ -2403,7 +2428,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2424,14 +2449,14 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "iced_renderer", "iced_runtime", "iced_style", "num-traits", "ouroboros 0.13.0", - "smithay-client-toolkit 0.17.0 (git+https://github.com/smithay/client-toolkit?rev=c9940f4)", + "smithay-client-toolkit 0.17.0", "thiserror", "unicode-segmentation", ] @@ -2569,12 +2594,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.4", + "rustix 0.38.3", "windows-sys 0.48.0", ] @@ -2598,9 +2623,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "jpeg-decoder" @@ -2690,7 +2715,7 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#b9bd41483d047841d9e327649c87cec1471ae6a8" +source = "git+https://github.com/pop-os/libcosmic/#456b2ddcd569782748e0f42533f247512a6425fe" dependencies = [ "apply", "cosmic-config", @@ -2710,7 +2735,7 @@ dependencies = [ "lazy_static", "palette", "slotmap", - "smithay-client-toolkit 0.17.0 (git+https://github.com/pop-os/client-toolkit?tag=themed-pointer)", + "smithay-client-toolkit 0.17.0", "tokio", "tracing", ] @@ -2752,9 +2777,9 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libpulse-binding" -version = "2.28.1" +version = "2.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3557a2dfc380c8f061189a01c6ae7348354e0c9886038dc6c171219c08eaff" +checksum = "1745b20bfc194ac12ef828f144f0ec2d4a7fe993281fa3567a0bd4969aee6890" dependencies = [ "bitflags 1.3.2", "libc", @@ -2766,9 +2791,9 @@ dependencies = [ [[package]] name = "libpulse-glib-binding" -version = "2.28.1" +version = "2.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72bb604d4f32d4c60e02581a67f9d9fd7500cb963ad984cee032013edeaf6bee" +checksum = "d39d9166164cf39b619f6a029ffafac958e718a10dabdc35bcebf8f69b5fa3cf" dependencies = [ "glib", "glib-sys", @@ -2778,9 +2803,9 @@ dependencies = [ [[package]] name = "libpulse-mainloop-glib-sys" -version = "1.21.1" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f9e6fbee0a60ac3f5751e3cc68eeaf9bff9d2687502df17b5c726220217531" +checksum = "9b97cd2ed4e84e54f3825b85648ec8637bec273ea7fcb981032b0a575dfef697" dependencies = [ "glib-sys", "libpulse-sys", @@ -2789,9 +2814,9 @@ dependencies = [ [[package]] name = "libpulse-sys" -version = "1.21.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc19e110fbf42c17260d30f6d3dc545f58491c7830d38ecb9aaca96e26067a9b" +checksum = "2191e6880818d1df4cf72eac8e91dce7a5a52ba0da4b2a5cdafabc22b937eadb" dependencies = [ "libc", "num-derive", @@ -2849,9 +2874,9 @@ checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "logind-zbus" -version = "3.1.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b36b364be05220b24411a1c1a1ee4df0ba77b09c9880e70e5f4c16ebdec157" +checksum = "3f2cfc54565c8d002ad7344ec08ce512c269b2de56dea59850708691e4b18fe3" dependencies = [ "serde", "zbus", @@ -2973,9 +2998,9 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" [[package]] name = "naga" -version = "0.12.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" +checksum = "80cd00bd6180a8790f1c020ed258a46b8d73dd5bd6af104a238c9d71f806938e" dependencies = [ "bit-set", "bitflags 1.3.2", @@ -3068,10 +3093,20 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.4.1" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ "num-bigint", "num-complex", @@ -3291,6 +3326,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "palette" version = "0.7.2" @@ -3312,7 +3353,7 @@ checksum = "3c02bfa6b3ba8af5434fa0531bf5701f750d983d4260acd6867faca51cdc4484" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -3405,7 +3446,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -3440,7 +3481,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -3552,9 +3593,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -3604,9 +3645,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.31" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -3718,9 +3759,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" dependencies = [ "aho-corasick", "memchr", @@ -3730,9 +3771,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" dependencies = [ "aho-corasick", "memchr", @@ -3741,9 +3782,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" [[package]] name = "renderdoc-sys" @@ -3831,7 +3872,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.26", + "syn 2.0.23", "walkdir", ] @@ -3897,9 +3938,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" dependencies = [ "bitflags 2.3.3", "errno", @@ -3910,9 +3951,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "rustybuzz" @@ -3933,9 +3974,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "same-file" @@ -3954,9 +3995,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "self_cell" @@ -3965,30 +4006,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ef965a420fe14fdac7dd018862966a4c14094f900e1650bbc71ddd7d580c8af" [[package]] -name = "serde" -version = "1.0.173" +name = "sendfd" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" +checksum = "604b71b8fc267e13bb3023a2c901126c8f349393666a6d98ac1ae5729b701798" +dependencies = [ + "libc", + "tokio", +] + +[[package]] +name = "serde" +version = "1.0.166" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.173" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49" +checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" dependencies = [ "itoa", "ryu", @@ -4003,7 +4054,7 @@ checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -4037,6 +4088,15 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + [[package]] name = "shlex" version = "1.1.0" @@ -4045,9 +4105,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" dependencies = [ "libc", "signal-hook-registry", @@ -4103,9 +4163,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smithay-client-toolkit" @@ -4143,31 +4203,7 @@ dependencies = [ "wayland-backend", "wayland-client 0.30.2", "wayland-cursor 0.30.0", - "wayland-protocols 0.30.1", - "wayland-protocols-wlr", - "wayland-scanner 0.30.1", - "xkbcommon", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.17.0" -source = "git+https://github.com/smithay/client-toolkit?rev=c9940f4#c9940f4167f0d81cc26f77b7eeef6a34068a90a5" -dependencies = [ - "bitflags 1.3.2", - "calloop", - "cursor-icon", - "dlib", - "log", - "memmap2", - "nix 0.26.2", - "pkg-config", - "thiserror", - "wayland-backend", - "wayland-client 0.30.2", - "wayland-csd-frame", - "wayland-cursor 0.30.0", - "wayland-protocols 0.30.1", + "wayland-protocols 0.30.0", "wayland-protocols-wlr", "wayland-scanner 0.30.1", "xkbcommon", @@ -4202,7 +4238,7 @@ dependencies = [ "cfg_aliases", "cocoa", "core-graphics", - "fastrand 1.9.0", + "fastrand", "foreign-types", "log", "nix 0.26.2", @@ -4337,9 +4373,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -4377,15 +4413,15 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml 0.7.6", + "toml 0.7.5", "version-compare", ] [[package]] name = "target-lexicon" -version = "0.12.10" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" +checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" [[package]] name = "temp-dir" @@ -4395,14 +4431,15 @@ checksum = "af547b166dd1ea4b472165569fc456cfb6818116f854690b0ff205e636523dab" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg", "cfg-if", - "fastrand 2.0.0", + "fastrand", "redox_syscall 0.3.5", - "rustix 0.38.4", + "rustix 0.37.23", "windows-sys 0.48.0", ] @@ -4417,22 +4454,32 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] @@ -4459,9 +4506,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" dependencies = [ "serde", "time-core", @@ -4552,7 +4599,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -4577,9 +4624,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" dependencies = [ "serde", "serde_spanned", @@ -4598,15 +4645,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.5.0", + "winnow", ] [[package]] @@ -4629,7 +4676,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", ] [[package]] @@ -4639,6 +4686,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", ] [[package]] @@ -4728,9 +4801,9 @@ checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-linebreak" @@ -4854,13 +4927,19 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" dependencies = [ "getrandom", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vec_map" version = "0.8.2" @@ -4928,7 +5007,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", "wasm-bindgen-shared", ] @@ -4962,7 +5041,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5044,17 +5123,6 @@ dependencies = [ "wayland-sys 0.29.5", ] -[[package]] -name = "wayland-csd-frame" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72191e30290b83491325d32c1327be7f45459c97263d9d48494c81efc9328116" -dependencies = [ - "bitflags 2.3.3", - "cursor-icon", - "wayland-backend", -] - [[package]] name = "wayland-cursor" version = "0.29.5" @@ -5091,9 +5159,9 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.30.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" +checksum = "7fefbeb8a360abe67ab7c2efe1d297a1a50ee011f5460791bc18870c26bb84e2" dependencies = [ "bitflags 1.3.2", "wayland-backend", @@ -5111,7 +5179,7 @@ dependencies = [ "bitflags 1.3.2", "wayland-backend", "wayland-client 0.30.2", - "wayland-protocols 0.30.1", + "wayland-protocols 0.30.0", "wayland-scanner 0.30.1", "wayland-server", ] @@ -5193,9 +5261,9 @@ checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" [[package]] name = "wgpu" -version = "0.16.3" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480c965c9306872eb6255fa55e4b4953be55a8b64d57e61d7ff840d3dcc051cd" +checksum = "3059ea4ddec41ca14f356833e2af65e7e38c0a8f91273867ed526fb9bafcca95" dependencies = [ "arrayvec", "cfg-if", @@ -5240,9 +5308,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.16.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb3258078e936deee14fd4e0febe1cfe9bbb5ffef165cb60218d2ee5eb4448" +checksum = "74851c2c8e5d97652e74c241d41b0656b31c924a45dcdecde83975717362cfa4" dependencies = [ "android_system_properties", "arrayvec", @@ -5282,9 +5350,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.16.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c153280bb108c2979eb5c7391cb18c56642dd3c072e55f52065e13e2a1252a" +checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" dependencies = [ "bitflags 2.3.3", "js-sys", @@ -5504,18 +5572,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] @@ -5587,7 +5646,7 @@ dependencies = [ [[package]] name = "xdg-shell-wrapper-config" version = "0.1.0" -source = "git+https://github.com/pop-os/xdg-shell-wrapper#87e5124cc06069dfb2fd8e5bd4cebeeea80a512b" +source = "git+https://github.com/pop-os/xdg-shell-wrapper#763666c3e6b2800655a652033c9d62073ec74c29" dependencies = [ "serde", "wayland-protocols-wlr", @@ -5605,9 +5664,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.16" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" +checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" [[package]] name = "xmlparser" @@ -5629,9 +5688,9 @@ checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] name = "zbus" -version = "3.13.1" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3d77c9966c28321f1907f0b6c5a5561189d1f7311eea6d94180c6be9daab29" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", "async-executor", @@ -5642,6 +5701,7 @@ dependencies = [ "async-recursion", "async-task", "async-trait", + "blocking", "byteorder", "derivative", "enumflags2", @@ -5670,16 +5730,15 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.13.1" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e341d12edaff644e539ccbbf7f161601294c9a84ed3d7e015da33155b435af" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", "regex", "syn 1.0.109", - "winnow 0.4.1", "zvariant_utils", ] diff --git a/cosmic-applet-notifications/Cargo.toml b/cosmic-applet-notifications/Cargo.toml index 05387c25..aa884291 100644 --- a/cosmic-applet-notifications/Cargo.toml +++ b/cosmic-applet-notifications/Cargo.toml @@ -19,3 +19,8 @@ sendfd = { version = "0.4", features = [ "tokio" ] } bytemuck = "1" tracing-subscriber = "0.3" zbus = "3.14" +# Application i18n +i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] } +i18n-embed-fl = "0.6.4" +rust-embed = "6.3.0" +rust-embed-utils = "7.5.0" diff --git a/cosmic-applet-notifications/i18n.toml b/cosmic-applet-notifications/i18n.toml new file mode 100644 index 00000000..05c50ba2 --- /dev/null +++ b/cosmic-applet-notifications/i18n.toml @@ -0,0 +1,4 @@ +fallback_language = "en" + +[fluent] +assets_dir = "i18n" \ No newline at end of file diff --git a/cosmic-applet-notifications/i18n/en/cosmic_applet_notifications.ftl b/cosmic-applet-notifications/i18n/en/cosmic_applet_notifications.ftl new file mode 100644 index 00000000..1d9b72df --- /dev/null +++ b/cosmic-applet-notifications/i18n/en/cosmic_applet_notifications.ftl @@ -0,0 +1,3 @@ +hours-ago = {$duration} Hours Ago +minutes-ago = {$duration} Minutes Ago +clear-all = Clear All Notifications \ No newline at end of file diff --git a/cosmic-applet-notifications/src/localize.rs b/cosmic-applet-notifications/src/localize.rs new file mode 100644 index 00000000..8f87ca3e --- /dev/null +++ b/cosmic-applet-notifications/src/localize.rs @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: MPL-2.0-only + +use cosmic_time::once_cell::sync::Lazy; +use i18n_embed::{ + fluent::{fluent_language_loader, FluentLanguageLoader}, + DefaultLocalizer, LanguageLoader, Localizer, +}; +use rust_embed::RustEmbed; + +#[derive(RustEmbed)] +#[folder = "i18n/"] +struct Localizations; + +pub static LANGUAGE_LOADER: Lazy = Lazy::new(|| { + let loader: FluentLanguageLoader = fluent_language_loader!(); + + loader + .load_fallback_language(&Localizations) + .expect("Error while loading fallback language"); + + loader +}); + +#[macro_export] +macro_rules! fl { + ($message_id:literal) => {{ + i18n_embed_fl::fl!($crate::localize::LANGUAGE_LOADER, $message_id) + }}; + + ($message_id:literal, $($args:expr),*) => {{ + i18n_embed_fl::fl!($crate::localize::LANGUAGE_LOADER, $message_id, $($args), *) + }}; +} + +// Get the `Localizer` to be used for localizing this library. +pub fn localizer() -> Box { + Box::from(DefaultLocalizer::new(&*LANGUAGE_LOADER, &Localizations)) +} + +pub fn localize() { + let localizer = localizer(); + let requested_languages = i18n_embed::DesktopLanguageRequester::requested_languages(); + + if let Err(error) = localizer.select(&requested_languages) { + eprintln!("Error while loading language for App List {}", error); + } +} diff --git a/cosmic-applet-notifications/src/main.rs b/cosmic-applet-notifications/src/main.rs index 88fbdee2..d5035eb5 100644 --- a/cosmic-applet-notifications/src/main.rs +++ b/cosmic-applet-notifications/src/main.rs @@ -1,3 +1,4 @@ +mod localize; mod subscriptions; use cosmic::cosmic_config::{config_subscription, Config, CosmicConfigEntry}; @@ -6,7 +7,8 @@ use cosmic::iced::{ widget::{button, column, row, text, Row, Space}, window, Alignment, Application, Color, Command, Length, Subscription, }; -use cosmic::iced_core::image; +use cosmic::iced_core::alignment::Horizontal; +use cosmic::iced_core::{image, Widget}; use cosmic::iced_futures::subscription; use cosmic::iced_widget::button::StyleSheet; use cosmic_applet::{applet_button_theme, CosmicAppletHelper}; @@ -15,13 +17,14 @@ use cosmic::iced_style::application::{self, Appearance}; use cosmic::iced_widget::{horizontal_space, scrollable, Column}; use cosmic::theme::{Button, Svg}; -use cosmic::widget::{divider, icon}; +use cosmic::widget::{container, divider, icon}; use cosmic::Renderer; use cosmic::{Element, Theme}; use cosmic_notifications_config::NotificationsConfig; use cosmic_notifications_util::{AppletEvent, Notification}; use cosmic_time::{anim, chain, id, once_cell::sync::Lazy, Instant, Timeline}; use std::borrow::Cow; +use std::collections::HashMap; use std::process; use tokio::sync::mpsc::Sender; use tracing::info; @@ -29,6 +32,8 @@ use tracing::info; #[tokio::main(flavor = "current_thread")] pub async fn main() -> cosmic::iced::Result { tracing_subscriber::fmt::init(); + // Prepare i18n + localize::localize(); info!("Notifications applet"); @@ -37,7 +42,6 @@ pub async fn main() -> cosmic::iced::Result { } static DO_NOT_DISTURB: Lazy = Lazy::new(id::Toggler::unique); - #[derive(Default)] struct Notifications { applet_helper: CosmicAppletHelper, @@ -64,6 +68,7 @@ enum Message { Config(NotificationsConfig), DbusEvent(subscriptions::dbus::Output), Dismissed(u32), + ClearAll, } impl Application for Notifications { @@ -230,6 +235,21 @@ impl Application for Notifications { Command::none() } }, + Message::ClearAll => { + for n in self.notifications.drain(..) { + if let Some(tx) = &self.dbus_sender { + let tx = tx.clone(); + tokio::spawn(async move { + if let Err(err) = + tx.send(subscriptions::dbus::Input::Dismiss(n.id)).await + { + tracing::error!("{:?}", err); + } + }); + } + } + Command::none() + } } } @@ -254,28 +274,36 @@ impl Application for Notifications { row_button(vec!["Notification Settings...".into()]).on_press(Message::Settings); let notifications = if self.notifications.len() == 0 { - row![ - Space::with_width(Length::Fill), + row![container( column![text_icon(&self.icon_name, 40), "No Notifications"] - .align_items(Alignment::Center), - Space::with_width(Length::Fill) - ] + .align_items(Alignment::Center) + ) + .width(Length::Fill) + .align_x(Horizontal::Center)] .spacing(12) } else { - let mut notifs = Vec::with_capacity(self.notifications.len()); - + let mut notifs: Vec> = Vec::with_capacity(self.notifications.len()); + notifs.push( + column![cosmic::widget::button(Button::Text) + .custom(vec![text(fl!("clear-all")).size(14).into()]) + .on_press(Message::ClearAll)] + .into(), + ); for n in &self.notifications { - let summary = text(if n.summary.len() > 24 { + let app_name = text(if n.app_name.len() > 24 { Cow::from(format!( "{:.26}...", - n.summary.lines().next().unwrap_or_default() + n.app_name.lines().next().unwrap_or_default() )) } else { - Cow::from(&n.summary) + Cow::from(&n.app_name) }) - .size(18); + .size(12) + .width(Length::Fill); let urgency = n.urgency(); + let duration_since = text(duration_ago_msg(n)).size(12); + notifs.push( cosmic::widget::button(Button::Custom { active: Box::new(move |t| { @@ -310,12 +338,12 @@ impl Application for Notifications { .custom(vec![column!( match n.image() { Some(cosmic_notifications_util::Image::File(path)) => { - row![icon(path.as_path(), 32), summary] + row![icon(path.as_path(), 16), app_name, duration_since] .spacing(8) .align_items(Alignment::Center) } Some(cosmic_notifications_util::Image::Name(name)) => { - row![icon(name.as_str(), 32), summary] + row![icon(name.as_str(), 16), app_name, duration_since] .spacing(8) .align_items(Alignment::Center) } @@ -326,21 +354,30 @@ impl Application for Notifications { }) => { let handle = image::Handle::from_pixels(*width, *height, data.clone()); - row![icon(handle, 32), summary] + row![icon(handle, 16), app_name, duration_since] .spacing(8) .align_items(Alignment::Center) } - None => row![summary], + None => row![app_name, duration_since], }, - text(if n.body.len() > 38 { + text(if n.summary.len() > 77 { Cow::from(format!( - "{:.40}...", - n.body.lines().next().unwrap_or_default() + "{:.80}...", + n.summary.lines().next().unwrap_or_default() )) } else { Cow::from(&n.summary) }) .size(14), + text(if n.body.len() > 77 { + Cow::from(format!( + "{:.80}...", + n.body.lines().next().unwrap_or_default() + )) + } else { + Cow::from(&n.body) + }) + .size(12), horizontal_space(Length::Fixed(300.0)), ) .spacing(8) @@ -349,7 +386,6 @@ impl Application for Notifications { .into(), ); } - row!(scrollable( Column::with_children(notifs) .spacing(8) @@ -402,3 +438,17 @@ fn row_button( fn text_icon(name: &str, size: u16) -> cosmic::widget::Icon { icon(name, size).style(Svg::Symbolic) } + +fn duration_ago_msg(notification: &Notification) -> String { + if let Some(d) = notification.duration_since() { + let min = d.as_secs() / 60; + let hrs = min / 60; + if hrs > 0 { + fl!("hours-ago", HashMap::from_iter(vec![("duration", hrs)])) + } else { + fl!("minutes-ago", HashMap::from_iter(vec![("duration", min)])) + } + } else { + format!("") + } +}