From 6c1dfe191843ad56aaa0381e5645ad9e74c38b8b Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Fri, 17 Jan 2025 23:01:00 +0200 Subject: Accumulate config engine, build metadata, and doc updates Remaining files from the backlog: Lua config engine additions (general/register/support/window), workspace Cargo.toml/ Cargo.lock churn from the new dependencies added elsewhere in this sweep, srdwm/main.rs wiring, and docs (DEFAULTS.md plus a new SESSION_HANDOFF.md written mid-session for continuity across a restart - see that file's own header for what it is and isn't). --- Cargo.lock | 769 ++++++++++++++++++++++++++++------- Cargo.toml | 2 + crates/config/src/engine/general.rs | 20 +- crates/config/src/engine/register.rs | 2 + crates/config/src/engine/support.rs | 2 + crates/config/src/engine/window.rs | 14 + crates/srdwm/Cargo.toml | 2 +- crates/srdwm/src/main.rs | 84 +++- docs/DEFAULTS.md | 18 +- 9 files changed, 752 insertions(+), 161 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72ed780..4305b11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,75 +65,156 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" [[package]] -name = "anstream" -version = "1.0.0" +name = "appendlist" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e149dc73cd30538307e7ffa2acd3d2221148eaeed4871f246657b1c3eaa1cbd2" + +[[package]] +name = "approx" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", + "num-traits", ] [[package]] -name = "anstyle" -version = "1.0.14" +name = "as-raw-xcb-connection" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] -name = "anstyle-parse" -version = "1.0.0" +name = "async-broadcast" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "utf8parse", + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", ] [[package]] -name = "anstyle-query" -version = "1.1.5" +name = "async-channel" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" dependencies = [ - "windows-sys 0.61.2", + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", ] [[package]] -name = "anstyle-wincon" -version = "3.0.11" +name = "async-executor" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" dependencies = [ - "anstyle", - "once_cell_polyfill", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "pin-project-lite", + "slab", +] + +[[package]] +name = "async-io" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" +dependencies = [ + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix 1.1.4", + "slab", "windows-sys 0.61.2", ] [[package]] -name = "appendlist" -version = "1.4.0" +name = "async-lock" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e149dc73cd30538307e7ffa2acd3d2221148eaeed4871f246657b1c3eaa1cbd2" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] [[package]] -name = "approx" -version = "0.4.0" +name = "async-process" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ - "num-traits", + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix 1.1.4", ] [[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" +name = "async-recursion" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "async-signal" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 1.1.4", + "signal-hook-registry", + "slab", + "windows-sys 0.61.2", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] [[package]] name = "atomic-waker" @@ -153,6 +234,26 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags 2.13.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex 1.3.0", + "syn 2.0.118", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -183,6 +284,19 @@ dependencies = [ "objc2", ] +[[package]] +name = "blocking" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + [[package]] name = "bstr" version = "1.12.3" @@ -216,7 +330,7 @@ checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -273,7 +387,16 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", ] [[package]] @@ -299,10 +422,14 @@ dependencies = [ ] [[package]] -name = "colorchoice" -version = "1.0.5" +name = "clang-sys" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", +] [[package]] name = "combine" @@ -428,37 +555,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" -[[package]] -name = "defmt" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" -dependencies = [ - "bitflags 1.3.2", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" -dependencies = [ - "defmt-parser", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "defmt-parser" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" -dependencies = [ - "thiserror 2.0.18", -] - [[package]] name = "digest" version = "0.10.7" @@ -552,34 +648,49 @@ dependencies = [ ] [[package]] -name = "env_filter" -version = "2.0.0" +name = "endi" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900d271a03799a1ee8d1ca9b19893b48ca674a9284fefcfb85f05e74ed314217" +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" + +[[package]] +name = "enum-repr" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad30c9c0fa1aaf1ae5010dab11f1117b15d35faf62cda4bbbc53b9987950f18" dependencies = [ - "log", - "regex", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "env_home" -version = "0.1.0" +name = "enumflags2" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] [[package]] -name = "env_logger" -version = "0.11.11" +name = "enumflags2_derive" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de671bd27a75a797dc9ae289ba1e77276e75e2026408aab65185384e2d5cd3f6" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ - "anstream", - "anstyle", - "env_filter", - "jiff", - "log", + "proc-macro2", + "quote", + "syn 2.0.118", ] +[[package]] +name = "env_home" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" + [[package]] name = "equivalent" version = "1.0.2" @@ -596,6 +707,26 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "event-listener" +version = "5.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" +dependencies = [ + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "2.4.1" @@ -642,7 +773,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -657,6 +788,25 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +[[package]] +name = "futures-io" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-task" version = "0.3.32" @@ -729,6 +879,12 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + [[package]] name = "hashbrown" version = "0.15.5" @@ -758,6 +914,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "indexmap" version = "2.14.0" @@ -798,10 +960,13 @@ dependencies = [ ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.2" +name = "itertools" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] [[package]] name = "itoa" @@ -809,31 +974,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "jiff" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961d16382652bfdd8c6f68b223b26a8c93e0d475c672f414411db31c6c5c900e" -dependencies = [ - "defmt", - "jiff-static", - "log", - "portable-atomic", - "portable-atomic-util", - "serde_core", -] - -[[package]] -name = "jiff-static" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0879bd39df99c4c5e2c6615ccc026391a423dde10532c573e6086eb94a802cc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "jni" version = "0.22.4" @@ -861,7 +1001,7 @@ dependencies = [ "quote", "rustc_version", "simd_cesu8", - "syn", + "syn 2.0.118", ] [[package]] @@ -889,7 +1029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" dependencies = [ "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -919,6 +1059,18 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.186" @@ -1020,6 +1172,15 @@ dependencies = [ "which", ] +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + [[package]] name = "memchr" version = "2.8.3" @@ -1044,6 +1205,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 = "mlua" version = "0.9.9" @@ -1054,7 +1221,7 @@ dependencies = [ "mlua-sys", "num-traits", "once_cell", - "rustc-hash", + "rustc-hash 2.1.3", ] [[package]] @@ -1100,6 +1267,25 @@ dependencies = [ "jni-sys 0.3.1", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1128,7 +1314,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -1340,12 +1526,6 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "once_cell_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" - [[package]] name = "orbclient" version = "0.3.55" @@ -1356,6 +1536,45 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "pam-client" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bd776116a7ada5ebbe31f54cdc5b1030ed7265686cf7c8a21c057a2f8dab9a" +dependencies = [ + "bitflags 1.3.2", + "enum-repr", + "libc", + "pam-sys", + "rustversion", +] + +[[package]] +name = "pam-sys" +version = "1.0.0-alpha5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce9484729b3e52c0bacdc5191cb6a6a5f31ef4c09c5e4ab1209d3340ad9e997b" +dependencies = [ + "bindgen", + "libc", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "paste" version = "1.0.15" @@ -1385,7 +1604,7 @@ checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -1394,6 +1613,17 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "piper" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + [[package]] name = "pixman" version = "0.2.1" @@ -1438,21 +1668,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "portable-atomic" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" - -[[package]] -name = "portable-atomic-util" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" -dependencies = [ - "portable-atomic", -] - [[package]] name = "ppv-lite86" version = "0.2.21" @@ -1496,7 +1711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" dependencies = [ "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -1611,6 +1826,12 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hash" version = "2.1.3" @@ -1712,7 +1933,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -1728,6 +1949,17 @@ dependencies = [ "zmij", ] +[[package]] +name = "serde_repr" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + [[package]] name = "sha2" version = "0.10.9" @@ -1739,12 +1971,37 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "shlex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + [[package]] name = "simd_cesu8" version = "1.1.1" @@ -1865,7 +2122,6 @@ dependencies = [ name = "srdwm" version = "0.1.0" dependencies = [ - "env_logger", "libc", "log", "srdwm-config", @@ -1875,6 +2131,7 @@ dependencies = [ "srdwm-wayland", "srdwm-windows", "srdwm-x11", + "tracing-subscriber", ] [[package]] @@ -1914,11 +2171,13 @@ name = "srdwm-platform" version = "0.1.0" dependencies = [ "log", + "pam-client", "serde", "serde_json", "srdwm-core", "tempfile", "thiserror 2.0.18", + "zbus", ] [[package]] @@ -1928,6 +2187,7 @@ dependencies = [ "fontdue", "log", "memmap2", + "pixman", "serde", "serde_json", "smithay", @@ -1936,9 +2196,11 @@ dependencies = [ "thiserror 2.0.18", "wayland-backend", "wayland-protocols", + "wayland-protocols-plasma", "wayland-protocols-wlr", "wayland-scanner", "xcursor", + "xkbcommon", ] [[package]] @@ -1963,6 +2225,17 @@ dependencies = [ "x11rb", ] +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.118" @@ -1974,6 +2247,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tempfile" version = "3.27.0" @@ -2013,7 +2297,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -2024,7 +2308,16 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", ] [[package]] @@ -2077,7 +2370,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -2087,6 +2380,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -2113,6 +2436,17 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "uds_windows" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" +dependencies = [ + "memoffset", + "tempfile", + "windows-sys 0.61.2", +] + [[package]] name = "unicode-ident" version = "1.0.24" @@ -2126,10 +2460,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] -name = "utf8parse" -version = "0.2.2" +name = "uuid" +version = "1.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cefc03fd367c0c6d4305de1b312cf00248c4114f4a0418ce6a6af769e3b0bd9" +dependencies = [ + "js-sys", + "serde_core", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "version_check" @@ -2198,7 +2543,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.118", "wasm-bindgen-shared", ] @@ -2306,6 +2651,7 @@ dependencies = [ "wayland-client", "wayland-protocols", "wayland-scanner", + "wayland-server", ] [[package]] @@ -2432,7 +2778,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -2443,7 +2789,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -2774,6 +3120,76 @@ version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" +[[package]] +name = "zbus" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907" +dependencies = [ + "async-broadcast", + "async-executor", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-lite", + "hex", + "libc", + "ordered-stream", + "rustix 1.1.4", + "serde", + "serde_repr", + "tracing", + "uds_windows", + "uuid", + "windows-sys 0.61.2", + "winnow", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.3", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e" +dependencies = [ + "serde", + "winnow", + "zvariant", +] + +[[package]] +name = "zcheapstr" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473" +dependencies = [ + "serde", +] + [[package]] name = "zerocopy" version = "0.8.54" @@ -2791,7 +3207,7 @@ checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.118", ] [[package]] @@ -2799,3 +3215,44 @@ name = "zmij" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zvariant" +version = "5.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e28c25bd8bb8da5a1f3e7065d0c156b9ee9a7973adf78b0e35eaefdf3b1b5c" +dependencies = [ + "endi", + "enumflags2", + "serde", + "winnow", + "zcheapstr", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d496a145685283b67e232bd9e47377f6b60ad9d51e3601b23867f77c42477f96" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 3.0.3", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "629d80ece222cad20fe0e8741be493c4ab166acf3b85341bdc2cdbcfd8f3c2d6" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "syn 3.0.3", + "winnow", +] diff --git a/Cargo.toml b/Cargo.toml index 4c12acc..e3ac289 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,8 @@ srdwm-macos = { path = "crates/macos" } log = "0.4" env_logger = "0.11" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } thiserror = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/crates/config/src/engine/general.rs b/crates/config/src/engine/general.rs index 96ea4d3..98cfebe 100644 --- a/crates/config/src/engine/general.rs +++ b/crates/config/src/engine/general.rs @@ -128,7 +128,8 @@ impl Engine { /// class_regex = "...", instance = "..." }, { floating = true, /// workspace = 2, x = .., y = .., width = .., height = .., /// decorated = false, border_color = {r,g,b}, border_width = 2, - /// maximized = true, opacity = 0.9 })`. At least one matcher field is + /// corner_radius = 10, maximized = true, opacity = 0.9 })`. At least + /// one matcher field is /// required; unmatched rules apply nothing. /// /// `title`/`class` are plain substring/exact match, cheap and cover @@ -182,6 +183,7 @@ impl Engine { decorated: actions.get("decorated")?, border_color, border_width: actions.get("border_width")?, + corner_radius: actions.get("corner_radius")?, pinned: actions.get("pinned")?, opacity: actions.get("opacity")?, resize_margin: actions.get("resize_margin")?, @@ -217,6 +219,22 @@ impl Engine { })?) } + /// Sets an environment variable in srdwm's own process - `std::process:: + /// Command` inherits the parent's environment by default (`fn_spawn` + /// above never overrides that), so anything set here is visible to + /// every process `srd.spawn` starts from this point on, and to their own + /// children in turn. Hyprland's `env = NAME,VALUE` works the same way + /// (sets it in its own process before forking anything), which is the + /// mechanism a ported `env.conf` needs - there is no per-spawn + /// equivalent that would let one client see a variable no other client + /// does, so this is deliberately global and process-wide, not scoped. + pub(super) fn fn_setenv(&self) -> Result> { + Ok(self.lua.create_function(move |_, (name, value): (String, String)| { + std::env::set_var(&name, &value); + Ok(()) + })?) + } + pub(super) fn fn_quit(&self) -> Result> { let state = self.state.clone(); Ok(self.lua.create_function(move |_, ()| { diff --git a/crates/config/src/engine/register.rs b/crates/config/src/engine/register.rs index abe919b..0cf64bc 100644 --- a/crates/config/src/engine/register.rs +++ b/crates/config/src/engine/register.rs @@ -17,6 +17,7 @@ impl Engine { srd.set("rule", self.fn_rule()?)?; srd.set("load", self.fn_load()?)?; srd.set("spawn", self.fn_spawn()?)?; + srd.set("setenv", self.fn_setenv()?)?; srd.set("notify", self.fn_notify()?)?; srd.set("quit", self.fn_quit()?)?; srd.set("reload", self.fn_reload()?)?; @@ -44,6 +45,7 @@ impl Engine { window.set("set_decorations", self.fn_window_set_decorations()?)?; window.set("set_border_color", self.fn_window_set_border_color()?)?; window.set("set_border_width", self.fn_window_set_border_width()?)?; + window.set("set_corner_radius", self.fn_window_set_corner_radius()?)?; window.set("set_opacity", self.fn_window_set_opacity()?)?; window.set("set_resize_margin", self.fn_window_set_resize_margin()?)?; window.set("set_floating", self.fn_window_set_floating()?)?; diff --git a/crates/config/src/engine/support.rs b/crates/config/src/engine/support.rs index 9346499..0f83885 100644 --- a/crates/config/src/engine/support.rs +++ b/crates/config/src/engine/support.rs @@ -82,6 +82,7 @@ pub(super) fn validate(s: &SharedState) -> Vec { check_range("layout.floating.gaps.outer", 0.0, 100.0); check_range("general.border_width", 0.0, 20.0); check_range("theme.decorations.border.width", 0.0, 20.0); + check_range("theme.decorations.border.radius", 0.0, 100.0); check_range("general.animation_duration", 0.0, 1000.0); check_range("general.resize_margin", 1.0, 50.0); check_range("performance.max_fps", 30.0, 240.0); @@ -242,6 +243,7 @@ pub(super) fn default_config() -> HashMap { set("theme.colors.success", String("#a3be8c".into())); set("theme.decorations.border.width", Number(2.0)); + set("theme.decorations.border.radius", Number(6.0)); set("theme.decorations.border.active_color", String("#88c0d0".into())); set("theme.decorations.border.inactive_color", String("#2e3440".into())); set("theme.decorations.border.focused_style", String("solid".into())); diff --git a/crates/config/src/engine/window.rs b/crates/config/src/engine/window.rs index a7e6bf3..61e7b89 100644 --- a/crates/config/src/engine/window.rs +++ b/crates/config/src/engine/window.rs @@ -139,6 +139,20 @@ impl Engine { })?) } + pub(super) fn fn_window_set_corner_radius(&self) -> Result> { + let state = self.state.clone(); + Ok(self.lua.create_function(move |_, radius: u32| { + let wm = state.borrow().wm.clone(); + let mut wm = wm.borrow_mut(); + if let Some(id) = wm.focused_id() { + if let Some(w) = wm.window_mut(id) { + w.corner_radius = radius; + } + } + Ok(()) + })?) + } + pub(super) fn fn_window_set_opacity(&self) -> Result> { let state = self.state.clone(); Ok(self.lua.create_function(move |_, opacity: f32| { diff --git a/crates/srdwm/Cargo.toml b/crates/srdwm/Cargo.toml index 0d1ffaf..a8ecd34 100644 --- a/crates/srdwm/Cargo.toml +++ b/crates/srdwm/Cargo.toml @@ -14,7 +14,7 @@ srdwm-core.workspace = true srdwm-platform.workspace = true srdwm-config.workspace = true log.workspace = true -env_logger.workspace = true +tracing-subscriber.workspace = true [target.'cfg(unix)'.dependencies] # SIGTERM/SIGINT handling only - see `main.rs`'s `install_signal_handlers` diff --git a/crates/srdwm/src/main.rs b/crates/srdwm/src/main.rs index 5c2bfea..7e25fec 100644 --- a/crates/srdwm/src/main.rs +++ b/crates/srdwm/src/main.rs @@ -175,9 +175,49 @@ fn apply_general_settings(engine: &Engine, wm: &Rc>) { } let border_width = engine.get_f64("theme.decorations.border.width", 2.0).max(0.0) as u32; theme.default_border_width = border_width; + let corner_radius = engine.get_f64("theme.decorations.border.radius", 6.0).max(0.0) as u32; + theme.default_corner_radius = corner_radius; if let Some(rgb) = srdwm_core::parse_hex_color(&engine.get_string("theme.decorations.border.active_color", "#88c0d0")) { theme.default_border_color = rgb; } + // "server" (srdwm draws the titlebar, Windows/macOS-style) or "client" + // (srdwm steps back for anything with no decoration opinion of its + // own, GNOME-style) - see `ThemeConfig::default_decorated`'s own doc + // comment. Anything other than exactly "client" is treated as + // "server", the existing default, rather than erroring on a typo. + theme.default_decorated = engine.get_string("theme.decorations.default_mode", "server") != "client"; + + // `theme.lock.*` - srdwm's own session-lock UI (`crates/wayland/src/ + // native_lock.rs`), configured the same "start from ThemeConfig-style + // Nord defaults, override per key" way as everything above. + let mut lock = srdwm_core::LockConfig::default(); + if let Some(rgb) = srdwm_core::parse_hex_color(&engine.get_string("theme.lock.box_bg", "#2e3440")) { + lock.box_bg = rgb; + } + if let Some(rgb) = srdwm_core::parse_hex_color(&engine.get_string("theme.lock.box_border", "#88c0d0")) { + lock.box_border = rgb; + } + if let Some(rgb) = srdwm_core::parse_hex_color(&engine.get_string("theme.lock.text_color", "#eceff4")) { + lock.text_color = rgb; + } + if let Some(rgb) = srdwm_core::parse_hex_color(&engine.get_string("theme.lock.error_color", "#bf616a")) { + lock.error_color = rgb; + } + lock.corner_radius = engine.get_f64("theme.lock.corner_radius", lock.corner_radius as f64).max(0.0) as u32; + lock.blur_radius = engine.get_f64("theme.lock.blur_radius", lock.blur_radius as f64).max(0.0) as u32; + lock.show_caps_lock = engine.get_bool("theme.lock.show_caps_lock", lock.show_caps_lock); + lock.show_failed_attempts = engine.get_bool("theme.lock.show_failed_attempts", lock.show_failed_attempts); + let fail_message = engine.get_string("theme.lock.fail_message", &lock.fail_message); + lock.fail_message = fail_message; + // A single character, not a string - silently keeping the default + // rather than erroring is deliberate here (same "malformed value falls + // back to default rather than erroring a second time" stance `parse_ + // hex_color` callers already take above), since a multi-character + // "dot" would misalign the whole password row's width calculations, + // which assume one glyph per typed character. + if let Some(ch) = engine.get_string("theme.lock.dot_char", &lock.dot_char.to_string()).chars().next() { + lock.dot_char = ch; + } let mut wm = wm.borrow_mut(); wm.tiling.gap_inner = gap; @@ -190,6 +230,7 @@ fn apply_general_settings(engine: &Engine, wm: &Rc>) { wm.focus_follows_mouse = focus_follows_mouse; wm.auto_raise = auto_raise; wm.theme = theme; + wm.lock = lock; wm.auto_back_and_forth = engine.get_bool("workspace.auto_back_and_forth", false); } @@ -305,6 +346,18 @@ fn sync(wm: &Rc>, platform: &mut dyn Platform) { } } + // Same "core records the intent, this loop forwards it to the platform + // that can actually act on it" shape as `close_requests` above - a + // count rather than a single flag, so more than one `srd dispatch + // cycle_keyboard_layout` in one tick isn't silently collapsed into one + // real cycle. + for _ in 0..wm.borrow_mut().take_keyboard_layout_cycle_requests() { + match platform.cycle_keyboard_layout() { + Ok(name) => wm.borrow_mut().set_keyboard_layout(name), + Err(e) => log::warn!("cycle_keyboard_layout() failed: {e}"), + } + } + let ws = wm.borrow().current_workspace(); wm.borrow_mut().arrange_workspace(ws); @@ -388,7 +441,25 @@ fn main() -> Result<(), Box> { } }; - env_logger::init(); + // `log::*` throughout this codebase and `tracing::*` inside smithay + // (its own buffer-import failures, e.g. "Failed to import surface" / + // "Unknown buffer format for", are emitted via `tracing::warn!`/ + // `error!`, not `log::`) are two independent facades - plain + // `env_logger::init()` only ever installed a `log` backend, so every + // smithay-side diagnostic was silently dropped with no subscriber to + // receive it. `tracing_subscriber::fmt()` bridges `log::*` calls into + // `tracing` itself (its default `tracing-log` feature installs that + // bridge as part of `init()`) and then prints both, still filtered by + // the same `RUST_LOG` directive syntax `env_logger` used - a separate, + // explicit `tracing_log::LogTracer::init()` call here crashed srdwm on + // every single startup (`SetLoggerError` - `log::set_boxed_logger` can + // only ever succeed once process-wide, and `init()` below already + // claims it) instead of merely being redundant with it, since `init()` + // internally unwraps that install rather than tolerating it being taken + // already. Confirmed live: this is what put srdwm into a boot loop. + tracing_subscriber::fmt() + .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) + .init(); log::info!("srdwm starting"); // Decided before the config loads (it needs no engine, just argv/the @@ -443,6 +514,17 @@ fn main() -> Result<(), Box> { log::info!("detected {} monitor(s)", monitors.len()); wm.borrow_mut().set_monitors(monitors); + // Read once so `WindowManager::keyboard_layout` (surfaced over `srd`, + // for an AGS peer session's keyboard-layout badge) has a real value + // from the start rather than an empty string until the first real + // cycle. `Err` here just means this backend has no real XKB-backed + // seat to ask (X11, Windows, macOS) - not worth failing startup over, + // same as any other platform capability that's honestly unsupported. + match platform.keyboard_layout() { + Ok(name) => wm.borrow_mut().set_keyboard_layout(name), + Err(e) => log::debug!("keyboard_layout() unavailable on this backend: {e}"), + } + // The platform is fully connected now (for Wayland, `WAYLAND_DISPLAY` // was just set by `srdwm_wayland::connect` - see `udev`/`winit` // - and for X11, `DISPLAY` was already set by whatever started the X diff --git a/docs/DEFAULTS.md b/docs/DEFAULTS.md index 4b4e195..68d3839 100644 --- a/docs/DEFAULTS.md +++ b/docs/DEFAULTS.md @@ -153,6 +153,7 @@ srd.theme.set_colors({ srd.theme.set_decorations({ border = { width = 2, -- Default: 2 + radius = 6, -- Default: 6 (corner radius, logical px) active_color = "#88c0d0", -- Default: Nord blue inactive_color = "#2e3440", -- Default: Nord dark focused_style = "solid", -- Default: "solid" @@ -164,7 +165,20 @@ srd.theme.set_decorations({ font = "JetBrains Mono 10", -- Default: "JetBrains Mono 10" background = "#2e3440", -- Default: Nord dark foreground = "#eceff4" -- Default: Nord light - } + }, + - Which decoration mode a window gets before any per-window rule or + - the window's own `xdg-decoration` request has a say. "server" + - (default): srdwm draws its own titlebar for anything that doesn't + - ask otherwise - consistent Windows/macOS-style chrome, and KDE/ + - KWin's own choice too. "client": srdwm steps back by default and + - lets every window draw its own chrome (GNOME/Mutter's approach) -- + - a window with no titlebar opinion of its own then gets no titlebar + - at all. A client that explicitly requests a mode is always honored + - either way; this only decides what a client with *no* preference + - ends up with. Also live-settable without a config reload/restart: + - `srd set decoration_mode server` / `srd set decoration_mode client` + - (affects windows created after the call, not already-open ones). + default_mode = "server" -- Default: "server" }) ``` @@ -217,7 +231,7 @@ srd.rule(matcher, actions) - `x`, `y`, `width`, `height` (number) - explicit geometry; all four must be given together to take effect - `decorated` (bool) -- `border_color` (`{r, g, b}`), `border_width` (number) +- `border_color` (`{r, g, b}`), `border_width` (number), `corner_radius` (number) - `pinned` (bool) - always-on-top - `opacity` (number, `0.0`..=`1.0`) - content opacity; srdwm's own titlebar/border/shadow always stay fully opaque regardless -- cgit v1.2.3