diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fddeffd2..9f54c721 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,9 @@ jobs: - name: Build Linux tool run: cargo build -p framework_tool + - name: Build Linux daemon + run: cargo build -p frameworkd + - name: Check if Linux tool can start run: cargo run -- --help @@ -65,6 +68,12 @@ jobs: name: framework_tool path: target/debug/framework_tool + - name: Upload Linux Daemon + uses: actions/upload-artifact@v3 + with: + name: framework_d + path: target/debug/framework_d + - name: Build UEFI application (no ESP) run: make -C framework_uefi build/x86_64-unknown-uefi/boot.efi @@ -97,6 +106,9 @@ jobs: - name: Build Windows tool run: cargo build -p framework_tool --no-default-features --features "windows" + - name: Build Windows daemon + run: cargo build -p frameworkd --no-default-features --features "windows" + - name: Check if Windows tool can start run: cargo run --no-default-features --features "windows" -- --help @@ -106,6 +118,12 @@ jobs: name: framework_tool.exe path: target/debug/framework_tool.exe + - name: Upload Windows Daemon + uses: actions/upload-artifact@v3 + with: + name: frameworkd.exe + path: target/debug/frameworkd.exe + test: name: Test Suite @@ -147,7 +165,7 @@ jobs: run: cargo fmt --all -- --check - name: Run cargo clippy - run: cargo clippy -p framework_lib -p framework_tool -- -D warnings + run: cargo clippy -p framework_lib -p framework_tool -p framework_d -- -D warnings # Just make sure doc generation works doc: @@ -170,3 +188,13 @@ jobs: - name: Run cargo doc run: cargo doc + + build-installer: + name: Build frameworkd Windows installer + runs-on: windows-latest + steps: + - name: Build installer + run: cargo wix -p frameworkd --nocapture -d + + - name: Check output + run: dir target\wix \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9ad6d33d..a2879ea5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,6 +20,165 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-broadcast" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +dependencies = [ + "event-listener", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock", + "autocfg", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +dependencies = [ + "async-lock", + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + [[package]] name = "autocfg" version = "1.1.0" @@ -38,15 +197,52 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + +[[package]] +name = "brightness" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ccf3c64278486354c6c41b71293570a207684a34cceb53137975d781748d33f" +dependencies = [ + "async-trait", + "blocking", + "cfg-if", + "futures", + "itertools", + "thiserror", + "windows 0.39.0", + "zbus", +] + [[package]] name = "built" version = "0.5.2" @@ -64,6 +260,12 @@ version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + [[package]] name = "cargo-lock" version = "8.0.3" @@ -105,17 +307,13 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.32" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", - "strsim", - "termcolor", ] [[package]] @@ -128,27 +326,35 @@ dependencies = [ "log", ] +[[package]] +name = "clap_builder" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ - "heck", - "proc-macro-error", + "heck 0.4.0", "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.26", ] [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codespan-reporting" @@ -160,6 +366,33 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "concat-string" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7439becb5fafc780b6f4de382b1a7a3e70234afe783854a4702ee8adbb838609" + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-sha1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb58b6451e8c2a812ad979ed1d83378caa5e927eef2622017a45f251457c2c9d" + [[package]] name = "convert_case" version = "0.4.0" @@ -190,13 +423,22 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -231,7 +473,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.13", + "syn 2.0.26", ] [[package]] @@ -248,7 +490,18 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.26", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", ] [[package]] @@ -266,14 +519,41 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", ] +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "enumflags2" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + [[package]] name = "env_logger" version = "0.10.0" @@ -287,6 +567,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -298,6 +584,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -308,6 +605,32 @@ dependencies = [ "libc", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "find-winsdk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8cbf17b871570c1f8612b763bac3e86290602bcf5dc3c5ce657e0e1e9071d9e" +dependencies = [ + "serde", + "serde_derive", + "winreg", +] + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -330,7 +653,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix", + "nix 0.25.1", "no-std-compat", "num", "num-derive", @@ -364,11 +687,129 @@ dependencies = [ "uefi-services", ] +[[package]] +name = "frameworkd" +version = "0.1.0" +dependencies = [ + "brightness", + "framework_lib", + "qmk_hid", + "trayicon", + "winapi", + "windows 0.3.1", + "windres", + "winrt-notification", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -383,13 +824,24 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "git2" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "libgit2-sys", "log", @@ -402,7 +854,22 @@ version = "0.11.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.26", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", ] [[package]] @@ -413,18 +880,21 @@ checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hidapi" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a090a12b53564bcb2f6053b8be08d5f9e7b91f26953d6e8e08c9affd8aeb4ec9" +checksum = "794c84123f70c5ac93c45f0fed6edd39db80aab71a62097982e4ab13b43e8bb7" dependencies = [ "cc", "libc", @@ -472,6 +942,25 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "io-kit-sys" version = "0.1.0" @@ -489,19 +978,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "io-lifetimes", - "rustix", - "windows-sys", + "rustix 0.38.4", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", ] [[package]] @@ -539,9 +1036,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libgit2-sys" @@ -594,6 +1091,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.9" @@ -646,6 +1149,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "nix" version = "0.25.1" @@ -653,13 +1165,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", "pin-utils", ] +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", + "static_assertions", +] + [[package]] name = "no-std-compat" version = "0.4.1" @@ -742,15 +1267,25 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "os_str_bytes" -version = "6.4.1" +name = "ordered-stream" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "percent-encoding" @@ -758,6 +1293,12 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + [[package]] name = "pin-utils" version = "0.1.0" @@ -777,34 +1318,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "polling" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.107", - "version_check", + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "once_cell", + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] @@ -829,21 +1378,69 @@ dependencies = [ "syn 1.0.107", ] +[[package]] +name = "qmk_hid" +version = "0.1.8" +dependencies = [ + "clap", + "hidapi", + "static_vcruntime", +] + [[package]] name = "quote" -version = "1.0.26" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + [[package]] name = "redox_hwio" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eb516ad341a84372b5b15a5a35cf136ba901a639c8536f521b108253d7fce74" +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "regex" version = "1.10.4" @@ -898,12 +1495,25 @@ version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" dependencies = [ - "bitflags", - "errno", + "bitflags 1.3.2", + "errno 0.2.8", "io-lifetimes", "libc", - "linux-raw-sys", - "windows-sys", + "linux-raw-sys 0.1.4", + "windows-sys 0.42.0", +] + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno 0.3.1", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys 0.48.0", ] [[package]] @@ -964,17 +1574,48 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_repr" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", "digest", ] +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + [[package]] name = "smbios-lib" version = "0.9.1" @@ -991,6 +1632,16 @@ dependencies = [ "serde_json", ] +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "spin" version = "0.5.2" @@ -1006,12 +1657,51 @@ dependencies = [ "lock_api", ] +[[package]] +name = "squote" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fccf17fd09e2455ea796d2ad267b64fa2c5cbd8701b2a93b555d2aa73449f7d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_vcruntime" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b" + [[package]] name = "strsim" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ac893c7d471c8a21f31cfe213ec4f6d9afeed25537c772e08ef3f005f8729e" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339f799d8b549e3744c7ac7feb216383e4005d94bdb22561b3ab8f3b808ae9fb" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.107", +] + [[package]] name = "syn" version = "1.0.107" @@ -1025,15 +1715,28 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix 0.36.5", + "windows-sys 0.42.0", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -1043,6 +1746,26 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "thiserror" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -1067,6 +1790,64 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.26", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "trayicon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51617694e059fe4b83ab48e435660c1ba5b48b1573b4c143fdabd1c0f279daa" +dependencies = [ + "winapi", +] + [[package]] name = "typenum" version = "1.16.0" @@ -1082,12 +1863,22 @@ dependencies = [ "bit_field", ] +[[package]] +name = "uds_windows" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +dependencies = [ + "tempfile", + "winapi", +] + [[package]] name = "uefi" version = "0.20.0" source = "git+https://github.com/FrameworkComputer/uefi-rs?branch=merged#76130a0f1c1585012e598b8c514526bac09c68e0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "derive_more", "log", "ptr_meta", @@ -1137,6 +1928,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" version = "0.1.10" @@ -1154,6 +1951,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1166,6 +1969,18 @@ 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 = "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.84" @@ -1251,6 +2066,43 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "426842497696b65fbfc575691d94ef65befb248ed1a8c4361e293c724e7ebe61" +dependencies = [ + "const-sha1", + "windows_gen", + "windows_macros", + "windows_winmd", +] + +[[package]] +name = "windows" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9f39345ae0c8ab072c0ac7fe8a8b411636aa34f89be19ddd0d9226544f13944" +dependencies = [ + "windows_i686_gnu 0.24.0", + "windows_i686_msvc 0.24.0", + "windows_x86_64_gnu 0.24.0", + "windows_x86_64_msvc 0.24.0", +] + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + [[package]] name = "windows" version = "0.42.0" @@ -1290,6 +2142,15 @@ dependencies = [ "windows_x86_64_msvc 0.42.0", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.48.0" @@ -1317,6 +2178,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" @@ -1329,6 +2196,43 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_gen" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ac8f0f06b647f42ee5459a8e1ffe41795647582c5926ec3fa363a91aad7d77" +dependencies = [ + "proc-macro2", + "quote", + "squote", + "syn 1.0.107", + "windows_gen_macros", + "windows_winmd", +] + +[[package]] +name = "windows_gen_macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23eac2169a20173b890c496f9e0e1149a92ef29fe4ba96026b72eec363b993f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "windows_i686_gnu" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0866510a3eca9aed73a077490bbbf03e5eaac4e1fd70849d89539e5830501fd" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + [[package]] name = "windows_i686_gnu" version = "0.42.0" @@ -1341,6 +2245,18 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf0ffed56b7e9369a29078d2ab3aaeceea48eb58999d2cff3aa2494a275b95c6" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + [[package]] name = "windows_i686_msvc" version = "0.42.0" @@ -1353,6 +2269,52 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edc57c944eec106c7823b425ab0fd9f90163489e50a4df747f65fcf9030e1fb" +dependencies = [ + "proc-macro2", + "quote", + "squote", + "syn 1.0.107", + "windows_gen", + "windows_winmd", +] + +[[package]] +name = "windows_winmd" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d44527d04c9713312ed598f5d6ce3c453754dbfc03ddc376615be4415ffc88" +dependencies = [ + "windows_winmd_macros", +] + +[[package]] +name = "windows_winmd_macros" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2353f43f512938450614a176abf2b6cb31ac3b84fd71c88470fee571303e3f36" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] + +[[package]] +name = "windows_x86_64_gnu" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384a173630588044205a2993b6864a2f56e5a8c1e7668c07b93ec18cf4888dc4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -1377,6 +2339,18 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd8f062d8ca5446358159d79a90be12c543b3a965c847c8f3eedf14b321d399" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + [[package]] name = "windows_x86_64_msvc" version = "0.42.0" @@ -1388,3 +2362,161 @@ name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "windres" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82115619221b2b66001a39088b8059d171b1f9005a00d6a10c6e8a71a30a4cdc" +dependencies = [ + "concat-string", + "find-winsdk", +] + +[[package]] +name = "winnow" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a" +dependencies = [ + "serde", + "winapi", +] + +[[package]] +name = "winrt-notification" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "007a0353840b23e0c6dc73e5b962ff58ed7f6bc9ceff3ce7fe6fbad8d496edf4" +dependencies = [ + "strum", + "windows 0.24.0", + "xml-rs", +] + +[[package]] +name = "xdg-home" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.2", + "winapi", +] + +[[package]] +name = "xml-rs" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" + +[[package]] +name = "zbus" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29242fa5ec5693629ae74d6eb1f69622a9511f600986d6d9779bccf36ac316e3" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "nix 0.26.2", + "once_cell", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tracing", + "uds_windows", + "winapi", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537793e26e9af85f774801dc52c6f6292352b2b517c5cf0449ffd3735732a53a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.107", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cb36cd95352132911c9c99fdcc1635de5c2c139bd34cbcf6dfb8350ee8ff6a7" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34951e1ac64f3a1443fe7181256b9ed6a811a1631917566c3d5ca718d8cf33" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.107", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b22993dbc4d128a17a3b6c92f1c63872dd67198537ee728d8b5d7c40640a8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.107", +] diff --git a/Cargo.toml b/Cargo.toml index 41f48e81..2ca370c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,8 @@ resolver = "2" members = [ # Linux and Windows tool to inspect and customize the system "framework_tool", + # Linux and Windows daemon to watch for system changes and handle them + "frameworkd", # UEFI tool to inspect and customize the system "framework_uefi", # Catchall library that we'll probably want to split up further @@ -20,6 +22,7 @@ members = [ default-members = [ "framework_lib", "framework_tool", + "frameworkd", ] [patch.crates-io] diff --git a/README.md b/README.md index 0bb53cf6..65e55ea3 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,10 @@ cargo build -p framework_lib cargo build -p framework_tool ls -l target/debug/framework_tool +# Building only the daemon +cargo build -p frameworkd +ls -l target/debug/frameworkd + # Build the UEFI application # Can't be built with cargo! That's why we need to exclude it in the other commands. make -C framework_uefi diff --git a/framework_lib/Cargo.toml b/framework_lib/Cargo.toml index bf0ea2a6..20b2ab71 100644 --- a/framework_lib/Cargo.toml +++ b/framework_lib/Cargo.toml @@ -1,4 +1,5 @@ [package] +authors = [ "Framework Computer Inc" ] name = "framework_lib" version = "0.1.0" edition = "2021" diff --git a/frameworkd/Cargo.toml b/frameworkd/Cargo.toml new file mode 100644 index 00000000..2a79608f --- /dev/null +++ b/frameworkd/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "frameworkd" +authors = [ "Framework Computer Inc" ] +version = "0.1.0" +edition = "2021" + +[features] +default = ["windows"] +linux = ["framework_lib/linux"] +windows = ["framework_lib/windows"] + +[dependencies] +trayicon = "0.2" +winapi = { version = "0.3.9", features = ["winuser", "windef", "minwindef", "shellapi", "libloaderapi", "commctrl", "basetsd"] } +#crossbeam-channel = "0.5" +brightness = "0.5.0" +qmk_hid = { path = '../../qmk_hid' } +winrt-notification = "0.5.1" +windows = "0.3" + +[build-dependencies] +windows = "0.3" +windres = "0.2" + +[dependencies.framework_lib] +path = "../framework_lib" +default-features = false diff --git a/frameworkd/build.rs b/frameworkd/build.rs new file mode 100644 index 00000000..f118bbff --- /dev/null +++ b/frameworkd/build.rs @@ -0,0 +1,7 @@ +fn main() { + // if compiling for windows bundle the rc file + if cfg!(windows) { + windres::Build::new().compile("res/res.rc").unwrap(); + windows::build!(windows::win32::shell::SetCurrentProcessExplicitAppUserModelID); + } +} diff --git a/frameworkd/res/logo_cropped_transparent_32x32.ico b/frameworkd/res/logo_cropped_transparent_32x32.ico new file mode 100644 index 00000000..b14c4480 Binary files /dev/null and b/frameworkd/res/logo_cropped_transparent_32x32.ico differ diff --git a/frameworkd/res/res.rc b/frameworkd/res/res.rc new file mode 100644 index 00000000..00fc6b42 --- /dev/null +++ b/frameworkd/res/res.rc @@ -0,0 +1 @@ +1 ICON "res\logo_cropped_transparent_32x32.ico" \ No newline at end of file diff --git a/frameworkd/src/icon2.ico b/frameworkd/src/icon2.ico new file mode 100644 index 00000000..9a356183 Binary files /dev/null and b/frameworkd/src/icon2.ico differ diff --git a/frameworkd/src/main.rs b/frameworkd/src/main.rs new file mode 100644 index 00000000..9ee7dab6 --- /dev/null +++ b/frameworkd/src/main.rs @@ -0,0 +1,480 @@ +// In debug builds don't disable terminal +// Otherwise we can't see println and can't exit with CTRL+C +//#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +#![windows_subsystem = "windows"] + +use core::mem::MaybeUninit; +use std::collections::HashMap; +use std::process::Command; +use std::thread; +use std::time::Duration; + +use brightness::blocking::Brightness; +use qmk_hid::via; +use trayicon::*; +use winapi::um::winuser; +use winrt_notification::Toast; + +#[repr(u16)] +enum FrameworkPid { + Macropad = 0x0012, + IsoKeyboard = 0x0018, +} + +const LOGO_32_ICO: &[u8] = include_bytes!("../res/logo_cropped_transparent_32x32.ico"); +const VIA_URL: &str = "https://usevia.app"; +const FWK_MARKETPLACE: &str = "https://frame.work/marketplace"; +const FWK_COMMUNITY: &str = "https://community.frame.work"; +const FWK_KB: &str = "https://knowledgebase.frame.work/"; +const FWK_GUIDES: &str = "https://guides.frame.work/c/Root"; + +#[derive(Copy, Clone, Eq, PartialEq, Debug)] +enum Events { + ClickTrayIcon, + DoubleClickTrayIcon, + Exit, + LaunchVia, + LaunchQmkGui, + LaunchLedmatrixControl, + LaunchMarketplace, + LaunchCommunity, + LaunchKb, + LaunchGuides, + // SyncKeyboards, + SyncKeyboardScreen, + NumLockOn, + NumLockOff, + NumLockToggle, +} + +enum Tool { + QmkGui, + LedmatrixControl, +} + +struct PrevValues { + brightness: HashMap, + numlock: bool, +} + +impl Default for PrevValues { + fn default() -> Self { + PrevValues { + brightness: HashMap::new(), + numlock: true, + } + } +} + +fn to_wstring(value: &str) -> Vec { + use std::os::windows::ffi::OsStrExt; + + std::ffi::OsStr::new(value) + .encode_wide() + .chain(std::iter::once(0)) + .collect() +} + +fn launch_website(url: &str) { + println!("Launch: {:?}", url); + use std::ptr::null_mut; + use winapi::um::shellapi::*; + use winapi::um::winuser::*; + let wurl = to_wstring(url).as_ptr(); + let action = to_wstring("open").as_ptr(); + let ret = unsafe { + ShellExecuteW( + null_mut(), + action, + wurl, + null_mut(), + null_mut(), + SW_SHOWNORMAL, + ) + }; + // TODO: Sometimes it fails with 0x1F, which I think is SE_ERR_NOASSOC + // Not sure why, maybe just retry? + println!( + "Launch: done with {:?}, success: {:?}", + ret, + (ret as u8) > 32 + ); +} + +fn launch_tool(t: Tool) { + let path = match t { + Tool::QmkGui => r"C:\Program Files\Framework Computer\qmk_gui.exe", + Tool::LedmatrixControl => r"C:\Program Files\Framework Computer\ledmatrix_control.exe", + }; + Command::new(path).spawn().unwrap(); +} + +// Returns percentage if brightness changed +fn sync_keyboards(prev_brightness: &mut HashMap) -> Option { + match qmk_hid::new_hidapi() { + Ok(api) => { + let found = qmk_hid::find_devices(&api, false, false, Some("32ac"), None); + + let dev_infos = found.raw_usages; + + if dev_infos.len() <= 1 { + // No need to sync + return None; + } + + for dev_info in &dev_infos { + let device = dev_info.open_device(&api).unwrap(); + let white_brightness = + via::get_backlight(&device, via::ViaBacklightValue::Brightness as u8).unwrap(); + let rgb_brightness = + via::get_rgb_u8(&device, via::ViaRgbMatrixValue::Brightness as u8).unwrap(); + //println!("{:?}", dev_info.product_string()); + //println!(" RGB: {}/255 White: {}/255", rgb_brightness, white_brightness); + + let mut br_changed = false; + let mut rgb_br_changed = false; + + let path = dev_info.path(); + if let Some((prev_white, prev_rgb)) = prev_brightness.get(path) { + if white_brightness != *prev_white { + // println!("White changed from {} to {}", prev_white, white_brightness); + br_changed = true + } + if rgb_brightness != *prev_rgb { + // println!("RGB changed from {} to {}", prev_rgb, rgb_brightness); + rgb_br_changed = true + } + } + prev_brightness.insert(path.into(), (white_brightness, rgb_brightness)); + + if br_changed || rgb_br_changed { + // Update other keyboards + let new_brightness = if br_changed { + white_brightness + } else { + rgb_brightness + }; + // println!("Updating based on {:?}", dev_info.product_string()); + // println!(" Updating other keyboards to {}", new_brightness); + for other_info in &dev_infos { + if path == other_info.path() { + continue; + } + // println!(" Updating {:?}", other_info.product_string()); + { + let other_device = other_info.open_device(&api).unwrap(); + via::set_backlight( + &other_device, + via::ViaBacklightValue::Brightness as u8, + new_brightness, + ) + .unwrap(); + via::set_rgb_u8( + &other_device, + via::ViaRgbMatrixValue::Brightness as u8, + new_brightness, + ) + .unwrap(); + } + + // Avoid triggering an update in the other direction + // Need to read the value since the keyboard might only have 3 brightness levels, + // if that's the case, the value we set and the value the keyboard sets itself to are not the same. + // Seems we have to sleep a bit and also connect to the device again to make the change visible. + // TODO: Figure out why QMK changes the value also on the RGB which should have all 255 levels + thread::sleep(Duration::from_millis(100)); + { + let other_device = other_info.open_device(&api).unwrap(); + let actual_white = via::get_backlight( + &other_device, + via::ViaBacklightValue::Brightness as u8, + ) + .unwrap(); + let actual_rgb = via::get_rgb_u8( + &other_device, + via::ViaRgbMatrixValue::Brightness as u8, + ) + .unwrap(); + // println!(" Actually set to white: {}, rgb: {}", actual_white, actual_rgb); + prev_brightness + .insert(other_info.path().into(), (actual_white, actual_rgb)); + } + } + return Some((new_brightness as u32) * 100 / 255); + } + } + //println!(); + } + Err(e) => { + eprintln!("Error: {e}"); + } + } + None +} + +fn sync_keyboard_screen() { + println!("Sync"); + match qmk_hid::new_hidapi() { + Ok(api) => { + let found = qmk_hid::find_devices(&api, false, false, Some("32ac"), None); + + let dev_infos = found.raw_usages; + + let dev_info = if dev_infos.is_empty() { + println!("No device found"); + return; + } else if dev_infos.len() == 1 { + //println!("Found one device"); + dev_infos.get(0).unwrap() + } else { + println!("More than 1 device found. Select a specific device with --vid and --pid"); + dev_infos.get(0).unwrap() + }; + //println!("Open"); + let device = dev_info.open_device(&api).unwrap(); + //println!("Opened"); + + //println!("Get RGB"); + let rgb_brightness = + via::get_rgb_u8(&device, via::ViaRgbMatrixValue::Brightness as u8).unwrap(); + //println!("Get white"); + let white_brightness = + via::get_backlight(&device, via::ViaBacklightValue::Brightness as u8).unwrap(); + // println!("RGB: {}/255 White: {}/255", rgb_brightness, brightness); + + // TODO: In firmware it should sync both brightnesses + let pid = dev_info.product_id(); + let brightness = if pid == FrameworkPid::IsoKeyboard as u16 { + white_brightness + // } else if pid == FrameworkPid::Macropad as u16 { + // white_brightness + } else if pid == FrameworkPid::Macropad as u16 { + rgb_brightness + } else { + white_brightness + }; + + let percent = (brightness as u32) * 100 / 255; + println!("Brightness: {}/255, {}%", brightness, percent); + + let devs = brightness::blocking::brightness_devices(); + for dev in devs { + let dev = dev.unwrap(); + dev.set(percent).unwrap(); + } + } + Err(e) => { + eprintln!("Error: {e}"); + } + }; +} + +fn add_menu(menu: MenuBuilder, _icon: &'static [u8], nm: Events) -> MenuBuilder { + let (nm_str, nm_checked) = match nm { + Events::NumLockOff => ("Numlock Off (Arrow Keys)", false), + Events::NumLockOn => ("Numlock On (Number Keys)", true), + _ => ("???", false), + }; + menu.submenu( + "Launch Inputmodule Apps", + MenuBuilder::new() + .item("Keyboard (VIA)", Events::LaunchVia) + .item("Keyboard (QMK GUI)", Events::LaunchQmkGui) + .item("LED Matrix", Events::LaunchLedmatrixControl), + ) + .separator() + // TODO + // .item("Sync keyboard brightness", Events::SyncKeyboards) + .item( + "Sync keyboard brightness with screen", + Events::SyncKeyboardScreen, + ) + //.separator() + .checkable(nm_str, nm_checked, Events::NumLockToggle) + //.with(MenuItem::Item { + // name: "Item Disabled".into(), + // disabled: true, // Disabled entry example + // id: Events::DisabledItem1, + // icon: Result::ok(Icon::from_buffer(icon, None, None)), + //}) + .separator() + .submenu( + "Framework Websites", + MenuBuilder::new() + .item("Marketplace", Events::LaunchMarketplace) + .item("Community", Events::LaunchCommunity) + .item("Knowledge Base", Events::LaunchKb) + .item("Guides", Events::LaunchGuides), + ) + .separator() + .item("E&xit", Events::Exit) +} + +/// Check if numlock is enabled +/// +/// Enabled means number mode, disabled means arrow mode +fn numlock_enabled() -> bool { + use winapi::um::winuser::*; + unsafe { GetKeyState(VK_NUMLOCK) == 1 } +} + +fn numlock_toggle() { + use winapi::um::winuser::*; + unsafe { + keybd_event(VK_NUMLOCK as u8, 0x3A, 0x1, 0); + keybd_event(VK_NUMLOCK as u8, 0x3A, 0x3, 0); + } +} + +#[cfg(windows)] +mod win_bindings { + ::windows::include_bindings!(); + pub use self::windows::win32::shell::SetCurrentProcessExplicitAppUserModelID; +} + +fn main() { + unsafe { + win_bindings::SetCurrentProcessExplicitAppUserModelID( + to_wstring("work.frame.tray").as_ptr(), + ) + .unwrap(); + } + Toast::new("work.frame.tray") + .title("Framework Tray Application") + .text1("Started") + .sound(None) + .duration(winrt_notification::Duration::Short) + .show() + .expect("unable to toast"); + + let (s, r) = std::sync::mpsc::channel::(); + let icon = LOGO_32_ICO; + // let icon2 = include_bytes!("icon2.ico"); + // let second_icon = Icon::from_buffer(icon2, None, None).unwrap(); + // let first_icon = Icon::from_buffer(icon, None, None).unwrap(); + + // Needlessly complicated tray icon with all the whistles and bells + let mut tray_icon = TrayIconBuilder::new() + .sender(s.clone()) + .icon_from_buffer(icon) + .tooltip("Cool Tray 👀 Icon") + .on_click(Events::ClickTrayIcon) + .on_double_click(Events::DoubleClickTrayIcon) + .menu(add_menu(MenuBuilder::new(), icon, Events::NumLockOn)) + .build() + .unwrap(); + + let periodic_s = s; + let mut prev_values = PrevValues::default(); + + std::thread::spawn(move || loop { + let numlock_state = numlock_enabled(); + if numlock_state != prev_values.numlock { + let text = if numlock_state { + periodic_s.send(Events::NumLockOn).unwrap(); + "Numlock enabled" + } else { + periodic_s.send(Events::NumLockOff).unwrap(); + "Numlock disabled" + }; + // TODO: Figure out our own Application User Model ID + Toast::new("work.frame.tray") + .title("Framework Keyboard") + .text1(text) + .sound(None) + .duration(winrt_notification::Duration::Short) + .show() + .expect("unable to toast"); + } + prev_values.numlock = numlock_state; + + //sync_keyboard_screen(); + if let Some(percentage) = sync_keyboards(&mut prev_values.brightness) { + let devs = brightness::blocking::brightness_devices(); + for dev in devs { + let dev = dev.unwrap(); + dev.set(percentage).unwrap(); + } + } + + thread::sleep(Duration::from_secs(1)); + }); + + std::thread::spawn(move || { + r.iter().for_each(|m| match m { + // About Popup + // FontAwesome Icon + // Events::About => {}, + Events::LaunchVia => launch_website(VIA_URL), + Events::LaunchQmkGui => launch_tool(Tool::QmkGui), + Events::LaunchLedmatrixControl => launch_tool(Tool::LedmatrixControl), + Events::LaunchMarketplace => launch_website(FWK_MARKETPLACE), + Events::LaunchCommunity => launch_website(FWK_COMMUNITY), + Events::LaunchKb => launch_website(FWK_KB), + Events::LaunchGuides => launch_website(FWK_GUIDES), + //Events::SyncKeyboards => sync_keyboards(), + Events::SyncKeyboardScreen => sync_keyboard_screen(), + + Events::DoubleClickTrayIcon => { + println!("Double click"); + let devs = brightness::blocking::brightness_devices(); + for dev in devs { + let dev = dev.unwrap(); + dev.set(50).unwrap(); + } + } + Events::ClickTrayIcon => { + println!("Single click"); + let devs = brightness::blocking::brightness_devices(); + for dev in devs { + // TODO: Skip unsupported monitors + let dev = dev.unwrap(); + println!("{:?}", dev.device_name()); + println!(" {:?}", dev.get()); + } + sync_keyboard_screen(); + } + Events::Exit => { + std::process::exit(0); + } + Events::NumLockToggle => { + numlock_toggle(); + } + Events::NumLockOn => { + //println!("Turning numlock on"); + tray_icon + .set_menu(&add_menu(MenuBuilder::new(), icon, Events::NumLockOn)) + .unwrap(); + } + Events::NumLockOff => { + //println!("Turning numlock off"); + tray_icon + .set_menu(&add_menu(MenuBuilder::new(), icon, Events::NumLockOff)) + .unwrap(); + } // Events::Item1 => { + // tray_icon.set_icon(&second_icon).unwrap(); + // } + // Events::Item2 => { + // tray_icon.set_icon(&first_icon).unwrap(); + // } + // e => { + // println!("{:?}", e); + // } + }) + }); + + // Your applications message loop. Because all applications require an + // application loop, you are best served using an `winit` crate. + loop { + unsafe { + let mut msg = MaybeUninit::uninit(); + let bret = winuser::GetMessageA(msg.as_mut_ptr(), 0 as _, 0, 0); + if bret > 0 { + winuser::TranslateMessage(msg.as_ptr()); + winuser::DispatchMessageA(msg.as_ptr()); + } else { + break; + } + } + } +} diff --git a/frameworkd/wix/main.wxs b/frameworkd/wix/main.wxs new file mode 100644 index 00000000..27428eb2 --- /dev/null +++ b/frameworkd/wix/main.wxs @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 1 + + + + + + + + + + + + + + + + + + diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1a0b7fd6..534e0297 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] profile = "default" -channel = "1.68.2" +channel = "1.77.1" components = ["rust-src", "clippy", "rustfmt"] targets = ["x86_64-unknown-uefi"]