diff --git a/Cargo.lock b/Cargo.lock index 03afb652..360f54bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,32 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "ab_glyph" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" + [[package]] name = "addr2line" version = "0.17.0" @@ -17,6 +43,38 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_glue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" + [[package]] name = "ansi_term" version = "0.12.1" @@ -26,6 +84,110 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "as-any" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3419eecc9f5967e6f0f29a0c3fefe22bda6ea34b15798f3c452cb81f2c3fa7" + +[[package]] +name = "async-broadcast" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90622698a1218e0b2fb846c97b5f19a0831f6baddee73d9454156365ccfa473b" +dependencies = [ + "easy-parallel", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi 0.3.9", +] + +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-task" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" + +[[package]] +name = "async-trait" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic_refcell" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b5e5f48b927f04e952dedc932f31995a65a0bf65ec971c74436e51bf6e970d" + [[package]] name = "atty" version = "0.2.14" @@ -64,12 +226,78 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "bytemuck" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "calloop" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +dependencies = [ + "log", + "nix 0.22.3", +] + [[package]] name = "cc" version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "0.1.10" @@ -82,6 +310,28 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time 0.1.43", + "winapi 0.3.9", +] + [[package]] name = "clap" version = "3.1.10" @@ -122,6 +372,58 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clipboard-win" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" +dependencies = [ + "lazy-bytes-cast", + "winapi 0.3.9", +] + +[[package]] +name = "clipboard-win" +version = "4.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3e1238132dc01f081e1cbb9dace14e5ef4c3a51ee244bd982275fb514605db" +dependencies = [ + "error-code", + "str-buf", + "winapi 0.3.9", +] + +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation 0.9.3", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + [[package]] name = "color-eyre" version = "0.6.1" @@ -149,12 +451,127 @@ dependencies = [ "tracing-error", ] +[[package]] +name = "combine" +version = "4.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "const-sha1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" + +[[package]] +name = "copypasta" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" +dependencies = [ + "clipboard-win 3.1.1", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "x11-clipboard", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys 0.7.0", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation 0.9.3", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation 0.9.3", + "foreign-types", + "libc", +] + +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", + "libc", + "objc", +] + [[package]] name = "crossbeam-channel" version = "0.5.4" @@ -206,10 +623,85 @@ version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19c6cedffdc8c03a3346d723eb20bd85a13362bb96dc2ac000842c6381ec7bf" dependencies = [ - "nix", + "nix 0.23.1", "winapi 0.3.9", ] +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "dark-light" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b83576e2eee2d9cdaa8d08812ae59cbfe1b5ac7ac5ac4b8400303c6148a88c1" +dependencies = [ + "dconf_rs", + "detect-desktop-environment", + "dirs", + "objc", + "rust-ini", + "web-sys", + "winreg 0.8.0", + "zbus", + "zvariant", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dconf_rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive-ahk" version = "0.1.0" @@ -219,6 +711,12 @@ dependencies = [ "syn", ] +[[package]] +name = "detect-desktop-environment" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21d8ad60dd5b13a4ee6bd8fa2d5d88965c597c67bce32b5fc49c94f55cb50810" + [[package]] name = "dirs" version = "4.0.0" @@ -239,18 +737,201 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading", +] + +[[package]] +name = "dlv-list" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + [[package]] name = "dyn-clone" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" +[[package]] +name = "easy-parallel" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946" + +[[package]] +name = "eframe" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9fe0985844076809b8c08b609266567797a6b721abb6a4975e158ab413cd6f2" +dependencies = [ + "egui", + "egui-winit", + "egui_glow", + "egui_web", + "epi", +] + +[[package]] +name = "egui" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3cd1d47e12f7a17912595241622e373aa652a4e0fa90b3f9278f90a64aedf7" +dependencies = [ + "ahash 0.7.6", + "epaint", + "nohash-hasher", + "tracing", +] + +[[package]] +name = "egui-winit" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43eac3180ea178ef1a5f3048cc12c58bcbcb17fc3401813f7229c99ef2ffc1d9" +dependencies = [ + "copypasta", + "dark-light", + "egui", + "epi", + "instant", + "tracing", + "webbrowser", + "winit", +] + +[[package]] +name = "egui_glow" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04a252f6d333fceb910a8f5b3ef2d4402e1646cd4daa11e7b11ea38d1b6190d3" +dependencies = [ + "bytemuck", + "egui", + "egui-winit", + "epi", + "glow", + "glutin", + "memoffset", + "tracing", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "egui_web" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030f81109b90583cd7b3bc7e4bb31dfae615f4adcc422b1b313030929d3b350c" +dependencies = [ + "bytemuck", + "egui", + "egui_glow", + "epi", + "js-sys", + "percent-encoding", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "either" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "emath" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a977a80456be58a2c2d48e69c1d0baadef46cecef5a0c98df141c468da006f12" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "enumflags2" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "epaint" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033292846059f08e03a71e1b5db2ee6ab7c9622c3b48da21f4bd13258ebee2db" +dependencies = [ + "ab_glyph", + "ahash 0.7.6", + "atomic_refcell", + "bytemuck", + "emath", + "nohash-hasher", +] + +[[package]] +name = "epi" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95445deccef4d29fa30488d3f7f2e942dd343eef01228becc7cefd5b918176e" +dependencies = [ + "egui", + "tracing", +] + +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + [[package]] name = "eyre" version = "0.6.8" @@ -261,6 +942,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "filetime" version = "0.2.16" @@ -279,6 +969,37 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + [[package]] name = "fs-tail" version = "0.1.4" @@ -329,6 +1050,59 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "getrandom" version = "0.2.6" @@ -337,7 +1111,7 @@ checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] @@ -358,6 +1132,110 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + +[[package]] +name = "glow" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "glutin" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00ea9dbe544bc8a657c4c4a798c2d16cd01b549820e47657297549d28371f6d2" +dependencies = [ + "android_glue", + "cgl", + "cocoa", + "core-foundation 0.9.3", + "glutin_egl_sys", + "glutin_emscripten_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "lazy_static", + "libloading", + "log", + "objc", + "osmesa-sys", + "parking_lot 0.11.2", + "wayland-client", + "wayland-egl", + "winapi 0.3.9", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" +dependencies = [ + "gl_generator", + "winapi 0.3.9", +] + +[[package]] +name = "glutin_emscripten_sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +dependencies = [ + "gl_generator", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" +dependencies = [ + "gl_generator", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +dependencies = [ + "gl_generator", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash 0.4.7", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -379,6 +1257,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hotwatch" version = "0.4.6" @@ -389,6 +1273,23 @@ dependencies = [ "notify", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indenter" version = "0.3.3" @@ -402,7 +1303,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -425,6 +1326,18 @@ dependencies = [ "libc", ] +[[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", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "iovec" version = "0.1.4" @@ -440,6 +1353,35 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -450,6 +1392,12 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "komorebi" version = "0.1.8" @@ -467,7 +1415,7 @@ dependencies = [ "lazy_static", "miow 0.4.0", "nanoid", - "parking_lot", + "parking_lot 0.12.0", "paste", "schemars", "serde", @@ -479,9 +1427,32 @@ dependencies = [ "tracing-subscriber", "uds_windows", "which", - "windows", + "windows 0.35.0", "winput", - "winreg", + "winreg 0.10.1", +] + +[[package]] +name = "komorebi-bar" +version = "0.1.0" +dependencies = [ + "as-any", + "chrono", + "clipboard-win 4.4.1", + "color-eyre", + "eframe", + "egui", + "komorebi", + "komorebi-core", + "lazy_static", + "local-ip-address", + "miow 0.4.0", + "parking_lot 0.12.0", + "schemafy", + "serde", + "serde_json", + "sysinfo", + "windows 0.35.0", ] [[package]] @@ -495,7 +1466,7 @@ dependencies = [ "serde_json", "serde_yaml", "strum", - "windows", + "windows 0.35.0", ] [[package]] @@ -516,9 +1487,15 @@ dependencies = [ "serde_json", "serde_yaml", "uds_windows", - "windows", + "windows 0.35.0", ] +[[package]] +name = "lazy-bytes-cast" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" + [[package]] name = "lazy_static" version = "1.4.0" @@ -537,12 +1514,35 @@ version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + [[package]] name = "linked-hash-map" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +[[package]] +name = "local-ip-address" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b143c6ef86e36328caa40a7578e95d1544aca8a1740235fd2b416a69441a5c7" +dependencies = [ + "libc", + "memalloc", + "neli", + "thiserror", + "windows 0.18.0", +] + [[package]] name = "lock_api" version = "0.4.7" @@ -562,6 +1562,15 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -571,12 +1580,33 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memalloc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" + [[package]] name = "memchr" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "memmap2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -586,6 +1616,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.5.1" @@ -614,6 +1650,20 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "mio" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +dependencies = [ + "libc", + "log", + "miow 0.3.7", + "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + [[package]] name = "mio-extras" version = "2.0.6" @@ -622,7 +1672,7 @@ checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", "log", - "mio", + "mio 0.6.23", "slab", ] @@ -638,6 +1688,15 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "miow" version = "0.4.0" @@ -656,6 +1715,106 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "ndk" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.2.2", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.3.0", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.5.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.2.2", +] + +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.6.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.3.0", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "neli" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9053554eb5dcb7e10d9cdab1206965bde870eed5d0d341532ca035e3ba221508" +dependencies = [ + "byteorder", + "libc", +] + [[package]] name = "net2" version = "0.2.37" @@ -667,6 +1826,19 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "nix" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + [[package]] name = "nix" version = "0.23.1" @@ -680,6 +1852,22 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "notify" version = "4.0.17" @@ -692,7 +1880,7 @@ dependencies = [ "fsevent-sys", "inotify", "libc", - "mio", + "mio 0.6.23", "mio-extras", "walkdir", "winapi 0.3.9", @@ -707,6 +1895,25 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.13.1" @@ -717,6 +1924,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "num_threads" version = "0.1.5" @@ -726,6 +1954,35 @@ dependencies = [ "libc", ] +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "object" version = "0.28.3" @@ -741,18 +1998,73 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +[[package]] +name = "ordered-multimap" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +dependencies = [ + "dlv-list", + "hashbrown 0.9.1", +] + +[[package]] +name = "ordered-stream" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "os_str_bytes" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +[[package]] +name = "osmesa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +dependencies = [ + "shared_library", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" +dependencies = [ + "ttf-parser", +] + [[package]] name = "owo-colors" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e72e30578e0d0993c8ae20823dd9cff2bc5517d2f586a8aef462a581e8a03eb" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.5", +] + [[package]] name = "parking_lot" version = "0.12.0" @@ -760,7 +2072,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.2", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", ] [[package]] @@ -785,6 +2111,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + [[package]] name = "petgraph" version = "0.6.0" @@ -801,6 +2133,31 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi 0.3.9", +] + [[package]] name = "powershell_script" version = "0.3.2" @@ -813,6 +2170,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -846,6 +2213,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "quick-xml" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.18" @@ -913,6 +2289,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + [[package]] name = "rayon" version = "1.5.2" @@ -972,6 +2357,8 @@ version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] @@ -999,6 +2386,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "rust-ini" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -1026,6 +2423,49 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schemafy" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9725c16a64e85972fcb3630677be83fef699a1cd8e4bfbdcf3b3c6675f838a19" +dependencies = [ + "Inflector", + "schemafy_core", + "schemafy_lib", + "serde", + "serde_derive", + "serde_json", + "serde_repr", + "syn", +] + +[[package]] +name = "schemafy_core" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bec29dddcfe60f92f3c0d422707b8b56473983ef0481df8d5236ed3ab8fdf24" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "schemafy_lib" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af3d87f1df246a9b7e2bfd1f4ee5f88e48b11ef9cfc62e63f0dead255b1a6f5f" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "schemafy_core", + "serde", + "serde_derive", + "serde_json", + "syn", + "uriparse", +] + [[package]] name = "schemars" version = "0.8.8" @@ -1050,6 +2490,12 @@ dependencies = [ "syn", ] +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1098,6 +2544,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "serde_yaml" version = "0.8.23" @@ -1110,6 +2567,21 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sharded-slab" version = "0.1.4" @@ -1119,18 +2591,88 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + [[package]] name = "slab" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +[[package]] +name = "smithay-client-toolkit" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" +dependencies = [ + "bitflags", + "calloop", + "dlib", + "lazy_static", + "log", + "memmap2", + "nix 0.22.3", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "str-buf" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" + [[package]] name = "strsim" version = "0.10.0" @@ -1177,7 +2719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eea2ed6847da2e0c7289f72cb4f285f0bd704694ca067d32be811b2a45ea858" dependencies = [ "cfg-if 1.0.0", - "core-foundation-sys", + "core-foundation-sys 0.8.3", "libc", "ntapi", "once_cell", @@ -1263,6 +2805,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "time" version = "0.3.9" @@ -1274,6 +2826,30 @@ dependencies = [ "num_threads", ] +[[package]] +name = "tinyvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + [[package]] name = "tracing" version = "0.1.34" @@ -1293,7 +2869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time", + "time 0.3.9", "tracing-subscriber", ] @@ -1357,6 +2933,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "ttf-parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74c96594835e10fa545e2a51e8709f30b173a092bfd6036ef2cec53376244f3" + [[package]] name = "uds_windows" version = "1.0.1" @@ -1367,12 +2949,49 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "unicode-bidi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-xid" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + [[package]] name = "valuable" version = "0.1.0" @@ -1385,6 +3004,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.3.2" @@ -1402,6 +3027,194 @@ version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" + +[[package]] +name = "wayland-client" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.22.3", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" +dependencies = [ + "nix 0.22.3", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" +dependencies = [ + "nix 0.22.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-egl" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83281d69ee162b59031c666385e93bde4039ec553b90c4191cdb128ceea29a3a" +dependencies = [ + "wayland-client", + "wayland-sys", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c28b6b6a78440b02647358625e3febc90724126480b9da6a967b5f674b3554" +dependencies = [ + "jni", + "ndk-glue 0.6.2", + "url", + "web-sys", + "widestring", + "winapi 0.3.9", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "which" version = "4.2.5" @@ -1413,6 +3226,12 @@ dependencies = [ "libc", ] +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + [[package]] name = "winapi" version = "0.2.8" @@ -1456,6 +3275,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68088239696c06152844eadc03d262f088932cce50c67e4ace86e19d95e976fe" +dependencies = [ + "const-sha1", + "windows_gen", + "windows_macros", +] + [[package]] name = "windows" version = "0.35.0" @@ -1513,6 +3343,12 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" +[[package]] +name = "windows_gen" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf583322dc423ee021035b358e535015f7fd163058a31e2d37b99a939141121d" + [[package]] name = "windows_i686_gnu" version = "0.28.0" @@ -1549,6 +3385,16 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" +[[package]] +name = "windows_macros" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58acfb8832e9f707f8997bd161e537a1c1f603e60a5bd9c3cf53484fdcc998f3" +dependencies = [ + "syn", + "windows_gen", +] + [[package]] name = "windows_x86_64_gnu" version = "0.28.0" @@ -1585,6 +3431,39 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" +[[package]] +name = "winit" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" +dependencies = [ + "bitflags", + "cocoa", + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "core-video-sys", + "dispatch", + "instant", + "lazy_static", + "libc", + "log", + "mio 0.8.2", + "ndk 0.5.0", + "ndk-glue 0.5.2", + "ndk-sys 0.2.2", + "objc", + "parking_lot 0.11.2", + "percent-encoding", + "raw-window-handle", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client", + "wayland-protocols", + "web-sys", + "winapi 0.3.9", + "x11-dl", +] + [[package]] name = "winput" version = "0.2.5" @@ -1594,6 +3473,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "winreg" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d107f8c6e916235c4c01cabb3e8acf7bea8ef6a63ca2e7fa0527c049badfc48c" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winreg" version = "0.10.1" @@ -1613,6 +3501,52 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "x11-clipboard" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" +dependencies = [ + "xcb", +] + +[[package]] +name = "x11-dl" +version = "2.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "xcb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" +dependencies = [ + "libc", + "log", + "quick-xml", +] + +[[package]] +name = "xcursor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +dependencies = [ + "nom", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -1621,3 +3555,90 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] + +[[package]] +name = "zbus" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb86f3d4592e26a48b2719742aec94f8ae6238ebde20d98183ee185d1275e9a" +dependencies = [ + "async-broadcast", + "async-channel", + "async-executor", + "async-io", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "lazy_static", + "nix 0.23.1", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "winapi 0.3.9", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36823cc10fddc3c6b19f048903262dacaf8274170e9a255784bdd8b4570a8040" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn", +] + +[[package]] +name = "zbus_names" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45dfcdcf87b71dad505d30cc27b1b7b88a64b6d1c435648f48f9dbc1fdc4b7e1" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49ea5dc38b2058fae6a5b79009388143dadce1e91c26a67f984a0fc0381c8033" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2cecc5a61c2a053f7f653a24cd15b3b0195d7f7ddb5042c837fb32e161fb7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 1adc4354..635e18ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,6 @@ members = [ "derive-ahk", "komorebi", "komorebi-core", + "komorebi-bar", "komorebic" ] diff --git a/komorebi-bar/Cargo.toml b/komorebi-bar/Cargo.toml new file mode 100644 index 00000000..e8aa45db --- /dev/null +++ b/komorebi-bar/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "komorebi-bar" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +komorebi = { path = "../komorebi" } +komorebi-core = { path = "../komorebi-core" } + +as-any = "0.3" +chrono = "0.4" +color-eyre = "0.6" +eframe = "0.17" +egui = "0.17" +lazy_static = "1.4" +miow = "0.4" +schemafy = "0.6" +serde = "1" +serde_json = "1" +parking_lot = "0.12" +local-ip-address = "0.4" +clipboard-win = "4.4" +sysinfo = "0.23" + +[dependencies.windows] +version = "0.35" +features = [ + "Win32_Graphics_Gdi", +] diff --git a/komorebi-bar/src/bar.rs b/komorebi-bar/src/bar.rs new file mode 100644 index 00000000..8f82e5b6 --- /dev/null +++ b/komorebi-bar/src/bar.rs @@ -0,0 +1,125 @@ +use crate::date::Date; +use crate::ram::Ram; +use crate::time::Time; +use crate::widget::BarWidget; +use crate::widget::Output; +use crate::widget::Widget; +use crate::IpAddress; +use crate::Storage; +use crate::Workspaces; +use clipboard_win::set_clipboard_string; +use color_eyre::owo_colors::OwoColorize; +use eframe::epi::App; +use eframe::epi::Frame; +use egui::style::Margin; +use egui::CentralPanel; +use egui::Color32; +use egui::Context; +use egui::Direction; +use egui::Layout; +use egui::Rounding; +use std::process::Command; +use std::sync::atomic::Ordering; + +pub struct Bar { + pub background_rgb: Color32, + pub text_rgb: Color32, + pub workspaces: Workspaces, + pub time: Time, + pub date: Date, + pub ip_address: IpAddress, + pub memory: Ram, + pub storage: Storage, +} + +impl App for Bar { + fn update(&mut self, ctx: &Context, frame: &Frame) { + let custom_frame = egui::Frame { + margin: Margin::symmetric(8.0, 8.0), + rounding: Rounding::none(), + fill: self.background_rgb, + ..Default::default() + }; + + CentralPanel::default().frame(custom_frame).show(ctx, |ui| { + ui.horizontal(|horizontal| { + horizontal.style_mut().visuals.override_text_color = Option::from(self.text_rgb); + + horizontal.with_layout(Layout::left_to_right(), |ltr| { + for (i, workspace) in self.workspaces.output().iter().enumerate() { + if workspace == "komorebi offline" { + ltr.label(workspace); + } else { + ctx.request_repaint(); + if ltr + .selectable_label(*self.workspaces.selected.lock() == i, workspace) + .clicked() + { + let mut selected = self.workspaces.selected.lock(); + *selected = i; + + if let Err(error) = Workspaces::focus(i) { + eprintln!("{}", error) + }; + } + } + } + }); + + horizontal.with_layout(Layout::right_to_left(), |rtl| { + for time in self.time.output() { + ctx.request_repaint(); + if rtl.button(format!("🕐 {}", time)).clicked() { + self.time.format.toggle() + }; + } + + for date in self.date.output() { + if rtl.button(format!("📅 {}", date)).clicked() { + self.date.format.next() + }; + } + + for memory in self.memory.output() { + if rtl.button(format!("🐏 {}", memory)).clicked() { + if let Err(error) = + Command::new("cmd.exe").args(["/C", "taskmgr.exe"]).output() + { + eprintln!("{}", error) + } + }; + } + + for disk in self.storage.output() { + if rtl.button(format!("🖴 {}", disk)).clicked() { + if let Err(error) = Command::new("cmd.exe") + .args([ + "/C", + "explorer.exe", + disk.split(' ').collect::>()[0], + ]) + .output() + { + eprintln!("{}", error) + } + }; + } + + for ip in self.ip_address.output() { + if rtl.button(format!("🌐 {}", ip)).clicked() { + if let Err(error) = + Command::new("cmd.exe").args(["/C", "ncpa.cpl"]).output() + { + eprintln!("{}", error) + } + }; + } + }); + }) + }); + } + + fn name(&self) -> &str { + "komorebi-bar" + } +} diff --git a/komorebi-bar/src/date.rs b/komorebi-bar/src/date.rs new file mode 100644 index 00000000..de83f846 --- /dev/null +++ b/komorebi-bar/src/date.rs @@ -0,0 +1,46 @@ +use crate::widget::BarWidget; + +pub enum DateFormat { + MonthDateYear, + YearMonthDate, + DateMonthYear, + DayDateMonthYear, +} + +impl DateFormat { + pub fn next(&mut self) { + match self { + DateFormat::MonthDateYear => *self = Self::YearMonthDate, + DateFormat::YearMonthDate => *self = Self::DateMonthYear, + DateFormat::DateMonthYear => *self = Self::DayDateMonthYear, + DateFormat::DayDateMonthYear => *self = Self::MonthDateYear, + }; + } + + fn fmt_string(&self) -> String { + match self { + DateFormat::MonthDateYear => String::from("%D"), + DateFormat::YearMonthDate => String::from("%F"), + DateFormat::DateMonthYear => String::from("%v"), + DateFormat::DayDateMonthYear => String::from("%A %e %B %Y"), + } + } +} + +pub struct Date { + pub format: DateFormat, +} + +impl Date { + pub fn init(format: DateFormat) -> Self { + Self { format } + } +} + +impl BarWidget for Date { + fn output(&mut self) -> Vec { + vec![chrono::Local::now() + .format(&self.format.fmt_string()) + .to_string()] + } +} diff --git a/komorebi-bar/src/ip_address.rs b/komorebi-bar/src/ip_address.rs new file mode 100644 index 00000000..81ed316e --- /dev/null +++ b/komorebi-bar/src/ip_address.rs @@ -0,0 +1,27 @@ +use crate::widget::BarWidget; +use local_ip_address::find_ifa; +use local_ip_address::local_ip; + +pub struct IpAddress { + pub interface: String, +} + +impl IpAddress { + pub fn init(interface: String) -> Self { + IpAddress { interface } + } +} + +impl BarWidget for IpAddress { + fn output(&mut self) -> Vec { + if let Ok(interfaces) = local_ip_address::list_afinet_netifas() { + if let Some((interface, ip_address)) = + local_ip_address::find_ifa(interfaces, &self.interface) + { + return vec![format!("{}: {}", interface, ip_address)]; + } + } + + vec![format!("{}: disconnected", self.interface)] + } +} diff --git a/komorebi-bar/src/main.rs b/komorebi-bar/src/main.rs new file mode 100644 index 00000000..b375b95e --- /dev/null +++ b/komorebi-bar/src/main.rs @@ -0,0 +1,80 @@ +mod bar; +mod date; +mod ip_address; +mod ram; +mod storage; +mod time; +mod widget; +mod workspaces; + +use crate::ip_address::IpAddress; +use crate::ram::Ram; +use crate::storage::Storage; +use bar::Bar; +use color_eyre::Result; +use date::Date; +use date::DateFormat; +use eframe::run_native; +use eframe::NativeOptions; +use egui::Color32; +use egui::Pos2; +use egui::Vec2; +use komorebi::WindowsApi; +use time::Time; +use time::TimeFormat; +use windows::Win32::Graphics::Gdi::HMONITOR; +use workspaces::Workspaces; + +fn main() -> Result<()> { + let workspaces = Workspaces::init(0)?; + let time = Time::init(TimeFormat::TwentyFourHour); + let date = Date::init(DateFormat::DayDateMonthYear); + let ip_address = IpAddress::init(String::from("Ethernet")); + + let app = Bar { + background_rgb: Color32::from_rgb(255, 0, 0), + text_rgb: Color32::from_rgb(255, 255, 255), + workspaces, + time, + date, + ip_address, + memory: Ram, + storage: Storage, + }; + + let mut win_option = NativeOptions { + decorated: false, + ..Default::default() + }; + + // let hmonitors = WindowsApi::valid_hmonitors()?; + // for hmonitor in hmonitors { + // let info = WindowsApi::monitor_info(hmonitor)?; + // } + + let info = WindowsApi::monitor_info_w(HMONITOR(65537))?; + + let offset = Offsets { + vertical: 10.0, + horizontal: 200.0, + }; + + win_option.initial_window_pos = Option::from(Pos2::new( + info.rcWork.left as f32 + offset.horizontal, + info.rcWork.top as f32 + offset.vertical * 2.0, + )); + + win_option.initial_window_size = Option::from(Vec2::new( + info.rcWork.right as f32 - (offset.horizontal * 2.0), + info.rcWork.top as f32 - offset.vertical, + )); + + win_option.always_on_top = true; + + run_native(Box::new(app), win_option); +} + +struct Offsets { + vertical: f32, + horizontal: f32, +} diff --git a/komorebi-bar/src/ram.rs b/komorebi-bar/src/ram.rs new file mode 100644 index 00000000..c75a78f5 --- /dev/null +++ b/komorebi-bar/src/ram.rs @@ -0,0 +1,15 @@ +use crate::widget::BarWidget; +use sysinfo::RefreshKind; +use sysinfo::System; +use sysinfo::SystemExt; + +pub struct Ram; + +impl BarWidget for Ram { + fn output(&mut self) -> Vec { + let sys = System::new_with_specifics(RefreshKind::new().with_memory()); + let used = sys.used_memory(); + let total = sys.total_memory(); + vec![format!("RAM: {}%", (used * 100) / total)] + } +} diff --git a/komorebi-bar/src/storage.rs b/komorebi-bar/src/storage.rs new file mode 100644 index 00000000..279bee97 --- /dev/null +++ b/komorebi-bar/src/storage.rs @@ -0,0 +1,35 @@ +use crate::widget::BarWidget; +use crate::widget::Output; +use crate::widget::Widget; +use color_eyre::Result; +use sysinfo::DiskExt; +use sysinfo::RefreshKind; +use sysinfo::System; +use sysinfo::SystemExt; + +pub struct Storage; + +impl BarWidget for Storage { + fn output(&mut self) -> Vec { + let sys = System::new_with_specifics(RefreshKind::new().with_disks_list()); + + let mut disks = vec![]; + + for disk in sys.disks() { + let mount = disk.mount_point(); + let total = disk.total_space(); + let available = disk.available_space(); + let used = total - available; + + disks.push(format!( + "{} {}%", + mount.to_string_lossy(), + (used * 100) / total + )) + } + + disks.reverse(); + + disks + } +} diff --git a/komorebi-bar/src/time.rs b/komorebi-bar/src/time.rs new file mode 100644 index 00000000..de2e000e --- /dev/null +++ b/komorebi-bar/src/time.rs @@ -0,0 +1,40 @@ +use crate::widget::BarWidget; + +pub enum TimeFormat { + TwelveHour, + TwentyFourHour, +} + +impl TimeFormat { + pub fn toggle(&mut self) { + match self { + TimeFormat::TwelveHour => *self = TimeFormat::TwentyFourHour, + TimeFormat::TwentyFourHour => *self = TimeFormat::TwelveHour, + }; + } + + fn fmt_string(&self) -> String { + match self { + TimeFormat::TwelveHour => String::from("%l:%M:%S %p"), + TimeFormat::TwentyFourHour => String::from("%T"), + } + } +} + +pub struct Time { + pub format: TimeFormat, +} + +impl Time { + pub fn init(format: TimeFormat) -> Self { + Self { format } + } +} + +impl BarWidget for Time { + fn output(&mut self) -> Vec { + vec![chrono::Local::now() + .format(&self.format.fmt_string()) + .to_string()] + } +} diff --git a/komorebi-bar/src/widget.rs b/komorebi-bar/src/widget.rs new file mode 100644 index 00000000..e61ca181 --- /dev/null +++ b/komorebi-bar/src/widget.rs @@ -0,0 +1,25 @@ +use as_any::AsAny; +use color_eyre::Result; + +#[derive(Debug, Clone)] +pub enum Output { + SingleBox(String), + MultiBox(Vec), +} + +#[derive(Debug, Copy, Clone)] +pub enum RepaintStrategy { + Default, + Constant, +} + +pub trait Widget: AsAny { + fn output(&mut self) -> Result; + fn repaint_strategy(&self) -> RepaintStrategy { + RepaintStrategy::Default + } +} + +pub trait BarWidget { + fn output(&mut self) -> Vec; +} diff --git a/komorebi-bar/src/workspaces.rs b/komorebi-bar/src/workspaces.rs new file mode 100644 index 00000000..67075e40 --- /dev/null +++ b/komorebi-bar/src/workspaces.rs @@ -0,0 +1,179 @@ +use crate::widget::BarWidget; +use color_eyre::Report; +use color_eyre::Result; +use komorebi::Notification; +use komorebi::State; +use miow::pipe::NamedPipe; +use parking_lot::Mutex; +use std::io::Read; +use std::process::Command; +use std::sync::Arc; +use std::thread; +use std::thread::sleep; +use std::time::Duration; + +pub struct Workspaces { + pub enabled: bool, + pub monitor_idx: usize, + pub connected: Arc>, + pub pipe: Arc>, + pub state: Arc>, + pub selected: Arc>, +} + +impl BarWidget for Workspaces { + fn output(&mut self) -> Vec { + let state = self.state.lock(); + let mut workspaces = vec![]; + + if let Some(primary_monitor) = state.monitors.elements().get(self.monitor_idx) { + for (i, workspace) in primary_monitor.workspaces().iter().enumerate() { + workspaces.push(if let Some(name) = workspace.name() { + name.clone() + } else { + format!("{}", i + 1) + }); + } + } + + if workspaces.is_empty() || !*self.connected.lock() { + vec!["komorebi offline".to_string()] + } else { + workspaces + } + } +} + +const PIPE: &str = r#"\\.\pipe\"#; + +impl Workspaces { + pub fn focus(index: usize) -> Result<()> { + Ok(Command::new("cmd.exe") + .args([ + "/C", + "komorebic.exe", + "focus-workspace", + &format!("{}", index), + ]) + .output() + .map(|_| ())?) + } + + pub fn init(monitor_idx: usize) -> Result { + let name = format!("bar-{}", monitor_idx); + let pipe = format!("{}\\{}", PIPE, name); + + let mut named_pipe = NamedPipe::new(pipe)?; + + let mut output = Command::new("cmd.exe") + .args(["/C", "komorebic.exe", "subscribe", &name]) + .output()?; + + while !output.status.success() { + println!( + "komorebic.exe failed with error code {:?}, retrying in 5 seconds...", + output.status.code() + ); + + sleep(Duration::from_secs(5)); + + output = Command::new("cmd.exe") + .args(["/C", "komorebic.exe", "subscribe", &name]) + .output()?; + } + + named_pipe.connect()?; + + let mut buf = vec![0; 4096]; + + let mut bytes_read = named_pipe.read(&mut buf)?; + let mut data = String::from_utf8(buf[0..bytes_read].to_vec())?; + while data == "\n" { + bytes_read = named_pipe.read(&mut buf)?; + data = String::from_utf8(buf[0..bytes_read].to_vec())?; + } + + let notification: Notification = serde_json::from_str(&data)?; + + let mut workspaces = Self { + enabled: true, + monitor_idx, + connected: Arc::new(Mutex::new(true)), + pipe: Arc::new(Mutex::new(named_pipe)), + state: Arc::new(Mutex::new(notification.state)), + selected: Arc::new(Mutex::new(0)), + }; + + workspaces.listen()?; + Ok(workspaces) + } + + pub fn listen(&mut self) -> Result<()> { + let state = self.state.clone(); + let pipe = self.pipe.clone(); + let connected = self.connected.clone(); + let selected = self.selected.clone(); + + thread::spawn(move || -> Result<()> { + let mut buf = vec![0; 4096]; + loop { + let mut named_pipe = pipe.lock(); + match (*named_pipe).read(&mut buf) { + Ok(bytes_read) => { + let data = String::from_utf8(buf[0..bytes_read].to_vec())?; + if data == "\n" { + continue; + } + + let notification: Notification = serde_json::from_str(&data)?; + + let mut sl = selected.lock(); + *sl = notification.state.monitors.elements()[0].focused_workspace_idx(); + + let mut st = state.lock(); + *st = notification.state; + } + Err(error) => { + // Broken pipe + if error.raw_os_error().unwrap() == 109 { + { + let mut cn = connected.lock(); + *cn = false; + } + + named_pipe.disconnect()?; + + let mut output = Command::new("cmd.exe") + .args(["/C", "komorebic.exe", "subscribe", "bar"]) + .output()?; + + while !output.status.success() { + println!( + "komorebic.exe failed with error code {:?}, retrying in 5 seconds...", + output.status.code() + ); + + sleep(Duration::from_secs(5)); + + output = Command::new("cmd.exe") + .args(["/C", "komorebic.exe", "subscribe", "bar"]) + .output()?; + } + + named_pipe.connect()?; + + { + let mut cn = connected.lock(); + *cn = true; + } + } else { + return Err(Report::from(error)); + } + } + } + } + }); + + Ok(()) + } +} diff --git a/komorebi/Cargo.toml b/komorebi/Cargo.toml index 72b3e72d..33b9bbc5 100644 --- a/komorebi/Cargo.toml +++ b/komorebi/Cargo.toml @@ -8,6 +8,14 @@ repository = "https://github.com/LGUG2Z/komorebi" license = "MIT" edition = "2021" +[lib] +name = "komorebi" +path = "src/lib.rs" + +[[bin]] +name = "komorebi" +path = "src/main.rs" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/komorebi/src/container.rs b/komorebi/src/container.rs index 448c56da..64a9e17b 100644 --- a/komorebi/src/container.rs +++ b/komorebi/src/container.rs @@ -3,14 +3,15 @@ use std::collections::VecDeque; use getset::Getters; use nanoid::nanoid; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use crate::ring::Ring; use crate::window::Window; -#[derive(Debug, Clone, Serialize, Getters, JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, Getters, JsonSchema)] pub struct Container { - #[serde(skip_serializing)] + #[serde(skip)] #[getset(get = "pub")] id: String, windows: Ring, diff --git a/komorebi/src/lib.rs b/komorebi/src/lib.rs new file mode 100644 index 00000000..7e467c68 --- /dev/null +++ b/komorebi/src/lib.rs @@ -0,0 +1,236 @@ +#![warn(clippy::all, clippy::nursery, clippy::pedantic)] +#![allow(clippy::missing_errors_doc)] + +use color_eyre::eyre::anyhow; +use color_eyre::Result; +use lazy_static::lazy_static; +use parking_lot::Mutex; +use schemars::JsonSchema; +use serde::Deserialize; +use serde::Serialize; +use std::collections::HashMap; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; +use std::process::Command; +use std::sync::atomic::AtomicBool; +use std::sync::atomic::AtomicU32; +use std::sync::atomic::Ordering; +use std::sync::Arc; +use which::which; +use winreg::enums::HKEY_CURRENT_USER; +use winreg::RegKey; + +use komorebi_core::HidingBehaviour; +use komorebi_core::SocketMessage; + +#[macro_use] +mod ring; + +mod container; +mod monitor; +mod process_command; +mod process_event; +mod process_movement; +mod set_window_position; +mod styles; +mod window; +mod window_manager; +mod window_manager_event; +mod windows_api; +mod windows_callbacks; +mod winevent; +mod winevent_listener; +mod workspace; + +pub use process_command::listen_for_commands; +pub use process_event::listen_for_events; +pub use process_movement::listen_for_movements; +pub use window_manager::State; +pub use window_manager::WindowManager; +pub use window_manager_event::WindowManagerEvent; +pub use windows_api::WindowsApi; +pub use winevent_listener::WinEventListener; + +lazy_static! { + static ref HIDDEN_HWNDS: Arc>> = Arc::new(Mutex::new(vec![])); + static ref LAYERED_WHITELIST: Arc>> = + Arc::new(Mutex::new(vec!["steam.exe".to_string()])); + static ref TRAY_AND_MULTI_WINDOW_IDENTIFIERS: Arc>> = + Arc::new(Mutex::new(vec![ + "explorer.exe".to_string(), + "firefox.exe".to_string(), + "chrome.exe".to_string(), + "idea64.exe".to_string(), + "ApplicationFrameHost.exe".to_string(), + "steam.exe".to_string(), + ])); + static ref OBJECT_NAME_CHANGE_ON_LAUNCH: Arc>> = Arc::new(Mutex::new(vec![ + "firefox.exe".to_string(), + "idea64.exe".to_string(), + ])); + static ref WORKSPACE_RULES: Arc>> = + Arc::new(Mutex::new(HashMap::new())); + static ref MANAGE_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![])); + static ref FLOAT_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![ + // mstsc.exe creates these on Windows 11 when a WSL process is launched + // https://github.com/LGUG2Z/komorebi/issues/74 + "OPContainerClass".to_string(), + "IHWindowClass".to_string() + ])); + static ref BORDER_OVERFLOW_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![])); + static ref WSL2_UI_PROCESSES: Arc>> = Arc::new(Mutex::new(vec![ + "X410.exe".to_string(), + "mstsc.exe".to_string(), + "vcxsrv.exe".to_string(), + ])); + static ref SUBSCRIPTION_PIPES: Arc>> = + Arc::new(Mutex::new(HashMap::new())); + static ref HIDING_BEHAVIOUR: Arc> = + Arc::new(Mutex::new(HidingBehaviour::Minimize)); + pub static ref HOME_DIR: PathBuf = { + if let Ok(home_path) = std::env::var("KOMOREBI_CONFIG_HOME") { + let home = PathBuf::from(&home_path); + + if home.as_path().is_dir() { + home + } else { + panic!( + "$Env:KOMOREBI_CONFIG_HOME is set to '{}', which is not a valid directory", + home_path + ); + } + } else { + dirs::home_dir().expect("there is no home directory") + } + }; +} + +pub static CUSTOM_FFM: AtomicBool = AtomicBool::new(false); +pub static SESSION_ID: AtomicU32 = AtomicU32::new(0); + +fn current_virtual_desktop() -> Option> { + let hkcu = RegKey::predef(HKEY_CURRENT_USER); + + // This is the path on Windows 10 + let mut current = hkcu + .open_subkey(format!( + r#"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\{}\VirtualDesktops"#, + SESSION_ID.load(Ordering::SeqCst) + )) + .ok() + .and_then( + |desktops| match desktops.get_raw_value("CurrentVirtualDesktop") { + Ok(current) => Option::from(current.bytes), + Err(_) => None, + }, + ); + + // This is the path on Windows 11 + if current.is_none() { + current = hkcu + .open_subkey(r#"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops"#) + .ok() + .and_then( + |desktops| match desktops.get_raw_value("CurrentVirtualDesktop") { + Ok(current) => Option::from(current.bytes), + Err(_) => None, + }, + ); + } + + // For Win10 users that do not use virtual desktops, the CurrentVirtualDesktop value will not + // exist until one has been created in the task view + + // The registry value will also not exist on user login if virtual desktops have been created + // but the task view has not been initiated + + // In both of these cases, we return None, and the virtual desktop validation will never run. In + // the latter case, if the user desires this validation after initiating the task view, komorebi + // should be restarted, and then when this // fn runs again for the first time, it will pick up + // the value of CurrentVirtualDesktop and validate against it accordingly + current +} + +pub fn load_configuration() -> Result<()> { + let home = HOME_DIR.clone(); + + let mut config_v1 = home.clone(); + config_v1.push("komorebi.ahk"); + + let mut config_v2 = home; + config_v2.push("komorebi.ahk2"); + + if config_v1.exists() && which("autohotkey.exe").is_ok() { + tracing::info!( + "loading configuration file: {}", + config_v1 + .as_os_str() + .to_str() + .ok_or_else(|| anyhow!("cannot convert path to string"))? + ); + + Command::new("autohotkey.exe") + .arg(config_v1.as_os_str()) + .output()?; + } else if config_v2.exists() && which("AutoHotkey64.exe").is_ok() { + tracing::info!( + "loading configuration file: {}", + config_v2 + .as_os_str() + .to_str() + .ok_or_else(|| anyhow!("cannot convert path to string"))? + ); + + Command::new("AutoHotkey64.exe") + .arg(config_v2.as_os_str()) + .output()?; + }; + + Ok(()) +} + +#[derive(Debug, Serialize, Deserialize, JsonSchema)] +#[serde(untagged)] +pub enum NotificationEvent { + WindowManager(WindowManagerEvent), + Socket(SocketMessage), +} + +#[derive(Debug, Serialize, Deserialize, JsonSchema)] +pub struct Notification { + pub event: NotificationEvent, + pub state: State, +} + +fn notify_subscribers(notification: &str) { + let mut stale_subscriptions = vec![]; + let mut subscriptions = SUBSCRIPTION_PIPES.lock(); + for (subscriber, pipe) in subscriptions.iter_mut() { + match writeln!(pipe, "{}", notification) { + Ok(_) => { + tracing::debug!("pushed notification to subscriber: {}", subscriber); + } + Err(error) => { + // ERROR_FILE_NOT_FOUND + // 2 (0x2) + // The system cannot find the file specified. + + // ERROR_NO_DATA + // 232 (0xE8) + // The pipe is being closed. + + // Remove the subscription; the process will have to subscribe again + if let Some(2 | 232) = error.raw_os_error() { + let subscriber_cl = subscriber.clone(); + stale_subscriptions.push(subscriber_cl); + } + } + } + } + + for subscriber in stale_subscriptions { + tracing::warn!("removing stale subscription: {}", subscriber); + subscriptions.remove(&subscriber); + } +} diff --git a/komorebi/src/main.rs b/komorebi/src/main.rs index 10d5c5a4..ada04a5d 100644 --- a/komorebi/src/main.rs +++ b/komorebi/src/main.rs @@ -1,127 +1,37 @@ #![warn(clippy::all, clippy::nursery, clippy::pedantic)] #![allow(clippy::missing_errors_doc)] -use std::collections::HashMap; -use std::fs::File; -use std::io::Write; -use std::path::PathBuf; -use std::process::Command; -use std::sync::atomic::AtomicBool; -use std::sync::atomic::AtomicU32; +use clap::Parser; +use color_eyre::Result; +use crossbeam_channel::Receiver; +use crossbeam_channel::Sender; +#[cfg(feature = "deadlock_detection")] +use parking_lot::deadlock; +use parking_lot::Mutex; use std::sync::atomic::Ordering; use std::sync::Arc; #[cfg(feature = "deadlock_detection")] use std::thread; #[cfg(feature = "deadlock_detection")] use std::time::Duration; - -use clap::Parser; -use color_eyre::eyre::anyhow; -use color_eyre::Result; -use crossbeam_channel::Receiver; -use crossbeam_channel::Sender; -use lazy_static::lazy_static; -#[cfg(feature = "deadlock_detection")] -use parking_lot::deadlock; -use parking_lot::Mutex; -use schemars::JsonSchema; -use serde::Serialize; use sysinfo::Process; use sysinfo::ProcessExt; use sysinfo::SystemExt; use tracing_appender::non_blocking::WorkerGuard; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::EnvFilter; -use which::which; -use winreg::enums::HKEY_CURRENT_USER; -use winreg::RegKey; -use komorebi_core::HidingBehaviour; -use komorebi_core::SocketMessage; - -use crate::process_command::listen_for_commands; -use crate::process_event::listen_for_events; -use crate::process_movement::listen_for_movements; -use crate::window_manager::State; -use crate::window_manager::WindowManager; -use crate::window_manager_event::WindowManagerEvent; -use crate::windows_api::WindowsApi; - -#[macro_use] -mod ring; - -mod container; -mod monitor; -mod process_command; -mod process_event; -mod process_movement; -mod set_window_position; -mod styles; -mod window; -mod window_manager; -mod window_manager_event; -mod windows_api; -mod windows_callbacks; -mod winevent; -mod winevent_listener; -mod workspace; - -lazy_static! { - static ref HIDDEN_HWNDS: Arc>> = Arc::new(Mutex::new(vec![])); - static ref LAYERED_WHITELIST: Arc>> = - Arc::new(Mutex::new(vec!["steam.exe".to_string()])); - static ref TRAY_AND_MULTI_WINDOW_IDENTIFIERS: Arc>> = - Arc::new(Mutex::new(vec![ - "explorer.exe".to_string(), - "firefox.exe".to_string(), - "chrome.exe".to_string(), - "idea64.exe".to_string(), - "ApplicationFrameHost.exe".to_string(), - "steam.exe".to_string(), - ])); - static ref OBJECT_NAME_CHANGE_ON_LAUNCH: Arc>> = Arc::new(Mutex::new(vec![ - "firefox.exe".to_string(), - "idea64.exe".to_string(), - ])); - static ref WORKSPACE_RULES: Arc>> = - Arc::new(Mutex::new(HashMap::new())); - static ref MANAGE_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![])); - static ref FLOAT_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![ - // mstsc.exe creates these on Windows 11 when a WSL process is launched - // https://github.com/LGUG2Z/komorebi/issues/74 - "OPContainerClass".to_string(), - "IHWindowClass".to_string() - ])); - static ref BORDER_OVERFLOW_IDENTIFIERS: Arc>> = Arc::new(Mutex::new(vec![])); - static ref WSL2_UI_PROCESSES: Arc>> = Arc::new(Mutex::new(vec![ - "X410.exe".to_string(), - "mstsc.exe".to_string(), - "vcxsrv.exe".to_string(), - ])); - static ref SUBSCRIPTION_PIPES: Arc>> = - Arc::new(Mutex::new(HashMap::new())); - static ref HIDING_BEHAVIOUR: Arc> = - Arc::new(Mutex::new(HidingBehaviour::Minimize)); - static ref HOME_DIR: PathBuf = { - if let Ok(home_path) = std::env::var("KOMOREBI_CONFIG_HOME") { - let home = PathBuf::from(&home_path); - - if home.as_path().is_dir() { - home - } else { - panic!( - "$Env:KOMOREBI_CONFIG_HOME is set to '{}', which is not a valid directory", - home_path - ); - } - } else { - dirs::home_dir().expect("there is no home directory") - } - }; -} - -pub static CUSTOM_FFM: AtomicBool = AtomicBool::new(false); -pub static SESSION_ID: AtomicU32 = AtomicU32::new(0); +use komorebi::listen_for_commands; +use komorebi::listen_for_events; +use komorebi::listen_for_movements; +use komorebi::load_configuration; +use komorebi::WinEventListener; +use komorebi::WindowManager; +use komorebi::WindowManagerEvent; +use komorebi::WindowsApi; +use komorebi::CUSTOM_FFM; +use komorebi::HOME_DIR; +use komorebi::SESSION_ID; fn setup() -> Result<(WorkerGuard, WorkerGuard)> { if std::env::var("RUST_LIB_BACKTRACE").is_err() { @@ -187,134 +97,6 @@ fn setup() -> Result<(WorkerGuard, WorkerGuard)> { Ok((guard, color_guard)) } -pub fn load_configuration() -> Result<()> { - let home = HOME_DIR.clone(); - - let mut config_v1 = home.clone(); - config_v1.push("komorebi.ahk"); - - let mut config_v2 = home; - config_v2.push("komorebi.ahk2"); - - if config_v1.exists() && which("autohotkey.exe").is_ok() { - tracing::info!( - "loading configuration file: {}", - config_v1 - .as_os_str() - .to_str() - .ok_or_else(|| anyhow!("cannot convert path to string"))? - ); - - Command::new("autohotkey.exe") - .arg(config_v1.as_os_str()) - .output()?; - } else if config_v2.exists() && which("AutoHotkey64.exe").is_ok() { - tracing::info!( - "loading configuration file: {}", - config_v2 - .as_os_str() - .to_str() - .ok_or_else(|| anyhow!("cannot convert path to string"))? - ); - - Command::new("AutoHotkey64.exe") - .arg(config_v2.as_os_str()) - .output()?; - }; - - Ok(()) -} - -pub fn current_virtual_desktop() -> Option> { - let hkcu = RegKey::predef(HKEY_CURRENT_USER); - - // This is the path on Windows 10 - let mut current = hkcu - .open_subkey(format!( - r#"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SessionInfo\{}\VirtualDesktops"#, - SESSION_ID.load(Ordering::SeqCst) - )) - .ok() - .and_then( - |desktops| match desktops.get_raw_value("CurrentVirtualDesktop") { - Ok(current) => Option::from(current.bytes), - Err(_) => None, - }, - ); - - // This is the path on Windows 11 - if current.is_none() { - current = hkcu - .open_subkey(r#"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops"#) - .ok() - .and_then( - |desktops| match desktops.get_raw_value("CurrentVirtualDesktop") { - Ok(current) => Option::from(current.bytes), - Err(_) => None, - }, - ); - } - - // For Win10 users that do not use virtual desktops, the CurrentVirtualDesktop value will not - // exist until one has been created in the task view - - // The registry value will also not exist on user login if virtual desktops have been created - // but the task view has not been initiated - - // In both of these cases, we return None, and the virtual desktop validation will never run. In - // the latter case, if the user desires this validation after initiating the task view, komorebi - // should be restarted, and then when this // fn runs again for the first time, it will pick up - // the value of CurrentVirtualDesktop and validate against it accordingly - current -} - -#[derive(Debug, Serialize, JsonSchema)] -#[serde(untagged)] -pub enum NotificationEvent { - WindowManager(WindowManagerEvent), - Socket(SocketMessage), -} - -#[derive(Debug, Serialize, JsonSchema)] -pub struct Notification { - pub event: NotificationEvent, - pub state: State, -} - -pub fn notify_subscribers(notification: &str) -> Result<()> { - let mut stale_subscriptions = vec![]; - let mut subscriptions = SUBSCRIPTION_PIPES.lock(); - for (subscriber, pipe) in subscriptions.iter_mut() { - match writeln!(pipe, "{}", notification) { - Ok(_) => { - tracing::debug!("pushed notification to subscriber: {}", subscriber); - } - Err(error) => { - // ERROR_FILE_NOT_FOUND - // 2 (0x2) - // The system cannot find the file specified. - - // ERROR_NO_DATA - // 232 (0xE8) - // The pipe is being closed. - - // Remove the subscription; the process will have to subscribe again - if let Some(2 | 232) = error.raw_os_error() { - let subscriber_cl = subscriber.clone(); - stale_subscriptions.push(subscriber_cl); - } - } - } - } - - for subscriber in stale_subscriptions { - tracing::warn!("removing stale subscription: {}", subscriber); - subscriptions.remove(&subscriber); - } - - Ok(()) -} - #[cfg(feature = "deadlock_detection")] #[tracing::instrument] fn detect_deadlocks() { @@ -389,7 +171,7 @@ fn main() -> Result<()> { let (outgoing, incoming): (Sender, Receiver) = crossbeam_channel::unbounded(); - let winevent_listener = winevent_listener::new(Arc::new(Mutex::new(outgoing))); + let winevent_listener = WinEventListener::new(Arc::new(Mutex::new(outgoing))); winevent_listener.start(); let wm = Arc::new(Mutex::new(WindowManager::new(Arc::new(Mutex::new( diff --git a/komorebi/src/monitor.rs b/komorebi/src/monitor.rs index ead80f01..a2afd04c 100644 --- a/komorebi/src/monitor.rs +++ b/komorebi/src/monitor.rs @@ -8,6 +8,7 @@ use getset::Getters; use getset::MutGetters; use getset::Setters; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use komorebi_core::Rect; @@ -16,7 +17,9 @@ use crate::container::Container; use crate::ring::Ring; use crate::workspace::Workspace; -#[derive(Debug, Clone, Serialize, Getters, CopyGetters, MutGetters, Setters, JsonSchema)] +#[derive( + Debug, Clone, Serialize, Deserialize, Getters, CopyGetters, MutGetters, Setters, JsonSchema, +)] pub struct Monitor { #[getset(get_copy = "pub", set = "pub")] id: isize, @@ -25,7 +28,7 @@ pub struct Monitor { #[getset(get = "pub", set = "pub")] work_area_size: Rect, workspaces: Ring, - #[serde(skip_serializing)] + #[serde(skip)] #[getset(get_mut = "pub")] workspace_names: HashMap, } diff --git a/komorebi/src/process_command.rs b/komorebi/src/process_command.rs index 064d571b..5cbc8b24 100644 --- a/komorebi/src/process_command.rs +++ b/komorebi/src/process_command.rs @@ -722,7 +722,7 @@ impl WindowManager { notify_subscribers(&serde_json::to_string(&Notification { event: NotificationEvent::Socket(message.clone()), state: self.as_ref().into(), - })?)?; + })?); } Ok(()) diff --git a/komorebi/src/process_event.rs b/komorebi/src/process_event.rs index 6bdb2306..3d7a8c83 100644 --- a/komorebi/src/process_event.rs +++ b/komorebi/src/process_event.rs @@ -495,7 +495,7 @@ impl WindowManager { notify_subscribers(&serde_json::to_string(&Notification { event: NotificationEvent::WindowManager(*event), state: self.as_ref().into(), - })?)?; + })?); tracing::info!("processed: {}", event.window().to_string()); Ok(()) diff --git a/komorebi/src/ring.rs b/komorebi/src/ring.rs index e0c7cb4c..d5da1698 100644 --- a/komorebi/src/ring.rs +++ b/komorebi/src/ring.rs @@ -1,9 +1,10 @@ use std::collections::VecDeque; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; -#[derive(Debug, Clone, Serialize, JsonSchema)] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct Ring { elements: VecDeque, focused: usize, diff --git a/komorebi/src/window.rs b/komorebi/src/window.rs index 4ecab9c1..79218481 100644 --- a/komorebi/src/window.rs +++ b/komorebi/src/window.rs @@ -7,6 +7,7 @@ use color_eyre::Result; use schemars::JsonSchema; use serde::ser::Error; use serde::ser::SerializeStruct; +use serde::Deserialize; use serde::Serialize; use serde::Serializer; use windows::Win32::Foundation::HWND; @@ -26,7 +27,7 @@ use crate::LAYERED_WHITELIST; use crate::MANAGE_IDENTIFIERS; use crate::WSL2_UI_PROCESSES; -#[derive(Debug, Clone, Copy, JsonSchema)] +#[derive(Debug, Clone, Copy, Deserialize, JsonSchema)] pub struct Window { pub(crate) hwnd: isize, } diff --git a/komorebi/src/window_manager.rs b/komorebi/src/window_manager.rs index 3e0fd19b..4150ab49 100644 --- a/komorebi/src/window_manager.rs +++ b/komorebi/src/window_manager.rs @@ -12,6 +12,7 @@ use hotwatch::notify::DebouncedEvent; use hotwatch::Hotwatch; use parking_lot::Mutex; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use uds_windows::UnixListener; @@ -66,7 +67,7 @@ pub struct WindowManager { pub pending_move_op: Option<(usize, usize, usize)>, } -#[derive(Debug, Serialize, JsonSchema)] +#[derive(Debug, Serialize, Deserialize, JsonSchema)] pub struct State { pub monitors: Ring, pub is_paused: bool, diff --git a/komorebi/src/window_manager_event.rs b/komorebi/src/window_manager_event.rs index 95477037..b23da8a1 100644 --- a/komorebi/src/window_manager_event.rs +++ b/komorebi/src/window_manager_event.rs @@ -2,13 +2,14 @@ use std::fmt::Display; use std::fmt::Formatter; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use crate::window::Window; use crate::winevent::WinEvent; use crate::OBJECT_NAME_CHANGE_ON_LAUNCH; -#[derive(Debug, Copy, Clone, Serialize, JsonSchema)] +#[derive(Debug, Copy, Clone, Serialize, Deserialize, JsonSchema)] #[serde(tag = "type", content = "content")] pub enum WindowManagerEvent { Destroy(WinEvent, Window), @@ -89,6 +90,7 @@ impl Display for WindowManagerEvent { } impl WindowManagerEvent { + #[must_use] pub const fn window(self) -> Window { match self { WindowManagerEvent::Destroy(_, window) @@ -106,6 +108,7 @@ impl WindowManagerEvent { } } + #[must_use] pub fn from_win_event(winevent: WinEvent, window: Window) -> Option { match winevent { WinEvent::ObjectDestroy => Option::from(Self::Destroy(winevent, window)), diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index ddcaae9f..e775f8fb 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -239,12 +239,14 @@ impl WindowsApi { .process() } + #[must_use] pub fn monitor_from_window(hwnd: HWND) -> isize { // MONITOR_DEFAULTTONEAREST ensures that the return value will never be NULL // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-monitorfromwindow unsafe { MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST) }.0 } + #[must_use] pub fn monitor_from_point(point: POINT) -> isize { // MONITOR_DEFAULTTONEAREST ensures that the return value will never be NULL // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-monitorfromwindow @@ -364,6 +366,7 @@ impl WindowsApi { Self::set_cursor_pos(rect.left + (rect.right / 2), rect.top + (rect.bottom / 2)) } + #[must_use] pub fn window_thread_process_id(hwnd: HWND) -> (u32, u32) { let mut process_id: u32 = 0; @@ -374,10 +377,12 @@ impl WindowsApi { (process_id, thread_id) } + #[must_use] pub fn current_thread_id() -> u32 { unsafe { GetCurrentThreadId() } } + #[must_use] pub fn current_process_id() -> u32 { unsafe { GetCurrentProcessId() } } @@ -532,18 +537,25 @@ impl WindowsApi { )) } + #[must_use] pub fn is_window(hwnd: HWND) -> bool { unsafe { IsWindow(hwnd) }.into() } + #[must_use] pub fn is_window_visible(hwnd: HWND) -> bool { unsafe { IsWindowVisible(hwnd) }.into() } + #[must_use] pub fn is_iconic(hwnd: HWND) -> bool { unsafe { IsIconic(hwnd) }.into() } + pub fn monitor_info(hmonitor: isize) -> Result { + Self::monitor_info_w(HMONITOR(hmonitor)) + } + pub fn monitor_info_w(hmonitor: HMONITOR) -> Result { let mut monitor_info: MONITORINFO = unsafe { std::mem::zeroed() }; monitor_info.cbSize = u32::try_from(std::mem::size_of::())?; @@ -566,7 +578,7 @@ impl WindowsApi { } #[allow(dead_code)] - pub fn system_parameters_info_w( + fn system_parameters_info_w( action: SYSTEM_PARAMETERS_INFO_ACTION, ui_param: u32, pv_param: *mut c_void, diff --git a/komorebi/src/winevent.rs b/komorebi/src/winevent.rs index 62af825a..ed6cb7e7 100644 --- a/komorebi/src/winevent.rs +++ b/komorebi/src/winevent.rs @@ -1,6 +1,7 @@ #![allow(clippy::use_self)] use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use strum::Display; use windows::Win32::UI::WindowsAndMessaging::EVENT_AIA_END; @@ -88,7 +89,7 @@ use windows::Win32::UI::WindowsAndMessaging::EVENT_UIA_EVENTID_START; use windows::Win32::UI::WindowsAndMessaging::EVENT_UIA_PROPID_END; use windows::Win32::UI::WindowsAndMessaging::EVENT_UIA_PROPID_START; -#[derive(Clone, Copy, PartialEq, Debug, Serialize, Display, JsonSchema)] +#[derive(Clone, Copy, PartialEq, Debug, Serialize, Deserialize, Display, JsonSchema)] #[repr(u32)] #[allow(dead_code)] pub enum WinEvent { diff --git a/komorebi/src/winevent_listener.rs b/komorebi/src/winevent_listener.rs index ce593212..dbb4f657 100644 --- a/komorebi/src/winevent_listener.rs +++ b/komorebi/src/winevent_listener.rs @@ -32,14 +32,15 @@ pub struct WinEventListener { outgoing_events: Arc>>, } -pub fn new(outgoing: Arc>>) -> WinEventListener { - WinEventListener { - hook: Arc::new(AtomicIsize::new(0)), - outgoing_events: outgoing, - } -} - impl WinEventListener { + #[must_use] + pub fn new(outgoing: Arc>>) -> Self { + Self { + hook: Arc::new(AtomicIsize::new(0)), + outgoing_events: outgoing, + } + } + pub fn start(self) { let hook = self.hook.clone(); let outgoing = self.outgoing_events.lock().clone(); diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index 34899877..103b0b88 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -8,6 +8,7 @@ use getset::Getters; use getset::MutGetters; use getset::Setters; use schemars::JsonSchema; +use serde::Deserialize; use serde::Serialize; use komorebi_core::Axis; @@ -22,19 +23,21 @@ use crate::ring::Ring; use crate::window::Window; use crate::windows_api::WindowsApi; -#[derive(Debug, Clone, Serialize, Getters, CopyGetters, MutGetters, Setters, JsonSchema)] +#[derive( + Debug, Clone, Serialize, Deserialize, Getters, CopyGetters, MutGetters, Setters, JsonSchema, +)] pub struct Workspace { - #[getset(set = "pub")] + #[getset(get = "pub", set = "pub")] name: Option, containers: Ring, #[getset(get = "pub", get_mut = "pub", set = "pub")] monocle_container: Option, - #[serde(skip_serializing)] + #[serde(skip)] #[getset(get_copy = "pub", set = "pub")] monocle_container_restore_idx: Option, #[getset(get = "pub", get_mut = "pub", set = "pub")] maximized_window: Option, - #[serde(skip_serializing)] + #[serde(skip)] #[getset(get_copy = "pub", set = "pub")] maximized_window_restore_idx: Option, #[getset(get = "pub", get_mut = "pub")] @@ -49,7 +52,7 @@ pub struct Workspace { workspace_padding: Option, #[getset(get_copy = "pub", set = "pub")] container_padding: Option, - #[serde(skip_serializing)] + #[serde(skip)] #[getset(get = "pub", set = "pub")] latest_layout: Vec, #[getset(get = "pub", get_mut = "pub", set = "pub")]