diff --git a/Cargo.lock b/Cargo.lock index b1cc236..f86d0fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,27 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -11,6 +32,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + [[package]] name = "appdirs" version = "0.2.0" @@ -31,20 +58,21 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aw-client-rust" version = "0.1.0" -source = "git+https://github.com/ActivityWatch/aw-server-rust.git#bd547add68b1028f018f25727799a48acb3188a2" +source = "git+https://github.com/ActivityWatch/aw-server-rust.git#0240dc02a4cd3ac990cd650b31c7f1adf5bd07e2" dependencies = [ "aw-models", "chrono", - "gethostname 0.4.1", + "gethostname 0.4.3", "reqwest", "serde", "serde_json", + "tokio", ] [[package]] name = "aw-models" version = "0.1.0" -source = "git+https://github.com/ActivityWatch/aw-server-rust.git#bd547add68b1028f018f25727799a48acb3188a2" +source = "git+https://github.com/ActivityWatch/aw-server-rust.git#0240dc02a4cd3ac990cd650b31c7f1adf5bd07e2" dependencies = [ "chrono", "log", @@ -57,28 +85,42 @@ dependencies = [ name = "aw-watcher-window-wayland" version = "0.1.0" dependencies = [ + "anyhow", "appdirs", "aw-client-rust", "chrono", "file-lock", "gethostname 0.2.3", "getopts", - "lazy_static", - "mio 0.6.23", + "nix 0.27.1", "serde_json", - "smallvec", - "timerfd", + "wayland-backend", "wayland-client", - "wayland-commons", - "wayland-scanner", + "wayland-protocols-plasma", + "wayland-protocols-wlr", "wayland-sys", ] +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" -version = "0.21.0" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bitflags" @@ -86,23 +128,32 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -118,28 +169,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "serde", - "time", "wasm-bindgen", - "winapi 0.3.9", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", + "windows-targets", ] [[package]] @@ -154,52 +194,17 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "cxx" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.91" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] -name = "cxxbridge-macro" -version = "1.0.91" +name = "dlib" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "proc-macro2", - "quote", - "syn", + "libloading", ] [[package]] @@ -210,48 +215,34 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dyn-clone" -version = "1.0.10" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "errno" -version = "0.2.8" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", "libc", + "windows-sys", ] [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-lock" @@ -288,9 +279,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -301,60 +292,44 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-io", @@ -383,12 +358,12 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a329e22866dd78b35d2c639a4a23d7b950aeae300dfd79f4fb19f74055c2404" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "windows", + "windows-targets", ] [[package]] @@ -400,11 +375,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "h2" -version = "0.3.15" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -427,12 +408,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "http" @@ -464,15 +442,15 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -485,7 +463,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -507,33 +485,32 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "windows-core", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -541,73 +518,35 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" -dependencies = [ - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ipnet" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -616,93 +555,71 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] -name = "link-cplusplus" -version = "1.0.8" +name = "libloading" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ - "cc", + "cfg-if 1.0.0", + "windows-sys", ] [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "memchr" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] -name = "memchr" -version = "2.5.0" +name = "memoffset" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "mio" -version = "0.6.23" +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", + "adler", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "wasi", + "windows-sys", ] [[package]] @@ -732,24 +649,13 @@ dependencies = [ "tempfile", ] -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nix" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "becb657d662f1cd2ef38c7ad480ec6b8cf9e96b27adb543e594f9cf0f2e6065c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if 0.1.10", "libc", @@ -758,46 +664,55 @@ dependencies = [ [[package]] name = "nix" -version = "0.15.0" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", + "bitflags 1.3.2", + "cfg-if 1.0.0", "libc", - "void", + "memoffset", ] [[package]] -name = "num-integer" -version = "0.1.45" +name = "nix" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "autocfg", - "num-traits", + "bitflags 2.4.1", + "cfg-if 1.0.0", + "libc", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "ole32-sys" version = "0.2.0" @@ -810,17 +725,17 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.48" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags", + "bitflags 2.4.1", "cfg-if 1.0.0", "foreign-types", "libc", @@ -831,13 +746,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -848,11 +763,10 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.83" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", @@ -861,15 +775,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -879,24 +793,33 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", +] + [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -950,18 +873,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "base64", "bytes", @@ -984,6 +907,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -994,6 +918,12 @@ dependencies = [ "winreg", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-serialize" version = "0.3.24" @@ -1002,38 +932,37 @@ checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" [[package]] name = "rustix" -version = "0.36.8" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags", + "bitflags 2.4.1", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "schemars" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "chrono", "dyn-clone", @@ -1044,29 +973,29 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn", + "syn 1.0.109", ] [[package]] -name = "scratch" -version = "1.0.3" +name = "scoped-tls" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -1075,9 +1004,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -1085,22 +1014,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -1111,14 +1040,14 @@ checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1149,37 +1078,38 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "0.6.14" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi 0.3.9", ] [[package]] -name = "spin" -version = "0.5.2" +name = "socket2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] [[package]] name = "syn" @@ -1193,45 +1123,48 @@ dependencies = [ ] [[package]] -name = "tempfile" -version = "3.4.0" +name = "syn" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.42.0", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "termcolor" -version = "1.2.0" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "winapi-util", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "time" -version = "0.1.45" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ + "core-foundation-sys", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", ] [[package]] -name = "timerfd" -version = "1.4.0" +name = "tempfile" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0664936efa25f2bbe03ca25b62c50f5f492abec07e59d6dcf45131014b33483f" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall", "rustix", + "windows-sys", ] [[package]] @@ -1251,19 +1184,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", - "mio 0.8.6", + "mio", "num_cpus", "pin-project-lite", - "socket2", - "windows-sys 0.42.0", + "socket2 0.5.5", + "windows-sys", ] [[package]] @@ -1278,9 +1210,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1298,20 +1230,19 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -1324,15 +1255,15 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1345,15 +1276,15 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -1384,20 +1315,13 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1406,9 +1330,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -1416,24 +1340,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1443,9 +1367,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1453,72 +1377,114 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] -name = "wayland-client" -version = "0.24.1" +name = "wayland-backend" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcc929c26d59a655b0d2cd337299326acc1f6e3d4434c3ae2d6c78d32290ca4" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" dependencies = [ - "bitflags", + "cc", "downcast-rs", - "libc", - "nix 0.15.0", - "wayland-commons", - "wayland-scanner", + "nix 0.26.4", + "scoped-tls", + "smallvec", "wayland-sys", ] [[package]] -name = "wayland-commons" -version = "0.24.1" +name = "wayland-client" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539cdd0c296802332d763ff663739a7f83bdf67b3df58e99fe0215e96a495142" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" dependencies = [ - "nix 0.15.0", - "smallvec", - "spin", - "wayland-sys", + "bitflags 2.4.1", + "nix 0.26.4", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" +dependencies = [ + "bitflags 2.4.1", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.4.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.1", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", ] [[package]] name = "wayland-scanner" -version = "0.24.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ea5ea1a117137d72c0c197431d198d69783b5e8ca996b0583c98e10b44d426" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" dependencies = [ "proc-macro2", + "quick-xml", "quote", - "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.24.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537500923d50be11d95a63c4cb538145e4c82edf61296b7debc1f94a1a6514ed" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "pkg-config", +] [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -1552,15 +1518,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1568,49 +1525,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows-targets", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1623,67 +1559,52 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", + "cfg-if 1.0.0", + "windows-sys", ] - -[[package]] -name = "xml-rs" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/Cargo.toml b/Cargo.toml index 6c961e3..4908590 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,28 +2,24 @@ name = "aw-watcher-window-wayland" version = "0.1.0" authors = ["Johan Bjäreholt "] -edition = "2018" -build = "src/build.rs" - -[build-dependencies] -wayland-scanner = "0.24" +edition = "2021" [dependencies] -smallvec = "0.6" -lazy_static = "1.2" -wayland-client = "0.24" -wayland-commons = "0.24" -wayland-sys = "0.24" +wayland-client = "0.31" +wayland-sys = "0.31" serde_json = "1.0" chrono = "0.4" -mio = "0.6" -timerfd = "1.0" file-lock = "1.1" appdirs = "0.2" gethostname = "0.2" getopts = "0.2" aw-client-rust = { git = "https://github.com/ActivityWatch/aw-server-rust.git" } +wayland-protocols-plasma = { version = "0.2.0", features = ["client"] } +wayland-protocols-wlr = { version = "0.2.0", features = ["client"] } +wayland-backend = "0.3.2" +anyhow = "1.0.75" +nix = { version = "0.27.1", features = ["poll"] } [profile.release] opt-level = 3 diff --git a/protocols/idle.xml b/protocols/idle.xml deleted file mode 100644 index 92d9989..0000000 --- a/protocols/idle.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - . - ]]> - - - This interface allows to monitor user idle time on a given seat. The interface - allows to register timers which trigger after no user activity was registered - on the seat for a given interval. It notifies when user activity resumes. - - This is useful for applications wanting to perform actions when the user is not - interacting with the system, e.g. chat applications setting the user as away, power - management features to dim screen, etc.. - - - - - - - - - - - - - - - - - - - - - - diff --git a/protocols/wlr-foreign-toplevel-management-unstable-v1.xml b/protocols/wlr-foreign-toplevel-management-unstable-v1.xml deleted file mode 100644 index a97738f..0000000 --- a/protocols/wlr-foreign-toplevel-management-unstable-v1.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - Copyright © 2018 Ilia Bozhinov - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that copyright notice and this permission - notice appear in supporting documentation, and that the name of - the copyright holders not be used in advertising or publicity - pertaining to distribution of the software without specific, - written prior permission. The copyright holders make no - representations about the suitability of this software for any - purpose. It is provided "as is" without express or implied - warranty. - - THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN - AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - THIS SOFTWARE. - - - - - The purpose of this protocol is to enable the creation of taskbars - and docks by providing them with a list of opened applications and - letting them request certain actions on them, like maximizing, etc. - - After a client binds the zwlr_foreign_toplevel_manager_v1, each opened - toplevel window will be sent via the toplevel event - - - - - This event is emitted whenever a new toplevel window is created. It - is emitted for all toplevels, regardless of the app that has created - them. - - All initial details of the toplevel(title, app_id, states, etc.) will - be sent immediately after this event via the corresponding events in - zwlr_foreign_toplevel_handle_v1. - - - - - - - Indicates the client no longer wishes to receive events for new toplevels. - However the compositor may emit further toplevel_created events, until - the finished event is emitted. - - The client must not send any more requests after this one. - - - - - - This event indicates that the compositor is done sending events to the - zwlr_foreign_toplevel_manager_v1. The server will destroy the object - immediately after sending this request, so it will become invalid and - the client should free any resources associated with it. - - - - - - - A zwlr_foreign_toplevel_handle_v1 object represents an opened toplevel - window. Each app may have multiple opened toplevels. - - Each toplevel has a list of outputs it is visible on, conveyed to the - client with the output_enter and output_leave events. - - - - - This event is emitted whenever the title of the toplevel changes. - - - - - - - This event is emitted whenever the app-id of the toplevel changes. - - - - - - - This event is emitted whenever the toplevel becomes visible on - the given output. A toplevel may be visible on multiple outputs. - - - - - - - This event is emitted whenever the toplevel stops being visible on - the given output. It is guaranteed that an entered-output event - with the same output has been emitted before this event. - - - - - - - Requests that the toplevel be maximized. If the maximized state actually - changes, this will be indicated by the state event. - - - - - - Requests that the toplevel be unmaximized. If the maximized state actually - changes, this will be indicated by the state event. - - - - - - Requests that the toplevel be minimized. If the minimized state actually - changes, this will be indicated by the state event. - - - - - - Requests that the toplevel be unminimized. If the minimized state actually - changes, this will be indicated by the state event. - - - - - - Request that this toplevel be activated on the given seat. - There is no guarantee the toplevel will be actually activated. - - - - - - - The different states that a toplevel can have. These have the same meaning - as the states with the same names defined in xdg-toplevel - - - - - - - - - - - This event is emitted immediately after the zlw_foreign_toplevel_handle_v1 - is created and each time the toplevel state changes, either because of a - compositor action or because of a request in this protocol. - - - - - - - - This event is sent after all changes in the toplevel state have been - sent. - - This allows changes to the zwlr_foreign_toplevel_handle_v1 properties - to be seen as atomic, even if they happen via multiple events. - - - - - - Send a request to the toplevel to close itself. The compositor would - typically use a shell-specific method to carry out this request, for - example by sending the xdg_toplevel.close event. However, this gives - no guarantees the toplevel will actually be destroyed. If and when - this happens, the zwlr_foreign_toplevel_handle_v1.closed event will - be emitted. - - - - - - The rectangle of the surface specified in this request corresponds to - the place where the app using this protocol represents the given toplevel. - It can be used by the compositor as a hint for some operations, e.g - minimizing. The client is however not required to set this, in which - case the compositor is free to decide some default value. - - If the client specifies more than one rectangle, only the last one is - considered. - - The dimensions are given in surface-local coordinates. - Setting width=height=0 removes the already-set rectangle. - - - - - - - - - - - - - - - - This event means the toplevel has been destroyed. It is guaranteed there - won't be any more events for this zwlr_foreign_toplevel_handle_v1. The - toplevel itself becomes inert so any requests will be ignored except the - destroy request. - - - - - - Destroys the zwlr_foreign_toplevel_handle_v1 object. - - This request should be called either when the client does not want to - use the toplevel anymore or after the closed event to finalize the - destruction of the object. - - - - - - - - Requests that the toplevel be fullscreened on the given output. If the - fullscreen state and/or the outputs the toplevel is visible on actually - change, this will be indicated by the state and output_enter/leave - events. - - The output parameter is only a hint to the compositor. Also, if output - is NULL, the compositor should decide which output the toplevel will be - fullscreened on, if at all. - - - - - - - Requests that the toplevel be unfullscreened. If the fullscreen state - actually changes, this will be indicated by the state event. - - - - diff --git a/src/build.rs b/src/build.rs deleted file mode 100644 index 28f293a..0000000 --- a/src/build.rs +++ /dev/null @@ -1,26 +0,0 @@ -extern crate wayland_scanner; - -use std::fs::create_dir_all; -use wayland_scanner::{Side, generate_code}; - -fn main() { - // Location of the xml file, relative to the `Cargo.toml` - // (xmlsrc, outsrc) - let protocols = vec!( - ("./protocols/wlr-foreign-toplevel-management-unstable-v1.xml", - "./src/protocols/wlr-foreign-toplevel-management.rs"), - ("./protocols/idle.xml", - "./src/protocols/idle.rs"), - ); - - // Create "./src/protocols" folder for generated bindings - create_dir_all("./src/protocols").unwrap(); - - for protocol in protocols { - let (xmlsrc, outsrc) = protocol; - generate_code( - xmlsrc, outsrc, - Side::Client, // Replace by `Side::Server` for server-side code - ); - } -} diff --git a/src/current_window.rs b/src/current_window.rs index b58332d..75f1271 100644 --- a/src/current_window.rs +++ b/src/current_window.rs @@ -1,111 +1,128 @@ use std::collections::HashMap; -use wayland_client::Main; -use std::sync::Mutex; +use wayland_backend::rs::client::ObjectId; +use wayland_client::{ + event_created_child, + globals::{registry_queue_init, GlobalListContents}, + protocol::wl_registry::WlRegistry, + Connection, EventQueue, Proxy, delegate_dispatch, +}; -use super::wl_client as wl_client; +use wayland_protocols_wlr::foreign_toplevel::v1::client::{ + zwlr_foreign_toplevel_handle_v1::{ + Event as TopLevelHandleEvent, State as TopLevelHandleState, ZwlrForeignToplevelHandleV1, + }, + zwlr_foreign_toplevel_manager_v1::{ + Event as ToplevelManagerEvent, ZwlrForeignToplevelManagerV1, EVT_TOPLEVEL_OPCODE, + }, +}; -use wl_client::toplevel_management::zwlr_foreign_toplevel_manager_v1::ZwlrForeignToplevelManagerV1 as ToplevelManager; -use wl_client::toplevel_management::zwlr_foreign_toplevel_handle_v1::ZwlrForeignToplevelHandleV1 as ToplevelHandle; - -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Window { pub title: String, pub appid: String, } pub struct WindowState { - pub current_window: Option, - pub all_windows: HashMap::, + pub current_window: Option, + pub all_windows: HashMap, } -lazy_static! { - static ref WINDOW_STATE_LOCKED: Mutex = Mutex::new(WindowState { - current_window: None, - all_windows: HashMap::new(), - }); +impl WindowState { + pub fn get_focused_window(&self) -> Option { + let current_window_id = match &self.current_window { + Some(id) => id, + None => { + println!("No focused window"); + return None; + } + }; + self.all_windows.get(current_window_id).cloned() + } } -pub fn get_focused_window() -> Option { - let window_state = WINDOW_STATE_LOCKED.lock() - .expect("Unable to take lock"); - let current_window_id = match window_state.current_window { - Some(id) => id, - None => { - println!("No focused window"); - return None; +delegate_dispatch!(WindowState: [WlRegistry: GlobalListContents] => crate::utils::RegistryState); + +impl wayland_client::Dispatch for WindowState { + fn event( + state: &mut Self, + proxy: &ZwlrForeignToplevelHandleV1, + event: ::Event, + _data: &(), + _conn: &Connection, + _qhandle: &wayland_client::QueueHandle, + ) { + let id = proxy.id(); + let window = state + .all_windows + .get_mut(&id) + .expect("Tried to change appid on a non-existing window"); + match event { + TopLevelHandleEvent::AppId { app_id } => window.appid = app_id, + TopLevelHandleEvent::Title { title } => window.title = title, + TopLevelHandleEvent::State { state: event_state } => { + if event_state.contains(&(TopLevelHandleState::Activated as u8)) { + state.current_window = Some(id); + println!( + "current window changed to: {:?}", + state.get_focused_window() + ); + } + } + TopLevelHandleEvent::Done => (), // TODO: do something here? + TopLevelHandleEvent::Closed => { + let closed_window = state.all_windows.remove(&id).unwrap(); + println!("closed {}", closed_window.appid); + } + _ => println!("Unknown toplevel handle event"), } - }; - match window_state.all_windows.get(¤t_window_id) { - Some(window_ref) => Some(window_ref.clone()), - None => None } } -fn assign_toplevel_handle(toplevel_handle: &wayland_client::Main) -> () { - use wl_client::toplevel_management::zwlr_foreign_toplevel_handle_v1::Event as HandleEvent; +impl wayland_client::Dispatch for WindowState { + fn event( + state: &mut Self, + _proxy: &ZwlrForeignToplevelManagerV1, + event: ::Event, + _data: &(), + _conn: &Connection, + _qhandle: &wayland_client::QueueHandle, + ) { + match event { + ToplevelManagerEvent::Toplevel { toplevel: handle } => { + let id = handle.id(); + let window = Window { + appid: "unknown".into(), + title: "unknown".into(), + }; + state.all_windows.insert(id, window); + } + // TODO: What do do at finish? + ToplevelManagerEvent::Finished => println!("Finished?"), + _ => println!("Unknown toplevel handle event"), + } + } - toplevel_handle - .assign_mono(|toplevel_handle : Main, event| { - let mut window_state = WINDOW_STATE_LOCKED.lock() - .expect("Unable to take lock!"); - let id = toplevel_handle.as_ref().id(); - match event { - HandleEvent::AppId{ app_id } => { - //println!("appid: {}", app_id); - let window = window_state.all_windows.get_mut(&id) - .expect("Tried to change appid on a non-existing window"); - window.appid = app_id.clone(); - }, - HandleEvent::Title{ title } => { - //println!("title: {}", title); - let window = window_state.all_windows.get_mut(&id) - .expect("Tried to change title on a non-existing window"); - window.title = title.clone(); - }, - HandleEvent::State{ state } => { - // TODO: Remove this clone - for field in state { - if field == 2 { // 2 == focused - window_state.current_window = Some(id); - break; - } - } - } - HandleEvent::Done => (),//println!("done"), - HandleEvent::Closed => { - let closed_window = window_state.all_windows.remove(&id) - .expect("Tried to remove window which does not exist"); - println!("closed {}", closed_window.appid) - }, - _ => println!("Unknown toplevel handle event") - }; - }); + event_created_child!(WindowState, ZwlrForeignToplevelManagerV1, [ + EVT_TOPLEVEL_OPCODE => (ZwlrForeignToplevelHandleV1, ()), + ]); } -pub fn assign_toplevel_manager(globals: &wayland_client::GlobalManager) -> () { - use wl_client::toplevel_management::zwlr_foreign_toplevel_manager_v1::Event as ToplevelEvent; +pub fn init_toplevel_manager( + conn: &Connection, +) -> anyhow::Result<(WindowState, EventQueue)> { + let (globals, mut queue) = registry_queue_init(conn)?; + let _toplevel_manager: ZwlrForeignToplevelManagerV1 = globals.bind( + &queue.handle(), + 1..=ZwlrForeignToplevelManagerV1::interface().version, + (), + )?; - globals - .instantiate_exact::(1) - .expect("Wayland session does not expose a ToplevelManager object, \ - this window manager is most likely not supported") - .assign_mono(move |_toplevel_manager : Main, event| { - match event { - ToplevelEvent::Toplevel{ toplevel: handle } => { - //println!("new handle"); - let mut windows_state = WINDOW_STATE_LOCKED.lock() - .expect("Unable to take lock!"); - let id = handle.as_ref().id(); - let window = Window { - appid: "unknown".into(), - title: "unknown".into(), - }; - windows_state.all_windows.insert(id, window); - assign_toplevel_handle(&handle); - } - // TODO: What do do at finish? - ToplevelEvent::Finished => println!("Finished?"), - _ => panic!("Got an unexpected event!") - } - }); + let mut window_state = WindowState { + current_window: None, + all_windows: HashMap::new(), + }; + + queue.roundtrip(&mut window_state)?; + + Ok((window_state, queue)) } diff --git a/src/idle.rs b/src/idle.rs index 54b8c74..f4fc33c 100644 --- a/src/idle.rs +++ b/src/idle.rs @@ -1,5 +1,4 @@ -use super::wl_client as wl_client; -use std::sync::Mutex; +use anyhow::Ok; use serde_json::{Map, Value}; use chrono::prelude::*; @@ -7,89 +6,102 @@ use chrono::{DateTime, Duration}; use aw_client_rust::Event as AwEvent; +use wayland_client::globals::GlobalListContents; +use wayland_client::protocol::wl_registry::WlRegistry; use wayland_client::protocol::wl_seat::WlSeat; -use wl_client::idle::org_kde_kwin_idle::OrgKdeKwinIdle as Idle; -use wl_client::idle::org_kde_kwin_idle_timeout::Event as TimeoutEvent; +use wayland_client::{Proxy, delegate_dispatch}; -struct AfkState { +use wayland_client::{delegate_noop, globals::registry_queue_init, Connection, EventQueue}; +use wayland_protocols_plasma::idle::client::org_kde_kwin_idle_timeout::Event as OrgKdeKwinIdleTimeoutEvent; +use wayland_protocols_plasma::idle::client::{ + org_kde_kwin_idle::OrgKdeKwinIdle, org_kde_kwin_idle_timeout::OrgKdeKwinIdleTimeout, +}; + +pub struct AfkState { is_afk: bool, state_start: DateTime, timeout_ms: u32, } -lazy_static! { - static ref AFK_STATE_LOCKED: Mutex = Mutex::new(AfkState { - is_afk: false, - state_start: Utc::now(), - timeout_ms: 0, /* gets set in start on assign_idle_timeout */ - }); -} +impl AfkState { + pub fn get_current_afk_event(&self) -> AwEvent { + let now = Utc::now(); + + let timestamp = match self.is_afk { + true => now, + false => { + let last_guaranteed_activity = now - Duration::milliseconds(self.timeout_ms as i64); + match last_guaranteed_activity > self.state_start { + true => last_guaranteed_activity, + false => self.state_start, + } + } + }; + + let mut data = Map::new(); + let json_afk_state = match self.is_afk { + true => Value::String("afk".to_string()), + false => Value::String("not-afk".to_string()), + }; + data.insert("status".to_string(), json_afk_state); -fn init_afk_state(timeout_ms: u32) { - let mut afk_state = AFK_STATE_LOCKED.lock().expect("Unable to lock"); - afk_state.state_start = Utc::now(); - afk_state.timeout_ms = timeout_ms; + AwEvent { + id: None, + timestamp, + duration: Duration::milliseconds(0), + data, + } + } } -fn set_afk_state(afk: bool) { - let mut afk_state = AFK_STATE_LOCKED.lock().expect("Unable to lock"); - afk_state.is_afk = afk; - afk_state.state_start = Utc::now(); +impl wayland_client::Dispatch for AfkState { + fn event( + state: &mut Self, + _proxy: &OrgKdeKwinIdleTimeout, + event: ::Event, + _data: &(), + _conn: &Connection, + _qhandle: &wayland_client::QueueHandle, + ) { + match event { + OrgKdeKwinIdleTimeoutEvent::Idle => { + println!("Became AFK"); + state.is_afk = true; + state.state_start = Utc::now(); + } + OrgKdeKwinIdleTimeoutEvent::Resumed => { + println!("No longer AFK"); + state.is_afk = false; + state.state_start = Utc::now(); + } + _ => (), + } + } } -pub fn get_current_afk_event() -> AwEvent { - let afk_state = AFK_STATE_LOCKED.lock().expect("Unable to take lock"); +delegate_dispatch!(AfkState: [WlRegistry: GlobalListContents] => crate::utils::RegistryState); - let now = Utc::now(); +pub fn init_afk_state( + conn: &Connection, + timeout_ms: u32, +) -> anyhow::Result<(AfkState, EventQueue)> { + let (globals, mut queue) = registry_queue_init(conn)?; + let seat: WlSeat = globals.bind(&queue.handle(), 1..=WlSeat::interface().version, ())?; + let idle: OrgKdeKwinIdle = + globals.bind(&queue.handle(), 1..=OrgKdeKwinIdle::interface().version, ())?; - let timestamp = match afk_state.is_afk { - true => now, - false => { - let last_guaranteed_activity = - now - Duration::milliseconds(afk_state.timeout_ms as i64); - match last_guaranteed_activity > afk_state.state_start { - true => last_guaranteed_activity, - false => afk_state.state_start, - } - } - }; + let _kwin_idle_timeout = idle.get_idle_timeout(&seat, timeout_ms, &queue.handle(), ()); + + delegate_noop!(AfkState: ignore WlSeat); + delegate_noop!(AfkState: OrgKdeKwinIdle); - let mut data = Map::new(); - let json_afk_state = match afk_state.is_afk { - true => Value::String("afk".to_string()), - false => Value::String("not-afk".to_string()), + let mut afk_state = AfkState { + is_afk: false, + state_start: Utc::now(), + timeout_ms, }; - data.insert("status".to_string(), json_afk_state); - AwEvent { - id: None, - timestamp: timestamp, - duration: Duration::milliseconds(0), - data, - } -} + queue.roundtrip(&mut afk_state)?; -pub fn assign_idle_timeout(globals: &wayland_client::GlobalManager, - timeout_ms: u32) -> () { - init_afk_state(timeout_ms); - let seat = globals.instantiate_exact::(1) - .expect("Wayland session does not expose a WlSeat object, \ - this window manager is most likely not supported"); - let idle = globals.instantiate_exact::(1) - .expect("Wayland session does not expose a Idle object, \ - this window manager is most likely not supported"); - let idle_timeout = idle.get_idle_timeout(&seat, timeout_ms); - idle_timeout.assign_mono(|_idle_timeout, event| { - match event { - TimeoutEvent::Idle => { - println!("idle"); - set_afk_state(true); - }, - TimeoutEvent::Resumed => { - println!("resumed"); - set_afk_state(false); - }, - _ => panic!("Got unexpected timeout event"), - } - }); + Ok((afk_state, queue)) } diff --git a/src/main.rs b/src/main.rs index c9268d3..88d6bbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,42 +1,18 @@ -// The generated code will import stuff from wayland_sys -extern crate wayland_sys; -extern crate wayland_client; -extern crate aw_client_rust; -extern crate chrono; -extern crate gethostname; -extern crate getopts; - -#[macro_use] extern crate lazy_static; - -#[macro_use] extern crate smallvec; - -mod wl_client; mod current_window; mod idle; mod singleinstance; +mod utils; -use std::env; -use std::time::Duration; -use std::os::unix::io::AsRawFd; - -use mio::{Poll, Token, PollOpt, Ready, Events}; -use mio::unix::EventedFd; -use timerfd::{TimerFd, TimerState, SetTimeFlags}; +use std::io::ErrorKind; +use std::sync::{Arc, Mutex}; +use std::time; +use std::{env, thread}; +use chrono::Utc; use serde_json::{Map, Value}; -use chrono::prelude::*; -fn get_wl_display() -> wayland_client::Display { - match wayland_client::Display::connect_to_env() { - Ok(display) => return display, - Err(e) => println!("Couldn't connect to wayland display by env: {}", e) - }; - match wayland_client::Display::connect_to_name("wayland-0") { - Ok(display) => return display, - Err(e) => println!("Couldn't connect to wayland display by name 'wayland-0': {}", e) - } - panic!("Failed to connect to wayland display"); -} +use wayland_backend::client::WaylandError; +use wayland_client::Connection; fn window_to_event(window: ¤t_window::Window) -> aw_client_rust::Event { let mut data = Map::new(); @@ -46,16 +22,12 @@ fn window_to_event(window: ¤t_window::Window) -> aw_client_rust::Event { id: None, timestamp: Utc::now(), duration: chrono::Duration::milliseconds(0), - data: data, + data, } } -// Setup some tokens to allow us to identify which event is for which socket. -const STATE_CHANGE: Token = Token(0); -const TIMER: Token = Token(1); - -static HEARTBEAT_INTERVAL_MS : u32 = 5000; -static HEARTBEAT_INTERVAL_MARGIN_S : f64 = (HEARTBEAT_INTERVAL_MS + 1000) as f64 / 1000.0; +static HEARTBEAT_INTERVAL_MS: u64 = 5000; +static HEARTBEAT_INTERVAL_MARGIN_S: f64 = (HEARTBEAT_INTERVAL_MS + 1000) as f64 / 1000.0; fn main() { let args: Vec = env::args().collect(); @@ -78,127 +50,120 @@ fn main() { testing = true; } - println!("### Setting up display"); - let display = get_wl_display(); - let mut event_queue = display.create_event_queue(); - let attached_display = (*display).clone().attach(event_queue.get_token()); - - println!("### Fetching wayland globals"); - let globals = wayland_client::GlobalManager::new(&attached_display); - event_queue.sync_roundtrip(|_, _| unreachable!()) - .expect("Failed to sync_roundtrip when fetching globals"); + println!("### Connecting to wayland server"); + let conn = Connection::connect_to_env().unwrap(); println!("### Setting up toplevel manager"); - current_window::assign_toplevel_manager(&globals); + let (window_state, mut window_queue) = current_window::init_toplevel_manager(&conn).unwrap(); + let shared_window_state = Arc::new(Mutex::new(window_state)); println!("### Setting up idle timeout"); - idle::assign_idle_timeout(&globals, 120000); - - println!("### Syncing roundtrip"); - event_queue - .sync_roundtrip(|_, _| { /* we ignore unfiltered messages */ }) - .expect("event_queue sync_roundtrip failure"); - - println!("### Preparing poll fds"); - let poll = Poll::new() - .expect("Failed to create poll fds"); - let fd = event_queue.get_connection_fd(); - - let mut timer = TimerFd::new() - .expect("Failed to create timer fd"); - let timer_state = TimerState::Periodic { - current: Duration::from_secs(1), - interval: Duration::from_millis(HEARTBEAT_INTERVAL_MS as u64) - }; - let timer_flags = SetTimeFlags::Default; - timer.set_state(timer_state, timer_flags); + let (afk_state, mut afk_queue) = idle::init_afk_state(&conn, 120000).unwrap(); + let shared_afk_state = Arc::new(Mutex::new(afk_state)); + + { + let shared_window_state = shared_window_state.clone(); + let shared_afk_state = shared_afk_state.clone(); + + // a new thread to read wayland socket and handle events + thread::spawn(move || { + let mut dispatch = || { + let mut window_state = shared_window_state.lock().unwrap(); + let mut afk_state = shared_afk_state.lock().unwrap(); + window_queue.dispatch_pending(&mut window_state).unwrap(); + afk_queue.dispatch_pending(&mut afk_state).unwrap(); + }; + + loop { + match conn.prepare_read() { + Some(guard) => { + // mostly copied from https://github.com/Smithay/wayland-rs/blob/edd0f60d0baf09604553525c2636df5d6ba05d44/wayland-client/src/conn.rs#L219 + // because the method is not public... + let fd = guard.connection_fd(); + let mut fds = [nix::poll::PollFd::new( + &fd, + nix::poll::PollFlags::POLLIN | nix::poll::PollFlags::POLLERR, + )]; + + loop { + match nix::poll::poll(&mut fds, -1) { + Ok(_) => break, + Err(nix::errno::Errno::EINTR) => continue, + Err(e) => { + panic!("poll wayland socket err: {:?}", e); + } + } + } - poll.register(&EventedFd(&fd), STATE_CHANGE, Ready::readable(), PollOpt::empty()) - .expect("Failed to register state_change fd"); - poll.register(&EventedFd(&timer.as_raw_fd()), TIMER, Ready::readable(), PollOpt::empty()) - .expect("Failed to register timer fd"); + // at this point the fd is ready + match guard.read() { + Ok(_) => dispatch(), + // if we are still "wouldblock", just continue and retry. + Err(WaylandError::Io(e)) if e.kind() == ErrorKind::WouldBlock => { + continue + } + Err(e) => { + panic!("read wayland socket err: {:?}", e); + } + }; + } + None => dispatch(), + } + } + }); + } println!("### Taking client locks"); let host = "localhost"; let port = match testing { true => "5666", - false => "5600" + false => "5600", }; - let _window_lock = singleinstance::get_client_lock(&format!("aw-watcher-window-at-{}-on-{}", host, port)).unwrap(); - let _afk_lock = singleinstance::get_client_lock(&format!("aw-watcher-afk-at-{}-on-{}", host, port)).unwrap(); + let _window_lock = + singleinstance::get_client_lock(&format!("aw-watcher-window-at-{}-on-{}", host, port)) + .unwrap(); + let _afk_lock = + singleinstance::get_client_lock(&format!("aw-watcher-afk-at-{}-on-{}", host, port)) + .unwrap(); println!("### Creating aw-client"); - let client = aw_client_rust::AwClient::new(host, port, "aw-watcher-wayland"); + let client = aw_client_rust::blocking::AwClient::new(host, port, "aw-watcher-wayland"); let hostname = gethostname::gethostname().into_string().unwrap(); let window_bucket = format!("aw-watcher-window_{}", hostname); let afk_bucket = format!("aw-watcher-afk_{}", hostname); - client.create_bucket_simple(&window_bucket, "currentwindow") + client + .create_bucket_simple(&window_bucket, "currentwindow") .expect("Failed to create window bucket"); - client.create_bucket_simple(&afk_bucket, "afkstatus") + client + .create_bucket_simple(&afk_bucket, "afkstatus") .expect("Failed to create afk bucket"); println!("### Watcher is now running"); - let mut events = Events::with_capacity(1); - let mut prev_window : Option = None; loop { - poll.poll(&mut events, None).expect("Failed to poll fds"); - for event in &events { - match event.token() { - STATE_CHANGE => { - //println!("state change!"); - event_queue - .dispatch(|_, _| { /* we ignore unfiltered messages */ } ) - .expect("event_queue dispatch failure"); - - if let Some(ref prev_window) = prev_window { - let window_event = window_to_event(&prev_window); - if client.heartbeat(&window_bucket, &window_event, HEARTBEAT_INTERVAL_MARGIN_S).is_err() { - println!("Failed to send heartbeat"); - break; - } - } - - match current_window::get_focused_window() { - Some(current_window) => { - let window_event = window_to_event(¤t_window); - if client.heartbeat(&window_bucket, &window_event, HEARTBEAT_INTERVAL_MARGIN_S).is_err() { - println!("Failed to send heartbeat"); - break; - } - prev_window = Some(current_window); - }, - None => { - prev_window = None; - }, - } - - let afk_event = idle::get_current_afk_event(); - if client.heartbeat(&afk_bucket, &afk_event, HEARTBEAT_INTERVAL_MARGIN_S).is_err() { - println!("Failed to send heartbeat"); - break; - } - }, - TIMER => { - //println!("timer!"); - timer.read(); - - if let Some(ref prev_window) = prev_window { - let window_event = window_to_event(&prev_window); - if client.heartbeat(&window_bucket, &window_event, HEARTBEAT_INTERVAL_MARGIN_S).is_err() { - println!("Failed to send heartbeat"); - break; - } - } - - let afk_event = idle::get_current_afk_event(); - if client.heartbeat(&afk_bucket, &afk_event, HEARTBEAT_INTERVAL_MARGIN_S).is_err() { - println!("Failed to send heartbeat"); - break; - } + { + // need another block to drop mutex lock + let window_state = shared_window_state.lock().unwrap(); + if let Some(window) = window_state.get_focused_window() { + let window_event = window_to_event(&window); + if client + .heartbeat(&window_bucket, &window_event, HEARTBEAT_INTERVAL_MARGIN_S) + .is_err() + { + println!("Failed to send heartbeat"); + break; + } + } - }, - _ => panic!("Invalid token!") + let afk_state = shared_afk_state.lock().unwrap(); + let afk_event = afk_state.get_current_afk_event(); + if client + .heartbeat(&afk_bucket, &afk_event, HEARTBEAT_INTERVAL_MARGIN_S) + .is_err() + { + println!("Failed to send heartbeat"); + break; } } + thread::sleep(time::Duration::from_millis(HEARTBEAT_INTERVAL_MS)); } } diff --git a/src/singleinstance.rs b/src/singleinstance.rs index 5d265b1..75a0950 100644 --- a/src/singleinstance.rs +++ b/src/singleinstance.rs @@ -1,7 +1,3 @@ -//extern crate nix; -extern crate appdirs; -extern crate file_lock; - use file_lock::FileLock; use std::fs; use std::io; @@ -23,7 +19,7 @@ pub fn get_client_lock(clientname: &str) -> Result { path.push(clientname); - match FileLock::lock(&path.to_str().unwrap(), false, true) { + match FileLock::lock(path.to_str().unwrap(), false, true) { Ok(lockfile) => Ok(lockfile), Err(err) => Err(format!( "Failed to get lock for client '{}': {}", diff --git a/src/utils.rs b/src/utils.rs new file mode 100644 index 0000000..e5bc815 --- /dev/null +++ b/src/utils.rs @@ -0,0 +1,22 @@ +use wayland_client::{protocol::wl_registry, Dispatch, globals::GlobalListContents, QueueHandle, Connection}; + +pub struct RegistryState; + +impl Dispatch for RegistryState +where +State: Dispatch, +{ + fn event( + _: &mut State, + _: &wl_registry::WlRegistry, + event: wl_registry::Event, + _: &GlobalListContents, + _: &Connection, + _: &QueueHandle, + ) { + // TODO: handle dynamic global change + // although I think we can simply do nothing here.. + println!("wayland globals has changed: {:?}", event); + } +} + diff --git a/src/wl_client.rs b/src/wl_client.rs deleted file mode 100644 index 54930f7..0000000 --- a/src/wl_client.rs +++ /dev/null @@ -1,36 +0,0 @@ - - -// Re-export only the actual code, and then only use this re-export -// The `generated` module below is just some boilerplate to properly isolate stuff -// and avoid exposing internal details. -// -// You can use all the types from my_protocol as if they went from `wayland_client::protocol`. - -// The generated code tends to trigger a lot of warnings -// so we isolate it into a very permissive module -#![allow(dead_code,non_camel_case_types,unused_unsafe,unused_variables)] -#![allow(non_upper_case_globals,non_snake_case,unused_imports)] - -pub mod toplevel_management { - pub(crate) use smallvec; - pub(crate) use wayland_sys as sys; - pub(crate) use wayland_client::{AnonymousObject, Interface, Main, Proxy, ProxyMap}; - pub(crate) use wayland_client::protocol::{wl_surface, wl_region, wl_seat, wl_output}; - pub(crate) use wayland_commons::{MessageGroup}; - pub(crate) use wayland_commons::map::{Object, ObjectMetadata}; - pub(crate) use wayland_commons::wire::{Argument, ArgumentType, Message, MessageDesc}; - - include!("protocols/wlr-foreign-toplevel-management.rs"); -} - -pub mod idle { - pub(crate) use smallvec; - pub(crate) use wayland_sys as sys; - pub(crate) use wayland_client::{AnonymousObject, Interface, Main, Proxy, ProxyMap}; - pub(crate) use wayland_client::protocol::{wl_surface, wl_region, wl_seat, wl_output}; - pub(crate) use wayland_commons::{MessageGroup}; - pub(crate) use wayland_commons::map::{Object, ObjectMetadata}; - pub(crate) use wayland_commons::wire::{Argument, ArgumentType, Message, MessageDesc}; - - include!("protocols/idle.rs"); -}