diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c204e3..d916666 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: install system dependencies - run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev + run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libdav1d-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev - uses: actions/checkout@v6 - name: install toolchain run: rustup toolchain install 1.90.0 --component clippy @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: install system dependencies - run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev + run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libdav1d-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev - uses: actions/checkout@v6 - name: install toolchain run: rustup show @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: install system dependencies - run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev just + run: sudo apt-get update && sudo apt-get install lld cmake libclang-dev libdav1d-dev libexpat1-dev libfontconfig-dev libfreetype-dev libpipewire-0.3-dev libpulse-dev pkg-config libxkbcommon-dev libudev-dev libinput-dev libwayland-dev just - uses: actions/checkout@v6 - name: install toolchain run: rustup show diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..2cc7b98 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,15 @@ +{ + "format_on_save": "on", + "lsp": { + "rust-analyzer": { + "initialization_options": { + "check": { + "command": "clippy", + }, + "rustfmt": { + "extraArgs": ["+nightly"], + }, + }, + }, + }, +} diff --git a/Cargo.lock b/Cargo.lock index e9205b2..ec77873 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,7 +104,7 @@ dependencies = [ [[package]] name = "accounts-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "zbus", ] @@ -132,7 +132,7 @@ checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher 0.4.4", - "cpufeatures", + "cpufeatures 0.2.17", ] [[package]] @@ -189,13 +189,19 @@ checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" [[package]] name = "alloc-stdlib" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195" dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "almost" version = "0.2.0" @@ -209,7 +215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f2a1bb052857d5dd49572219344a7332b31b76405648eabac5bc68978251bcd" dependencies = [ "android-properties", - "bitflags 2.11.1", + "bitflags 2.13.0", "cc", "jni", "libc", @@ -236,16 +242,6 @@ dependencies = [ "libc", ] -[[package]] -name = "annotate-snippets" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" -dependencies = [ - "anstyle", - "unicode-width 0.2.2", -] - [[package]] name = "anstream" version = "1.0.0" @@ -298,9 +294,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "apply" @@ -325,9 +321,9 @@ checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" [[package]] name = "arc-swap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" dependencies = [ "rustversion", ] @@ -340,7 +336,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -351,15 +347,9 @@ checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "as-raw-xcb-connection" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" [[package]] name = "as-slice" @@ -388,7 +378,7 @@ dependencies = [ "enumflags2", "futures-channel", "futures-util", - "rand 0.9.4", + "rand 0.9.5", "raw-window-handle", "serde", "serde_repr", @@ -406,7 +396,7 @@ dependencies = [ "enumflags2", "futures-channel", "futures-util", - "rand 0.9.4", + "rand 0.9.5", "serde", "serde_repr", "tokio", @@ -510,7 +500,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -545,7 +535,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -600,21 +590,34 @@ dependencies = [ [[package]] name = "auto_enums" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65398a2893f41bce5c9259f6e1a4f03fbae40637c1bdc755b4f387f48c613b03" +checksum = "2e4487600931c9a89f8db7ffbdf3fbdd45bb7bd85e26861f659a463cd0dff966" dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "av-data" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca67ba5d317924c02180c576157afd54babe48a76ebc66ce6d34bb8ba08308e" +dependencies = [ + "byte-slice-cast", + "bytes", + "num-derive", + "num-rational", + "num-traits", +] [[package]] name = "av-scenechange" @@ -645,16 +648,16 @@ dependencies = [ "anyhow", "arrayvec", "log", - "nom 8.0.0", + "nom", "num-rational", "v_frame", ] [[package]] name = "avif-serialize" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375082f007bd67184fb9c0374614b29f9aaa604ec301635f72338bb65386a53d" +checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" dependencies = [ "arrayvec", ] @@ -689,25 +692,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bindgen" -version = "0.72.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" -dependencies = [ - "annotate-snippets", - "bitflags 2.11.1", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash 2.1.2", - "shlex", - "syn 2.0.117", -] - [[package]] name = "bit-set" version = "0.8.0" @@ -737,13 +721,22 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" dependencies = [ "serde_core", ] +[[package]] +name = "bitreader" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "886559b1e163d56c765bc3a985febb4eee8009f625244511d8ee3c432e08c066" +dependencies = [ + "cfg-if", +] + [[package]] name = "bitstream-io" version = "4.10.0" @@ -777,6 +770,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + [[package]] name = "block-padding" version = "0.3.3" @@ -831,7 +833,7 @@ dependencies = [ [[package]] name = "bluez-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "futures-channel", "futures-util", @@ -841,9 +843,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd1e3f8955a5d7de9fab72fc8373fade9fb8a703968cb200ae3dc6cf08e185a" +checksum = "2f3f6da4992df95bbcd9af42a6c7dcb994498fc9048230405f3b36ff7cd3f145" dependencies = [ "bytes", "cfg_aliases 0.2.1", @@ -851,23 +853,32 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "5.0.0" +version = "5.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" +checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", ] [[package]] -name = "bstr" -version = "1.12.1" +name = "bs58" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bstr" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cee35f73844aa3014bb606320a6c1f010249dbdf43342fe54b5a4f6a8ed4b79" dependencies = [ "memchr", "regex-automata", - "serde", + "serde_core", ] [[package]] @@ -881,15 +892,15 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" [[package]] name = "bumpalo" -version = "3.20.2" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "by_address" @@ -898,23 +909,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] -name = "bytemuck" -version = "1.25.0" +name = "byte-slice-cast" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" +checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -931,9 +948,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "calendrical_calculations" @@ -951,7 +968,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dbf9978365bac10f54d1d4b04f7ce4427e51f71d61f2fe15e3fed5166474df7" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "polling", "rustix 1.1.4", "slab", @@ -981,23 +998,14 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.60" +version = "1.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", -] - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom 7.1.3", + "shlex 2.0.1", ] [[package]] @@ -1013,9 +1021,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6b04e07d8080154ed4ac03546d9a2b303cc2fe1901ba0b35b301516e289368" +checksum = "fb693542bcafa528e198be0ebd9d3632ca5b7c93dbe7237460e199910835997c" dependencies = [ "smallvec", "target-lexicon", @@ -1041,9 +1049,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -1068,21 +1076,10 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "crypto-common", + "crypto-common 0.1.7", "inout", ] -[[package]] -name = "clang-sys" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" -dependencies = [ - "glob", - "libc", - "libloading", -] - [[package]] name = "clap" version = "4.6.1" @@ -1114,7 +1111,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -1135,7 +1132,6 @@ dependencies = [ [[package]] name = "clipboard_macos" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "objc", "objc-foundation", @@ -1145,22 +1141,12 @@ dependencies = [ [[package]] name = "clipboard_wayland" version = "0.2.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "dnd", "mime 0.1.0", "smithay-clipboard", ] -[[package]] -name = "clipboard_x11" -version = "0.4.2" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" -dependencies = [ - "thiserror 1.0.69", - "x11rb", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -1199,7 +1185,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width 0.2.2", ] [[package]] @@ -1262,24 +1248,15 @@ dependencies = [ [[package]] name = "configparser" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57e3272f0190c3f1584272d613719ba5fc7df7f4942fe542e63d949cf3a649b" +checksum = "b46dec724fd22199ebde05033a0cbae453bc3b1ecff11eb6a6bb3eec4b90c6a4" [[package]] -name = "convert_case" -version = "0.8.0" +name = "const-oid" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "cookie-factory" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" [[package]] name = "core-foundation" @@ -1337,7 +1314,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "core-foundation 0.10.1", "libc", ] @@ -1354,7 +1331,6 @@ dependencies = [ [[package]] name = "cosmic-bg-config" version = "1.0.3" -source = "git+https://github.com/pop-os/cosmic-bg#06970d5945b45a634b9ed314f5ca3a86a8502fd8" dependencies = [ "cosmic-config", "derive_setters", @@ -1365,10 +1341,9 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" -version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols//?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" +version = "0.2.0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cosmic-protocols", "libc", "smithay-client-toolkit", @@ -1379,11 +1354,10 @@ dependencies = [ [[package]] name = "cosmic-comp-config" version = "1.0.0" -source = "git+https://github.com/pop-os/cosmic-comp#4df95190db07f7410666cec4d3bf648de90f81dd" dependencies = [ "cosmic-config", "input", - "ron 0.12.1", + "ron 0.12.2", "serde", "tracing", ] @@ -1391,7 +1365,6 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1401,7 +1374,7 @@ dependencies = [ "iced_futures", "known-folders", "notify", - "ron 0.12.1", + "ron 0.12.2", "serde", "tokio", "tracing", @@ -1412,42 +1385,27 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "cosmic-dbus-a11y" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "zbus", ] -[[package]] -name = "cosmic-dbus-networkmanager" -version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" -dependencies = [ - "bitflags 2.11.1", - "derive_builder", - "jiff", - "procfs", - "zbus", - "zvariant", -] - [[package]] name = "cosmic-freedesktop-icons" version = "0.4.0" -source = "git+https://github.com/pop-os/freedesktop-icons#9c562fe3ecf03241a46a60c0078cd6ea10bd75ce" dependencies = [ "bstr", "btoi", "memchr", - "memmap2 0.9.10", + "memmap2 0.9.11", "thiserror 2.0.18", "tracing", "xdg", @@ -1456,7 +1414,6 @@ dependencies = [ [[package]] name = "cosmic-idle-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-idle#c95d066b5b640509a6369634b669ca60dc50e168" dependencies = [ "cosmic-config", "serde", @@ -1464,19 +1421,20 @@ dependencies = [ [[package]] name = "cosmic-mime-apps" -version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-mime-apps#673f3758920a7b20d307d356d586deef714df6b0" +version = "0.2.0" +source = "git+https://github.com/pop-os/cosmic-mime-apps#8fc81e8857e46c018ea21ab985aaf30ac853c007" dependencies = [ "freedesktop-desktop-entry", + "futures-util", "mime 0.3.17", "quick-xml 0.38.4", + "tokio", "xdg", ] [[package]] name = "cosmic-panel-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#d518c7d25ef96f1a9696aa8cce008656bf66ece4" dependencies = [ "anyhow", "cosmic-config", @@ -1487,25 +1445,11 @@ dependencies = [ "xdg-shell-wrapper-config", ] -[[package]] -name = "cosmic-pipewire" -version = "1.0.7" -dependencies = [ - "intmap", - "libspa", - "libspa-sys", - "pipewire", - "serde", - "serde_json", - "tracing", -] - [[package]] name = "cosmic-protocols" -version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-protocols//?rev=d0e95be#d0e95be25e423cfe523b11111a3666ed7aaf0dc4" +version = "0.2.0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -1517,7 +1461,6 @@ dependencies = [ [[package]] name = "cosmic-randr" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-randr#6e8e795970fa06d434af22775e415b517f7552d3" dependencies = [ "cosmic-protocols", "indexmap 2.14.0", @@ -1531,7 +1474,6 @@ dependencies = [ [[package]] name = "cosmic-randr-shell" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-randr#6e8e795970fa06d434af22775e415b517f7552d3" dependencies = [ "kdl", "slotmap", @@ -1540,7 +1482,7 @@ dependencies = [ [[package]] name = "cosmic-settings" -version = "1.0.7" +version = "1.0.12" dependencies = [ "accounts-zbus", "anyhow", @@ -1552,7 +1494,6 @@ dependencies = [ "cosmic-bg-config", "cosmic-comp-config", "cosmic-config", - "cosmic-dbus-networkmanager", "cosmic-idle-config", "cosmic-mime-apps", "cosmic-panel-config", @@ -1562,12 +1503,12 @@ dependencies = [ "cosmic-settings-a11y-manager-subscription", "cosmic-settings-accessibility-subscription", "cosmic-settings-airplane-mode-subscription", + "cosmic-settings-audio-client", "cosmic-settings-bluetooth-subscription", - "cosmic-settings-config", + "cosmic-settings-config 0.1.0 (git+https://github.com/pop-os/cosmic-settings-daemon)", "cosmic-settings-daemon-config", - "cosmic-settings-network-manager-subscription", "cosmic-settings-page", - "cosmic-settings-sound-subscription", + "cosmic-settings-sound", "cosmic-settings-upower-subscription", "cosmic-settings-wallpaper", "derive_setters", @@ -1585,21 +1526,23 @@ dependencies = [ "icu", "image", "indexmap 2.14.0", - "itertools 0.14.0", + "intmap", + "itertools", "itoa", "jiff", "libcosmic", "locale1", "locales-rs", "mime 0.3.17", - "nm-secret-agent-manager", + "nmrs", "notify", "num-traits", "pwhash", "regex", - "ron 0.12.1", + "ron 0.12.2", "rust-embed", "rustix 1.1.4", + "secret-service", "secure-string", "serde", "slab", @@ -1621,6 +1564,7 @@ dependencies = [ "xkeysym", "zbus", "zbus_polkit", + "zlink", ] [[package]] @@ -1659,6 +1603,33 @@ dependencies = [ "tokio", ] +[[package]] +name = "cosmic-settings-audio-client" +version = "1.0.0" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#1af414fc6cb9080349847382a66db9fd69dbe964" +dependencies = [ + "cosmic-settings-audio-core", + "dirs", + "futures-util", + "ron 0.12.2", + "serde", + "tokio", + "tokio-util", + "tracing", + "zlink", +] + +[[package]] +name = "cosmic-settings-audio-core" +version = "1.0.0" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#1af414fc6cb9080349847382a66db9fd69dbe964" +dependencies = [ + "dirs", + "ron 0.12.2", + "serde", + "zlink", +] + [[package]] name = "cosmic-settings-bluetooth-subscription" version = "1.0.7" @@ -1674,7 +1645,19 @@ dependencies = [ [[package]] name = "cosmic-settings-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#716da6d6af0b252e2f78aba2ad72ee19ae0241e0" +dependencies = [ + "cosmic-config", + "ron 0.11.0", + "serde", + "serde_with", + "tracing", + "xkbcommon 0.9.0", +] + +[[package]] +name = "cosmic-settings-config" +version = "0.1.0" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#1af414fc6cb9080349847382a66db9fd69dbe964" dependencies = [ "cosmic-config", "ron 0.11.0", @@ -1686,8 +1669,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon" -version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +version = "0.1.1-yoda.1" dependencies = [ "zbus", ] @@ -1695,7 +1677,7 @@ dependencies = [ [[package]] name = "cosmic-settings-daemon-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-daemon#716da6d6af0b252e2f78aba2ad72ee19ae0241e0" +source = "git+https://github.com/pop-os/cosmic-settings-daemon#1af414fc6cb9080349847382a66db9fd69dbe964" dependencies = [ "cosmic-config", "serde", @@ -1713,24 +1695,6 @@ dependencies = [ "zbus", ] -[[package]] -name = "cosmic-settings-network-manager-subscription" -version = "1.0.7" -dependencies = [ - "bitflags 2.11.1", - "cosmic-dbus-networkmanager", - "futures", - "iced_futures", - "itertools 0.14.0", - "nm-secret-agent-manager", - "secret-service", - "secure-string", - "thiserror 2.0.18", - "tokio", - "tracing", - "zbus", -] - [[package]] name = "cosmic-settings-page" version = "1.0.7" @@ -1745,26 +1709,12 @@ dependencies = [ ] [[package]] -name = "cosmic-settings-pulse-subscription" +name = "cosmic-settings-sound" version = "0.1.0" dependencies = [ - "futures", - "iced_futures", - "libpulse-binding", - "log", - "rustix 1.1.4", -] - -[[package]] -name = "cosmic-settings-sound-subscription" -version = "1.0.7" -dependencies = [ - "cosmic-pipewire", + "cosmic-settings-audio-client", "futures", "intmap", - "libcosmic", - "numtoa", - "rustix 1.1.4", "tokio", "tracing", ] @@ -1803,18 +1753,17 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.18.2" -source = "git+https://github.com/pop-os/cosmic-text.git#4d74f795cc771fdcc7ea0f9cacba63fcf036fad6" +version = "0.19.0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "fontdb", "harfrust", "linebender_resource_handle", "log", "rangemap", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "self_cell", - "skrifa", + "skrifa 0.40.0", "smol_str", "swash", "sys-locale", @@ -1822,20 +1771,21 @@ dependencies = [ "unicode-linebreak", "unicode-script", "unicode-segmentation", + "unicode-width 0.2.2", ] [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "almost", "configparser", "cosmic-config", "csscolorparser", "dirs", + "hex_color", "palette", - "ron 0.12.1", + "ron 0.12.2", "serde", "serde_json", "thiserror 2.0.18", @@ -1850,6 +1800,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -1861,9 +1820,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1871,18 +1830,18 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crunchy" @@ -1893,12 +1852,11 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cryoglyph" version = "0.1.0" -source = "git+https://github.com/pop-os/glyphon.git?tag=cosmic-0.14#c49de15bce4d8254ac136d1be9911960cc85ce12" dependencies = [ "cosmic-text", "etagere", "lru", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "wgpu", ] @@ -1912,6 +1870,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + [[package]] name = "crypto-mac" version = "0.10.1" @@ -1940,28 +1907,12 @@ dependencies = [ "uncased", ] -[[package]] -name = "ctor-lite" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e162d0c2e2068eb736b71e5597eff0b9944e6b973cd9f37b6a288ab9bf20e300" - [[package]] name = "cursor-icon" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - [[package]] name = "darling" version = "0.21.3" @@ -1982,20 +1933,6 @@ dependencies = [ "darling_macro 0.23.0", ] -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - [[package]] name = "darling_core" version = "0.21.3" @@ -2007,7 +1944,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2020,18 +1957,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2042,7 +1968,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2053,7 +1979,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" dependencies = [ "darling_core 0.23.0", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2062,47 +1988,68 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376" +[[package]] +name = "dav1d" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee89cb860616069c67520dcd66cacdb900b57c799f634a0eb6d91f6e2a82b61" +dependencies = [ + "av-data", + "bitflags 2.13.0", + "dav1d-sys", + "static_assertions", +] + +[[package]] +name = "dav1d-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c91aea6668645415331133ed6f8ddf0e7f40160cd97a12d59e68716a58704b" +dependencies = [ + "libc", + "system-deps", +] + +[[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 2.0.118", +] + +[[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 = "deranged" version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ - "powerfmt", "serde_core", ] -[[package]] -name = "derive_builder" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "derive_builder_macro" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" -dependencies = [ - "derive_builder_core", - "syn 2.0.117", -] - [[package]] name = "derive_setters" version = "0.1.9" @@ -2112,7 +2059,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2123,7 +2070,7 @@ checksum = "362f47930db19fe7735f527e6595e4900316b893ebf6d48ad3d31be928d57dd6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2142,10 +2089,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "crypto-common", + "crypto-common 0.1.7", "subtle", ] +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "const-oid", + "crypto-common 0.2.2", +] + [[package]] name = "dirs" version = "6.0.0" @@ -2173,7 +2131,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "libc", "objc2 0.6.4", @@ -2181,13 +2139,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2202,9 +2160,8 @@ dependencies = [ [[package]] name = "dnd" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "mime 0.1.0", "raw-window-handle", "smithay-client-toolkit", @@ -2235,46 +2192,6 @@ checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" [[package]] name = "dpi" version = "0.1.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" - -[[package]] -name = "drm" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "drm-ffi", - "drm-fourcc", - "rustix 0.38.44", -] - -[[package]] -name = "drm-ffi" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41334f8405792483e32ad05fbb9c5680ff4e84491883d2947a4757dc54cb2ac6" -dependencies = [ - "drm-sys", - "rustix 0.38.44", -] - -[[package]] -name = "drm-fourcc" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4" - -[[package]] -name = "drm-sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176" -dependencies = [ - "libc", - "linux-raw-sys 0.6.5", -] [[package]] name = "dyn-clone" @@ -2284,9 +2201,9 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "endi" @@ -2312,7 +2229,7 @@ checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2332,7 +2249,7 @@ checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2399,14 +2316,16 @@ dependencies = [ [[package]] name = "exr" -version = "1.74.0" +version = "1.74.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4300e043a56aa2cb633c01af81ca8f699a321879a7854d3896a0ba89056363be" +checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3" dependencies = [ "bit_field", "half", "lebe", "miniz_oxide", + "num-complex", + "pulp", "rayon-core", "smallvec", "zune-inflate", @@ -2422,6 +2341,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fallible_collections" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" +dependencies = [ + "hashbrown 0.13.2", +] + [[package]] name = "fast-srgb8" version = "1.0.0" @@ -2448,26 +2376,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" -[[package]] -name = "fax" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" -dependencies = [ - "fax_derive", -] - -[[package]] -name = "fax_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "fdeflate" version = "0.3.7" @@ -2554,7 +2462,7 @@ dependencies = [ "fluent-syntax", "intl-memoizer", "intl_pluralrules", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "self_cell", "smallvec", "unic-langid", @@ -2623,7 +2531,7 @@ checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" dependencies = [ "fontconfig-parser", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "slotmap", "tinyvec", "ttf-parser", @@ -2647,7 +2555,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2687,14 +2595,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6d3a3635983a889f065aa9ce760384713f23a9b4a04f696f86c39a5d7a6a5a" dependencies = [ "indexmap 2.14.0", - "nom 8.0.0", + "nom", ] [[package]] name = "fs-err" -version = "3.3.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fde052dbfc920003cfd2c8e2c6e6d4cc7c1091538c3a24226cec0665ab08c0" +checksum = "b91aa448ca50d7e79433bdf3ee8d99215430d2ec02ade5aefab2a073a1822e8a" dependencies = [ "autocfg", "tokio", @@ -2778,7 +2686,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -2793,6 +2701,12 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +[[package]] +name = "futures-timer" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af43fadb8a98512d547e37b4e92e0ced13e205c061b87b4623eff01d918d6968" + [[package]] name = "futures-util" version = "0.3.32" @@ -2820,16 +2734,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "gethostname" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" -dependencies = [ - "rustix 1.1.4", - "windows-link 0.2.1", -] - [[package]] name = "getrandom" version = "0.2.17" @@ -2855,15 +2759,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "wasip2", - "wasip3", ] [[package]] @@ -2896,16 +2798,6 @@ dependencies = [ "weezl", ] -[[package]] -name = "gif" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "gimli" version = "0.32.3" @@ -2929,12 +2821,6 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - [[package]] name = "glow" version = "0.16.0" @@ -2956,35 +2842,18 @@ dependencies = [ "gl_generator", ] -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.11.1", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.11.1", -] - [[package]] name = "gpu-allocator" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd" +checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" dependencies = [ + "ash", + "hashbrown 0.16.1", "log", "presser", - "thiserror 1.0.69", - "windows 0.58.0", + "thiserror 2.0.18", + "windows 0.62.2", ] [[package]] @@ -2993,7 +2862,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "gpu-descriptor-types", "hashbrown 0.15.5", ] @@ -3004,14 +2873,14 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] name = "grid" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e2d4c0a8296178d8802098410ca05d86b17a10bb5ab559b3fb404c1f948220" +checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5" [[package]] name = "guillotiere" @@ -3041,10 +2910,10 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9da2e5ae821f6e96664977bf974d6d6a2d6682f9ccee23e62ec1d134246845f9" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "core_maths", - "read-fonts", + "read-fonts 0.37.0", "smallvec", ] @@ -3054,6 +2923,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.15.5" @@ -3069,14 +2947,16 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", ] [[package]] name = "hashbrown" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "heck" @@ -3108,6 +2988,17 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex_color" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37f101bf4c633f7ca2e4b5e136050314503dd198e78e325ea602c327c484ef0" +dependencies = [ + "arrayvec", + "rand 0.8.7", + "serde", +] + [[package]] name = "hexf-parse" version = "0.2.1" @@ -3151,11 +3042,20 @@ checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" [[package]] name = "hostname1-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "zbus", ] +[[package]] +name = "hybrid-array" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" +dependencies = [ + "typenum", +] + [[package]] name = "i18n-config" version = "0.4.8" @@ -3206,7 +3106,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.117", + "syn 2.0.118", "unic-langid", ] @@ -3220,7 +3120,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -3250,7 +3150,6 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "dnd", "iced_accessibility", @@ -3271,7 +3170,6 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "accesskit", "accesskit_winit", @@ -3280,9 +3178,8 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytes", "cosmic-client-toolkit", "dnd", @@ -3294,10 +3191,11 @@ dependencies = [ "num-traits", "palette", "raw-window-handle", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "serde", "smol_str", "thiserror 2.0.18", + "unicode-segmentation", "web-time", "window_clipboard", ] @@ -3305,7 +3203,6 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_core", "iced_futures", @@ -3315,12 +3212,11 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "futures", "iced_core", "log", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "tokio", "wasm-bindgen-futures", "wasmtimer", @@ -3329,9 +3225,8 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cosmic-text", "half", @@ -3342,7 +3237,7 @@ dependencies = [ "log", "lyon_path", "raw-window-handle", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "thiserror 2.0.18", "unicode-segmentation", ] @@ -3350,7 +3245,6 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_graphics", "iced_runtime", @@ -3359,7 +3253,6 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3371,7 +3264,6 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -3387,7 +3279,6 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "bytemuck", "cosmic-text", @@ -3396,7 +3287,7 @@ dependencies = [ "kurbo 0.10.4", "log", "resvg", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "softbuffer", "tiny-skia", ] @@ -3404,10 +3295,8 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ - "as-raw-xcb-connection", - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cosmic-client-toolkit", "cryoglyph", @@ -3420,22 +3309,19 @@ dependencies = [ "lyon", "raw-window-handle", "resvg", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "rustix 0.38.44", "thiserror 2.0.18", - "tiny-xlib", "wayland-backend", "wayland-client", "wayland-protocols", "wayland-sys", "wgpu", - "x11rb", ] [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -3446,7 +3332,7 @@ dependencies = [ "num-traits", "ouroboros", "qrcode", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "thiserror 2.0.18", "unicode-segmentation", "window_clipboard", @@ -3455,7 +3341,6 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" dependencies = [ "cosmic-client-toolkit", "cursor-icon", @@ -3468,7 +3353,7 @@ dependencies = [ "iced_runtime", "log", "raw-window-handle", - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", "rustix 0.38.44", "thiserror 2.0.18", "wasm-bindgen-futures", @@ -3557,9 +3442,9 @@ checksum = "846b0857ca091204be3c874bc93daaf89d4777e8d2d20b0d3ffe8f671d98014b" [[package]] name = "icu_collator" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b521b92a2666061ddda902769d8a4cf730b5c9529a845cc1b69770b12a6c9a71" +checksum = "8bbdf98e5e0aa827770acee171ebb568aaab975a36b56afdb5fd0e2f525750bb" dependencies = [ "icu_collator_data", "icu_collections", @@ -3884,12 +3769,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f2f8aeca682d874a5247084aa4fb7d1cef9ba45d889c21209a8818dcaaa0ec9" -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "ident_case" version = "1.0.1" @@ -3909,9 +3788,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -3925,27 +3804,24 @@ checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" dependencies = [ "bytemuck", "byteorder-lite", - "color_quant", + "dav1d", "exr", - "gif 0.14.2", "image-webp", "moxcms", + "mp4parse", "num-traits", "png 0.18.1", - "qoi", "ravif", "rayon", - "rgb", - "tiff", "zune-core 0.5.1", "zune-jpeg 0.5.15", ] [[package]] name = "image-extras" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d29ba92ef6970a2685cc758b455d190842b8b9e96c865ffd31cdb9954b7548" +checksum = "60d02eb2c9ccbbab470538fce34c7bc3be7b4e59268e65a3171367b296cdb842" dependencies = [ "image", ] @@ -3968,9 +3844,9 @@ checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] name = "imgref" -version = "1.12.0" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" +checksum = "89194689a993ab15268672e99e7b0e19da2da3268ac682e8f02d29d4d1434cd7" [[package]] name = "indenter" @@ -3996,7 +3872,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.17.0", + "hashbrown 0.17.1", "serde", "serde_core", ] @@ -4012,20 +3888,20 @@ dependencies = [ [[package]] name = "inotify" -version = "0.11.1" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5b3eaf1a28b758ac0faa5a4254e8ab2705605496f1b1f3fbbc3988ad73d199" +checksum = "153be1941a183ec9ccd095ddbe17a8b8d435ef6c76e9e02451b933c3999af2c8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "inotify-sys", "libc", ] [[package]] name = "inotify-sys" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d" dependencies = [ "libc", ] @@ -4042,11 +3918,11 @@ dependencies = [ [[package]] name = "input" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdc09524a91f9cacd26f16734ff63d7dc650daffadd2b6f84d17a285bd875a9" +checksum = "f9793345a65d71317763a33066b5d8351f8760dde8d4930fe9e39b5f14a7959d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "input-sys", "libc", "log", @@ -4067,7 +3943,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -4112,15 +3988,6 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -4144,35 +4011,36 @@ checksum = "2ceaf4c6c48465bead8cb6a0b7c4ee0c86ecbb31239032b9c66ab9a08d2f3ee1" [[package]] name = "jiff" -version = "0.2.23" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +checksum = "961d16382652bfdd8c6f68b223b26a8c93e0d475c672f414411db31c6c5c900e" dependencies = [ + "defmt", "jiff-static", "jiff-tzdb-platform", "log", "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.61.2", + "windows-link 0.2.1", ] [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +checksum = "d0879bd39df99c4c5e2c6615ccc026391a423dde10532c573e6086eb94a802cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "jiff-tzdb" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c900ef84826f1338a557697dc8fc601df9ca9af4ac137c7fb61d4c6f2dfd3076" +checksum = "142bd39932ad231f10513df9ab62661fead8719872150b7ad02a2df79f4e141e" [[package]] name = "jiff-tzdb-platform" @@ -4210,7 +4078,7 @@ dependencies = [ "quote", "rustc_version", "simd_cesu8", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -4238,28 +4106,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" dependencies = [ "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "jobserver" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -4316,9 +4183,9 @@ dependencies = [ [[package]] name = "jxl-grid" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e0ef92d5d60e76bf41098e57e985f523185e08fad54268da448637feca6989" +checksum = "01671307879a033bfa52e6e8784b941aca770b3f3a7d33830b455b6844f793fb" dependencies = [ "tracing", ] @@ -4355,9 +4222,9 @@ dependencies = [ [[package]] name = "jxl-modular" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da758b2f989aafd9eeb39489fe43d7be5a3a0d2ad61cf1bad705eb6990a6053c" +checksum = "2a2f045b24c738dd91d482be385512b512721ae08a671bd4b27bf1c47f215235" dependencies = [ "jxl-bitstream", "jxl-coding", @@ -4369,9 +4236,9 @@ dependencies = [ [[package]] name = "jxl-oxide" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8ecd2678ed70c1eda42b811ccb2e25ab836edeb18e7f1178c1f917ed36b772" +checksum = "d36c662923f47586880211f3bc7c0d83fb3a9b410d278c7bde93450748abeef3" dependencies = [ "brotli-decompressor", "bytemuck", @@ -4399,9 +4266,9 @@ dependencies = [ [[package]] name = "jxl-render" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa0c3100918bd3c41bb0f8ce1f4f1664e48f3032ff8eeab0d6a2cfc3276f462d" +checksum = "d34386bfdb6a19b5a30cc9beb4d475d537422c31ae8c39bb69640fcce3fcaf19" dependencies = [ "bytemuck", "jxl-bitstream", @@ -4469,7 +4336,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fbe853b403ae61a04233030ae8a79d94975281ed9770a1f9e246732b534b28d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "serde", ] @@ -4501,9 +4368,9 @@ dependencies = [ [[package]] name = "kqueue" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +checksum = "273c0752728918e0ac4976f2b275b6fefb9ecd400585dec929419f3844cd87b5" dependencies = [ "kqueue-sys", "libc", @@ -4511,11 +4378,11 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.0.4" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.0", "libc", ] @@ -4546,12 +4413,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "lebe" version = "0.5.3" @@ -4560,14 +4421,13 @@ checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" [[package]] name = "libc" -version = "0.2.185" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libcosmic" -version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic#3f9e93067b31d9ba81a4e3a28653b3380c61c352" +version = "0.1.0-yoda.2" dependencies = [ "apply", "ashpd 0.12.3", @@ -4575,11 +4435,12 @@ dependencies = [ "cosmic-client-toolkit", "cosmic-config", "cosmic-freedesktop-icons", - "cosmic-settings-config", + "cosmic-settings-config 0.1.0", "cosmic-settings-daemon", "cosmic-theme", "css-color", "derive_setters", + "enumflags2", "float-cmp 0.10.0", "freedesktop-desktop-entry", "futures", @@ -4604,11 +4465,11 @@ dependencies = [ "palette", "phf 0.13.1", "rfd", - "ron 0.12.1", + "ron 0.12.2", "rust-embed", "rustix 1.1.4", "serde", - "shlex", + "shlex 1.3.0", "slotmap", "taffy", "thiserror 2.0.18", @@ -4621,9 +4482,9 @@ dependencies = [ [[package]] name = "libfuzzer-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12a681b7dd8ce12bff52488013ba614b869148d54dd79836ab85aafdd53f08d" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", @@ -4645,71 +4506,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" -[[package]] -name = "libpulse-binding" -version = "2.30.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909eb3049e16e373680fe65afe6e2a722ace06b671250cc4849557bc57d6a397" -dependencies = [ - "bitflags 2.11.1", - "libc", - "libpulse-sys", - "num-derive", - "num-traits", - "winapi", -] - -[[package]] -name = "libpulse-sys" -version = "1.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d74371848b22e989f829cc1621d2ebd74960711557d8b45cfe740f60d0a05e61" -dependencies = [ - "libc", - "num-derive", - "num-traits", - "pkg-config", - "winapi", -] - [[package]] name = "libredox" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "libc", "plain", - "redox_syscall 0.7.4", -] - -[[package]] -name = "libspa" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b8cfa2a7656627b4c92c6b9ef929433acd673d5ab3708cda1b18478ac00df4" -dependencies = [ - "bitflags 2.11.1", - "cc", - "convert_case", - "cookie-factory", - "libc", - "libspa-sys", - "nix", - "nom 8.0.0", - "system-deps", -] - -[[package]] -name = "libspa-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901049455d2eb6decf9058235d745237952f4804bc584c5fcb41412e6adcc6e0" -dependencies = [ - "bindgen", - "cc", - "system-deps", + "redox_syscall 0.9.0", ] [[package]] @@ -4743,12 +4549,6 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" -[[package]] -name = "linux-raw-sys" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -4770,7 +4570,7 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" [[package]] name = "locale1" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "zbus", ] @@ -4810,9 +4610,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "loop9" @@ -4841,9 +4641,9 @@ dependencies = [ [[package]] name = "lyon_algorithms" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9815fac08e6fd96733a11dce4f9d15a3f338e96a2e2311ee21e1b738efc2bc0f" +checksum = "8575c0d003ae459399623c4def180c63b77f343b1a7fee64f249b349e7699a31" dependencies = [ "lyon_path", "num-traits", @@ -4922,9 +4722,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.8.0" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memmap2" @@ -4937,9 +4737,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] @@ -4955,11 +4755,11 @@ dependencies = [ [[package]] name = "metal" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605" +checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block", "core-graphics-types 0.2.0", "foreign-types", @@ -4981,7 +4781,6 @@ dependencies = [ [[package]] name = "mime" version = "0.1.0" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "smithay-clipboard", ] @@ -4993,10 +4792,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "mime_guess" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime 0.3.17", + "unicase", +] [[package]] name = "miniz_oxide" @@ -5010,9 +4813,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.2.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" dependencies = [ "libc", "log", @@ -5030,6 +4833,20 @@ dependencies = [ "pxfm", ] +[[package]] +name = "mp4parse" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63a35203d3c6ce92d5251c77520acb2e57108c88728695aa883f70023624c570" +dependencies = [ + "bitreader", + "byteorder", + "fallible_collections", + "log", + "num-traits", + "static_assertions", +] + [[package]] name = "mutate_once" version = "0.1.2" @@ -5038,13 +4855,13 @@ checksum = "13d2233c9842d08cfe13f9eac96e207ca6a2ea10b80259ebe8ad0268be27d2af" [[package]] name = "naga" -version = "27.0.3" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" +checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135" dependencies = [ "arrayvec", "bit-set", - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg-if", "cfg_aliases 0.2.1", "codespan-reporting", @@ -5068,7 +4885,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "jni-sys 0.3.1", "log", "ndk-sys", @@ -5099,44 +4916,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] -name = "nix" -version = "0.30.1" +name = "nmrs" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" -dependencies = [ - "bitflags 2.11.1", - "cfg-if", - "cfg_aliases 0.2.1", - "libc", -] - -[[package]] -name = "nm-secret-agent-manager" -version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +checksum = "62c427203beda58ac05815b356d64a34eeb2fba180b3077d543ebb1472fc1269" dependencies = [ + "async-trait", + "base64", + "bitflags 2.13.0", + "futures", + "futures-timer", + "log", + "serde", + "thiserror 2.0.18", + "tokio", + "uuid", "zbus", + "zvariant", ] [[package]] name = "no_std_io2" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b51ed7824b6e07d354605f4abb3d9d300350701299da96642ee084f5ce631550" +checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" dependencies = [ "memchr", ] -[[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 = "nom" version = "8.0.0" @@ -5158,7 +4965,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "fsevent-sys", "inotify", "kqueue", @@ -5176,7 +4983,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -5213,9 +5020,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" dependencies = [ "num-integer", "num-traits", @@ -5227,14 +5034,15 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ + "bytemuck", "num-traits", ] [[package]] name = "num-conv" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-derive" @@ -5244,7 +5052,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -5258,11 +5066,10 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -5307,15 +5114,9 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] -[[package]] -name = "numtoa" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e4d8a81ede501fad07191e746a299f4d79f6dcd053bab1b97af4ff5a90099f2" - [[package]] name = "objc" version = "0.2.7" @@ -5367,7 +5168,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -5383,7 +5184,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-core-foundation", @@ -5396,7 +5197,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -5408,7 +5209,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "objc2 0.6.4", @@ -5420,7 +5221,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "libc", "objc2-core-foundation", ] @@ -5443,7 +5244,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d425caf1df73233f29fd8a5c3e5edbc30d2d4307870f802d18f00d83dc5141a6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "objc2-core-foundation", "objc2-core-graphics", ] @@ -5460,7 +5261,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -5472,7 +5273,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "objc2 0.6.4", "objc2-core-foundation", @@ -5494,7 +5295,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -5506,7 +5307,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation 0.2.2", @@ -5519,7 +5320,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "objc2 0.6.4", "objc2-core-foundation", "objc2-foundation 0.3.2", @@ -5569,9 +5370,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orbclient" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59aed3b33578edcfa1bc96a321d590d31832b6ad55a26f0313362ce687e9abd6" +checksum = "5df339f526ea9a60e371768d50efc2f2508c7203290731565d1f7a6f71d21747" dependencies = [ "libc", "libredox", @@ -5617,7 +5418,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -5657,7 +5458,7 @@ dependencies = [ "by_address", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -5735,7 +5536,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared 0.11.3", - "rand 0.8.5", + "rand 0.8.7", ] [[package]] @@ -5758,7 +5559,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -5771,7 +5572,7 @@ dependencies = [ "phf_shared 0.13.1", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "uncased", ] @@ -5802,22 +5603,22 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.11" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -5843,34 +5644,6 @@ dependencies = [ "futures-io", ] -[[package]] -name = "pipewire" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9688b89abf11d756499f7c6190711d6dbe5a3acdb30c8fbf001d6596d06a8d44" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "libc", - "libspa", - "libspa-sys", - "nix", - "once_cell", - "pipewire-sys", - "thiserror 2.0.18", -] - -[[package]] -name = "pipewire-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb028afee0d6ca17020b090e3b8fa2d7de23305aef975c7e5192a5050246ea36" -dependencies = [ - "bindgen", - "libspa-sys", - "system-deps", -] - [[package]] name = "pkg-config" version = "0.3.33" @@ -5902,7 +5675,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "crc32fast", "fdeflate", "flate2", @@ -5976,16 +5749,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.117", -] - [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -6014,7 +5777,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -6034,51 +5797,53 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "version_check", "yansi", ] -[[package]] -name = "procfs" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25485360a54d6861439d60facef26de713b1e126bf015ec8f98239467a2b82f7" -dependencies = [ - "bitflags 2.11.1", - "procfs-core", - "rustix 1.1.4", -] - -[[package]] -name = "procfs-core" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6401bf7b6af22f78b563665d15a22e9aef27775b79b149a66ca022468a4e405" -dependencies = [ - "bitflags 2.11.1", - "hex", -] - [[package]] name = "profiling" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52717f9a02b6965224f95ca2a81e2e0c5c43baacd28ca057577988930b6c3d5b" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" dependencies = [ "quote", - "syn 2.0.117", + "syn 2.0.118", ] +[[package]] +name = "pulp" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740" + [[package]] name = "pwhash" version = "1.0.0" @@ -6089,25 +5854,16 @@ dependencies = [ "byteorder", "hmac 0.10.1", "md-5", - "rand 0.8.5", + "rand 0.8.7", "sha-1", "sha2 0.9.9", ] [[package]] name = "pxfm" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a041e753da8b807c9255f28de81879c78c876392ff2469cde94799b2896b9d" - -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" [[package]] name = "qrcode" @@ -6128,23 +5884,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c" dependencies = [ "memchr", - "serde", ] [[package]] name = "quick-xml" -version = "0.39.2" +version = "0.39.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" +checksum = "cdcc8dd4e2f670d309a5f0e83fe36dfdc05af317008fea29144da1a2ac858e5e" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.45" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -6163,9 +5918,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -6174,9 +5929,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", @@ -6248,7 +6003,7 @@ dependencies = [ "built", "cfg-if", "interpolate_name", - "itertools 0.14.0", + "itertools", "libc", "libfuzzer-sys", "log", @@ -6259,7 +6014,7 @@ dependencies = [ "num-traits", "paste", "profiling", - "rand 0.9.4", + "rand 0.9.5", "rand_chacha 0.9.0", "simd_helpers", "thiserror 2.0.18", @@ -6282,6 +6037,15 @@ dependencies = [ "rgb", ] +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags 2.13.0", +] + [[package]] name = "raw-window-handle" version = "0.6.2" @@ -6319,22 +6083,48 @@ dependencies = [ "font-types", ] +[[package]] +name = "read-fonts" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4ed38b89c2c77ff968c524145ad65fb010f38af5c7a224b53b81d47ac2daa81" +dependencies = [ + "bytemuck", + "font-types", +] + +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + +[[package]] +name = "redox_event" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5018d583d6d2f5499352aea8d177e9067d1eb03ab17c78169d5ba7a30001b15" +dependencies = [ + "bitflags 2.13.0", + "libredox", +] + [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] name = "redox_syscall" -version = "0.7.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" +checksum = "c5102a6aaa05aa011a238e178e6bca86d2cb56fc9f586d37cb80f5bca6e07759" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -6365,14 +6155,14 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "regex" -version = "1.12.3" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2" dependencies = [ "aho-corasick", "memchr", @@ -6382,9 +6172,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db" dependencies = [ "aho-corasick", "memchr", @@ -6393,9 +6183,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "renderdoc-sys" @@ -6409,7 +6199,7 @@ version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43" dependencies = [ - "gif 0.13.3", + "gif", "image-webp", "log", "pico-args", @@ -6460,7 +6250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db09040cc89e461f1a265139777a2bde7f8d8c67c4936f700c63ce3e2904d468" dependencies = [ "base64", - "bitflags 2.11.1", + "bitflags 2.13.0", "serde", "serde_derive", "unicode-ident", @@ -6468,11 +6258,11 @@ dependencies = [ [[package]] name = "ron" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4147b952f3f819eca0e99527022f7d6a8d05f111aeb0a62960c74eb283bec8fc" +checksum = "81116b9531d61eabc41aeb228e4b6b2435bcca3233b98cf3b3077d4e6e9debb3" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "once_cell", "serde", "serde_derive", @@ -6488,9 +6278,9 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rust-embed" -version = "8.11.0" +version = "8.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04113cb9355a377d83f06ef1f0a45b8ab8cd7d8b1288160717d66df5c7988d27" +checksum = "e9e7760e252aaba7b09f4be00e36476cf585bdb68a53552ac954cdf504ab4bc9" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -6499,32 +6289,33 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.11.0" +version = "8.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0902e4c7c8e997159ab384e6d0fc91c221375f6894346ae107f47dd0f3ccaa" +checksum = "3bcfc4d6f53af43755f7a723e4b6b8794fcce052a178dd8c6c1dadc5f5343097" dependencies = [ + "mime_guess", "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.117", + "syn 2.0.118", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.11.0" +version = "8.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bcdef0be6fe7f6fa333b1073c949729274b05f123a0ad7efcb8efd878e5c3b1" +checksum = "42ffa149f6aa81b58a5b3011d01a857c4ed12c7a732d2c51947a4c7c692185f0" dependencies = [ - "sha2 0.10.9", + "sha2 0.11.0", "walkdir", ] [[package]] name = "rustc-demangle" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" [[package]] name = "rustc-hash" @@ -6534,9 +6325,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hash" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc_version" @@ -6553,7 +6344,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -6566,7 +6357,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "errno", "libc", "linux-raw-sys 0.12.1", @@ -6575,9 +6366,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "rustybuzz" @@ -6585,7 +6376,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "core_maths", "log", @@ -6597,6 +6388,12 @@ dependencies = [ "unicode-script", ] +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + [[package]] name = "same-file" version = "1.0.6" @@ -6650,7 +6447,7 @@ checksum = "1dd3accc0f3f4bbaf2c9e1957a030dc582028130c67660d44c0a0345a22ca69b" dependencies = [ "ab_glyph", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "smithay-client-toolkit", "tiny-skia", ] @@ -6735,14 +6532,14 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "indexmap 2.14.0", "itoa", @@ -6760,7 +6557,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -6774,11 +6571,12 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.18.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" +checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" dependencies = [ "base64", + "bs58", "chrono", "hex", "indexmap 1.9.3", @@ -6793,14 +6591,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.18.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" +checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" dependencies = [ "darling 0.23.0", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -6811,11 +6609,17 @@ checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.9.0", "opaque-debug", ] +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + [[package]] name = "sha2" version = "0.9.9" @@ -6824,7 +6628,7 @@ checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.9.0", "opaque-debug", ] @@ -6836,10 +6640,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -6855,6 +6670,12 @@ 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" @@ -6907,9 +6728,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] name = "skrifa" @@ -6918,7 +6739,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fbdfe3d2475fbd7ddd1f3e5cf8288a30eb3e5f95832829570cd88115a7434ac" dependencies = [ "bytemuck", - "read-fonts", + "read-fonts 0.37.0", +] + +[[package]] +name = "skrifa" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c34617370ae968efb7161bb2beb517d9084659aae19e24b89e3db25b46e4564" +dependencies = [ + "bytemuck", + "read-fonts 0.39.2", ] [[package]] @@ -6938,9 +6769,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "smithay-client-toolkit" @@ -6948,14 +6779,14 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "pkg-config", "rustix 1.1.4", "thiserror 2.0.18", @@ -6975,7 +6806,6 @@ dependencies = [ [[package]] name = "smithay-clipboard" version = "0.8.0" -source = "git+https://github.com/pop-os/smithay-clipboard?tag=sctk-0.20#859b02c88f45c554049a67c6ddeec1692ce0e20b" dependencies = [ "libc", "raw-window-handle", @@ -6995,9 +6825,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", "windows-sys 0.61.2", @@ -7006,31 +6836,26 @@ dependencies = [ [[package]] name = "softbuffer" version = "0.4.1" -source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-4.0#a3f77e251e7422803f693df6e3fc313c010c4dcb" dependencies = [ - "as-raw-xcb-connection", "bytemuck", "cfg_aliases 0.2.1", "cocoa", "core-graphics", - "drm", "fastrand", "foreign-types", "js-sys", "log", - "memmap2 0.9.10", + "memmap2 0.9.11", "objc", "raw-window-handle", "redox_syscall 0.5.18", "rustix 0.38.44", - "tiny-xlib", "wasm-bindgen", "wayland-backend", "wayland-client", "wayland-sys", "web-sys", "windows-sys 0.52.0", - "x11rb", ] [[package]] @@ -7039,7 +6864,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", ] [[package]] @@ -7130,11 +6955,11 @@ dependencies = [ [[package]] name = "swash" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842f3cd369c2ba38966204f983eaa5e54a8e84a7d7159ed36ade2b6c335aae64" +checksum = "0811b01ca2c4e8718760713911feaf4675c24f94e50530a015ec646cfb622f7c" dependencies = [ - "skrifa", + "skrifa 0.42.1", "yazi", "zeno", ] @@ -7152,9 +6977,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.117" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -7169,7 +6994,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -7222,9 +7047,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.13.3" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7f62577c25e07834649fc3b39fafdc597c0a3527dc1c60129201ccfcbaa50c" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" [[package]] name = "temp-dir" @@ -7239,7 +7064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.2", + "getrandom 0.4.3", "once_cell", "rustix 1.1.4", "windows-sys 0.61.2", @@ -7280,7 +7105,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -7291,40 +7116,25 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "thread_local" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", ] -[[package]] -name = "tiff" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" -dependencies = [ - "fax", - "flate2", - "half", - "quick-error", - "weezl", - "zune-jpeg 0.5.15", -] - [[package]] name = "time" -version = "0.3.47" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde_core", @@ -7334,15 +7144,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" dependencies = [ "num-conv", "time-core", @@ -7351,7 +7161,7 @@ dependencies = [ [[package]] name = "timedate-zbus" version = "0.1.0" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "zbus", ] @@ -7382,19 +7192,6 @@ dependencies = [ "strict-num", ] -[[package]] -name = "tiny-xlib" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e" -dependencies = [ - "as-raw-xcb-connection", - "ctor-lite", - "libloading", - "pkg-config", - "tracing", -] - [[package]] name = "tinystr" version = "0.8.3" @@ -7408,9 +7205,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" dependencies = [ "tinyvec_macros", ] @@ -7423,9 +7220,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.52.0" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91135f59b1cbf38c91e73cf3386fca9bb77915c45ce2771460c9d92f0f3d776" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -7446,7 +7243,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -7458,6 +7255,20 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] @@ -7481,7 +7292,7 @@ dependencies = [ "toml_datetime", "toml_parser", "toml_writer", - "winnow 1.0.1", + "winnow 1.0.4", ] [[package]] @@ -7495,14 +7306,14 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.25.11+spec-1.1.0" +version = "0.25.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +checksum = "d2153edc6955a6c354fad8f5efd38b6a8769bdccf9fe50f8e1329f81b0baa5d7" dependencies = [ "indexmap 2.14.0", "toml_datetime", "toml_parser", - "winnow 1.0.1", + "winnow 1.0.4", ] [[package]] @@ -7511,7 +7322,7 @@ version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow 1.0.1", + "winnow 1.0.4", ] [[package]] @@ -7540,7 +7351,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -7607,7 +7418,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90" dependencies = [ - "rustc-hash 2.1.2", + "rustc-hash 2.1.3", ] [[package]] @@ -7618,9 +7429,9 @@ checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "udev" @@ -7723,9 +7534,9 @@ checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee" [[package]] name = "unicode-segmentation" -version = "1.13.2" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" [[package]] name = "unicode-vo" @@ -7745,16 +7556,10 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "upower_dbus" version = "0.3.2" -source = "git+https://github.com/pop-os/dbus-settings-bindings#507e342c21d3ce6ae41b1d4f3fa2f0ad5ee23e75" +source = "git+https://github.com/pop-os/dbus-settings-bindings#eed01dd3609e90e3c8cd043656734c500956c793" dependencies = [ "serde", "serde_repr", @@ -7827,12 +7632,14 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.23.1" +version = "1.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a" dependencies = [ + "getrandom 0.4.3", "js-sys", "serde_core", + "sha1_smol", "wasm-bindgen", ] @@ -7883,27 +7690,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -7914,9 +7712,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.68" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ "js-sys", "wasm-bindgen", @@ -7924,9 +7722,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7934,60 +7732,26 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap 2.14.0", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.15.5", - "indexmap 2.14.0", - "semver", -] - [[package]] name = "wasmtimer" version = "0.4.3" @@ -8022,7 +7786,7 @@ version = "0.31.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "rustix 1.1.4", "wayland-backend", "wayland-scanner", @@ -8034,7 +7798,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cursor-icon", "wayland-backend", ] @@ -8052,11 +7816,11 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.32.12" +version = "0.32.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563a85523cade2429938e790815fd7319062103b9f4a2dc806e9b53b95982d8f" +checksum = "23d0c813de3daa2ed6520af85a3bd49b0e722a3078506899aa9686fea58dc4b6" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -8069,7 +7833,7 @@ version = "20250721.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -8082,7 +7846,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9567599ef23e09b8dad6e429e5738d4509dfc46b3b21f32841a304d16b29c8" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -8095,7 +7859,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b6d8cf1eb2c1c31ed1f5643c88a6e53538129d4af80030c8cabd1f9fa884d91" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -8108,7 +7872,7 @@ version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb04e52f7836d7c7976c78ca0250d61e33873c34156a2a1fc9474828ec268234" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -8123,7 +7887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c324a910fd86ebdc364a3e61ec1f11737d3b1d6c273c0239ee8ff4bc0d24b4a" dependencies = [ "proc-macro2", - "quick-xml 0.39.2", + "quick-xml 0.39.4", "quote", ] @@ -8133,7 +7897,7 @@ version = "0.31.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc1846eb04c49182e04f4a099e2a830a2b745610bbc1d61246e206f29c7000a0" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "downcast-rs 1.2.1", "rustix 1.1.4", "wayland-backend", @@ -8154,9 +7918,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.95" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ "js-sys", "wasm-bindgen", @@ -8180,12 +7944,13 @@ checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" [[package]] name = "wgpu" -version = "27.0.1" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77" +checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f" dependencies = [ "arrayvec", - "bitflags 2.11.1", + "bitflags 2.13.0", + "bytemuck", "cfg-if", "cfg_aliases 0.2.1", "document-features", @@ -8209,14 +7974,14 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "27.0.3" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7" +checksum = "d23f4642f53f666adcfd2d3218ab174d1e6681101aef18696b90cbe64d1c10f9" dependencies = [ "arrayvec", "bit-set", "bit-vec", - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "cfg_aliases 0.2.1", "document-features", @@ -8241,42 +8006,42 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0772ae958e9be0c729561d5e3fd9a19679bcdfb945b8b1a1969d9bfe8056d233" +checksum = "87b7b696b918f337c486bf93142454080a32a37832ba8a31e4f48221890047da" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-emscripten" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06ac3444a95b0813ecfd81ddb2774b66220b264b3e2031152a4a29fda4da6b5" +checksum = "34b251c331f84feac147de3c4aa3aa45112622a95dd7ee1b74384fa0458dbd79" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-windows-linux-android" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71197027d61a71748e4120f05a9242b2ad142e3c01f8c1b47707945a879a03c3" +checksum = "68ca976e72b2c9964eb243e281f6ce7f14a514e409920920dcda12ae40febaae" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-hal" -version = "27.0.4" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce" +checksum = "44d6cb474beb218824dcc9e1ce679d973f719262789bfb27407da560cac20eeb" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 2.11.1", + "bitflags 2.13.0", "block", "bytemuck", "cfg-if", @@ -8284,7 +8049,6 @@ dependencies = [ "core-graphics-types 0.2.0", "glow", "glutin_wgl_sys", - "gpu-alloc", "gpu-allocator", "gpu-descriptor", "hashbrown 0.16.1", @@ -8311,29 +8075,28 @@ dependencies = [ "wasm-bindgen", "web-sys", "wgpu-types", - "windows 0.58.0", - "windows-core 0.58.0", + "windows 0.62.2", + "windows-core 0.62.2", ] [[package]] name = "wgpu-types" -version = "27.0.1" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb" +checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "bytemuck", "js-sys", "log", - "thiserror 2.0.18", "web-sys", ] [[package]] name = "which" -version = "8.0.2" +version = "8.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81995fafaaaf6ae47a7d0cc83c67caf92aeb7e5331650ae6ff856f7c0c60c459" +checksum = "48d7cd18d4acb58fb3cdfe9ea54e6cd96a4e7d4cc45c56338b236e82dad47248" dependencies = [ "libc", ] @@ -8372,28 +8135,16 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" version = "0.4.1" -source = "git+https://github.com/pop-os/window_clipboard.git?tag=sctk-0.20#f68595ee0e62fbd6589f4709b5aaa5c3c7ea5f6c" dependencies = [ "clipboard-win", "clipboard_macos", "clipboard_wayland", - "clipboard_x11", "dnd", "mime 0.1.0", "raw-window-handle", "thiserror 1.0.69", ] -[[package]] -name = "windows" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" -dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.61.3" @@ -8437,27 +8188,14 @@ dependencies = [ "windows-core 0.62.2", ] -[[package]] -name = "windows-core" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" -dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows-implement", + "windows-interface", "windows-link 0.1.3", "windows-result 0.3.4", "windows-strings 0.4.2", @@ -8469,8 +8207,8 @@ version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-implement 0.60.2", - "windows-interface 0.59.3", + "windows-implement", + "windows-interface", "windows-link 0.2.1", "windows-result 0.4.1", "windows-strings 0.5.1", @@ -8498,17 +8236,6 @@ dependencies = [ "windows-threading 0.2.1", ] -[[package]] -name = "windows-implement" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "windows-implement" version = "0.60.2" @@ -8517,18 +8244,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-interface" -version = "0.58.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -8539,7 +8255,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] @@ -8574,15 +8290,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.3.4" @@ -8601,16 +8308,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-strings" version = "0.4.2" @@ -8881,9 +8578,8 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cfg_aliases 0.2.1", "cursor-icon", "dpi", @@ -8901,16 +8597,14 @@ dependencies = [ "winit-wayland", "winit-web", "winit-win32", - "winit-x11", ] [[package]] name = "winit-android" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "android-activity", - "bitflags 2.11.1", + "bitflags 2.13.0", "dpi", "ndk", "raw-window-handle", @@ -8922,9 +8616,8 @@ dependencies = [ [[package]] name = "winit-appkit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "dpi", @@ -8944,24 +8637,21 @@ dependencies = [ [[package]] name = "winit-common" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "memmap2 0.9.10", + "memmap2 0.9.11", "objc2 0.6.4", "objc2-core-foundation", "smol_str", "tracing", "winit-core", - "x11-dl", "xkbcommon-dl", ] [[package]] name = "winit-core" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cursor-icon", "dpi", "keyboard-types", @@ -8973,14 +8663,13 @@ dependencies = [ [[package]] name = "winit-orbital" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "dpi", "libredox", "orbclient", "raw-window-handle", - "redox_syscall 0.7.4", + "redox_event", "smol_str", "tracing", "winit-core", @@ -8989,9 +8678,8 @@ dependencies = [ [[package]] name = "winit-uikit" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "block2 0.6.2", "dispatch2", "dpi", @@ -9009,15 +8697,14 @@ dependencies = [ [[package]] name = "winit-wayland" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "ahash", - "bitflags 2.11.1", + "bitflags 2.13.0", "calloop", "cursor-icon", "dpi", "libc", - "memmap2 0.9.10", + "memmap2 0.9.11", "raw-window-handle", "rustix 1.1.4", "sctk-adwaita", @@ -9035,10 +8722,9 @@ dependencies = [ [[package]] name = "winit-web" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ "atomic-waker", - "bitflags 2.11.1", + "bitflags 2.13.0", "concurrent-queue", "cursor-icon", "dpi", @@ -9057,9 +8743,8 @@ dependencies = [ [[package]] name = "winit-win32" version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "cursor-icon", "dpi", "raw-window-handle", @@ -9070,29 +8755,6 @@ dependencies = [ "winit-core", ] -[[package]] -name = "winit-x11" -version = "0.31.0-beta.2" -source = "git+https://github.com/pop-os/winit.git?tag=cosmic-0.14#261cda54017f98a12dc55569c864430fe6770366" -dependencies = [ - "bitflags 2.11.1", - "bytemuck", - "calloop", - "cursor-icon", - "dpi", - "libc", - "percent-encoding", - "raw-window-handle", - "rustix 1.1.4", - "smol_str", - "tracing", - "winit-common", - "winit-core", - "x11-dl", - "x11rb", - "xkbcommon-dl", -] - [[package]] name = "winnow" version = "0.6.24" @@ -9104,109 +8766,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.15" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen" -version = "0.51.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck 0.5.0", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck 0.5.0", - "indexmap 2.14.0", - "prettyplease", - "syn 2.0.117", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.117", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "indexmap 2.14.0", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.14.0", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "write16" @@ -9223,39 +8794,6 @@ dependencies = [ "either", ] -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" -dependencies = [ - "as-raw-xcb-connection", - "gethostname", - "libc", - "libloading", - "once_cell", - "rustix 1.1.4", - "x11rb-protocol", - "xcursor", -] - -[[package]] -name = "x11rb-protocol" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" - [[package]] name = "xcursor" version = "0.3.10" @@ -9271,7 +8809,6 @@ checksum = "2fb433233f2df9344722454bc7e96465c9d03bff9d77c248f9e7523fe79585b5" [[package]] name = "xdg-shell-wrapper-config" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-panel#d518c7d25ef96f1a9696aa8cce008656bf66ece4" dependencies = [ "serde", "wayland-protocols-wlr", @@ -9317,7 +8854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d66ca9352cbd4eecbbc40871d8a11b4ac8107cfc528a6e14d7c19c69d0e1ac9" dependencies = [ "libc", - "memmap2 0.9.10", + "memmap2 0.9.11", "xkeysym", ] @@ -9328,7 +8865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a974f48060a14e95705c01f24ad9c3345022f4d97441b8a36beb7ed5c4a02d" dependencies = [ "libc", - "memmap2 0.9.10", + "memmap2 0.9.11", "xkeysym", ] @@ -9338,7 +8875,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.11.1", + "bitflags 2.13.0", "dlib", "log", "once_cell", @@ -9356,9 +8893,9 @@ dependencies = [ [[package]] name = "xml" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8aa498d22c9bbaf482329839bc5620c46be275a19a812e9a22a2b07529a642a" +checksum = "636f85e5ca6488e96401b61eb7de54f4e44755c988af0f52cf90230c312a1a89" [[package]] name = "xml-rs" @@ -9401,9 +8938,9 @@ checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5" [[package]] name = "yoke" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -9418,15 +8955,15 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "synstructure", ] [[package]] name = "zbus" -version = "5.14.0" +version = "5.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc" +checksum = "a28b97f866896a4be7aefd2b5a8e01bb6773d19a775d54ab28b4d094b9a4480e" dependencies = [ "async-broadcast", "async-executor", @@ -9452,7 +8989,7 @@ dependencies = [ "uds_windows", "uuid", "windows-sys 0.61.2", - "winnow 0.7.15", + "winnow 1.0.4", "zbus_macros", "zbus_names", "zvariant", @@ -9476,7 +9013,7 @@ checksum = "10da05367f3a7b7553c8cdf8fa91aee6b64afebe32b51c95177957efc47ca3a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "zbus-lockstep", "zbus_xml", "zvariant", @@ -9484,14 +9021,14 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.14.0" +version = "5.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222" +checksum = "5e05ad887425eecf5e8384dc2406a4a9313eb73468712fc1cdea362eb4fe0469" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "zbus_names", "zvariant", "zvariant_utils", @@ -9499,12 +9036,12 @@ dependencies = [ [[package]] name = "zbus_names" -version = "4.3.1" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f" +checksum = "1039ca249fee9559680f3a9f05b55e0761fee51af4f6c1e7d8c1f31e549721d2" dependencies = [ "serde", - "winnow 0.7.15", + "winnow 1.0.4", "zvariant", ] @@ -9523,12 +9060,12 @@ dependencies = [ [[package]] name = "zbus_xml" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "441a0064125265655bccc3a6af6bef56814d9277ac83fce48b1cd7e160b80eac" +checksum = "59ab0513c0a66a60a8718d5ad712a5094845a20d95b5c1c81e2bd8e904a52b4f" dependencies = [ - "quick-xml 0.38.4", "serde", + "winnow 1.0.4", "zbus_names", "zvariant", ] @@ -9541,29 +9078,29 @@ checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", ] [[package]] name = "zerofrom" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] @@ -9576,15 +9113,15 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "synstructure", ] [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" [[package]] name = "zerotrie" @@ -9618,14 +9155,81 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", +] + +[[package]] +name = "zlink" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b895b99588dceb73f4d349b8323eabad9a97d48ce83698d475c7223727c6148" +dependencies = [ + "zlink-smol", + "zlink-tokio", +] + +[[package]] +name = "zlink-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd12701bd1d42a982b931f0159cf5054bf13d90e7828a8377dfc02ed4b00342d" +dependencies = [ + "futures-util", + "itoa", + "libc", + "pin-project-lite", + "rustix 1.1.4", + "ryu", + "serde", + "serde_json", + "tracing", + "zlink-macros", +] + +[[package]] +name = "zlink-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f2416a5f504dfd7e04fee49f31abafe3314a3f62b4ddaa8e9a5fd496d4dd50" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "zlink-smol" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bc53cd0d636ad753f759aab0abb1f456e985c3938a279d11ebda92340ae37b1" +dependencies = [ + "async-broadcast", + "async-channel", + "async-io", + "futures-lite", + "futures-util", + "pin-project-lite", + "zlink-core", +] + +[[package]] +name = "zlink-tokio" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cbf366ac77ab41bf9a8d43535d3d620a072f7957813e03355d3d010c16cc4f" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", + "tokio-stream", + "zlink-core", ] [[package]] name = "zmij" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "zune-core" @@ -9668,41 +9272,45 @@ dependencies = [ [[package]] name = "zvariant" -version = "5.10.0" +version = "5.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b" +checksum = "7cf057bb00bf5c9ad77abb6147b0ca4818236a1858416e9d988e40d6322fefa7" dependencies = [ "endi", "enumflags2", "serde", "url", - "winnow 0.7.15", + "winnow 1.0.4", "zvariant_derive", "zvariant_utils", ] [[package]] name = "zvariant_derive" -version = "5.10.0" +version = "5.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c" +checksum = "8118ca6bda77bfc0ab51d660db0c955f2505eef854c9a449435bccb616933b31" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.117", + "syn 2.0.118", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9" +checksum = "90cb9383f9b45290407a1258b202d3f8f01db719eb60b4e4055c6375af4fc7c7" dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.117", - "winnow 0.7.15", + "syn 2.0.118", + "winnow 1.0.4", ] + +[[patch.unused]] +name = "winit-x11" +version = "0.31.0-beta.2" diff --git a/Cargo.toml b/Cargo.toml index c42187c..ee9855c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,22 @@ [workspace] -members = ["cosmic-settings", "crates/*", "page", "pages/*", "subscriptions/*"] +members = ["cosmic-settings", "page", "pages/*", "subscriptions/*"] default-members = ["cosmic-settings"] resolver = "3" [workspace.package] -rust-version = "1.90" +rust-version = "1.93" [workspace.dependencies] -cosmic-randr = { git = "https://github.com/pop-os/cosmic-randr" } +cosmic-randr = { path = "../cosmic-randr/lib" } tokio = { version = "1.49.0", features = ["macros"] } -iced_winit = { git = "https://github.com/pop-os/libcosmic", default-features = false } +iced_winit = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/winit", default-features = false } +image = { version = "0.25.10", default-features = false, features = [ + "jpeg", + "png", + "rayon", + "webp", + "hdr", +] } [workspace.dependencies.libcosmic] features = [ @@ -20,29 +27,29 @@ features = [ "tokio", "qr_code", ] -git = "https://github.com/pop-os/libcosmic" +path = "/home/lionel/Projets/COSMIC/libcosmic" [workspace.dependencies.cosmic-config] -git = "https://github.com/pop-os/libcosmic" +path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-config" [workspace.dependencies.cosmic-bg-config] -git = "https://github.com/pop-os/cosmic-bg" +path = "../cosmic-bg/config" [workspace.dependencies.cosmic-comp-config] -git = "https://github.com/pop-os/cosmic-comp" +path = "../cosmic-comp/cosmic-comp-config" features = ["output"] [workspace.dependencies.cosmic-idle-config] -git = "https://github.com/pop-os/cosmic-idle" +path = "../cosmic-idle/cosmic-idle-config" [workspace.dependencies.cosmic-panel-config] -git = "https://github.com/pop-os/cosmic-panel" +path = "../cosmic-panel/cosmic-panel-config" [workspace.dependencies.cosmic-randr-shell] -git = "https://github.com/pop-os/cosmic-randr" +path = "../cosmic-randr/shell" [workspace.dependencies.sctk] -version = "0.20" +version = "1.3.0" package = "smithay-client-toolkit" [profile.dev] @@ -59,34 +66,18 @@ inherits = "release" lto = "off" debug = true -# [patch.'https://github.com/pop-os/cosmic-text'] -# cosmic-text = { git = "https://github.com/pop-os/cosmic-text//", rev = "b017d7c" } - [patch.'https://github.com/pop-os/cosmic-protocols'] -cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "d0e95be" } -cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols//", rev = "d0e95be" } +cosmic-protocols = { path = "../cosmic-protocols" } +cosmic-client-toolkit = { path = "../cosmic-protocols/client-toolkit" } -# [patch.'https://github.com/pop-os/cosmic-settings-daemon'] -# cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon//", branch = "input_nobuild" } +[patch.'https://github.com/pop-os/libcosmic'] +cosmic-config = { path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-config" } +cosmic-theme = { path = "/home/lionel/Projets/COSMIC/libcosmic/cosmic-theme" } +iced_futures = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/futures" } +iced_winit = { path = "/home/lionel/Projets/COSMIC/libcosmic/iced/winit" } -# For development and testing purposes -# [patch.'https://github.com/pop-os/libcosmic'] -# libcosmic = { path = "../libcosmic" } -# cosmic-config = { path = "../libcosmic/cosmic-config" } -# cosmic-theme = { path = "../libcosmic/cosmic-theme" } -# iced_futures = { path = "../libcosmic/iced/futures" } -# iced_winit = { path = "../libcosmic/iced/winit" } - -# libcosmic = { git = "https://github.com/pop-os/libcosmic//" } -# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" } -# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//" } -# iced_futures = { git = "https://github.com/pop-os/libcosmic//" } -# iced_winit = { git = "https://github.com/pop-os/libcosmic//" } - -# [patch.'https://github.com/pop-os/dbus-settings-bindings'] -# cosmic-dbus-networkmanager = { path = "../dbus-settings-bindings/networkmanager" } -# upower_dbus = { path = "../dbus-settings-bindings/upower" } -# nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings//", branch = "nm-secret-agent" } +[patch.'https://github.com/pop-os/cosmic-text.git'] +cosmic-text = { path = "../cosmic-text" } [patch.crates-io] atspi = { git = "https://github.com/wash2/atspi" } diff --git a/cosmic-settings/Cargo.toml b/cosmic-settings/Cargo.toml index 03c7a70..febae53 100644 --- a/cosmic-settings/Cargo.toml +++ b/cosmic-settings/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmic-settings" -version = "1.0.7" +version = "1.0.12" edition = "2024" license = "GPL-3.0-only" publish = false @@ -21,8 +21,6 @@ color-eyre = "0.6.5" cosmic-bg-config.workspace = true cosmic-comp-config = { workspace = true, optional = true } cosmic-config.workspace = true -cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } -nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } cosmic-idle-config.workspace = true cosmic-panel-config = { workspace = true, optional = true } cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", optional = true } @@ -34,11 +32,8 @@ cosmic-settings-accessibility-subscription = { path = "../subscriptions/accessib cosmic-settings-a11y-manager-subscription = { path = "../subscriptions/a11y-manager", optional = true } cosmic-settings-airplane-mode-subscription = { path = "../subscriptions/airplane-mode", optional = true } cosmic-settings-bluetooth-subscription = { path = "../subscriptions/bluetooth", optional = true } -cosmic-settings-network-manager-subscription = { path = "../subscriptions/network-manager", optional = true } +cosmic-settings-sound = { path = "../pages/sound", optional = true } cosmic-settings-upower-subscription = { path = "../subscriptions/upower", optional = true } -cosmic-settings-sound-subscription = { path = "../subscriptions/sound", optional = true, features = [ - "auto-profile-init", -] } cosmic-settings-wallpaper = { path = "../pages/wallpapers" } cosmic-settings-daemon-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", optional = true } derive_setters = "0.1.9" @@ -49,13 +44,7 @@ futures = "0.3.32" hostname-validator = "1.1.1" hostname1-zbus = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } i18n-embed-fl = "0.10.0" -image = { version = "0.25", default-features = false, features = [ - "jpeg", - "png", - "rayon", - "webp", - "hdr", -] } +image.workspace = true indexmap = "2.13.0" itertools = "0.14.0" itoa = "1.0.17" @@ -63,13 +52,15 @@ libcosmic.workspace = true iced_winit.workspace = true locale1 = { git = "https://github.com/pop-os/dbus-settings-bindings", optional = true } sysinfo = { version = "=0.38.0", optional = true } -mime-apps = { package = "cosmic-mime-apps", git = "https://github.com/pop-os/cosmic-mime-apps", optional = true } +mime-apps = { package = "cosmic-mime-apps", git = "https://github.com/pop-os/cosmic-mime-apps", features = ["tokio"], optional = true } notify = "8.2.0" +nmrs = { version = "3.4.0", optional = true } regex = "1.12.3" ron = "0.12" rust-embed = "8.11.0" sctk = { workspace = true, optional = true } secure-string = "0.3.0" +secret-service = { version = "5.1.0", features = ["rt-tokio-crypto-rust"], optional = true } serde = { version = "1.0.228", features = ["derive"] } slab = "0.4.12" slotmap = "1.1.1" @@ -98,6 +89,13 @@ gettext-rs = { version = "0.7.7", features = [ num-traits = "0.2" pwhash = "1" which = "8.0.0" +zlink = "0.5.0" +intmap = "3.1.3" + +[dependencies.cosmic-settings-audio-client] +git = "https://github.com/pop-os/cosmic-settings-daemon" +features = ["codec"] +optional = true [dependencies.icu] version = "2.1.1" @@ -113,8 +111,11 @@ git = "https://github.com/AerynOS/locales-rs" optional = true [features] -default = ["a11y", "linux", "single-instance", "wgpu"] +default = ["a11y", "avif", "linux", "single-instance", "wgpu", "systemd"] +avif = ["image/avif-native"] gettext = ["dep:gettext-rs"] +systemd = [] +openrc = [] # Default features for Linux linux = [ @@ -167,10 +168,9 @@ page-input = [ ] page-legacy-applications = ["cosmic-comp-config", "dep:cosmic-randr"] page-networking = [ - "dep:cosmic-settings-network-manager-subscription", "xdg-portal", - "dep:cosmic-dbus-networkmanager", - "dep:nm-secret-agent-manager", + "dep:nmrs", + "dep:secret-service", "dep:zbus", ] page-power = ["dep:upower_dbus", "dep:zbus"] @@ -181,7 +181,7 @@ page-region = [ "dep:zbus", "dep:accounts-zbus", ] -page-sound = ["dep:cosmic-settings-sound-subscription"] +page-sound = ["dep:cosmic-settings-audio-client", "dep:cosmic-settings-sound"] page-users = ["xdg-portal", "dep:accounts-zbus", "dep:zbus", "dep:zbus_polkit"] page-window-management = ["cosmic-comp-config", "dep:cosmic-settings-config"] page-workspaces = ["cosmic-comp-config"] diff --git a/cosmic-settings/build.rs b/cosmic-settings/build.rs index 4f0dd04..5be3e7c 100644 --- a/cosmic-settings/build.rs +++ b/cosmic-settings/build.rs @@ -1,4 +1,5 @@ -use std::{env, fs, path::PathBuf}; +use std::path::PathBuf; +use std::{env, fs}; use xdgen::{App, Context, FluentString}; fn main() { diff --git a/cosmic-settings/src/app.rs b/cosmic-settings/src/app.rs index dfac360..bbeec4a 100644 --- a/cosmic-settings/src/app.rs +++ b/cosmic-settings/src/app.rs @@ -5,7 +5,6 @@ use crate::PageCommands; use crate::config::Config; #[cfg(feature = "page-accessibility")] use crate::pages::accessibility; -use crate::pages::applications; #[cfg(feature = "page-bluetooth")] use crate::pages::bluetooth; use crate::pages::desktop::{self, appearance}; @@ -19,26 +18,21 @@ use crate::pages::networking; use crate::pages::power; #[cfg(feature = "page-sound")] use crate::pages::sound; -use crate::pages::{self, system, time}; +use crate::pages::{self, applications, system, time}; use crate::subscription::desktop_files; use crate::widget::{page_title, search_header}; +use cosmic::app::context_drawer::ContextDrawer; +use cosmic::app::{Core, Task}; #[cfg(feature = "wayland")] use cosmic::cctk::{sctk::output::OutputInfo, wayland_client::protocol::wl_output::WlOutput}; -use cosmic::{ - Element, - app::{Core, Task, context_drawer::ContextDrawer}, - iced::{ - self, Length, Subscription, - event::{self, PlatformSpecific}, - keyboard, window, - }, - prelude::*, - surface, - widget::{ - button, column, container, icon, id_container, nav_bar, row, scrollable, segmented_button, - settings, text_input, - }, +use cosmic::iced::event::{self, PlatformSpecific}; +use cosmic::iced::{self, Length, Subscription, keyboard, window}; +use cosmic::prelude::*; +use cosmic::widget::{ + button, column, container, icon, id_container, nav_bar, row, scrollable, segmented_button, + settings, text_input, }; +use cosmic::{Element, surface}; #[cfg(feature = "cosmic-comp-config")] use cosmic_comp_config::CosmicCompConfig; #[cfg(feature = "wayland")] @@ -52,8 +46,9 @@ use desktop::{ #[cfg(feature = "wayland")] use event::wayland; use page::Entity; +use std::borrow::Cow; use std::collections::BTreeSet; -use std::{borrow::Cow, str::FromStr}; +use std::str::FromStr; #[allow(clippy::struct_excessive_bools)] #[allow(clippy::module_name_repetitions)] diff --git a/cosmic-settings/src/config.rs b/cosmic-settings/src/config.rs index 88de69e..9856f63 100644 --- a/cosmic-settings/src/config.rs +++ b/cosmic-settings/src/config.rs @@ -1,10 +1,8 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{ - cosmic_config::{self, ConfigGet, ConfigSet}, - cosmic_theme::palette::Srgba, -}; +use cosmic::cosmic_config::{self, ConfigGet, ConfigSet}; +use cosmic::cosmic_theme::palette::Srgba; const NAME: &str = "com.system76.CosmicSettings"; diff --git a/cosmic-settings/src/localize.rs b/cosmic-settings/src/localize.rs index 25aee1d..3e4d237 100644 --- a/cosmic-settings/src/localize.rs +++ b/cosmic-settings/src/localize.rs @@ -1,10 +1,8 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use i18n_embed::{ - DefaultLocalizer, LanguageLoader, Localizer, - fluent::{FluentLanguageLoader, fluent_language_loader}, -}; +use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader}; +use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer}; use rust_embed::RustEmbed; use std::sync::LazyLock; diff --git a/cosmic-settings/src/main.rs b/cosmic-settings/src/main.rs index cb68840..7a39baf 100644 --- a/cosmic-settings/src/main.rs +++ b/cosmic-settings/src/main.rs @@ -7,6 +7,12 @@ #![allow(clippy::cast_lossless)] #![allow(clippy::too_many_lines)] +#[cfg(not(any(feature = "systemd", feature = "openrc")))] +compile_error!( + "At least one service manager feature must be enabled. \ + Enable 'systemd' or 'openrc' for bluetooth service management." +); + pub mod app; use std::str::FromStr; @@ -16,6 +22,7 @@ pub mod config; #[macro_use] pub mod localize; pub mod pages; +pub mod service_manager; pub mod subscription; pub mod theme; pub mod utils; @@ -24,7 +31,8 @@ pub mod widget; use std::path::PathBuf; use clap::{Parser, Subcommand}; -use cosmic::{app::CosmicFlags, iced::Limits}; +use cosmic::app::CosmicFlags; +use cosmic::iced::Limits; use i18n_embed::DesktopLanguageRequester; use ron::error::SpannedError; use serde::{Deserialize, Serialize}; diff --git a/cosmic-settings/src/pages/accessibility/magnifier.rs b/cosmic-settings/src/pages/accessibility/magnifier.rs index d476b71..7dae60d 100644 --- a/cosmic-settings/src/pages/accessibility/magnifier.rs +++ b/cosmic-settings/src/pages/accessibility/magnifier.rs @@ -1,20 +1,15 @@ use std::collections::HashSet; use std::fmt::Write; -use cosmic::{ - Apply, - iced::core::text::Wrapping, - iced::{Element, Length, stream}, - surface, - widget::{self, icon, settings, svg, text}, -}; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::{Element, Length, stream}; +use cosmic::widget::{self, icon, settings, svg, text}; +use cosmic::{Apply, surface}; use cosmic_comp_config::{ZoomConfig, ZoomMovement}; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_config::{Action, Binding, shortcuts}; -use cosmic_settings_page::{ - self as page, Entity, - section::{self, Section}, -}; +use cosmic_settings_page::section::{self, Section}; +use cosmic_settings_page::{self as page, Entity}; use futures::SinkExt; use slotmap::SlotMap; use tracing::error; diff --git a/cosmic-settings/src/pages/accessibility/mod.rs b/cosmic-settings/src/pages/accessibility/mod.rs index f8b75f2..919b5e5 100644 --- a/cosmic-settings/src/pages/accessibility/mod.rs +++ b/cosmic-settings/src/pages/accessibility/mod.rs @@ -1,21 +1,16 @@ -use cosmic::{ - Apply, Element, Task, - cosmic_theme::{CosmicPalette, ThemeBuilder}, - iced::core::text::Wrapping, - iced::stream, - surface, - theme::CosmicTheme, - widget::{dropdown, settings, text}, -}; +use cosmic::cosmic_theme::{CosmicPalette, ThemeBuilder}; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::stream; +use cosmic::theme::CosmicTheme; +use cosmic::widget::{dropdown, settings, text}; +use cosmic::{Apply, Element, Task, surface}; pub use cosmic_comp_config::ZoomMovement; use cosmic_config::CosmicConfigEntry; use cosmic_settings_a11y_manager_subscription as cosmic_a11y_manager; use cosmic_settings_accessibility_subscription as a11y_bus; use cosmic_settings_daemon_config::CosmicSettingsDaemonConfig; -use cosmic_settings_page::{ - self as page, Insert, - section::{self, Section}, -}; +use cosmic_settings_page::section::{self, Section}; +use cosmic_settings_page::{self as page, Insert}; use futures::SinkExt; use num_traits::FromPrimitive; use slotmap::SlotMap; diff --git a/cosmic-settings/src/pages/applications/default_apps.rs b/cosmic-settings/src/pages/applications/default_apps.rs index 89b28c0..046619e 100644 --- a/cosmic-settings/src/pages/applications/default_apps.rs +++ b/cosmic-settings/src/pages/applications/default_apps.rs @@ -2,28 +2,23 @@ // Copyright 2024 bbb651 // SPDX-License-Identifier: GPL-3.0-only -use std::{ - borrow::Cow, - collections::{BTreeMap, BTreeSet}, - path::{Path, PathBuf}, - sync::Arc, -}; - -use cosmic::{ - Apply, Element, Task, - iced::Alignment, - surface, - widget::{self, dropdown, icon, settings}, -}; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::{self, dropdown, icon, settings}; +use cosmic::{Apply, Element, Task, surface}; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_config::shortcuts::SystemActions; use cosmic_settings_config::shortcuts::action::System; use cosmic_settings_page::{self as page, Section, section}; -use freedesktop_desktop_entry::{ - DesktopEntry, Iter as DesktopEntryIter, default_paths, get_languages_from_env, -}; -use mime_apps::App; +use freedesktop_desktop_entry::{DesktopEntry, default_paths, get_languages_from_env}; +use mime::Mime; use slotmap::SlotMap; +use std::borrow::Cow; +use std::collections::BTreeSet; +use std::io::SeekFrom; +use std::path::PathBuf; +use std::str::FromStr; +use std::sync::Arc; +use tokio::io::{AsyncSeekExt, AsyncWriteExt}; const DROPDOWN_WEB_BROWSER: usize = 0; const DROPDOWN_FILE_MANAGER: usize = 1; @@ -52,7 +47,7 @@ pub enum Category { #[derive(Clone, Debug)] pub enum Message { SetDefault(Category, usize), - Update(CachedMimeApps), + Update(Arc), Surface(surface::Action), } @@ -68,28 +63,27 @@ impl From for crate::pages::Message { } } -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct CachedMimeApps { - pub list: mime_apps::List, - pub local_list: mime_apps::List, - pub apps: Vec, - pub known_mimes: BTreeSet, - pub config_path: Box, + local_list: Option<(mime_apps::List, tokio::fs::File)>, + apps: Vec, + known_mimes: BTreeSet, } #[derive(Clone, Debug)] pub struct AppMeta { selected: Option, - app_ids: Vec, + app_ids: Vec>, apps: Vec, icons: Vec, } -#[derive(Clone, Debug, Default)] +#[derive(Debug, Default)] pub struct Page { on_enter_handle: Option, mime_apps: Option, shortcuts_config: Option, + update_config: Option>, } impl page::AutoBind for Page {} @@ -113,46 +107,45 @@ impl page::Page for Page { handle.abort(); } + let config_update_handle = self.update_config.take(); + if self.shortcuts_config.is_none() { self.shortcuts_config = cosmic_settings_config::shortcuts::context().ok(); } let (task, on_enter_handle) = Task::future(async move { - let mut list = mime_apps::List::default(); - list.load_from_paths(&mime_apps::list_paths()); - - let mut local_list = mime_apps::List::default(); - - if let Some(path) = mime_apps::local_list_path() - && let Ok(buffer) = std::fs::read_to_string(&path) - { - local_list.load_from(&buffer); + // Wait for previous copy operation to complete. + if let Some(handle) = config_update_handle { + _ = handle.await; } - let assocs = mime_apps::associations::by_app(); + let local_list = mime_apps::load_user_mimeapps().await.ok(); + + let mut list = mime_apps::List::default(); + list.load_from_paths(&mime_apps::list_paths()); + let assocs = mime_apps::associations::load_from_disk(&list); let apps = vec![ - load_defaults(&assocs, &["x-scheme-handler/http"]).await, - load_defaults(&assocs, &["inode/directory"]).await, - load_defaults(&assocs, &["x-scheme-handler/mailto"]).await, - load_defaults(&assocs, &["audio/mp3", "application/ogg", "video/mp4"]).await, - load_defaults(&assocs, &["video/mp4"]).await, - load_defaults(&assocs, &["image/png"]).await, - load_defaults(&assocs, &["text/calendar"]).await, - load_terminal_apps(&assocs).await, - load_defaults(&assocs, &["text/plain"]).await, + load_defaults(&list, &assocs, &["x-scheme-handler/http"]), + load_defaults(&list, &assocs, &["inode/directory"]), + load_defaults(&list, &assocs, &["x-scheme-handler/mailto"]), + load_defaults( + &list, + &assocs, + &["audio/mpeg", "application/ogg", "audio/x-flac", "video/mp4"], + ), + load_defaults(&list, &assocs, &["video/mp4"]), + load_defaults(&list, &assocs, &["image/png"]), + load_defaults(&list, &assocs, &["text/calendar"]), + load_terminal_apps(&list, &assocs).await, + load_defaults(&list, &assocs, &["text/plain"]), ]; - Message::Update(CachedMimeApps { + Message::Update(Arc::new(CachedMimeApps { apps, - list, local_list, known_mimes: mime_apps::mime_info::mime_types(), - config_path: dirs::config_dir() - .expect("config dir not found") - .join("mimeapps.list") - .into(), - }) + })) .into() }) .abortable(); @@ -193,6 +186,7 @@ impl Page { "application/ogg", "application/x-cue", "application/x-ogg", + "audio/mpeg", "audio/mp3", "x-content/audio-cdda", ]) @@ -237,13 +231,16 @@ impl Page { "x-scheme-handler/https", ], ), - Category::TextEditor => (DROPDOWN_TEXT_EDITOR, &["text/plain"]), + Category::TextEditor => ( + DROPDOWN_TEXT_EDITOR, + &["application/x-zerosize", "text/plain"], + ), Category::Mime(_mime_type) => return Task::none(), }; let meta = &mut mime_apps.apps[category_id]; - if meta.selected != Some(id) { + if meta.selected.is_none_or(|selected| selected != id) { meta.selected = Some(id); let appid = &meta.app_ids[id]; @@ -254,24 +251,40 @@ impl Page { assign_default_terminal(config, appid); } - for mime in mime_types { - if let Ok(mime) = mime.parse() { - mime_apps - .local_list - .set_default_app(mime, [appid, ".desktop"].concat()); - }; + if let Some((local_list, local_file)) = mime_apps.local_list.as_mut() { + for mime in mime_types { + if let Ok(mime) = mime.parse() { + tracing::info!(target: "default-apps", ?mime, appid, "setting default for mime"); + local_list.set_default_app(mime, [appid, ".desktop"].concat()); + }; + } + + if let Some(config_update_handle) = self.update_config.take() { + config_update_handle.abort(); + } + + let mut buffer = local_list.to_string(); + buffer.push('\n'); + + if let Ok(mut local_file) = + futures::executor::block_on(local_file.try_clone()) + { + self.update_config = Some(tokio::spawn(async move { + tracing::debug!(target: "default-apps", buffer, "writing to mimeapps config"); + _ = local_file.seek(SeekFrom::Start(0)).await; + _ = local_file.set_len(buffer.len() as u64).await; + _ = local_file.write_all(buffer.as_bytes()).await; + _ = local_file.flush().await; + _ = local_file.seek(SeekFrom::Start(0)).await; + _ = tokio::process::Command::new("update-desktop-database") + .status() + .await; + })); + } } - - let mut buffer = mime_apps.local_list.to_string(); - buffer.push('\n'); - - _ = std::fs::write(&mime_apps.config_path, buffer); - _ = std::process::Command::new("update-desktop-database").status(); } } - Message::Update(mime_apps) => { - self.mime_apps = Some(mime_apps); - } + Message::Update(mime_apps) => self.mime_apps = Arc::into_inner(mime_apps), Message::Surface(a) => { return cosmic::task::message(crate::app::Message::Surface(a)); } @@ -281,269 +294,83 @@ impl Page { } } +fn app_item(meta: &AppMeta, label: String, category: Category) -> widget::FlexRow<'_, Message> { + // Avoid creating popup_dropdown for empty app lists. + // Empty categories are rendered as non-interactive text to prevent Wayland crashes. + settings::flex_item( + label, + if meta.apps.is_empty() { + widget::text(fl!("default-apps", "not-installed")).apply(Element::from) + } else { + dropdown::popup_dropdown( + &meta.apps, + Some(meta.selected.unwrap_or(0)), + move |id| Message::SetDefault(category, id), + cosmic::iced::window::Id::RESERVED, + Message::Surface, + |a| crate::app::Message::PageMessage(crate::pages::Message::DefaultApps(a)), + ) + .icons(Cow::Borrowed(&meta.icons)) + .apply(Element::from) + }, + ) + .align_items(Alignment::Center) + .width(Length::Shrink) +} + fn apps() -> Section { Section::default().view::(move |_binder, page, section| { let Some(mime_apps) = page.mime_apps.as_ref() else { return widget::space().into(); }; - // Avoid creating popup_dropdown for empty app lists. - // Empty categories are rendered as non-interactive text to prevent Wayland crashes. - settings::section() + settings::section::with_capacity(9) .title(§ion.title) - .add({ - let meta = &mime_apps.apps[DROPDOWN_WEB_BROWSER]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "web-browser"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "web-browser"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::WebBrowser, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - .min_item_width(300.0) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_FILE_MANAGER]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "file-manager"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "file-manager"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::FileManager, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_MAIL]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "mail-client"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "mail-client"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Mail, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_MUSIC]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "music"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "music"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Audio, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_VIDEO]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "video"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "video"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Video, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_PHOTO]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "photos"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "photos"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Image, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_CALENDAR]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "calendar"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "calendar"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Calendar, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_TERMINAL]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "terminal"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "terminal"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::Terminal, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) - .add({ - let meta = &mime_apps.apps[DROPDOWN_TEXT_EDITOR]; - if meta.apps.is_empty() { - settings::flex_item( - fl!("default-apps", "text-editor"), - widget::text(fl!("default-apps", "not-installed")), - ) - .align_items(Alignment::Center) - } else { - settings::flex_item( - fl!("default-apps", "text-editor"), - dropdown::popup_dropdown( - &meta.apps, - meta.selected, - |id| Message::SetDefault(Category::TextEditor, id), - cosmic::iced::window::Id::RESERVED, - Message::Surface, - |a| { - crate::app::Message::PageMessage( - crate::pages::Message::DefaultApps(a), - ) - }, - ) - .icons(Cow::Borrowed(&meta.icons)), - ) - .align_items(Alignment::Center) - } - }) + .add(app_item( + &mime_apps.apps[DROPDOWN_WEB_BROWSER], + fl!("default-apps", "web-browser"), + Category::WebBrowser, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_FILE_MANAGER], + fl!("default-apps", "file-manager"), + Category::FileManager, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_MAIL], + fl!("default-apps", "mail-client"), + Category::Mail, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_MUSIC], + fl!("default-apps", "music"), + Category::Audio, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_VIDEO], + fl!("default-apps", "video"), + Category::Video, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_PHOTO], + fl!("default-apps", "photos"), + Category::Image, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_CALENDAR], + fl!("default-apps", "calendar"), + Category::Calendar, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_TERMINAL], + fl!("default-apps", "terminal"), + Category::Terminal, + )) + .add(app_item( + &mime_apps.apps[DROPDOWN_TEXT_EDITOR], + fl!("default-apps", "text-editor"), + Category::TextEditor, + )) .apply(Element::from) .map(crate::pages::Message::DefaultApps) }) @@ -584,57 +411,71 @@ fn assign_default_terminal(config: &cosmic_config::Config, appid: &str) { } } -async fn load_defaults(assocs: &BTreeMap, Arc>, for_mimes: &[&str]) -> AppMeta { +fn load_defaults( + list: &mime_apps::List, + assocs: &mime_apps::Associations, + for_mimes: &[&str], +) -> AppMeta { let mut unsorted = Vec::new(); - let mut current_app = None; + let mut default_app = None; for for_mime in for_mimes { - let Ok(mime) = for_mime.parse() else { - return AppMeta { - selected: None, - app_ids: Vec::new(), - apps: Vec::new(), - icons: Vec::new(), - }; + let Ok(mime) = Mime::from_str(for_mime) else { + continue; }; - let current_app_entry = xdg_mime_query_default(for_mime).await; - let current_appid = current_app_entry - .as_ref() - .and_then(|entry| entry.strip_suffix(".desktop")); + for default in list.default_app_for(&mime).into_iter().flatten() { + let appid = default.strip_suffix(".desktop").unwrap_or(default.as_ref()); - if unsorted.is_empty() { - current_app = current_appid.and_then(|appid| assocs.get(appid)); + tracing::info!(target: "default-apps", ?mime, appid, "entry for mime"); + if default_app.is_none() { + default_app = assocs.by_app_id.get(appid); + if default_app.is_some() { + break; + } + } } - unsorted.extend( - mime_apps::apps_for_mime(&mime, assocs) - .map(|(app_id, app)| (app_id.clone(), app.clone())), - ); + for (appid, app) in mime_apps::apps_for_mime(&mime, assocs) { + if app.icon.is_none() { + continue; + } + + if unsorted.iter().any(|(id, _)| id == appid) { + continue; + } + + unsorted.push((appid.clone(), app.clone())); + } } unsorted.sort_unstable_by_key(|(_, app)| app.name.clone()); - unsorted.dedup_by_key(|(app_id, _)| app_id.clone()); let mut selected = None; let mut app_ids = Vec::new(); let mut apps = Vec::new(); let mut icons = Vec::new(); - for (id, (appid, app)) in unsorted.iter().enumerate() { - if let Some(current_app) = current_app - && app.name.as_ref() == current_app.name.as_ref() + let mut id = 0; + for (appid, app) in unsorted.iter() { + let Some(icon) = app.icon.as_deref() else { + continue; + }; + if let Some(default_app) = default_app + && app.name.as_ref() == default_app.name.as_ref() { selected = Some(id); } app_ids.push(appid.as_ref().into()); apps.push(app.name.as_ref().into()); - icons.push(if app.icon.starts_with('/') { - icon::from_path(PathBuf::from(app.icon.as_ref())) + icons.push(if icon.starts_with('/') { + icon::from_path(PathBuf::from(icon)) } else { - icon::from_name(app.icon.as_ref()).size(20).handle() + icon::from_name(icon).size(20).handle() }); + + id += 1; } AppMeta { @@ -645,86 +486,55 @@ async fn load_defaults(assocs: &BTreeMap, Arc>, for_mimes: &[&str] } } -async fn xdg_mime_query_default(mime_type: &str) -> Option { - let output = tokio::process::Command::new("xdg-mime") - .args(["query", "default", mime_type]) - .output() - .await - .ok()?; - - if !output.status.success() { - return None; - } - - String::from_utf8(output.stdout) - .ok() - .map(|string| string.trim().to_owned()) -} - -async fn load_terminal_apps(assocs: &BTreeMap, Arc>) -> AppMeta { - let mut terminals = Vec::new(); - let mut current_app = None; - - // Get the current default terminal if set - let current_entry = xdg_mime_query_default("x-scheme-handler/terminal").await; - let current_appid = current_entry - .as_ref() - .and_then(|entry| entry.strip_suffix(".desktop")); - - // Also check x-terminal-emulator - if current_app.is_none() { - let current_entry = xdg_mime_query_default("application/x-terminal-emulator").await; - let current_appid = current_entry - .as_ref() - .and_then(|entry| entry.strip_suffix(".desktop")); - if let Some(appid) = current_appid { - current_app = assocs.get(appid).cloned(); - } - } - - // Scan desktop entries for terminal applications - for path in DesktopEntryIter::new(default_paths()) { - if let Ok(bytes) = std::fs::read_to_string(&path) - && let Ok(entry) = DesktopEntry::from_str(&path, &bytes, None::<&[&str]>) - { - // Check if it's a terminal application - if entry - .categories() - .map(|cats| cats.contains(&"TerminalEmulator")) - .unwrap_or(false) - { - let id = entry.id(); - if let Some(app) = assocs.get(id) { - if current_appid.as_ref().map(|c| *c == id).unwrap_or(false) { - current_app = Some(app.clone()); - } - terminals.push((Arc::from(id), app.clone())); - } - } - } - } - - terminals.sort_unstable_by_key(|(_, app): &(Arc, Arc)| app.name.clone()); - terminals.dedup_by(|a, b| a.0 == b.0); - +async fn load_terminal_apps(list: &mime_apps::List, assocs: &mime_apps::Associations) -> AppMeta { let mut selected = None; let mut app_ids = Vec::new(); let mut apps = Vec::new(); let mut icons = Vec::new(); - for (id, (appid, app)) in terminals.iter().enumerate() { - if let Some(ref current_app) = current_app - && app.name.as_ref() == current_app.name.as_ref() - { + let mut terminals: Vec<_> = assocs + .apps + .iter() + .filter(|app| app.is_terminal && app.icon.is_some()) + .collect(); + + terminals.sort_unstable_by_key(|app| app.name.clone()); + + 'outer: for for_mime in [ + "x-scheme-handler/terminal", + "application/x-terminal-emulator", + ] { + let Ok(mime) = Mime::from_str(for_mime) else { + continue; + }; + + for default in list.default_app_for(&mime).into_iter().flatten() { + let appid = default.strip_suffix(".desktop").unwrap_or(default.as_ref()); + + for (id, app) in terminals.iter().enumerate() { + if app.appid.as_ref() == appid { + selected = Some(id); + break 'outer; + } + } + } + } + + for (id, app) in terminals.into_iter().enumerate() { + let Some(icon) = app.icon.as_deref() else { + continue; + }; + + if selected.is_none() && app.appid.as_ref() == "com.system76.CosmicTerm" { selected = Some(id); } - app_ids.push(appid.to_string()); + app_ids.push(app.appid.clone()); apps.push(app.name.as_ref().into()); - icons.push(if app.icon.starts_with('/') { - icon::from_path(PathBuf::from(app.icon.as_ref())) + icons.push(if icon.starts_with('/') { + icon::from_path(PathBuf::from(icon)) } else { - icon::from_name(app.icon.as_ref()).size(20).handle() + icon::from_name(icon).size(20).handle() }); } diff --git a/cosmic-settings/src/pages/applications/legacy_applications.rs b/cosmic-settings/src/pages/applications/legacy_applications.rs index a21d605..f2a1b20 100644 --- a/cosmic-settings/src/pages/applications/legacy_applications.rs +++ b/cosmic-settings/src/pages/applications/legacy_applications.rs @@ -1,25 +1,17 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::{ - process::ExitStatus, - sync::{ - Arc, - atomic::{AtomicBool, Ordering}, - }, -}; +use std::process::ExitStatus; +use std::sync::Arc; +use std::sync::atomic::{AtomicBool, Ordering}; -use cosmic::{ - Apply, Element, Task, - cosmic_config::{self, ConfigGet, ConfigSet}, - iced::stream, - surface, - widget::{self, dropdown, settings, text}, -}; +use cosmic::cosmic_config::{self, ConfigGet, ConfigSet}; +use cosmic::iced::stream; +use cosmic::widget::{self, dropdown, settings, text}; +use cosmic::{Apply, Element, Task, surface}; use cosmic_comp_config::{EavesdroppingKeyboardMode, XwaylandDescaling, XwaylandEavesdropping}; use cosmic_randr_shell::List; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use futures::SinkExt; use slotmap::SlotMap; use tokio::sync::oneshot; diff --git a/cosmic-settings/src/pages/applications/startup_apps.rs b/cosmic-settings/src/pages/applications/startup_apps.rs index bbe4488..4735771 100644 --- a/cosmic-settings/src/pages/applications/startup_apps.rs +++ b/cosmic-settings/src/pages/applications/startup_apps.rs @@ -1,7 +1,8 @@ use cosmic::app::ContextDrawer; use cosmic::iced::{Alignment, Length}; -use cosmic::widget::{button, icon, settings, text}; -use cosmic::{Apply, Element, Task, widget}; +use cosmic::widget::text_input::focus; +use cosmic::widget::{Id, button, icon, settings, text}; +use cosmic::{Apply, Element, Task, task, widget}; use cosmic_settings_page::section::Entity; use cosmic_settings_page::{self as page, Content, Info, Section}; use freedesktop_desktop_entry::DesktopEntry; @@ -9,8 +10,12 @@ use itertools::Itertools; use slotmap::{Key, SlotMap}; use std::collections::{HashMap, HashSet}; use std::path::PathBuf; +use std::sync::LazyLock; use tracing::error; +pub static ADD_APPLICATION_SEARCH: LazyLock = + LazyLock::new(|| widget::Id::new("ADD_APPLICATION_SEARCH")); + #[derive(Clone, Debug)] pub struct CachedApps { apps: HashMap>, @@ -51,6 +56,7 @@ pub enum Message { ShowApplicationSidebar(DirectoryType), UpdateApplications(CachedApps), UpdateStartupApplications(CachedApps), + FocusAddApplicationSearch, } #[derive(Clone, Debug, Eq, PartialEq, Hash)] @@ -116,6 +122,7 @@ impl page::Page for Page { let search = widget::search_input("", &self.application_search) .on_input(|i| Message::ApplicationSearch(i).into()) .on_clear(Message::ApplicationSearch(String::new()).into()) + .id(ADD_APPLICATION_SEARCH.clone()) .apply(Element::from); Some( @@ -142,8 +149,11 @@ impl page::Page for Page { let user_entries = freedesktop_desktop_entry::Iter::new(user_dirs.into_iter()).entries(Some(&locales)); + let mut user_entries_vec = user_entries.collect_vec(); + sort_entries_by_name(&mut user_entries_vec, &locales); + let mut apps_hash = HashMap::with_capacity(1); - apps_hash.insert(DirectoryType::User, user_entries.collect_vec()); + apps_hash.insert(DirectoryType::User, user_entries_vec); Message::UpdateStartupApplications(CachedApps { apps: apps_hash, @@ -217,7 +227,8 @@ impl Page { } Message::ShowApplicationSidebar(directory_type) => { self.context = Some(Context::AddApplication(directory_type)); - return cosmic::task::message(crate::app::Message::OpenContextDrawer(self.entity)); + return cosmic::task::message(crate::app::Message::OpenContextDrawer(self.entity)) + .chain(task::message(Message::FocusAddApplicationSearch)); } Message::AddStartupApplication(directory_type, app) => { let mut file_name = app.clone().appid; @@ -246,6 +257,10 @@ impl Page { if let Some(target_apps) = target_apps { let mut new_apps = target_apps.clone(); new_apps.push(app.clone()); + sort_entries_by_name( + &mut new_apps, + &cached_startup_apps.locales, + ); cached_startup_apps .apps @@ -312,6 +327,26 @@ impl Page { self.target_directory_type = None; self.context = None; } + Message::FocusAddApplicationSearch => { + // retry until the widget is in the tree and focused or the dialog is removed. + if matches!(self.context, Some(Context::AddApplication(_))) { + return cosmic::iced::runtime::task::widget( + cosmic::iced::core::widget::operation::focusable::find_focused(), + ) + .collect() + .then(|id| { + if id + .first() + .is_some_and(|id| *id == ADD_APPLICATION_SEARCH.clone()) + { + Task::none() + } else { + focus(ADD_APPLICATION_SEARCH.clone()) + .chain(task::message(Message::FocusAddApplicationSearch)) + } + }); + } + } _ => {} } @@ -433,6 +468,14 @@ fn apps() -> Section { }) } +fn sort_entries_by_name(entries: &mut [DesktopEntry], locales: &[String]) { + entries.sort_by_cached_key(|e| { + e.name(locales) + .map(|n| n.to_lowercase()) + .unwrap_or_else(|| e.appid.to_lowercase()) + }); +} + fn get_all_apps(locales: Vec) -> Vec { let mut dedupe = HashSet::new(); @@ -473,5 +516,7 @@ fn get_all_apps(locales: Vec) -> Vec { dedupe.insert(app_id.to_owned()); } + sort_entries_by_name(&mut result, &locales); + result } diff --git a/cosmic-settings/src/pages/bluetooth/mod.rs b/cosmic-settings/src/pages/bluetooth/mod.rs index f8d1338..8676665 100644 --- a/cosmic-settings/src/pages/bluetooth/mod.rs +++ b/cosmic-settings/src/pages/bluetooth/mod.rs @@ -3,7 +3,8 @@ use cosmic::iced::core::text::Wrapping; use cosmic::iced::{Alignment, Length, color}; -use cosmic::widget::{self, settings, space::horizontal as horizontal_space, text}; +use cosmic::widget::space::horizontal as horizontal_space; +use cosmic::widget::{self, settings, text}; use cosmic::{Apply, Element, Task, theme}; use cosmic_settings_bluetooth_subscription::*; use cosmic_settings_page::{self as page, Section, section}; @@ -15,24 +16,25 @@ use std::sync::Arc; use std::time::Duration; use zbus::zvariant::OwnedObjectPath; +#[cfg(test)] +use crate::service_manager::MockServiceManager; +use crate::service_manager::ServiceManagerHandle; + enum Dialog { - // RequestAuthorization { - // device: OwnedObjectPath, - // response: oneshot::Sender, - // }, RequestConfirmation { device: String, passkey: u32, response: oneshot::Sender, }, - // RequestPasskey { - // device: OwnedObjectPath, - // response: oneshot::Sender>, - // }, - // RequestPinCode { - // device: OwnedObjectPath, - // response: oneshot::Sender>, - // }, + DisplayPasskey { + device: String, + passkey: u32, + entered: u16, + }, + DisplayPinCode { + device: String, + pincode: String, + }, } #[derive(Default)] @@ -160,6 +162,8 @@ pub struct Page { service_is_active: bool, subscription: Option>, + + service_manager: ServiceManagerHandle, } impl page::Page for Page { @@ -255,6 +259,85 @@ impl page::Page for Page { Some(dialog) } + + Dialog::DisplayPasskey { + device, + passkey, + entered, + } => { + let description = widget::text::body(fl!( + "bluetooth-display-passkey", + "description", + device = device + )) + .wrapping(Wrapping::Word); + + let passkey_str = format!("{passkey:06}"); + let entered = *entered as usize; + + let pin = widget::text::title1(passkey_str) + .width(Length::Fill) + .align_x(Alignment::Center) + .wrapping(Wrapping::None); + + let mut control = widget::column::with_capacity(3).push(description).push(pin); + + // Only show the key progress counter when the device actually + // reports keypress notifications. Most keyboards don't support + // this, so entered stays at 0 for the entire pairing process. + if entered > 0 { + let progress = widget::text::body(format!("{entered} / 6 keys entered")) + .width(Length::Fill) + .align_x(Alignment::Center) + .wrapping(Wrapping::None); + control = control.push(progress); + } + + let control = control.spacing(theme::spacing().space_xxs); + + let cancel_button = + widget::button::standard(fl!("cancel")).on_press(Message::PinCancel); + + let dialog = widget::dialog() + .title(fl!("bluetooth-display-passkey")) + .control(control) + .secondary_action(cancel_button) + .apply(Element::from) + .map(Into::into); + + Some(dialog) + } + + Dialog::DisplayPinCode { device, pincode } => { + let description = widget::text::body(fl!( + "bluetooth-display-pin", + "description", + device = device + )) + .wrapping(Wrapping::Word); + + let pin = widget::text::title1(pincode.clone()) + .width(Length::Fill) + .align_x(Alignment::Center) + .wrapping(Wrapping::None); + + let control = widget::column::with_capacity(2) + .push(description) + .push(pin) + .spacing(theme::spacing().space_xxs); + + let cancel_button = + widget::button::standard(fl!("cancel")).on_press(Message::PinCancel); + + let dialog = widget::dialog() + .title(fl!("bluetooth-display-pin")) + .control(control) + .secondary_action(cancel_button) + .apply(Element::from) + .map(Into::into); + + Some(dialog) + } } } } @@ -401,6 +484,19 @@ impl Page { } Event::UpdatedDevice(path, update) => { + // Dismiss passkey/pin display dialogs when pairing completes, + // since BlueZ may not always send Cancel after a successful pair. + if update + .iter() + .any(|u| matches!(u, DeviceUpdate::Paired(true))) + && matches!( + self.dialog, + Some(Dialog::DisplayPasskey { .. } | Dialog::DisplayPinCode { .. }) + ) + { + self.dialog = None; + } + if let Some(existing) = self.model.devices.get_mut(&path) { tracing::debug!("Device {} updated", existing.address); existing.update(update); @@ -434,7 +530,18 @@ impl Page { } Event::DBusServiceUnknown => { - self.bluez_service_unknown = true; + // D-Bus activation for org.bluez is absent. On systemd this usually + // means bluez isn't installed; on OpenRC it may be installed but lack + // the D-Bus service file. Check the service manager to disambiguate. + if self.service_manager.is_installed() { + // Service manager confirms the service exists — query its real state. + self.bluez_service_unknown = false; + self.service_is_active = self.service_manager.is_active(); + self.service_is_enabled = self.service_manager.is_enabled(); + } else { + // Genuinely not installed — let status() show the unknown message. + self.bluez_service_unknown = true; + } } Event::Agent(message) => { @@ -464,6 +571,32 @@ impl Page { }); } + bluez_zbus::agent1::Message::DisplayPasskey { + device, + passkey, + entered, + } => { + let device = self.model.devices.get(&device).map_or_else( + || device.to_string(), + |device| device.alias_or_addr().to_owned(), + ); + + self.dialog = Some(Dialog::DisplayPasskey { + device, + passkey, + entered, + }); + } + + bluez_zbus::agent1::Message::DisplayPinCode { device, pincode } => { + let device = self.model.devices.get(&device).map_or_else( + || device.to_string(), + |device| device.alias_or_addr().to_owned(), + ); + + self.dialog = Some(Dialog::DisplayPinCode { device, pincode }); + } + bluez_zbus::agent1::Message::RequestPasskey { response, .. } => { _ = response.send(None); } @@ -552,8 +685,8 @@ impl Page { } Message::DBusConnect(connection) => { - self.service_is_active = systemd::is_bluetooth_active(); - self.service_is_enabled = systemd::is_bluetooth_enabled(); + self.service_is_active = self.service_manager.is_active(); + self.service_is_enabled = self.service_manager.is_enabled(); self.connection = Some(connection.clone()); let get_adapters_fut = get_adapters(connection.clone()); @@ -685,8 +818,9 @@ impl Page { } Message::ServiceActivate => { - return cosmic::task::future(async { - systemd::activate_bluetooth().await; + let activate_future = self.service_manager.activate(); + return cosmic::task::future(async move { + activate_future.await; tokio::time::sleep(Duration::from_secs(3)).await; match zbus::Connection::system().await { @@ -697,8 +831,9 @@ impl Page { } Message::ServiceEnable => { - return cosmic::task::future(async { - systemd::enable_bluetooth().await; + let enable_future = self.service_manager.enable(); + return cosmic::task::future(async move { + enable_future.await; tokio::time::sleep(Duration::from_secs(3)).await; match zbus::Connection::system().await { @@ -757,7 +892,7 @@ fn status() -> Section { return bluetooth_service_issue( fl!("bluetooth", "inactive"), fl!("activate"), - Message::ServiceEnable, + Message::ServiceActivate, ); } @@ -1010,36 +1145,65 @@ fn multiple_adapter() -> Section { impl page::AutoBind for Page {} -mod systemd { - use futures::FutureExt; - - pub fn activate_bluetooth() -> impl Future + Send { - tokio::process::Command::new("pkexec") - .args(["systemctl", "start", "bluetooth"]) - .status() - .map(|_| ()) - } - - pub fn enable_bluetooth() -> impl Future + Send { - tokio::process::Command::new("pkexec") - .args(["systemctl", "enable", "--now", "bluetooth"]) - .status() - .map(|_| ()) - } - - pub fn is_bluetooth_enabled() -> bool { - std::process::Command::new("systemctl") - .args(["is-enabled", "bluetooth"]) - .status() - .map(|status| status.success()) - .unwrap_or(true) - } - - pub fn is_bluetooth_active() -> bool { - std::process::Command::new("systemctl") - .args(["is-active", "bluetooth"]) - .status() - .map(|status| status.success()) - .unwrap_or(true) +impl Page { + #[cfg(test)] + fn with_service_manager(service_manager: ServiceManagerHandle) -> Self { + Self { + service_manager, + ..Page::default() + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_dbus_service_unknown_with_installed_service_queries_manager() { + let bluetooth = MockServiceManager::new(true, false); + let mut page = Page::with_service_manager(ServiceManagerHandle::new(Box::new(bluetooth))); + let _task = page.update(Message::BluetoothEvent(Event::DBusServiceUnknown)); + + assert!(page.service_is_enabled); + assert!(!page.service_is_active); + assert!(!page.bluez_service_unknown); + } + + #[test] + fn test_dbus_service_unknown_with_uninstalled_service_sets_bluez_unknown() { + let bluetooth = MockServiceManager::new(true, true).with_installed(false); + let mut page = Page::with_service_manager(ServiceManagerHandle::new(Box::new(bluetooth))); + let _task = page.update(Message::BluetoothEvent(Event::DBusServiceUnknown)); + + assert!(page.bluez_service_unknown); + assert!(!page.service_is_enabled); + assert!(!page.service_is_active); + } + + #[test] + fn test_dbus_service_unknown_clears_previously_set_bluez_service_unknown() { + // Simulate a stale state and verify the handler re-checks via is_installed(). + let bluetooth = MockServiceManager::new(true, true); + let mut page = Page::with_service_manager(ServiceManagerHandle::new(Box::new(bluetooth))); + page.bluez_service_unknown = true; + + let _task = page.update(Message::BluetoothEvent(Event::DBusServiceUnknown)); + + assert!(!page.bluez_service_unknown); + } + + #[tokio::test] + async fn test_service_activate_calls_through_to_service_manager() { + let bluetooth = MockServiceManager::new(false, false); + let mut page = Page::with_service_manager(ServiceManagerHandle::new(Box::new(bluetooth))); + let _task = page.update(Message::ServiceActivate); + } + + #[tokio::test] + async fn test_service_enable_calls_through_to_service_manager() { + let bluetooth = MockServiceManager::new(false, false); + let mut page = Page::with_service_manager(ServiceManagerHandle::new(Box::new(bluetooth))); + let _task = page.update(Message::ServiceEnable); } } diff --git a/cosmic-settings/src/pages/desktop/appearance/drawer.rs b/cosmic-settings/src/pages/desktop/appearance/drawer.rs index 7b7caa0..4d8334f 100644 --- a/cosmic-settings/src/pages/desktop/appearance/drawer.rs +++ b/cosmic-settings/src/pages/desktop/appearance/drawer.rs @@ -2,12 +2,11 @@ use cosmic::app::{ContextDrawer, context_drawer}; use cosmic::config::CosmicTk; use cosmic::cosmic_config::{Config, ConfigSet}; use cosmic::cosmic_theme::Spacing; +use cosmic::iced::Alignment; use cosmic::iced::core::{Color, Length}; -use cosmic::widget::{ - ColorPickerModel, color_picker::ColorPickerUpdate, container, flex_row, settings, text, -}; -use cosmic::{Apply, Task}; -use cosmic::{Element, widget}; +use cosmic::widget::color_picker::ColorPickerUpdate; +use cosmic::widget::{ColorPickerModel, container, flex_row, row, settings, slider, text}; +use cosmic::{Apply, Element, Task, task, widget}; use cosmic_config::ConfigGet; use std::sync::Arc; use tracing::error; @@ -15,11 +14,8 @@ use tracing::error; use crate::app; use crate::widget::color_picker_context_view; -use super::{ - ContextView, Message, font_config, icon_themes, - icon_themes::{IconHandles, IconThemes}, - theme_manager, -}; +use super::icon_themes::{IconHandles, IconThemes}; +use super::{ContextView, Message, font_config, icon_themes, theme_manager}; pub struct Content { context_view: Option, @@ -40,6 +36,12 @@ pub struct Content { icon_themes: IconThemes, icon_handles: IconHandles, tk_config: Option, + frosted: u8, + glass: f32, + frosted_system_interface: bool, + frosted_windows: bool, + frosted_panel: bool, + frosted_applets: bool, comp_config: cosmic_config::Config, #[cfg(feature = "cosmic-comp-config")] @@ -94,7 +96,7 @@ impl From<&theme_manager::Manager> for Content { application_background: ColorPickerModel::new( &*HEX, &*RGB, - Some(theme.background.base.into()), + Some(theme.background(false).base.into()), theme_manager.get_color(&ContextView::ApplicationBackground), ), container_background: ColorPickerModel::new( @@ -106,7 +108,7 @@ impl From<&theme_manager::Manager> for Content { interface_text: ColorPickerModel::new( &*HEX, &*RGB, - Some(theme.background.on.into()), + Some(theme.background(false).on.into()), theme_manager.get_color(&ContextView::InterfaceText), ), control_component: ColorPickerModel::new( @@ -122,6 +124,12 @@ impl From<&theme_manager::Manager> for Content { theme_manager.get_color(&ContextView::AccentWindowHint), ), font_config: font_config::Model::new(), + frosted: theme.frosted as u8, + glass: theme.alpha_map.guess_offset(), + frosted_system_interface: theme.frosted_system_interface, + frosted_windows: theme.frosted_windows, + frosted_panel: theme.frosted_panel, + frosted_applets: theme.frosted_applets, icons_fetched: false, icon_global: cosmic::config::apply_theme_global(), icon_fetch_handle: None, @@ -285,6 +293,40 @@ impl Content { Task::none() } + pub fn update_frosted_system_interface(&mut self, v: bool) -> Task { + self.frosted_system_interface = v; + + Task::none() + } + + pub fn update_frosted_windows(&mut self, v: bool) -> Task { + self.frosted_windows = v; + + Task::none() + } + + pub fn update_frosted_panel(&mut self, v: bool) -> Task { + self.frosted_panel = v; + + Task::none() + } + + pub fn update_frosted_applets(&mut self, v: bool) -> Task { + self.frosted_applets = v; + + Task::none() + } + + pub fn update_blur(&mut self, v: u8) -> Task { + self.frosted = v; + Task::none() + } + + pub fn update_glass(&mut self, v: f32) -> Task { + self.glass = v; + Task::none() + } + pub fn on_open(&mut self, context_view: &ContextView) -> Task { match *context_view { ContextView::IconsAndToolkit => { @@ -300,6 +342,7 @@ impl Content { } ContextView::MonospaceFont | ContextView::SystemFont => { self.font_config.reset(); + return task::message(super::Message::FocusFontInput); } _ => {} } @@ -331,7 +374,7 @@ impl Content { self.application_background = ColorPickerModel::new( &*HEX, &*RGB, - Some(manager.theme().background.base.into()), + Some(manager.theme().background(false).base.into()), manager.get_color(&ContextView::ApplicationBackground), ); self.custom_accent = ColorPickerModel::new( @@ -349,7 +392,7 @@ impl Content { self.interface_text = ColorPickerModel::new( &*HEX, &*RGB, - Some(manager.theme().background.on.into()), + Some(manager.theme().background(false).on.into()), manager.get_color(&ContextView::InterfaceText), ); self.control_component = ColorPickerModel::new( @@ -475,6 +518,10 @@ impl Content { self.shadow_and_corners(), crate::pages::Message::CloseContextDrawer, ), + ContextView::FrostedGlass => context_drawer( + self.frosted_glass(), + crate::pages::Message::CloseContextDrawer, + ), }) } @@ -558,4 +605,66 @@ impl Content { .apply(Element::from) .map(crate::pages::Message::Appearance) } + + pub fn frosted_glass(&self) -> Element<'_, crate::pages::Message> { + settings::section() + .add( + settings::item::builder(fl!("style", "frosted-panels")) + .description(fl!("style", "frosted-panels-desc")) + .toggler(self.frosted_panel, Message::FrostedPanel), + ) + .add( + settings::item::builder(fl!("style", "frosted-applets")) + .description(fl!("style", "frosted-applets-desc")) + .toggler(self.frosted_applets, Message::FrostedApplets), + ) + .add( + settings::item::builder(fl!("style", "frosted-system-interface")) + .description(fl!("style", "frosted-system-interface-desc")) + .toggler( + self.frosted_system_interface, + Message::FrostedSystemInterface, + ), + ) + .add( + settings::item::builder(fl!("style", "frosted-windows")) + .description(fl!("style", "frosted-windows-desc")) + .toggler(self.frosted_windows, Message::FrostedWindows), + ) + .add( + settings::item::builder(fl!("style", "frosted-thickness")).flex_control({ + row::with_children(vec![ + text::body(fl!("style", "less")).into(), + slider(0..=13, self.frosted, Message::Blur) + .width(Length::Fill) + .apply(cosmic::widget::container) + .max_width(250) + .into(), + text::body(fl!("style", "more")).into(), + ]) + .align_y(Alignment::Center) + .spacing(8) + .width(Length::Fill) + }), + ) + .add( + settings::item::builder(fl!("style", "glass-opacity")).flex_control({ + row::with_children(vec![ + text::body(fl!("style", "less")).into(), + slider(0.0..=1.0, self.glass, Message::Glass) + .step(0.05) + .width(Length::Fill) + .apply(cosmic::widget::container) + .max_width(250) + .into(), + text::body(fl!("style", "more")).into(), + ]) + .align_y(Alignment::Center) + .spacing(8) + .width(Length::Fill) + }), + ) + .apply(Element::from) + .map(crate::pages::Message::Appearance) + } } diff --git a/cosmic-settings/src/pages/desktop/appearance/font_config.rs b/cosmic-settings/src/pages/desktop/appearance/font_config.rs index d2b2558..420a044 100644 --- a/cosmic-settings/src/pages/desktop/appearance/font_config.rs +++ b/cosmic-settings/src/pages/desktop/appearance/font_config.rs @@ -1,20 +1,20 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::sync::Arc; +use std::sync::{Arc, LazyLock}; -use cosmic::{ - Apply, Element, Task, - config::{CosmicTk, FontConfig}, - widget, -}; +use cosmic::config::{CosmicTk, FontConfig}; +use cosmic::{Apply, Element, Task, widget}; use cosmic_config::ConfigSet; +use mime::FONT; use crate::app; use crate::widget::selection_context_item; use super::{ContextView, Message, drawer}; +pub static FONT_SEARCH: LazyLock = LazyLock::new(|| widget::Id::new("FONT_SEARCH")); + const INTERFACE_FONT: &str = "interface_font"; const MONOSPACE_FONT: &str = "monospace_font"; @@ -167,6 +167,7 @@ impl Model { .on_clear(Message::DrawerFont(drawer::FontMessage::Search( String::new(), ))) + .id(FONT_SEARCH.clone()) .apply(Element::from) .map(crate::pages::Message::Appearance) } diff --git a/cosmic-settings/src/pages/desktop/appearance/icon_themes.rs b/cosmic-settings/src/pages/desktop/appearance/icon_themes.rs index 5dc4620..112568c 100644 --- a/cosmic-settings/src/pages/desktop/appearance/icon_themes.rs +++ b/cosmic-settings/src/pages/desktop/appearance/icon_themes.rs @@ -1,14 +1,13 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::{collections::BTreeMap, path::PathBuf}; +use std::collections::BTreeMap; +use std::path::PathBuf; use super::Message; -use cosmic::{ - Element, - iced::{Background, Length}, - widget::{button, icon, text}, -}; +use cosmic::Element; +use cosmic::iced::{Background, Length}; +use cosmic::widget::{button, icon, text}; use tokio::io::AsyncBufReadExt; const ICON_PREV_N: usize = 6; diff --git a/cosmic-settings/src/pages/desktop/appearance/mod.rs b/cosmic-settings/src/pages/desktop/appearance/mod.rs index aa28ea8..594656e 100644 --- a/cosmic-settings/src/pages/desktop/appearance/mod.rs +++ b/cosmic-settings/src/pages/desktop/appearance/mod.rs @@ -16,23 +16,24 @@ use cosmic::app::ContextDrawer; use cosmic::config::CosmicTk; use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry}; use cosmic::cosmic_theme::palette::{FromColor, Hsv, Srgb}; -use cosmic::cosmic_theme::{CornerRadii, Density, ThemeBuilder, ThemeMode}; +use cosmic::cosmic_theme::{CornerRadii, Density, Roundness, ThemeBuilder, ThemeMode}; #[cfg(feature = "xdg-portal")] use cosmic::dialog::file_chooser::{self, FileFilter}; use cosmic::iced::Subscription; use cosmic::iced::core::{Alignment, Length}; -use cosmic::widget::{ - button, color_picker::ColorPickerUpdate, container, row, settings, space::horizontal, text, -}; -use cosmic::{Apply, Element, Task, widget}; +use cosmic::widget::color_picker::ColorPickerUpdate; +use cosmic::widget::space::horizontal; +use cosmic::widget::text_input::focus; +use cosmic::widget::{button, container, row, settings, text}; +use cosmic::{Apply, Element, Task, task, widget}; #[cfg(feature = "wayland")] use cosmic_panel_config::CosmicPanelConfig; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use ron::ser::PrettyConfig; use slotmap::{Key, SlotMap}; use crate::app; +use crate::pages::desktop::appearance::font_config::FONT_SEARCH; #[derive(Clone, Copy, Debug)] pub enum ContextView { @@ -40,6 +41,7 @@ pub enum ContextView { ApplicationBackground, ContainerBackground, ControlComponent, + FrostedGlass, #[cfg(feature = "cosmic-comp-config")] ShadowAndCorners, CustomAccent, @@ -139,6 +141,7 @@ pub enum Message { #[cfg(feature = "xdg-portal")] ExportSuccess, + FocusFontInput, GapSize(u32), #[cfg(feature = "xdg-portal")] ImportError, @@ -157,6 +160,12 @@ pub enum Message { UseDefaultWindowHint(bool), WindowHintSize(u32), Daytime(bool), + Blur(u8), + Glass(f32), + FrostedPanel(bool), + FrostedApplets(bool), + FrostedSystemInterface(bool), + FrostedWindows(bool), } impl From for crate::app::Message { @@ -171,56 +180,6 @@ impl From for crate::pages::Message { } } -#[derive(Debug, Clone, Copy)] -pub enum Roundness { - Round, - SlightlyRound, - Square, -} - -impl From for CornerRadii { - fn from(value: Roundness) -> Self { - match value { - Roundness::Round => CornerRadii { - radius_0: [0.0; 4], - radius_xs: [4.0; 4], - radius_s: [8.0; 4], - radius_m: [16.0; 4], - radius_l: [32.0; 4], - radius_xl: [160.0; 4], - }, - Roundness::SlightlyRound => CornerRadii { - radius_0: [0.0; 4], - radius_xs: [2.0; 4], - radius_s: [8.0; 4], - radius_m: [8.0; 4], - radius_l: [8.0; 4], - radius_xl: [8.0; 4], - }, - Roundness::Square => CornerRadii { - radius_0: [0.0; 4], - radius_xs: [2.0; 4], - radius_s: [2.0; 4], - radius_m: [2.0; 4], - radius_l: [2.0; 4], - radius_xl: [2.0; 4], - }, - } - } -} - -impl From for Roundness { - fn from(value: CornerRadii) -> Self { - if (value.radius_m[0] - 16.0).abs() < 0.01 { - Self::Round - } else if (value.radius_m[0] - 8.0).abs() < 0.01 { - Self::SlightlyRound - } else { - Self::Square - } - } -} - impl Page { #[allow(clippy::too_many_lines)] pub fn update(&mut self, message: Message) -> Task { @@ -241,6 +200,7 @@ impl Page { Message::DrawerOpen(context_view) => { self.context_view = Some(context_view); + self.drawer = drawer::Content::from(&self.theme_manager); tasks.push(cosmic::task::message( crate::app::Message::OpenContextDrawer(self.entity), )); @@ -289,8 +249,8 @@ impl Page { #[cfg(feature = "wayland")] tokio::task::spawn(async move { - Self::update_panel_radii(r); Self::update_dock_padding(r); + Self::update_panel_radii(r); }); } @@ -556,6 +516,86 @@ impl Page { self.drawer.reset(&self.theme_manager); } } + + Message::FocusFontInput => { + // retry until the widget is in the tree and focused or the dialog is removed. + if matches!( + self.context_view, + Some(ContextView::SystemFont | ContextView::MonospaceFont) + ) { + return cosmic::iced::runtime::task::widget( + cosmic::iced::core::widget::operation::focusable::find_focused(), + ) + .collect() + .then(|id| { + if id.first().is_some_and(|id| *id == FONT_SEARCH.clone()) { + Task::none() + } else { + focus(FONT_SEARCH.clone()).chain(task::message(Message::FocusFontInput)) + } + }); + } + } + Message::Blur(b) => { + let Ok(blur_strength) = b.try_into() else { + tracing::error!("Invalid blur strength: {b}"); + return Task::none(); + }; + theme_staged = self.theme_manager.set_frosted(blur_strength).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + + tasks.push(self.drawer.update_blur(blur_strength as u8)); + } + Message::Glass(glass) => { + let mut alpha_map = cosmic::cosmic_theme::AlphaMap::default(); + let glass_offset_min = alpha_map.extremely_high_2; + let glass_offset_max = 1.0 - alpha_map.extremely_low; + let offset = (glass - 0.5) / 0.5 + * if glass < 0.5 { + glass_offset_min + } else { + glass_offset_max + }; + alpha_map = alpha_map.offset(offset); + + // TODO optimize and apply to both light and dark themes + theme_staged = self.theme_manager.set_glass(alpha_map).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + + tasks.push(self.drawer.update_glass(glass)); + } + Message::FrostedSystemInterface(v) => { + theme_staged = self.theme_manager.set_frosted_system_interface(v).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + tasks.push(self.drawer.update_frosted_system_interface(v)); + } + Message::FrostedWindows(v) => { + theme_staged = self.theme_manager.set_frosted_windows(v).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + tasks.push(self.drawer.update_frosted_windows(v)); + } + Message::FrostedPanel(v) => { + theme_staged = self.theme_manager.set_frosted_panel(v).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + tasks.push(self.drawer.update_frosted_panel(v)); + } + Message::FrostedApplets(v) => { + theme_staged = self.theme_manager.set_frosted_applets(v).map(|_| { + self.drawer.reset(&self.theme_manager); + theme_manager::ThemeStaged::Current + }); + tasks.push(self.drawer.update_frosted_applets(v)); + } } let mut tasks = cosmic::Task::batch(tasks); @@ -570,113 +610,66 @@ impl Page { } // TODO: cache panel and dock configs so that they needn't be re-read + #[cfg(feature = "wayland")] + fn load_panel_config(name: &str) -> Option<(Config, CosmicPanelConfig)> { + let helper = CosmicPanelConfig::cosmic_config(name).ok()?; + let config = CosmicPanelConfig::get_entry(&helper).ok()?; + (config.name == name).then_some((helper, config)) + } + #[cfg(feature = "wayland")] pub fn update_panel_radii(roundness: Roundness) { - let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); - let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); + let corner_radii: CornerRadii = roundness.into(); + let radius = corner_radii.radius_xl[0] as u32; - let mut panel_config = panel_config_helper.as_ref().and_then(|config_helper| { - let panel_config = CosmicPanelConfig::get_entry(config_helper).ok()?; - (panel_config.name == "Panel").then_some(panel_config) - }); + for name in ["Panel", "Dock"] { + let Some((helper, mut config)) = Self::load_panel_config(name) else { + continue; + }; - let mut dock_config = dock_config_helper.as_ref().and_then(|config_helper| { - let panel_config = CosmicPanelConfig::get_entry(config_helper).ok()?; - (panel_config.name == "Dock").then_some(panel_config) - }); - - if let Some(panel_config_helper) = panel_config_helper.as_ref() - && let Some(panel_config) = panel_config.as_mut() - { - let radii = if panel_config.anchor_gap { - let cornder_radii: CornerRadii = roundness.into(); - cornder_radii.radius_xl[0] as u32 - } else if matches!(roundness, Roundness::Round) && !panel_config.expand_to_edges { - 12 + let new_radius = if config.anchor_gap { + radius + } else if !config.expand_to_edges { + radius.min(12) } else { 0 }; - if let Err(why) = panel_config.set_border_radius(panel_config_helper, radii) { - tracing::error!(?why, "Error updating panel corner radii"); - } - } - - if let Some(dock_config_helper) = dock_config_helper.as_ref() - && let Some(dock_config) = dock_config.as_mut() - { - let radii = if dock_config.anchor_gap { - let cornder_radii: CornerRadii = roundness.into(); - cornder_radii.radius_xl[0] as u32 - } else if matches!(roundness, Roundness::Round) && !dock_config.expand_to_edges { - 12 - } else { - 0 - }; - - if let Err(why) = dock_config.set_border_radius(dock_config_helper, radii) { - tracing::error!(?why, "Error updating dock corner radii"); + if let Err(why) = config.set_border_radius(&helper, new_radius) { + tracing::error!(?why, "Error updating {name} corner radii"); } } } #[cfg(feature = "wayland")] pub fn update_dock_padding(roundness: Roundness) { - let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); + let Some((helper, mut config)) = Self::load_panel_config("Dock") else { + return; + }; - let mut dock_config = dock_config_helper.as_ref().and_then(|config_helper| { - let panel_config = CosmicPanelConfig::get_entry(config_helper).ok()?; - (panel_config.name == "Dock").then_some(panel_config) - }); + let padding = match roundness { + Roundness::Round | Roundness::SlightlyRound => 4, + Roundness::Square => 0, + }; - if let Some(dock_config_helper) = dock_config_helper.as_ref() - && let Some(dock_config) = dock_config.as_mut() - { - let padding = match roundness { - Roundness::Round => 4, - Roundness::SlightlyRound => 4, - Roundness::Square => 0, - }; - - if let Err(why) = dock_config.set_padding(dock_config_helper, padding) { - tracing::error!(?why, "Error updating dock padding"); - } + if let Err(why) = config.set_padding(&helper, padding) { + tracing::error!(?why, "Error updating dock padding"); } } - // TODO: cache panel and dock configs so that they needn't be re-read #[cfg(feature = "wayland")] pub fn update_panel_spacing(density: Density) { let spacing: cosmic::cosmic_theme::Spacing = density.into(); - let space_none = spacing.space_none; - let panel_config_helper = CosmicPanelConfig::cosmic_config("Panel").ok(); - let dock_config_helper = CosmicPanelConfig::cosmic_config("Dock").ok(); - let mut panel_config = panel_config_helper.as_ref().and_then(|config_helper| { - let panel_config = CosmicPanelConfig::get_entry(config_helper).ok()?; - (panel_config.name == "Panel").then_some(panel_config) - }); - let mut dock_config = dock_config_helper.as_ref().and_then(|config_helper| { - let panel_config = CosmicPanelConfig::get_entry(config_helper).ok()?; - (panel_config.name == "Dock").then_some(panel_config) - }); + let space_none = spacing.space_none as u32; - if let Some(panel_config_helper) = panel_config_helper.as_ref() - && let Some(panel_config) = panel_config.as_mut() - { - let update = panel_config.set_spacing(panel_config_helper, space_none as u32); - if let Err(err) = update { - tracing::error!(?err, "Error updating panel spacing"); + for name in ["Panel", "Dock"] { + let Some((helper, mut config)) = Self::load_panel_config(name) else { + continue; + }; + if let Err(err) = config.set_spacing(&helper, space_none) { + tracing::error!(?err, "Error updating {name} spacing"); } - }; - - if let Some(dock_config_helper) = dock_config_helper.as_ref() - && let Some(dock_config) = dock_config.as_mut() - { - let update = dock_config.set_spacing(dock_config_helper, space_none as u32); - if let Err(err) = update { - tracing::error!(?err, "Error updating dock spacing"); - } - }; + } } fn can_reset(&self) -> bool { diff --git a/cosmic-settings/src/pages/desktop/appearance/style.rs b/cosmic-settings/src/pages/desktop/appearance/style.rs index 6db3477..cfce2b1 100644 --- a/cosmic-settings/src/pages/desktop/appearance/style.rs +++ b/cosmic-settings/src/pages/desktop/appearance/style.rs @@ -1,9 +1,12 @@ -use cosmic::iced::core::{Alignment, Length, text::Wrapping}; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::core::{Alignment, Length}; use cosmic::widget::icon::{from_name, icon}; use cosmic::widget::{button, container, settings, text}; use cosmic::{Apply, Element}; use cosmic_settings_page::Section; +use crate::pages::desktop::appearance::ContextView; + use super::{Message, Page, Roundness}; #[allow(clippy::too_many_lines)] @@ -12,6 +15,7 @@ pub fn section() -> Section { round = fl!("style", "round"); slightly_round = fl!("style", "slightly-round"); square = fl!("style", "square"); + frosted_glass = fl!("style", "frosted-glass"); }); let dark_round_style = from_name("illustration-appearance-dark-style-round").handle(); @@ -136,6 +140,10 @@ pub fn section() -> Section { ) .center_x(Length::Fill), ) + .add(crate::widget::go_next_item( + &descriptions[frosted_glass], + Message::DrawerOpen(ContextView::FrostedGlass), + )) .apply(Element::from) .map(crate::pages::Message::Appearance) }) diff --git a/cosmic-settings/src/pages/desktop/appearance/theme_manager.rs b/cosmic-settings/src/pages/desktop/appearance/theme_manager.rs index 12d8cc6..ac26c63 100644 --- a/cosmic-settings/src/pages/desktop/appearance/theme_manager.rs +++ b/cosmic-settings/src/pages/desktop/appearance/theme_manager.rs @@ -1,8 +1,8 @@ use cosmic::cosmic_config::{Config, ConfigSet, CosmicConfigEntry}; use cosmic::cosmic_theme::palette::{Srgb, Srgba}; use cosmic::cosmic_theme::{ - CornerRadii, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, Spacing, Theme, ThemeBuilder, - ThemeMode, + AlphaMap, BlurStrength, CornerRadii, DARK_THEME_BUILDER_ID, LIGHT_THEME_BUILDER_ID, Spacing, + Theme, ThemeBuilder, ThemeMode, }; use cosmic::iced::core::Color; @@ -74,7 +74,7 @@ impl From<(Option, Option, Option>)> for ThemeCustomi .success(theme.success.base.color) .warning(theme.warning.base.color) .neutral_tint(theme.palette.neutral_5.color) - .text_tint(theme.background.on.color); + .text_tint(theme.background(false).on.color); theme_builder.gaps = theme.gaps; @@ -160,20 +160,6 @@ impl Default for Manager { impl Manager { pub fn build_theme(&mut self, stage: ThemeStaged) -> Task { - macro_rules! theme_transaction { - ($config:ident, $current_theme:ident, $new_theme:ident, { $($name:ident;)+ }) => { - let tx = $config.transaction(); - - $( - if $current_theme.$name != $new_theme.$name { - _ = tx.set(stringify!($name), $new_theme.$name.clone()); - } - )+ - - _ = tx.commit(); - } - } - let map_data_fn = |customizer: &ThemeCustomizer| { (customizer.builder.0.clone(), customizer.theme.1.clone()) }; @@ -199,32 +185,80 @@ impl Manager { cosmic::task::future(async move { for (builder, config) in data.by_ref() { if let Some(config) = config { - let current_theme = match Theme::get_entry(&config) { + let cur = match Theme::get_entry(&config) { Ok(theme) => theme, Err((_errs, theme)) => theme, }; - let new_theme = builder.build(); - theme_transaction!(config, current_theme, new_theme, { - accent; - accent_button; - background; - button; - destructive; - destructive_button; - link_button; - icon_button; - palette; - primary; - secondary; - shade; - success; - text_button; - warning; - warning_button; - window_hint; - accent_text; - }); + let new = builder.build(); + + // do this without the macro + let tx = config.transaction(); + + if cur.accent != new.accent { + _ = tx.set("accent", new.accent.clone()); + } + if cur.accent_button != new.accent_button { + _ = tx.set("accent_button", new.accent_button.clone()); + } + if cur.background(false) != new.background(false) { + _ = tx.set("background", new.background(false).clone()); + } + if cur.background(true) != new.background(true) { + _ = tx.set("transparent_background", new.background(true).clone()); + } + if cur.button != new.button { + _ = tx.set("button", new.button.clone()); + } + if cur.destructive != new.destructive { + _ = tx.set("destructive", new.destructive.clone()); + } + if cur.destructive_button != new.destructive_button { + _ = tx.set("destructive_button", new.destructive_button.clone()); + } + if cur.link_button != new.link_button { + _ = tx.set("link_button", new.link_button.clone()); + } + if cur.icon_button != new.icon_button { + _ = tx.set("icon_button", new.icon_button.clone()); + } + if cur.palette != new.palette { + _ = tx.set("palette", new.palette.clone()); + } + if cur.primary(false) != new.primary(false) { + _ = tx.set("primary", new.primary(false).clone()); + } + if cur.secondary(false) != new.secondary(false) { + _ = tx.set("secondary", new.secondary(false).clone()); + } + if cur.primary(true) != new.primary(true) { + _ = tx.set("transparent_primary", new.primary(true).clone()); + } + if cur.secondary(true) != new.secondary(true) { + _ = tx.set("transparent_secondary", new.secondary(true).clone()); + } + if cur.shade != new.shade { + _ = tx.set("shade", new.shade.clone()); + } + if cur.success != new.success { + _ = tx.set("success", new.success.clone()); + } + if cur.text_button != new.text_button { + _ = tx.set("text_button", new.text_button.clone()); + } + if cur.warning != new.warning { + _ = tx.set("warning", new.warning.clone()); + } + if cur.warning_button != new.warning_button { + _ = tx.set("warning_button", new.warning_button.clone()); + } + if cur.window_hint != new.window_hint { + _ = tx.set("window_hint", new.window_hint.clone()); + } + if cur.accent_text != new.accent_text { + _ = tx.set("accent_text", new.accent_text.clone()); + } + _ = tx.commit(); } } @@ -360,6 +394,39 @@ impl Manager { Some(ThemeStaged::Both) } + pub fn set_frosted(&mut self, frosted: BlurStrength) -> Option { + self.dark.set_frosted(frosted)?; + self.light.set_frosted(frosted)?; + Some(ThemeStaged::Both) + } + + pub fn set_glass(&mut self, alpha_map: AlphaMap) -> Option { + self.dark.set_glass(alpha_map)?; + self.light.set_glass(alpha_map)?; + Some(ThemeStaged::Both) + } + + pub fn set_frosted_panel(&mut self, enabled: bool) -> Option { + self.dark.set_frosted_panel(enabled)?; + self.light.set_frosted_panel(enabled)?; + Some(ThemeStaged::Both) + } + pub fn set_frosted_applets(&mut self, enabled: bool) -> Option { + self.dark.set_frosted_applets(enabled)?; + self.light.set_frosted_applets(enabled)?; + Some(ThemeStaged::Both) + } + pub fn set_frosted_system_interface(&mut self, enabled: bool) -> Option { + self.dark.set_frosted_system_interface(enabled)?; + self.light.set_frosted_system_interface(enabled)?; + Some(ThemeStaged::Both) + } + pub fn set_frosted_windows(&mut self, enabled: bool) -> Option { + self.dark.set_frosted_windows(enabled)?; + self.light.set_frosted_windows(enabled)?; + Some(ThemeStaged::Both) + } + pub fn get_color(&self, context: &ContextView) -> Option { match *context { ContextView::CustomAccent => self.custom_accent().map(Color::from), @@ -540,6 +607,81 @@ impl ThemeCustomizer { Some(ThemeStaged::Current) } + pub fn set_frosted(&mut self, frosted: BlurStrength) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder.0.set_frosted(config, frosted).ok()?; + self.theme + .0 + .set_frosted(self.theme.1.as_ref()?, frosted) + .ok()?; + + Some(ThemeStaged::Current) + } + + pub fn set_glass(&mut self, alpha_map: AlphaMap) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder.0.set_alpha_map(config, alpha_map).ok()?; + self.theme + .0 + .set_alpha_map(self.theme.1.as_ref()?, alpha_map) + .ok()?; + + Some(ThemeStaged::Current) + } + + pub fn set_frosted_windows(&mut self, enabled: bool) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder.0.set_frosted_windows(config, enabled).ok()?; + self.theme + .0 + .set_frosted_windows(self.theme.1.as_ref()?, enabled) + .ok()?; + + Some(ThemeStaged::Current) + } + + pub fn set_frosted_system_interface(&mut self, enabled: bool) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder + .0 + .set_frosted_system_interface(config, enabled) + .ok()?; + self.theme + .0 + .set_frosted_system_interface(self.theme.1.as_ref()?, enabled) + .ok()?; + + Some(ThemeStaged::Current) + } + + pub fn set_frosted_applets(&mut self, enabled: bool) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder.0.set_frosted_applets(config, enabled).ok()?; + self.theme + .0 + .set_frosted_applets(self.theme.1.as_ref()?, enabled) + .ok()?; + + Some(ThemeStaged::Current) + } + + pub fn set_frosted_panel(&mut self, enabled: bool) -> Option { + let config = self.builder.1.as_ref()?; + + self.builder.0.set_frosted_panel(config, enabled).ok()?; + self.theme + .0 + .set_frosted_panel(self.theme.1.as_ref()?, enabled) + .ok()?; + + Some(ThemeStaged::Current) + } + // set active hints is set on all themes to be consistent between dark & light themes. pub fn set_active_hint(&mut self, active_hint: u32) -> Option { let config = self.builder.1.as_ref()?; diff --git a/cosmic-settings/src/pages/desktop/dock/applets.rs b/cosmic-settings/src/pages/desktop/dock/applets.rs index 5dc1923..a8a9dc4 100644 --- a/cosmic-settings/src/pages/desktop/dock/applets.rs +++ b/cosmic-settings/src/pages/desktop/dock/applets.rs @@ -1,22 +1,16 @@ -use cosmic::{ - Apply, Element, Task, - app::ContextDrawer, - cosmic_config::CosmicConfigEntry, - iced::{Alignment, Length}, - widget::{button, container, row}, -}; +use cosmic::app::ContextDrawer; +use cosmic::cosmic_config::CosmicConfigEntry; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::{button, container, row}; +use cosmic::{Apply, Element, Task}; use cosmic_panel_config::CosmicPanelConfig; use cosmic_settings_page::{self as page, Section, section}; use slotmap::{Key, SlotMap}; use std::borrow::Cow; -use crate::{ - app, - pages::{ - self, - desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists}, - }, -}; +use crate::app; +use crate::pages::desktop::panel::applets_inner::{self, AppletsPage, ContextDrawerVariant, lists}; +use crate::pages::{self}; pub(crate) struct Page { inner: applets_inner::Page, diff --git a/cosmic-settings/src/pages/desktop/dock/mod.rs b/cosmic-settings/src/pages/desktop/dock/mod.rs index 40738aa..a118e91 100644 --- a/cosmic-settings/src/pages/desktop/dock/mod.rs +++ b/cosmic-settings/src/pages/desktop/dock/mod.rs @@ -1,11 +1,8 @@ use std::collections::HashMap; -use cosmic::Apply; -use cosmic::{ - Element, Task, - cosmic_config::{ConfigSet, CosmicConfigEntry}, - widget::{settings, text}, -}; +use cosmic::cosmic_config::{ConfigSet, CosmicConfigEntry}; +use cosmic::widget::{settings, text}; +use cosmic::{Apply, Element, Task}; use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig}; use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; diff --git a/cosmic-settings/src/pages/desktop/panel/applets_inner.rs b/cosmic-settings/src/pages/desktop/panel/applets_inner.rs index bd0ed6c..8f75940 100644 --- a/cosmic-settings/src/pages/desktop/panel/applets_inner.rs +++ b/cosmic-settings/src/pages/desktop/panel/applets_inner.rs @@ -10,23 +10,21 @@ use cosmic::iced; use cosmic::iced::core::clipboard::IconSurface; use cosmic::widget::{Column, button, column, container, icon, list_column, row, text, text_input}; -use cosmic::{ - Apply, Element, - cosmic_config::{Config, CosmicConfigEntry}, - iced::core::{ - Clipboard, Shell, Widget, layout, renderer, - widget::{Operation, Tree, tree}, - }, - iced::runtime::{Task, core::id::Id}, - iced::{ - Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, core::window, event, - mouse, overlay, touch, - }, - theme, +use cosmic::cosmic_config::{Config, CosmicConfigEntry}; +use cosmic::iced::core::widget::{Operation, Tree, tree}; +use cosmic::iced::core::{Clipboard, Shell, Widget, layout, renderer, window}; +use cosmic::iced::runtime::Task; +use cosmic::iced::runtime::core::id::Id; +use cosmic::iced::{ + Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, event, mouse, overlay, touch, }; +use cosmic::{Apply, Element, theme}; +use std::borrow::Cow; +use std::fmt::Debug; +use std::mem; use std::path::{Path, PathBuf}; -use std::{borrow::Cow, fmt::Debug, mem, sync::LazyLock}; +use std::sync::LazyLock; use crate::{app, pages}; use cosmic_panel_config::CosmicPanelConfig; diff --git a/cosmic-settings/src/pages/desktop/panel/inner.rs b/cosmic-settings/src/pages/desktop/panel/inner.rs index bcd7bb3..ea54337 100644 --- a/cosmic-settings/src/pages/desktop/panel/inner.rs +++ b/cosmic-settings/src/pages/desktop/panel/inner.rs @@ -1,12 +1,11 @@ -use cosmic::{ - Element, Task, - cctk::sctk::reexports::client::{Proxy, backend::ObjectId, protocol::wl_output::WlOutput}, - cosmic_config::{self, CosmicConfigEntry}, - cosmic_theme::Density, - iced::{Alignment, Length}, - surface, - widget::{button, container, dropdown, row, settings, slider, space, text}, -}; +use cosmic::cctk::sctk::reexports::client::Proxy; +use cosmic::cctk::sctk::reexports::client::backend::ObjectId; +use cosmic::cctk::sctk::reexports::client::protocol::wl_output::WlOutput; +use cosmic::cosmic_config::{self, CosmicConfigEntry}; +use cosmic::cosmic_theme::{Density, Roundness}; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::{button, container, dropdown, row, settings, slider, space, text}; +use cosmic::{Element, Task, surface}; use cosmic::Apply; use cosmic_config::ConfigSet; @@ -15,16 +14,15 @@ use cosmic_panel_config::{ CosmicPanelOuput, PanelAnchor, PanelSize, }; use cosmic_settings_page::{self as page, Section}; -use std::{collections::HashMap, time::Duration}; - -use crate::pages::desktop::appearance::Roundness; +use std::collections::HashMap; +use std::time::Duration; pub struct PageInner { pub(crate) config_helper: Option, pub(crate) panel_config: Option, - pub size: Option, pub opacity: f32, pub opacity_changing: bool, + pub size: PanelSize, pub outputs: Vec, pub anchors: Vec, pub backgrounds: Vec, @@ -40,9 +38,9 @@ impl Default for PageInner { Self { config_helper: Option::default(), panel_config: Option::default(), - size: Option::default(), opacity: 0.0, opacity_changing: false, + size: PanelSize::M, outputs: vec![fl!("all-displays")], anchors: vec![ Anchor(PanelAnchor::Left).to_string(), @@ -120,7 +118,7 @@ pub(crate) fn behavior_and_position< .title(§ion.title) .add( settings::item::builder(&descriptions[autohide_label]) - .toggler(panel_config.autohide.is_some(), Message::AutoHidePanel), + .toggler(panel_config.autohide_enabled(), Message::AutoHidePanel), ) .add(settings::item( &descriptions[position], @@ -209,9 +207,7 @@ pub(crate) fn style< text::body(fl!("small")).into(), slider( 0..=4, - match inner.size.as_ref().expect( - "PageInner.size is None even though PageInner.panel_config is Some", - ) { + match inner.size { PanelSize::XS => 0, PanelSize::S => 1, PanelSize::M => 2, @@ -506,7 +502,7 @@ impl PageInner { if let Err(err) = default.write_entry(config) { tracing::error!(?err, "Error resetting panel config."); } - self.size = Some(default.size.clone()); + self.size.clone_from(&default.size); self.system_default = Some(default.clone()); self.panel_config.clone_from(&self.system_default); } else { @@ -546,18 +542,10 @@ impl PageInner { Message::AutoHidePanel(enabled) => { if enabled { _ = panel_config.set_exclusive_zone(helper, false); - _ = panel_config.set_autohide( - helper, - Some(AutoHide { - wait_time: 1000, - transition_time: 200, - handle_size: 4, - unhide_delay: 200, - }), - ); + _ = panel_config.set_autohide(helper, AutoHide::OnOverlap); } else { _ = panel_config.set_exclusive_zone(helper, true); - _ = panel_config.set_autohide(helper, None); + _ = panel_config.set_autohide(helper, AutoHide::Never); } } Message::PanelAnchor(i) => { @@ -591,30 +579,21 @@ impl PageInner { } let theme = cosmic::theme::system_preference(); let theme = theme.cosmic(); - let radius = theme.corner_radii; - let roundness: Roundness = radius.into(); - let new_radius; - if enabled { - let radii = theme.corner_radii.radius_xl[0] as u32; - new_radius = radii; - } else if matches!(roundness, Roundness::Round) && !panel_config.expand_to_edges { - new_radius = 12; + let radius = theme.corner_radii.radius_xl[0] as u32; + let new_radius = if enabled { + radius + } else if !panel_config.expand_to_edges { + radius.min(12) } else { - new_radius = 0; - } + 0 + }; _ = panel_config.set_border_radius(helper, new_radius).unwrap(); } Message::PanelSize(size) => { - self.size = Some(size); + self.size = size; } Message::PanelSizeCommit => { - _ = panel_config.set_size( - helper, - self.size - .as_ref() - .expect("PageInner.size is None even though it should be Some, since PageInner.panel_config is Some") - .clone() - ); + _ = panel_config.set_size(helper, self.size.clone()); // Reset any size overrides the user might have set _ = panel_config.set_size_center(helper, None); _ = panel_config.set_size_wings(helper, None); @@ -632,17 +611,14 @@ impl PageInner { let theme = cosmic::theme::system_preference(); let theme = theme.cosmic(); - let radius = theme.corner_radii; - let roundness: Roundness = radius.into(); - let new_radius; - if panel_config.anchor_gap { - let radii = theme.corner_radii.radius_xl[0] as u32; - new_radius = radii; - } else if matches!(roundness, Roundness::Round) && !enabled { - new_radius = 12; + let radius = theme.corner_radii.radius_xl[0] as u32; + let new_radius = if panel_config.anchor_gap { + radius + } else if !enabled { + radius.min(12) } else { - new_radius = 0; - } + 0 + }; _ = panel_config.set_border_radius(helper, new_radius).unwrap(); } Message::OpacityRequest(opacity) => { @@ -677,7 +653,7 @@ impl PageInner { } } Message::PanelConfig(c) => { - self.size = Some(c.size.clone()); + self.size = c.size.clone(); self.panel_config = Some(*c); return Task::none(); } diff --git a/cosmic-settings/src/pages/desktop/panel/mod.rs b/cosmic-settings/src/pages/desktop/panel/mod.rs index 7748618..72aa66b 100644 --- a/cosmic-settings/src/pages/desktop/panel/mod.rs +++ b/cosmic-settings/src/pages/desktop/panel/mod.rs @@ -1,6 +1,7 @@ use std::collections::HashMap; -use cosmic::{Task, cosmic_config::CosmicConfigEntry}; +use cosmic::Task; +use cosmic::cosmic_config::CosmicConfigEntry; use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfig}; use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; @@ -79,7 +80,6 @@ impl Default for Page { // If the config is not present, it will be created with the default values and the name will not match (panel_config.name == "Panel").then_some(panel_config) }); - let size = panel_config.as_ref().map(|c| c.size.clone()); let system_default = cosmic::cosmic_config::Config::system( &format!("{}.Panel", cosmic_panel_config::NAME), CosmicPanelConfig::VERSION, @@ -99,7 +99,6 @@ impl Default for Page { inner: PageInner { config_helper, panel_config, - size, container_config, outputs_map: HashMap::new(), system_default, diff --git a/cosmic-settings/src/pages/desktop/wallpaper/mod.rs b/cosmic-settings/src/pages/desktop/wallpaper/mod.rs index 7f99b25..b3acb5a 100644 --- a/cosmic-settings/src/pages/desktop/wallpaper/mod.rs +++ b/cosmic-settings/src/pages/desktop/wallpaper/mod.rs @@ -7,37 +7,25 @@ pub mod widgets; pub use config::Config; use url::Url; -use std::{ - collections::HashMap, - path::{Path, PathBuf}, - sync::Arc, -}; +use std::collections::HashMap; +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use cosmic::app::ContextDrawer; #[cfg(feature = "xdg-portal")] use cosmic::dialog::file_chooser; -use cosmic::{ - Apply, Element, Task, - iced::core::text::{Ellipsize, EllipsizeHeightLimit}, - widget::{ColorPickerModel, color_picker::ColorPickerUpdate, icon}, -}; -use cosmic::{app::ContextDrawer, iced::runtime::core::image::Handle as ImageHandle}; -use cosmic::{ - iced::Subscription, - widget::{ - button, dropdown, list_column, row, - segmented_button::{self, SingleSelectModel}, - settings, - space::horizontal as horizontal_space, - tab_bar, text, - }, -}; -use cosmic::{ - iced::{Alignment, Color, Length, window}, - surface, +use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit}; +use cosmic::iced::runtime::core::image::Handle as ImageHandle; +use cosmic::iced::{Alignment, Color, Length, Subscription, window}; +use cosmic::widget::color_picker::ColorPickerUpdate; +use cosmic::widget::segmented_button::{self, SingleSelectModel}; +use cosmic::widget::space::horizontal as horizontal_space; +use cosmic::widget::{ + ColorPickerModel, button, dropdown, icon, list_column, row, settings, tab_bar, text, }; +use cosmic::{Apply, Element, Task, surface}; use cosmic_bg_config::Source; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use cosmic_settings_wallpaper::{self as wallpaper, Entry, ScalingMode}; use image::imageops::FilterType::Lanczos3; use image::{ImageBuffer, Rgba}; diff --git a/cosmic-settings/src/pages/desktop/wallpaper/widgets.rs b/cosmic-settings/src/pages/desktop/wallpaper/widgets.rs index f9d2bcb..e71efde 100644 --- a/cosmic-settings/src/pages/desktop/wallpaper/widgets.rs +++ b/cosmic-settings/src/pages/desktop/wallpaper/widgets.rs @@ -3,8 +3,8 @@ use super::Message; use cosmic::iced::Radius; -use cosmic::iced::core::Border; -use cosmic::iced::core::{Background, Color, Degrees, Length, gradient::Linear}; +use cosmic::iced::core::gradient::Linear; +use cosmic::iced::core::{Background, Border, Color, Degrees, Length}; use cosmic::iced::runtime::core::image::Handle as ImageHandle; use cosmic::prelude::*; use cosmic::widget::{Space, button, container}; diff --git a/cosmic-settings/src/pages/desktop/window_management.rs b/cosmic-settings/src/pages/desktop/window_management.rs index b93e0f8..4d06894 100644 --- a/cosmic-settings/src/pages/desktop/window_management.rs +++ b/cosmic-settings/src/pages/desktop/window_management.rs @@ -1,18 +1,14 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{ - Apply, Element, - iced::Length, - surface, - widget::{self, settings}, -}; +use cosmic::iced::Length; +use cosmic::widget::{self, settings}; +use cosmic::{Apply, Element, surface}; use cosmic_comp_config::CosmicCompConfig; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_config::{Action, Binding, Shortcuts, shortcuts}; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; use tracing::error; @@ -95,7 +91,7 @@ impl Default for Page { fl!("super-key", "launcher"), fl!("super-key", "workspaces"), fl!("super-key", "applications"), - fl!("super-key", "disable"), + fl!("super-key", "none"), ], super_key_active: super_key_active_config(), comp_config, @@ -233,7 +229,7 @@ pub fn window_management() -> Section { _launcher = fl!("super-key", "launcher"); _workspaces = fl!("super-key", "workspaces"); _applications = fl!("super-key", "applications"); - _disable = fl!("super-key", "disable"); + _none = fl!("super-key", "none"); edge_gravity = fl!("edge-gravity"); }); diff --git a/cosmic-settings/src/pages/desktop/workspaces.rs b/cosmic-settings/src/pages/desktop/workspaces.rs index 6f5e1f2..ecb93a3 100644 --- a/cosmic-settings/src/pages/desktop/workspaces.rs +++ b/cosmic-settings/src/pages/desktop/workspaces.rs @@ -3,15 +3,11 @@ // TODO make settings work -use cosmic::{ - Apply, Element, - cosmic_config::{self, ConfigGet, ConfigSet}, - surface, - widget::{self, settings}, -}; +use cosmic::cosmic_config::{self, ConfigGet, ConfigSet}; +use cosmic::widget::{self, settings}; +use cosmic::{Apply, Element, surface}; use cosmic_comp_config::workspace::{Action, WorkspaceConfig, WorkspaceLayout, WorkspaceMode}; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; use tracing::error; diff --git a/cosmic-settings/src/pages/display/arrangement.rs b/cosmic-settings/src/pages/display/arrangement.rs index 61d99e4..0eced7f 100644 --- a/cosmic-settings/src/pages/display/arrangement.rs +++ b/cosmic-settings/src/pages/display/arrangement.rs @@ -5,11 +5,9 @@ use cosmic::Renderer; use cosmic::iced::core::renderer::Quad; use cosmic::iced::core::widget::{Tree, tree}; use cosmic::iced::core::{ - self as core, Border, Clipboard, Element, Layout, Length, Rectangle, Renderer as IcedRenderer, - Shell, Size, Widget, + self as core, Border, Clipboard, Element, Layout, Length, Point, Rectangle, + Renderer as IcedRenderer, Shell, Size, Widget, alignment, layout, mouse, renderer, text, touch, }; -use cosmic::iced::core::{Point, layout, mouse, renderer, touch}; -use cosmic::iced::core::{alignment, text}; use cosmic::widget::segmented_button::{self, SingleSelectModel}; use cosmic_randr_shell::{self as randr, OutputKey}; use randr::Transform; diff --git a/cosmic-settings/src/pages/display/mod.rs b/cosmic-settings/src/pages/display/mod.rs index 1b73211..95dddf7 100644 --- a/cosmic-settings/src/pages/display/mod.rs +++ b/cosmic-settings/src/pages/display/mod.rs @@ -20,9 +20,10 @@ use cosmic_settings_page::{self as page, Section, section}; use futures::SinkExt; use indexmap::Equivalent; use slotmap::{Key, SecondaryMap, SlotMap}; +use std::collections::BTreeMap; +use std::process::ExitStatus; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, LazyLock}; -use std::{collections::BTreeMap, process::ExitStatus}; use tokio::sync::oneshot; static DPI_SCALES: &[u32] = &[50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300]; @@ -912,8 +913,8 @@ impl Page { Some(orientation) => self.set_dialog( Randr::Transform(match orientation { 1 => Transform::Rotate90, - 2 => Transform::Flipped180, - 3 => Transform::Flipped270, + 2 => Transform::Rotate180, + 3 => Transform::Rotate270, _ => Transform::Normal, }), &request, diff --git a/cosmic-settings/src/pages/input/keyboard/mod.rs b/cosmic-settings/src/pages/input/keyboard/mod.rs index 468ecbb..714ae0a 100644 --- a/cosmic-settings/src/pages/input/keyboard/mod.rs +++ b/cosmic-settings/src/pages/input/keyboard/mod.rs @@ -5,50 +5,96 @@ pub mod shortcuts; use std::cmp; -use cosmic::{ - Apply, Element, Task, - app::{ContextDrawer, context_drawer}, - cosmic_config::{self, ConfigSet}, - iced::{Alignment, Length}, - theme, - widget::{self, ListColumn, button, container, icon, list, row, settings}, -}; +use cosmic::app::{ContextDrawer, context_drawer}; +use cosmic::cosmic_config::{self, ConfigSet}; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::{self, ListColumn, button, container, icon, list, row, settings}; +use cosmic::{Apply, Element, Task, theme}; use cosmic_comp_config::{KeyboardConfig, NumlockState, XkbConfig}; use cosmic_settings_page::{self as page, Section, section}; use itertools::Itertools; use slotmap::{DefaultKey, Key, SlotMap}; -static COMPOSE_OPTIONS: &[(&str, &str)] = &[ - // ("Left Alt", "compose:lalt"), XXX? - ("Right Alt", "compose:ralt"), - ("Left Super", "compose:lwin"), - ("Right Super", "compose:rwin"), - ("Menu key", "compose:menu"), - ("Right Ctrl", "compose:rctrl"), - ("Caps Lock", "compose:caps"), - ("Scroll Lock", "compose:sclk"), - ("Print Screen", "compose:prsc"), -]; +/// Contains all options for mapping a [SpecialKey]. +/// The available options differ for each key being mapped. +enum SpecialKeyAlternative { + AltLeft, + AltRight, + Ctrl, + CtrlRight, + SwapWithCtrl, + Super, + SuperLeft, + SuperRight, + CapsLock, + ScrollLock, + MenuKey, + Backspace, + Escape, + SwapWithEscape, + PrintScreen, + None, +} +impl SpecialKeyAlternative { + fn display_text(&self) -> String { + match self { + Self::AltLeft => fl!("keyboard-special-char", "alt-left"), + Self::AltRight => fl!("keyboard-special-char", "alt-right"), + Self::Ctrl => fl!("keyboard-special-char", "ctrl"), + Self::CtrlRight => fl!("keyboard-special-char", "ctrl-right"), + Self::SwapWithCtrl => fl!("keyboard-special-char", "swap-with-ctrl"), + Self::Super => fl!("keyboard-special-char", "super"), + Self::SuperLeft => fl!("keyboard-special-char", "super-left"), + Self::SuperRight => fl!("keyboard-special-char", "super-right"), + Self::CapsLock => fl!("keyboard-special-char", "caps"), + Self::ScrollLock => fl!("keyboard-special-char", "scroll-lock"), + Self::MenuKey => fl!("keyboard-special-char", "menu"), + Self::Backspace => fl!("keyboard-special-char", "backspace"), + Self::Escape => fl!("keyboard-special-char", "escape"), + Self::SwapWithEscape => fl!("keyboard-special-char", "swap-with-escape"), + Self::PrintScreen => fl!("keyboard-special-char", "print-screen"), + Self::None => fl!("keyboard-special-char", "none"), + } + } +} -static ALTERNATE_CHARACTER_OPTIONS: &[(&str, &str)] = &[ - ("Left Alt", "lv3:lalt_switch"), - ("Right Alt", "lv3:ralt_switch"), - ("Left Super", "lv3:lwin_switch"), - ("Right Super", "lv3:rwin_switch"), - ("Menu key", "lv3:menu_switch"), +/// The second/right value is the key identifier, which is how it will be saved to the configuration. +/// These values are different for each [SpecialKey], even for the same [SpecialKeyAlternative]. +/// The identifier starts with a prefix defined by [SpecialKey::prefixes]. +type SpecialKeyOption = (SpecialKeyAlternative, &'static str); + +/// Available options for [SpecialKey::Compose]. +static COMPOSE_OPTIONS: &[SpecialKeyOption] = &[ + // ("Left Alt", "compose:lalt"), XXX? + (SpecialKeyAlternative::AltRight, "compose:ralt"), + (SpecialKeyAlternative::SuperLeft, "compose:lwin"), + (SpecialKeyAlternative::SuperRight, "compose:rwin"), + (SpecialKeyAlternative::MenuKey, "compose:menu"), + (SpecialKeyAlternative::CtrlRight, "compose:rctrl"), + (SpecialKeyAlternative::CapsLock, "compose:caps"), + (SpecialKeyAlternative::ScrollLock, "compose:sclk"), + (SpecialKeyAlternative::PrintScreen, "compose:prsc"), +]; +/// Available options for [SpecialKey::AlternateCharacters]. +static ALTERNATE_CHARACTER_OPTIONS: &[SpecialKeyOption] = &[ + (SpecialKeyAlternative::AltLeft, "lv3:lalt_switch"), + (SpecialKeyAlternative::AltRight, "lv3:ralt_switch"), + (SpecialKeyAlternative::SuperLeft, "lv3:lwin_switch"), + (SpecialKeyAlternative::SuperRight, "lv3:rwin_switch"), + (SpecialKeyAlternative::MenuKey, "lv3:menu_switch"), // ("Right Ctrl", "lv3:"), XXX - ("Caps Lock", "lv3:caps_switch"), + (SpecialKeyAlternative::CapsLock, "lv3:caps_switch"), // ("Scroll Lock", "lv3:"), XXX // ("Print Screen", "lv3"), XXX ]; - -static CAPS_LOCK_OPTIONS: &[(&str, &str)] = &[ - ("Escape", "caps:escape"), - ("Swap with Escape", "caps:swapescape"), - ("Backspace", "caps:backspace"), - ("Super", "caps:super"), - ("Control", "caps:ctrl_modifier"), - ("Swap with Control", "ctrl:swapcaps"), +/// Available options for [SpecialKey::CapsLock]. +static CAPS_LOCK_OPTIONS: &[SpecialKeyOption] = &[ + (SpecialKeyAlternative::Escape, "caps:escape"), + (SpecialKeyAlternative::SwapWithEscape, "caps:swapescape"), + (SpecialKeyAlternative::Backspace, "caps:backspace"), + (SpecialKeyAlternative::Super, "caps:super"), + (SpecialKeyAlternative::Ctrl, "caps:ctrl_modifier"), + (SpecialKeyAlternative::SwapWithCtrl, "ctrl:swapcaps"), ]; #[derive(Clone, Debug)] @@ -146,9 +192,9 @@ pub enum SpecialKey { impl SpecialKey { pub fn title(self) -> String { match self { - Self::Compose => "Compose".to_string(), - Self::AlternateCharacters => "Alternate Characters".to_string(), - Self::CapsLock => "Caps Lock".to_string(), + Self::Compose => fl!("keyboard-special-char", "compose"), + Self::AlternateCharacters => fl!("keyboard-special-char", "alternate"), + Self::CapsLock => fl!("keyboard-special-char", "caps"), } } @@ -241,7 +287,7 @@ fn input_source( } fn special_char_radio_row<'a>( - desc: &'a str, + desc: String, value: Option<&'static str>, current_value: Option<&'a str>, ) -> list::ListButton<'a, Message> { @@ -621,14 +667,22 @@ impl Page { let mut list = cosmic::widget::list_column(); if matches!(special_key, SpecialKey::CapsLock) { - list = list.add(special_char_radio_row("Caps Lock", None, current)); + list = list.add(special_char_radio_row( + SpecialKeyAlternative::CapsLock.display_text(), + None, + current, + )); } else { - list = list.add(special_char_radio_row("None", None, current)); + list = list.add(special_char_radio_row( + SpecialKeyAlternative::None.display_text(), + None, + current, + )); } list = options .iter() - .map(|(desc, id)| special_char_radio_row(desc, Some(id), current)) + .map(|(key, id)| special_char_radio_row(key.display_text(), Some(id), current)) .fold(list, ListColumn::add); widget::column::with_capacity(2) diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs index 70e1952..5e6a558 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/common.rs @@ -8,7 +8,7 @@ use cosmic::iced::keyboard::{Key, Location, Modifiers}; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; use cosmic::iced::platform_specific::shell::wayland::keymap; use cosmic::iced::{self, Alignment, Length}; -use cosmic::widget::{self, button, icon, settings, text}; +use cosmic::widget::{self, button, icon, list, settings, text}; use cosmic::{Apply, Element, Task, theme}; use cosmic_config::{ConfigGet, ConfigSet}; use cosmic_settings_config::shortcuts::{self, Action, Binding, Shortcuts}; @@ -652,7 +652,8 @@ impl Model { modifiers, .. }) => { - use cosmic::iced::keyboard::{Key, key::Named}; + use cosmic::iced::keyboard::Key; + use cosmic::iced::keyboard::key::Named; if matches!( key, @@ -669,7 +670,8 @@ impl Model { location, .. }) => { - use cosmic::iced::keyboard::{Key, key::Named}; + use cosmic::iced::keyboard::Key; + use cosmic::iced::keyboard::key::Named; if matches!( key, @@ -865,13 +867,11 @@ fn context_drawer<'a>( } /// Display a shortcut as a list item -fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, ShortcutMessage> { - #[derive(Copy, Clone, Debug)] - enum LocalMessage { - Remove, - Show, - } - +fn shortcut_item( + custom: bool, + id: usize, + data: &ShortcutModel, +) -> list::ListButton<'_, ShortcutMessage> { let bindings = data .bindings .iter() @@ -880,7 +880,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .map(|(_, shortcut)| text::body(shortcut.binding.to_string()).into()) .collect::>(); - let shortcuts: Element = if bindings.is_empty() { + let shortcuts: Element = if bindings.is_empty() { text::body(fl!("disabled")).into() } else { widget::column::with_children(bindings) @@ -900,7 +900,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .push(icon::from_name("go-next-symbolic").size(16)) .push_maybe(custom.then(|| { widget::button::icon(icon::from_name("edit-delete-symbolic")) - .on_press(LocalMessage::Remove) + .on_press(ShortcutMessage::DeleteShortcut(id)) })) .align_y(Alignment::Center) .spacing(8); @@ -909,14 +909,7 @@ fn shortcut_item(custom: bool, id: usize, data: &ShortcutModel) -> Element<'_, S .flex_control(control) .align_items(Alignment::Center) .spacing(16) - .apply(widget::container) - .class(theme::Container::List) - .apply(widget::button::custom) - .class(theme::Button::Transparent) - .on_press(LocalMessage::Show) - .apply(Element::from) - .map(move |message| match message { - LocalMessage::Show => ShortcutMessage::ShowShortcut(id, data.description.clone()), - LocalMessage::Remove => ShortcutMessage::DeleteShortcut(id), - }) + .width(Length::Shrink) + .apply(list::button) + .on_press(ShortcutMessage::ShowShortcut(id, data.description.clone())) } diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/custom.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/custom.rs index 7b04dea..d15f4dc 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/custom.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/custom.rs @@ -590,7 +590,8 @@ impl page::Page for Page { &self, core: &cosmic::Core, ) -> cosmic::iced::Subscription { - use cosmic::iced::{self, event::listen_with}; + use cosmic::iced::event::listen_with; + use cosmic::iced::{self}; cosmic::iced::Subscription::batch(vec![ if self.add_shortcut.active @@ -605,7 +606,8 @@ impl page::Page for Page { modifiers, .. }) => { - use cosmic::iced::keyboard::{Key, key::Named}; + use cosmic::iced::keyboard::Key; + use cosmic::iced::keyboard::key::Named; if matches!( key, Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift) @@ -624,7 +626,8 @@ impl page::Page for Page { location, .. }) => { - use cosmic::iced::keyboard::{Key, key::Named}; + use cosmic::iced::keyboard::Key; + use cosmic::iced::keyboard::key::Named; if matches!( key, Key::Named(Named::Super | Named::Alt | Named::Control | Named::Shift) diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/manage_windows.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/manage_windows.rs index 3d14669..394f5fe 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/manage_windows.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/manage_windows.rs @@ -2,8 +2,9 @@ // SPDX-License-Identifier: GPL-3.0-only use super::{ShortcutMessage, ShortcutModel}; +use cosmic::app::ContextDrawer; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; -use cosmic::{Element, Task, app::ContextDrawer}; +use cosmic::{Element, Task}; use cosmic_settings_config::shortcuts::Action; use cosmic_settings_config::shortcuts::action::ResizeDirection; use cosmic_settings_page::{self as page, Section, section}; diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs index 5a5b1bb..12b77b9 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/mod.rs @@ -15,16 +15,16 @@ pub mod tiling; use cosmic::app::ContextDrawer; use cosmic::iced::Length; -use cosmic::widget::{self, icon, settings, text}; -use cosmic::{Apply, Element, Task, theme}; +use cosmic::widget::list::ListButton; +use cosmic::widget::{self, settings, text}; +use cosmic::{Apply, Element, Task}; use cosmic_config::ConfigGet; use cosmic_settings_config::Binding; use cosmic_settings_config::shortcuts::action::{ Direction, FocusDirection, Orientation, ResizeDirection, }; use cosmic_settings_config::shortcuts::{self, Action, Shortcuts}; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use itertools::Itertools; use shortcuts::action::System as SystemAction; use slab::Slab; @@ -222,11 +222,13 @@ impl Page { self.search.localized = SecondaryMap::new(); self.search.input = String::new(); self.search_model.on_clear(); - self.modified.custom = 0; + self.modified.accessibility = 0; self.modified.manage_windows = 0; self.modified.move_windows = 0; self.modified.nav = 0; self.modified.system = 0; + self.modified.window_tiling = 0; + self.modified.custom = 0; } fn reload_search(&mut self) { @@ -408,11 +410,13 @@ impl Search { .fold( Slab::with_capacity(self.actions.len()), |mut slab, (_, action)| { - slab.insert(ShortcutModel::new( - &self.defaults, - &self.shortcuts, - action.clone(), - )); + if !slab.iter().any(|(_, model)| &model.action == action) { + slab.insert(ShortcutModel::new( + &self.defaults, + &self.shortcuts, + action.clone(), + )); + } slab }, @@ -497,32 +501,18 @@ fn shortcuts() -> Section { } /// Display a category as a list item -fn category_item(category: Category, name: &str, modified: u16) -> Element<'_, Message> { - let icon = icon::from_name("go-next-symbolic").size(16); - - let control = if modified == 0 { - Element::from(icon) - } else { - widget::row::with_capacity(2) - .push(text::body(fl!("modified", count = modified))) - .push(icon) - .into() - }; - - settings::item::builder(name) - .control(control) - .spacing(16) - .apply(widget::container) - .class(theme::Container::List) - .apply(widget::button::custom) - .class(theme::Button::Transparent) - .width(Length::Fill) - .on_press(Message::Category(category)) - .into() +fn category_item(category: Category, name: &str, modified: u16) -> ListButton<'_, Message> { + crate::widget::go_next_with_item( + name, + (modified > 0).then(|| text::body(fl!("modified", count = modified)).apply(Element::from)), + Message::Category(category), + ) } fn action_category(action: &Action) -> Option { - Some(if manage_windows::actions().contains(action) { + Some(if accessibility::actions().contains(action) { + Category::Accessibility + } else if manage_windows::actions().contains(action) { Category::ManageWindow } else if move_window::actions().contains(action) { Category::MoveWindow @@ -530,6 +520,8 @@ fn action_category(action: &Action) -> Option { Category::Nav } else if system::actions().contains(action) { Category::System + } else if tiling::actions().contains(action) { + Category::WindowTiling } else { return None; }) diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/move_window.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/move_window.rs index f0ca09c..15389ed 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/move_window.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/move_window.rs @@ -2,8 +2,9 @@ // SPDX-License-Identifier: GPL-3.0-only // use super::{ShortcutMessage, ShortcutModel}; +use cosmic::app::ContextDrawer; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; -use cosmic::{Element, Task, app::ContextDrawer}; +use cosmic::{Element, Task}; use cosmic_settings_config::shortcuts::Action; use cosmic_settings_config::shortcuts::action::Direction; use cosmic_settings_page::{self as page, Section, section}; diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/system.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/system.rs index 02c2277..788f147 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/system.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/system.rs @@ -2,8 +2,9 @@ // SPDX-License-Identifier: GPL-3.0-only use super::{ShortcutMessage, ShortcutModel}; +use cosmic::app::ContextDrawer; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; -use cosmic::{Element, Task, app::ContextDrawer}; +use cosmic::{Element, Task}; use cosmic_settings_config::shortcuts::Action; use cosmic_settings_config::shortcuts::action::System as SystemAction; use cosmic_settings_page::{self as page, Section, section}; diff --git a/cosmic-settings/src/pages/input/keyboard/shortcuts/tiling.rs b/cosmic-settings/src/pages/input/keyboard/shortcuts/tiling.rs index aa0717d..1b40522 100644 --- a/cosmic-settings/src/pages/input/keyboard/shortcuts/tiling.rs +++ b/cosmic-settings/src/pages/input/keyboard/shortcuts/tiling.rs @@ -2,8 +2,9 @@ // SPDX-License-Identifier: GPL-3.0-only use super::{ShortcutMessage, ShortcutModel}; +use cosmic::app::ContextDrawer; use cosmic::iced::platform_specific::shell::wayland::commands::keyboard_shortcuts_inhibit; -use cosmic::{Element, Task, app::ContextDrawer}; +use cosmic::{Element, Task}; use cosmic_settings_config::shortcuts::Action; use cosmic_settings_config::shortcuts::action::Orientation; use cosmic_settings_page::{self as page, Section, section}; diff --git a/cosmic-settings/src/pages/input/mod.rs b/cosmic-settings/src/pages/input/mod.rs index 560f740..10613dc 100644 --- a/cosmic-settings/src/pages/input/mod.rs +++ b/cosmic-settings/src/pages/input/mod.rs @@ -2,10 +2,8 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::app; -use cosmic::{ - Task, - cosmic_config::{self, ConfigGet, ConfigSet}, -}; +use cosmic::Task; +use cosmic::cosmic_config::{self, ConfigGet, ConfigSet}; use cosmic_comp_config::input::{ AccelConfig, AccelProfile, ClickMethod, InputConfig, ScrollConfig, ScrollMethod, TapButtonMap, TapConfig, diff --git a/cosmic-settings/src/pages/input/mouse.rs b/cosmic-settings/src/pages/input/mouse.rs index a32eb57..849820f 100644 --- a/cosmic-settings/src/pages/input/mouse.rs +++ b/cosmic-settings/src/pages/input/mouse.rs @@ -5,8 +5,7 @@ use cosmic::iced::{Alignment, Length}; use cosmic::widget::{self, row, settings, text}; use cosmic::{Apply, Element}; use cosmic_comp_config::input::AccelProfile; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; use super::Message; diff --git a/cosmic-settings/src/pages/input/touchpad.rs b/cosmic-settings/src/pages/input/touchpad.rs index ba667ef..29d167c 100644 --- a/cosmic-settings/src/pages/input/touchpad.rs +++ b/cosmic-settings/src/pages/input/touchpad.rs @@ -8,8 +8,7 @@ use cosmic::{Apply, Element}; use cosmic_comp_config::CosmicCompConfig; use cosmic_comp_config::input::{AccelProfile, ClickMethod, ScrollMethod}; use cosmic_comp_config::workspace::{WorkspaceConfig, WorkspaceLayout}; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use slotmap::SlotMap; use tracing::error; diff --git a/cosmic-settings/src/pages/networking/backend.rs b/cosmic-settings/src/pages/networking/backend.rs new file mode 100644 index 0000000..eec2e4e --- /dev/null +++ b/cosmic-settings/src/pages/networking/backend.rs @@ -0,0 +1,1812 @@ +// Copyright 2026 System76 +// SPDX-License-Identifier: GPL-3.0-only + +use std::collections::{BTreeMap, HashMap}; +use std::fmt; +use std::net::Ipv4Addr; +use std::path::Path; +use std::sync::Arc; +use std::time::Duration; + +use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded}; +use futures::{FutureExt, SinkExt, StreamExt}; +use nmrs::agent::{SecretAgent, SecretAgentFlags, SecretRequest, SecretResponder, SecretSetting}; +use nmrs::raw::zbus; +use nmrs::raw::zvariant::{OwnedObjectPath, OwnedValue, Str, Value}; +use nmrs::{ + ActiveConnection, ConnectType, ConnectionOptions, EapOptions, NetworkEvent, NetworkManager, + SavedConnection, SettingsSummary, WifiKeyMgmt, WifiSecurity, +}; +use secure_string::SecureString; +use tokio::sync::oneshot; + +pub type SSID = Arc; +pub type UUID = Arc; + +const NM_DEST: &str = "org.freedesktop.NetworkManager"; +const NM_PATH: &str = "/org/freedesktop/NetworkManager"; +const NM_IFACE: &str = "org.freedesktop.NetworkManager"; +const SECRET_ID: &str = "com.system76.CosmicSettings.NetworkManager"; + +#[derive(Debug)] +pub enum Error { + Message(String), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Message(message) => f.write_str(message), + } + } +} + +impl std::error::Error for Error {} + +impl From for Error { + fn from(value: nmrs::ConnectionError) -> Self { + Self::Message(value.to_string()) + } +} + +impl From for Error { + fn from(value: zbus::Error) -> Self { + Self::Message(value.to_string()) + } +} + +pub mod hw_address { + #[derive(Clone, PartialEq, Eq, Default, Debug, PartialOrd, Ord)] + pub struct HwAddress { + octets: Vec, + } + + impl HwAddress { + pub fn from_str(arg: &str) -> Option { + let segments: Vec<&str> = arg.split(':').collect(); + if segments.len() != 6 && segments.len() != 8 { + return None; + } + + let mut octets = Vec::with_capacity(segments.len()); + for segment in segments { + if segment.len() != 2 { + return None; + } + octets.push(u8::from_str_radix(segment, 16).ok()?); + } + + Some(Self { octets }) + } + } + + impl std::fmt::Display for HwAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let hex_parts: Vec = self + .octets + .iter() + .map(|byte| format!("{byte:02x}")) + .collect(); + write!(f, "{}", hex_parts.join(":")) + } + } +} + +pub mod available_wifi { + use std::sync::Arc; + + use nmrs::raw::zvariant::OwnedObjectPath; + + use super::devices::DeviceState; + use super::hw_address::HwAddress; + + #[derive(Debug, Clone, PartialEq, Eq)] + pub struct AccessPoint { + pub ssid: Arc, + pub strength: u8, + pub state: DeviceState, + pub working: bool, + pub path: OwnedObjectPath, + pub hw_address: HwAddress, + pub secured: bool, + pub wps_push: bool, + pub network_type: NetworkType, + pub interface: Option, + pub bssid: Option, + } + + #[derive(Debug, Clone, Copy, PartialEq, Eq)] + pub enum NetworkType { + Open, + PskOrSae, + Sae, + EAP, + } +} + +pub mod current_networks { + use std::net::Ipv4Addr; + + use super::devices::ActiveConnectionState; + + #[derive(Debug, Clone, PartialEq, Eq)] + pub enum ActiveConnectionInfo { + Wired { + name: String, + hw_address: String, + speed: u32, + ip_addresses: Vec, + }, + WiFi { + name: String, + ip_addresses: Vec, + hw_address: String, + state: ActiveConnectionState, + strength: u8, + }, + Vpn { + name: String, + ip_addresses: Vec, + }, + } + + impl ActiveConnectionInfo { + pub fn name(&self) -> String { + match self { + Self::Wired { name, .. } | Self::WiFi { name, .. } | Self::Vpn { name, .. } => { + name.clone() + } + } + } + } +} + +pub mod devices { + use std::sync::Arc; + + use nmrs::raw::zvariant::OwnedObjectPath; + use nmrs::{NetworkManager, SavedConnection, SettingsSummary}; + + use super::{Error, active_connection_by_interface, owned_path, saved_matches_device}; + + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum DeviceType { + Ethernet, + Wifi, + WifiP2P, + Loopback, + Bluetooth, + Vlan, + WireGuard, + Other(u32), + } + + impl From for DeviceType { + fn from(value: nmrs::DeviceType) -> Self { + match value { + nmrs::DeviceType::Ethernet => Self::Ethernet, + nmrs::DeviceType::Wifi => Self::Wifi, + nmrs::DeviceType::WifiP2P => Self::WifiP2P, + nmrs::DeviceType::Loopback => Self::Loopback, + nmrs::DeviceType::Bluetooth => Self::Bluetooth, + nmrs::DeviceType::Vlan => Self::Vlan, + nmrs::DeviceType::Other(v) => Self::Other(v), + _ => Self::Other(0), + } + } + } + + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum DeviceState { + Unknown, + Unmanaged, + Unavailable, + Disconnected, + Prepare, + Config, + NeedAuth, + IpConfig, + IpCheck, + Secondaries, + Activated, + Deactivating, + Failed, + Other(u32), + } + + impl From for DeviceState { + fn from(value: nmrs::DeviceState) -> Self { + match value { + nmrs::DeviceState::Unmanaged => Self::Unmanaged, + nmrs::DeviceState::Unavailable => Self::Unavailable, + nmrs::DeviceState::Disconnected => Self::Disconnected, + nmrs::DeviceState::Prepare => Self::Prepare, + nmrs::DeviceState::Config => Self::Config, + nmrs::DeviceState::NeedAuth => Self::NeedAuth, + nmrs::DeviceState::IpConfig => Self::IpConfig, + nmrs::DeviceState::IpCheck => Self::IpCheck, + nmrs::DeviceState::Secondaries => Self::Secondaries, + nmrs::DeviceState::Activated => Self::Activated, + nmrs::DeviceState::Deactivating => Self::Deactivating, + nmrs::DeviceState::Failed => Self::Failed, + nmrs::DeviceState::Other(0) => Self::Unknown, + nmrs::DeviceState::Other(v) => Self::Other(v), + _ => Self::Unknown, + } + } + } + + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum ActiveConnectionState { + Unknown, + Activating, + Activated, + Deactivating, + Deactivated, + Other(u32), + } + + impl From for ActiveConnectionState { + fn from(value: nmrs::ActiveConnectionState) -> Self { + match value { + nmrs::ActiveConnectionState::Activating => Self::Activating, + nmrs::ActiveConnectionState::Activated => Self::Activated, + nmrs::ActiveConnectionState::Deactivating => Self::Deactivating, + nmrs::ActiveConnectionState::Deactivated => Self::Deactivated, + nmrs::ActiveConnectionState::Unknown => Self::Unknown, + nmrs::ActiveConnectionState::Other(v) => Self::Other(v), + _ => Self::Unknown, + } + } + } + + #[derive(Debug, Clone, Eq, PartialEq)] + pub struct DeviceInfo { + pub path: OwnedObjectPath, + pub device_type: DeviceType, + pub interface: String, + pub state: DeviceState, + pub active_connection: Option<(DeviceConnection, ActiveConnectionState)>, + pub available_connections: Vec, + pub known_connections: Vec, + } + + #[derive(Debug, Clone, Eq, PartialEq)] + pub struct DeviceConnection { + pub path: OwnedObjectPath, + pub id: String, + pub uuid: Arc, + } + + #[derive(Debug, Clone, Eq, PartialEq)] + pub struct KnownDeviceConnection { + pub id: String, + pub uuid: Arc, + } + + pub async fn list( + nm: &NetworkManager, + device_type_filter: fn(DeviceType) -> bool, + ) -> Result, Error> { + let (devices_res, saved_res, active_res) = futures::join!( + nm.list_devices(), + nm.list_saved_connections(), + nm.list_active_connections() + ); + + let saved = saved_res?; + let active = active_res.unwrap_or_default(); + let mut out = Vec::new(); + + for device in devices_res? { + let device_type = DeviceType::from(device.device_type); + if !device_type_filter(device_type) { + continue; + } + + let Ok(path) = owned_path(&device.path) else { + continue; + }; + + let matching_saved: Vec<&SavedConnection> = saved + .iter() + .filter(|connection| { + saved_matches_device(connection, device_type, &device.interface) + }) + .collect(); + + let available_connections = matching_saved + .iter() + .map(|connection| DeviceConnection { + path: connection.path.clone(), + id: connection.id.clone(), + uuid: Arc::from(connection.uuid.as_str()), + }) + .collect(); + + let known_connections = matching_saved + .iter() + .map(|connection| KnownDeviceConnection { + id: connection.id.clone(), + uuid: Arc::from(connection.uuid.as_str()), + }) + .collect(); + + let active_connection = + active_connection_by_interface(&active, &device.interface).map(|connection| { + ( + DeviceConnection { + path: connection.path.clone(), + id: connection.id.clone(), + uuid: Arc::from(connection.uuid.as_str()), + }, + connection.state, + ) + }); + + out.push(DeviceInfo { + path, + device_type, + interface: device.interface, + state: DeviceState::from(device.state), + active_connection, + available_connections, + known_connections, + }); + } + + Ok(out) + } + + pub fn is_wifi_summary(summary: &SettingsSummary) -> bool { + matches!(summary, SettingsSummary::Wifi { .. }) + } +} + +#[derive(Debug, Clone)] +pub struct ActiveConnectionRecord { + path: OwnedObjectPath, + id: String, + uuid: String, + state: devices::ActiveConnectionState, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct NetworkManagerState { + pub wireless_access_points: Vec, + pub active_conns: Vec, + pub known_access_points: Vec, + pub wifi_enabled: bool, + pub airplane_mode: bool, +} + +impl Default for NetworkManagerState { + fn default() -> Self { + Self { + wireless_access_points: Vec::new(), + active_conns: Vec::new(), + known_access_points: Vec::new(), + wifi_enabled: false, + airplane_mode: false, + } + } +} + +impl NetworkManagerState { + pub async fn new(nm: &NetworkManager) -> Result { + let (wifi_state, airplane_mode, active_conns, access_points, saved_connections) = futures::join!( + nm.wifi_state(), + nm.airplane_mode_state(), + nm.list_active_connections(), + nm.list_access_points(None), + nm.list_saved_connections() + ); + + let active_conns = active_conns.unwrap_or_default(); + let saved_connections = saved_connections.unwrap_or_default(); + + let mut wireless_access_points = access_points + .unwrap_or_default() + .into_iter() + .filter(|ap| !ap.ssid.is_empty() && ap.ssid != "") + .map(access_point_from_nmrs) + .fold( + BTreeMap::<(String, SSID), available_wifi::AccessPoint>::new(), + |mut acc, ap| { + let key = (ap.interface.clone().unwrap_or_default(), ap.ssid.clone()); + let replace = acc + .get(&key) + .is_none_or(|existing| existing.strength < ap.strength); + if replace { + acc.insert(key, ap); + } + acc + }, + ) + .into_values() + .collect::>(); + wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength)); + + let active_infos = active_connection_infos(active_conns); + let saved_wifi = saved_wifi_profiles(&saved_connections); + + let mut known_access_points = Vec::new(); + for saved in saved_wifi { + let Some((ssid, network_type)) = saved_wifi_identity(saved) else { + continue; + }; + if active_infos.iter().any(|active| active.name() == ssid) { + continue; + } + if let Some(visible) = wireless_access_points + .iter() + .find(|ap| ap.ssid.as_ref() == ssid) + .cloned() + { + known_access_points.push(visible); + continue; + } + + known_access_points.push(available_wifi::AccessPoint { + ssid: Arc::from(ssid), + strength: 0, + state: devices::DeviceState::Unknown, + working: false, + path: slash_path(), + hw_address: hw_address::HwAddress::default(), + secured: !matches!(network_type, available_wifi::NetworkType::Open), + wps_push: false, + network_type, + interface: saved.interface_name.clone(), + bssid: None, + }); + } + + known_access_points.sort_by(|a, b| a.ssid.cmp(&b.ssid)); + known_access_points.dedup_by(|a, b| a.ssid == b.ssid); + + Ok(Self { + wireless_access_points, + active_conns: active_infos, + known_access_points, + wifi_enabled: wifi_state.map(|state| state.enabled).unwrap_or(false), + airplane_mode: airplane_mode + .map(|state| state.is_airplane_mode()) + .unwrap_or(false), + }) + } + + #[allow(dead_code)] + pub fn clear(&mut self) { + self.active_conns = Vec::new(); + self.known_access_points = Vec::new(); + self.wireless_access_points = Vec::new(); + } +} + +#[derive(Debug, Clone)] +pub enum Request { + Activate(OwnedObjectPath, OwnedObjectPath), + ActivateVpn(UUID), + Deactivate(UUID), + Disconnect(SSID), + Forget(SSID), + Authenticate { + ssid: String, + identity: Option, + password: SecureString, + network_type: available_wifi::NetworkType, + secret_tx: Option>, + interface: Option, + }, + GetWiFiCredentials( + SSID, + UUID, + available_wifi::NetworkType, + Option>, + ), + Reload, + Remove(UUID), + SelectAccessPoint( + SSID, + available_wifi::NetworkType, + Option>, + Option, + ), + SetAirplaneMode(bool), + SetWiFi(bool), +} + +#[derive(Debug, Clone)] +pub enum Event { + RequestResponse { + req: Request, + state: NetworkManagerState, + success: bool, + }, + Init { + conn: NetworkManager, + sender: UnboundedSender, + state: NetworkManagerState, + }, + Devices, + WiFiEnabled(bool), + WirelessAccessPoints, + ActiveConns, + WiFiCredentials { + ssid: SSID, + password: Option, + security_type: available_wifi::NetworkType, + }, +} + +pub async fn watch(nm: NetworkManager, mut output: futures::channel::mpsc::Sender) { + let (request_tx, mut request_rx): (UnboundedSender, UnboundedReceiver) = + unbounded(); + + let state = NetworkManagerState::new(&nm).await.unwrap_or_default(); + if output + .send(Event::Init { + conn: nm.clone(), + sender: request_tx, + state, + }) + .await + .is_err() + { + return; + } + + let Ok(events) = nm.network_events().await else { + while let Some(req) = request_rx.next().await { + let event = request_response(&nm, req, false).await; + _ = output.send(event).await; + } + return; + }; + + let mut events = events.fuse(); + loop { + futures::select! { + req = request_rx.next().fuse() => { + let Some(req) = req else { + break; + }; + let event = handle_request(&nm, req).await; + if output.send(event).await.is_err() { + break; + } + } + event = events.next() => { + let Some(event) = event else { + break; + }; + let message = match event { + Ok(NetworkEvent::AccessPointsChanged) => Some(Event::WirelessAccessPoints), + Ok(NetworkEvent::DeviceChanged { .. } | NetworkEvent::SettingsChanged(_)) => Some(Event::Devices), + Ok(NetworkEvent::ActiveConnectionsChanged) => Some(Event::ActiveConns), + Ok(NetworkEvent::WirelessEnabledChanged) => Some(Event::WiFiEnabled( + nm.wifi_state().await.map(|state| state.enabled).unwrap_or(false), + )), + Ok(NetworkEvent::ConnectivityChanged | NetworkEvent::NetworkManagerRestarted) => Some(Event::ActiveConns), + Ok(_) => None, + Err(err) => { + tracing::error!(%err, "network event stream error"); + None + } + }; + + if let Some(message) = message + && output.send(message).await.is_err() + { + break; + } + } + } + } +} + +async fn handle_request(nm: &NetworkManager, req: Request) -> Event { + let success = match &req { + Request::Activate(device_path, connection_path) => activate_connection( + nm, + connection_path.clone(), + device_path.clone(), + slash_path(), + ) + .await + .is_ok(), + Request::ActivateVpn(uuid) => nm.connect_vpn_by_uuid(uuid).await.is_ok(), + Request::Deactivate(uuid) => deactivate_by_uuid(nm, uuid).await.is_ok(), + Request::Disconnect(ssid) => disconnect_wifi_by_ssid(nm, ssid).await.is_ok(), + Request::Forget(ssid) => nm.forget(ssid).await.is_ok(), + Request::Authenticate { + ssid, + identity, + password, + network_type, + secret_tx, + interface, + } => { + let result = authenticate_wifi( + nm, + ssid, + identity.as_deref(), + password, + *network_type, + interface.as_deref(), + ) + .await; + if let Err(err) = &result { + tracing::error!( + %err, + %ssid, + ?network_type, + ?interface, + "wifi authentication failed" + ); + } + let success = result.is_ok(); + + if success + && let Some(secret_tx) = secret_tx + && let Ok(Some(uuid)) = nm.get_saved_connection_uuid(ssid).await + { + let (applied_tx, applied_rx) = oneshot::channel(); + let (setting_name, key) = if identity.is_some() { + ("802-1x", "password") + } else { + ("802-11-wireless-security", "psk") + }; + _ = secret_tx + .send(nm_secret_agent::Request::SetSecrets { + setting_name: setting_name.to_string(), + uuid, + secrets: HashMap::from([(key.to_string(), password.clone())]), + applied_tx, + }) + .await; + _ = tokio::time::timeout(Duration::from_secs(1), applied_rx).await; + } + + success + } + Request::GetWiFiCredentials(ssid, uuid, security_type, secret_tx) => { + let password = if matches!(security_type, available_wifi::NetworkType::Open) { + None + } else if let Some(secret_tx) = secret_tx { + let (resp_tx, resp_rx) = oneshot::channel(); + let (setting_name, key) = + if matches!(security_type, available_wifi::NetworkType::EAP) { + ("802-1x", "password") + } else { + ("802-11-wireless-security", "psk") + }; + _ = secret_tx + .send(nm_secret_agent::Request::GetSecrets { + setting_name: setting_name.to_string(), + uuid: uuid.to_string(), + resp_tx, + }) + .await; + tokio::time::timeout(Duration::from_secs(10), resp_rx) + .await + .ok() + .and_then(Result::ok) + .and_then(|mut secrets| secrets.remove(key)) + } else { + None + }; + + return Event::WiFiCredentials { + ssid: ssid.clone(), + password, + security_type: *security_type, + }; + } + Request::Reload => true, + Request::Remove(uuid) => nm.delete_saved_connection(uuid).await.is_ok(), + Request::SelectAccessPoint(ssid, network_type, _secret_tx, interface) => { + let result = select_access_point(nm, ssid, *network_type, interface.as_deref()).await; + if let Err(err) = &result { + tracing::error!( + %err, + %ssid, + ?network_type, + ?interface, + "wifi access point selection failed" + ); + } + result.is_ok() + } + Request::SetAirplaneMode(enabled) => nm.set_airplane_mode(*enabled).await.is_ok(), + Request::SetWiFi(enabled) => nm.set_wireless_enabled(*enabled).await.is_ok(), + }; + + request_response(nm, req, success).await +} + +async fn request_response(nm: &NetworkManager, req: Request, success: bool) -> Event { + Event::RequestResponse { + req, + success, + state: NetworkManagerState::new(nm).await.unwrap_or_default(), + } +} + +async fn select_access_point( + nm: &NetworkManager, + ssid: &str, + network_type: available_wifi::NetworkType, + interface: Option<&str>, +) -> Result<(), Error> { + match network_type { + available_wifi::NetworkType::Open => { + nm.connect(ssid, interface, WifiSecurity::Open).await?; + } + available_wifi::NetworkType::PskOrSae => { + nm.connect(ssid, interface, WifiSecurity::WpaPsk { psk: String::new() }) + .await?; + } + available_wifi::NetworkType::Sae | available_wifi::NetworkType::EAP => { + let Some(saved) = find_saved_wifi(nm, ssid, interface).await? else { + return Err(Error::Message("no saved Wi-Fi connection".to_string())); + }; + let device = saved + .interface_name + .as_deref() + .or(interface) + .map(|interface| nm.get_device_by_interface(interface)) + .ok_or_else(|| { + Error::Message("no Wi-Fi interface for saved connection".to_string()) + })? + .await?; + let ap = find_access_point_path(nm, ssid, interface) + .await + .unwrap_or_else(slash_path); + activate_connection(nm, saved.path, device, ap).await?; + } + } + + Ok(()) +} + +async fn authenticate_wifi( + nm: &NetworkManager, + ssid: &str, + identity: Option<&str>, + password: &SecureString, + network_type: available_wifi::NetworkType, + interface: Option<&str>, +) -> Result<(), Error> { + match network_type { + available_wifi::NetworkType::Open => { + nm.connect(ssid, interface, WifiSecurity::Open).await? + } + available_wifi::NetworkType::PskOrSae => { + nm.connect( + ssid, + interface, + WifiSecurity::WpaPsk { + psk: password.unsecure().to_string(), + }, + ) + .await?; + } + available_wifi::NetworkType::Sae => { + connect_sae(nm, ssid, password.unsecure(), interface).await?; + } + available_wifi::NetworkType::EAP => { + nm.connect( + ssid, + interface, + WifiSecurity::WpaEap { + opts: EapOptions::new(identity.unwrap_or_default(), password.unsecure()), + }, + ) + .await?; + } + } + + Ok(()) +} + +async fn connect_sae( + nm: &NetworkManager, + ssid: &str, + password: &str, + interface: Option<&str>, +) -> Result<(), Error> { + let mut settings = nmrs::builders::WifiConnectionBuilder::new(ssid) + .wpa_psk(password) + .autoconnect(true) + .ipv4_auto() + .ipv6_auto() + .build(); + + if let Some(security) = settings.get_mut("802-11-wireless-security") { + security.insert("key-mgmt", Value::from("sae")); + security.remove("auth-alg"); + } + + let ap_path = find_access_point_path(nm, ssid, interface) + .await + .ok_or_else(|| Error::Message(format!("access point {ssid} not found")))?; + nm.add_and_activate_connection(settings, interface, Some(ap_path.as_str())) + .await?; + + Ok(()) +} + +async fn disconnect_wifi_by_ssid(nm: &NetworkManager, ssid: &str) -> Result<(), Error> { + for active in nm.list_active_connections().await? { + if let ActiveConnection::Wifi(wifi) = active + && wifi.ssid == ssid + { + return deactivate_by_uuid(nm, &wifi.uuid).await; + } + } + + Ok(()) +} + +async fn deactivate_by_uuid(nm: &NetworkManager, uuid: &str) -> Result<(), Error> { + if nm.disconnect_vpn_by_uuid(uuid).await.is_ok() { + return Ok(()); + } + + let active_path = find_active_connection_path(nm, uuid).await?; + let proxy = zbus::Proxy::new(nm.dbus_connection(), NM_DEST, NM_PATH, NM_IFACE).await?; + proxy + .call_method("DeactivateConnection", &(active_path,)) + .await?; + + Ok(()) +} + +async fn activate_connection( + nm: &NetworkManager, + connection_path: OwnedObjectPath, + device_path: OwnedObjectPath, + specific_path: OwnedObjectPath, +) -> Result<(), Error> { + let proxy = zbus::Proxy::new(nm.dbus_connection(), NM_DEST, NM_PATH, NM_IFACE).await?; + proxy + .call_method( + "ActivateConnection", + &(connection_path, device_path, specific_path), + ) + .await?; + Ok(()) +} + +async fn find_active_connection_path( + nm: &NetworkManager, + uuid: &str, +) -> Result { + let proxy = zbus::Proxy::new(nm.dbus_connection(), NM_DEST, NM_PATH, NM_IFACE).await?; + let paths: Vec = proxy.get_property("ActiveConnections").await?; + + for path in paths { + let active = zbus::Proxy::new( + nm.dbus_connection(), + NM_DEST, + path.clone(), + "org.freedesktop.NetworkManager.Connection.Active", + ) + .await?; + let active_uuid: String = active.get_property("Uuid").await?; + if active_uuid == uuid { + return Ok(path); + } + } + + Err(Error::Message(format!( + "active connection {uuid} not found" + ))) +} + +async fn find_access_point_path( + nm: &NetworkManager, + ssid: &str, + interface: Option<&str>, +) -> Option { + nm.list_access_points(interface) + .await + .ok()? + .into_iter() + .filter(|ap| ap.ssid == ssid) + .max_by_key(|ap| ap.strength) + .map(|ap| ap.path) +} + +async fn find_saved_wifi( + nm: &NetworkManager, + ssid: &str, + interface: Option<&str>, +) -> Result, Error> { + Ok(nm + .list_saved_connections() + .await? + .into_iter() + .find(|connection| { + if let Some(interface) = interface + && connection + .interface_name + .as_deref() + .is_some_and(|i| i != interface) + { + return false; + } + saved_wifi_identity(connection).is_some_and(|(saved_ssid, _)| saved_ssid == ssid) + })) +} + +pub async fn wifi_connection_settings( + nm: NetworkManager, +) -> Result, Box>, Error> { + Ok(nm + .list_saved_connections() + .await? + .into_iter() + .filter_map(|connection| { + saved_wifi_identity(&connection) + .map(|(ssid, _)| (ssid.into_boxed_str(), connection.uuid.into_boxed_str())) + }) + .collect()) +} + +pub async fn import_openvpn(path: impl AsRef) -> Result<(), Error> { + use nmrs::builders::{OpenVpnBuilder, build_openvpn_connection}; + + let nm = NetworkManager::new().await?; + let config = OpenVpnBuilder::from_ovpn_file(path)?.build()?; + let settings = build_openvpn_connection(&config, &ConnectionOptions::new(false))?; + nm.add_connection(settings).await?; + Ok(()) +} + +pub async fn import_wireguard(path: impl AsRef, name: &str) -> Result<(), Error> { + use nmrs::builders::WireGuardBuilder; + + let nm = NetworkManager::new().await?; + let config = parse_wireguard_config(path.as_ref(), name)?; + let mut builder = WireGuardBuilder::new(&config.name) + .private_key(config.private_key) + .address(config.address) + .add_peers(config.peers) + .autoconnect(false); + + if !config.dns.is_empty() { + builder = builder.dns(config.dns); + } + if let Some(mtu) = config.mtu { + builder = builder.mtu(mtu); + } + + nm.add_connection(builder.build()?).await?; + Ok(()) +} + +struct ParsedWireGuard { + name: String, + private_key: String, + address: String, + dns: Vec, + mtu: Option, + peers: Vec, +} + +fn parse_wireguard_config(path: &Path, name: &str) -> Result { + let contents = std::fs::read_to_string(path) + .map_err(|err| Error::Message(format!("failed to read {}: {err}", path.display())))?; + let mut section = ""; + let mut private_key = None; + let mut address = None; + let mut dns = Vec::new(); + let mut mtu = None; + let mut peers = Vec::new(); + let mut peer_public_key: Option = None; + let mut peer_endpoint: Option = None; + let mut peer_allowed_ips: Vec = Vec::new(); + let mut peer_preshared_key: Option = None; + let mut peer_keepalive: Option = None; + + let flush_peer = |peers: &mut Vec, + public_key: &mut Option, + endpoint: &mut Option, + allowed_ips: &mut Vec, + preshared_key: &mut Option, + keepalive: &mut Option| + -> Result<(), Error> { + if public_key.is_none() + && endpoint.is_none() + && allowed_ips.is_empty() + && preshared_key.is_none() + && keepalive.is_none() + { + return Ok(()); + } + + let public_key = public_key + .take() + .ok_or_else(|| Error::Message("WireGuard peer is missing PublicKey".to_string()))?; + let endpoint = endpoint + .take() + .ok_or_else(|| Error::Message("WireGuard peer is missing Endpoint".to_string()))?; + if allowed_ips.is_empty() { + return Err(Error::Message( + "WireGuard peer is missing AllowedIPs".to_string(), + )); + } + + let mut peer = nmrs::WireGuardPeer::new(public_key, endpoint, std::mem::take(allowed_ips)); + if let Some(psk) = preshared_key.take() { + peer = peer.with_preshared_key(psk); + } + if let Some(interval) = keepalive.take() { + peer = peer.with_persistent_keepalive(interval); + } + peers.push(peer); + Ok(()) + }; + + for raw_line in contents.lines() { + let line = raw_line + .split_once('#') + .map_or(raw_line, |(line, _)| line) + .trim(); + if line.is_empty() { + continue; + } + + if line.starts_with('[') && line.ends_with(']') { + if section.eq_ignore_ascii_case("Peer") { + flush_peer( + &mut peers, + &mut peer_public_key, + &mut peer_endpoint, + &mut peer_allowed_ips, + &mut peer_preshared_key, + &mut peer_keepalive, + )?; + } + section = &line[1..line.len() - 1]; + continue; + } + + let Some((key, value)) = line.split_once('=') else { + continue; + }; + let key = key.trim(); + let value = value.trim(); + + if section.eq_ignore_ascii_case("Interface") { + match key.to_ascii_lowercase().as_str() { + "privatekey" => private_key = Some(value.to_string()), + "address" => { + address = value + .split(',') + .map(str::trim) + .find(|value| value.contains('.')) + .or_else(|| value.split(',').map(str::trim).next()) + .map(ToOwned::to_owned); + } + "dns" => dns.extend( + value + .split(',') + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToOwned::to_owned), + ), + "mtu" => mtu = value.parse().ok(), + _ => {} + } + } else if section.eq_ignore_ascii_case("Peer") { + match key.to_ascii_lowercase().as_str() { + "publickey" => peer_public_key = Some(value.to_string()), + "endpoint" => peer_endpoint = Some(value.to_string()), + "allowedips" => { + peer_allowed_ips.extend( + value + .split(',') + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToOwned::to_owned), + ); + } + "presharedkey" => peer_preshared_key = Some(value.to_string()), + "persistentkeepalive" => peer_keepalive = value.parse().ok(), + _ => {} + } + } + } + + if section.eq_ignore_ascii_case("Peer") { + flush_peer( + &mut peers, + &mut peer_public_key, + &mut peer_endpoint, + &mut peer_allowed_ips, + &mut peer_preshared_key, + &mut peer_keepalive, + )?; + } + + Ok(ParsedWireGuard { + name: name.to_string(), + private_key: private_key + .ok_or_else(|| Error::Message("WireGuard config is missing PrivateKey".to_string()))?, + address: address + .ok_or_else(|| Error::Message("WireGuard config is missing Address".to_string()))?, + dns, + mtu, + peers, + }) +} + +fn active_connection_infos( + active: Vec, +) -> Vec { + let mut infos = active + .into_iter() + .filter_map(|connection| match connection { + ActiveConnection::Wired(wired) => Some(current_networks::ActiveConnectionInfo::Wired { + name: wired.id, + hw_address: wired.hw_address.unwrap_or_default(), + speed: wired.speed_mbps.unwrap_or_default(), + ip_addresses: parse_ipv4_list([wired.ip4_address]), + }), + ActiveConnection::Wifi(wifi) => Some(current_networks::ActiveConnectionInfo::WiFi { + name: wifi.ssid, + ip_addresses: parse_ipv4_list([wifi.ip4_address]), + hw_address: wifi.bssid.unwrap_or_default(), + state: devices::ActiveConnectionState::from(wifi.state), + strength: wifi.strength.unwrap_or_default(), + }), + ActiveConnection::Vpn(vpn) => Some(current_networks::ActiveConnectionInfo::Vpn { + name: vpn.id, + ip_addresses: parse_ipv4_list([vpn.ip4_address]), + }), + ActiveConnection::Other(_) => None, + _ => None, + }) + .collect::>(); + + infos.sort_by(|a, b| { + let helper = |conn: ¤t_networks::ActiveConnectionInfo| match conn { + current_networks::ActiveConnectionInfo::Vpn { name, .. } => format!("0{name}"), + current_networks::ActiveConnectionInfo::Wired { name, .. } => format!("1{name}"), + current_networks::ActiveConnectionInfo::WiFi { name, .. } => format!("2{name}"), + }; + helper(a).cmp(&helper(b)) + }); + + infos +} + +fn access_point_from_nmrs(ap: nmrs::AccessPoint) -> available_wifi::AccessPoint { + let network_type = match ap.security.preferred_connect_type() { + ConnectType::Open | ConnectType::Owe => available_wifi::NetworkType::Open, + ConnectType::Eap => available_wifi::NetworkType::EAP, + ConnectType::Psk => available_wifi::NetworkType::PskOrSae, + ConnectType::Sae => available_wifi::NetworkType::Sae, + _ => available_wifi::NetworkType::PskOrSae, + }; + + available_wifi::AccessPoint { + ssid: Arc::from(ap.ssid.as_str()), + strength: ap.strength, + state: devices::DeviceState::from(ap.device_state), + working: false, + path: ap.path, + hw_address: hw_address::HwAddress::from_str(&ap.bssid).unwrap_or_default(), + secured: !ap.security.is_open(), + wps_push: ap.security.wps, + network_type, + interface: Some(ap.interface), + bssid: Some(ap.bssid), + } +} + +fn saved_wifi_profiles(saved: &[SavedConnection]) -> impl Iterator { + saved.iter().filter(|connection| { + connection.connection_type == "802-11-wireless" + && matches!(connection.summary, SettingsSummary::Wifi { .. }) + }) +} + +fn saved_wifi_identity(saved: &SavedConnection) -> Option<(String, available_wifi::NetworkType)> { + let SettingsSummary::Wifi { ssid, security, .. } = &saved.summary else { + return None; + }; + if ssid.is_empty() { + return None; + } + + let network_type = match security.as_ref().map(|s| s.key_mgmt) { + None | Some(WifiKeyMgmt::None | WifiKeyMgmt::Owe | WifiKeyMgmt::OweTransitionMode) => { + available_wifi::NetworkType::Open + } + Some(WifiKeyMgmt::WpaEap) => available_wifi::NetworkType::EAP, + Some(WifiKeyMgmt::Wep | WifiKeyMgmt::WpaPsk) => available_wifi::NetworkType::PskOrSae, + Some(WifiKeyMgmt::Sae) => available_wifi::NetworkType::Sae, + Some(_) => available_wifi::NetworkType::PskOrSae, + }; + + Some((ssid.clone(), network_type)) +} + +fn saved_matches_device( + connection: &SavedConnection, + device_type: devices::DeviceType, + interface: &str, +) -> bool { + let type_matches = match device_type { + devices::DeviceType::Ethernet => connection.connection_type == "802-3-ethernet", + devices::DeviceType::Wifi => connection.connection_type == "802-11-wireless", + devices::DeviceType::WireGuard => connection.connection_type == "wireguard", + _ => false, + }; + + type_matches + && connection + .interface_name + .as_deref() + .is_none_or(|name| name == interface) +} + +fn active_connection_by_interface( + active: &[ActiveConnection], + interface: &str, +) -> Option { + for connection in active { + match connection { + ActiveConnection::Wired(wired) if wired.interface.as_deref() == Some(interface) => { + return Some(ActiveConnectionRecord { + path: slash_path(), + id: wired.id.clone(), + uuid: wired.uuid.clone(), + state: devices::ActiveConnectionState::from(wired.state), + }); + } + ActiveConnection::Wifi(wifi) if wifi.interface.as_deref() == Some(interface) => { + return Some(ActiveConnectionRecord { + path: slash_path(), + id: wifi.id.clone(), + uuid: wifi.uuid.clone(), + state: devices::ActiveConnectionState::from(wifi.state), + }); + } + ActiveConnection::Vpn(vpn) if vpn.interface.as_deref() == Some(interface) => { + return Some(ActiveConnectionRecord { + path: slash_path(), + id: vpn.id.clone(), + uuid: vpn.uuid.clone(), + state: devices::ActiveConnectionState::from(vpn.state), + }); + } + _ => {} + } + } + + None +} + +fn parse_ipv4_list(addresses: impl IntoIterator>) -> Vec { + addresses + .into_iter() + .flatten() + .filter_map(|address| { + address + .split_once('/') + .map_or(address.as_str(), |(address, _)| address) + .parse() + .ok() + }) + .collect() +} + +fn slash_path() -> OwnedObjectPath { + OwnedObjectPath::try_from("/").expect("slash is a valid object path") +} + +fn owned_path(path: &str) -> Result { + OwnedObjectPath::try_from(path) + .map_err(|err| Error::Message(format!("invalid object path {path}: {err}"))) +} + +pub mod nm_secret_agent { + use super::*; + + pub type SecretSender = + Arc>>>; + + #[derive(Debug, Clone, Copy, Eq, PartialEq)] + pub enum PasswordFlag { + None = 0, + AgentOwned = 1, + NotSaved = 2, + NotRequired = 4, + } + + #[derive(Clone, Debug)] + pub struct Error(pub String); + + impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(&self.0) + } + } + + impl std::error::Error for Error {} + + #[derive(Debug, Clone)] + pub enum Event { + RequestSecret { + uuid: String, + name: String, + description: Option, + previous: SecureString, + tx: SecretSender, + }, + CancelGetSecrets { + uuid: String, + name: String, + }, + Failed(Error), + } + + #[derive(Debug)] + pub enum Request { + SetSecrets { + setting_name: String, + uuid: String, + secrets: HashMap, + applied_tx: oneshot::Sender<()>, + }, + GetSecrets { + setting_name: String, + uuid: String, + resp_tx: oneshot::Sender>, + }, + } + + pub fn secret_agent_stream( + identifier: impl AsRef, + rx: tokio::sync::mpsc::Receiver, + ) -> impl futures::Stream { + let identifier = identifier.as_ref().to_string(); + cosmic::iced::stream::channel( + 4, + move |mut msg_tx: futures::channel::mpsc::Sender| async move { + if let Err(error) = secret_agent_stream_impl(&identifier, msg_tx.clone(), rx).await + { + _ = msg_tx.send(Event::Failed(error)).await; + } + }, + ) + } + + async fn secret_agent_stream_impl( + identifier: &str, + mut msg_tx: futures::channel::mpsc::Sender, + mut rx: tokio::sync::mpsc::Receiver, + ) -> Result<(), Error> { + unlock_collection().await?; + + let (_handle, mut requests) = SecretAgent::builder() + .with_identifier(identifier) + .register() + .await + .map_err(|err| Error(err.to_string()))?; + + loop { + futures::select! { + request = rx.recv().fuse() => { + let Some(request) = request else { + break; + }; + handle_control_request(request).await?; + } + request = requests.next().fuse() => { + let Some(request) = request else { + break; + }; + handle_secret_request(&mut msg_tx, request).await?; + } + } + } + + Ok(()) + } + + async fn handle_control_request(request: Request) -> Result<(), Error> { + match request { + Request::SetSecrets { + setting_name, + uuid, + secrets, + applied_tx, + } => { + if secrets.is_empty() { + delete_secrets(&uuid).await?; + } else { + store_secrets(&uuid, &setting_name, &secrets).await?; + } + _ = applied_tx.send(()); + } + Request::GetSecrets { + setting_name, + uuid, + resp_tx, + } => { + let secrets = get_secrets(&uuid, &setting_name).await?; + _ = resp_tx.send(secrets); + } + } + + Ok(()) + } + + async fn handle_secret_request( + msg_tx: &mut futures::channel::mpsc::Sender, + request: SecretRequest, + ) -> Result<(), Error> { + let setting_name = setting_name(&request.setting); + if !request.flags.contains(SecretAgentFlags::REQUEST_NEW) { + let stored = get_secrets(&request.connection_uuid, setting_name).await?; + if !stored.is_empty() { + return respond_with_stored(request, stored).await; + } + } + + if !request + .flags + .intersects(SecretAgentFlags::ALLOW_INTERACTION | SecretAgentFlags::REQUEST_NEW) + { + request + .responder + .no_secrets() + .await + .map_err(|err| Error(err.to_string()))?; + return Ok(()); + } + + let (tx, rx) = oneshot::channel(); + let tx = Arc::new(tokio::sync::Mutex::new(Some(tx))); + let description = match &request.setting { + SecretSetting::WifiPsk { ssid } => Some(ssid.clone()), + SecretSetting::WifiEap { identity, method } => Some( + format!( + "{} {}", + identity.clone().unwrap_or_default(), + method.clone().unwrap_or_default() + ) + .trim() + .to_string(), + ), + SecretSetting::Vpn { + service_type, + user_name, + } => Some(user_name.clone().unwrap_or_else(|| service_type.clone())), + SecretSetting::Other(setting) => Some(setting.clone()), + _ => None, + } + .filter(|value| !value.is_empty()); + + let event_name = match &request.setting { + SecretSetting::WifiPsk { .. } | SecretSetting::WifiEap { .. } => { + request.connection_uuid.clone() + } + _ => request.connection_id.clone(), + }; + + let response_kind = ResponseKind::from(&request); + let uuid = request.connection_uuid.clone(); + msg_tx + .send(Event::RequestSecret { + uuid: uuid.clone(), + name: event_name, + description, + previous: SecureString::from(""), + tx, + }) + .await + .map_err(|err| Error(err.to_string()))?; + + match rx.await { + Ok(secret) => { + let mut stored = HashMap::new(); + let key = response_kind.key(); + stored.insert(key.to_string(), secret.clone()); + store_secrets(&uuid, setting_name, &stored).await?; + response_kind.respond(request.responder, secret).await?; + } + Err(_) => { + request + .responder + .cancel() + .await + .map_err(|err| Error(err.to_string()))?; + } + } + + Ok(()) + } + + enum ResponseKind { + WifiPsk, + WifiEap { identity: Option }, + Vpn { key: String }, + Raw { setting_name: String, key: String }, + } + + impl ResponseKind { + fn from(request: &SecretRequest) -> Self { + match &request.setting { + SecretSetting::WifiPsk { .. } => Self::WifiPsk, + SecretSetting::WifiEap { identity, .. } => Self::WifiEap { + identity: identity.clone(), + }, + SecretSetting::Vpn { .. } => Self::Vpn { + key: request + .hints + .iter() + .find(|hint| !hint.contains(':')) + .cloned() + .unwrap_or_else(|| "password".to_string()), + }, + SecretSetting::Other(setting_name) => Self::Raw { + setting_name: setting_name.clone(), + key: request + .hints + .first() + .cloned() + .unwrap_or_else(|| "password".to_string()), + }, + _ => Self::Raw { + setting_name: setting_name(&request.setting).to_string(), + key: "password".to_string(), + }, + } + } + + fn key(&self) -> &str { + match self { + Self::WifiPsk => "psk", + Self::WifiEap { .. } => "password", + Self::Vpn { key } | Self::Raw { key, .. } => key.as_str(), + } + } + + async fn respond( + self, + responder: SecretResponder, + secret: SecureString, + ) -> Result<(), Error> { + match self { + Self::WifiPsk => responder + .wifi_psk(secret.unsecure().to_string()) + .await + .map_err(|err| Error(err.to_string())), + Self::WifiEap { identity } => responder + .wifi_eap(identity, secret.unsecure().to_string()) + .await + .map_err(|err| Error(err.to_string())), + Self::Vpn { key } => responder + .vpn_secrets(HashMap::from([(key, secret.unsecure().to_string())])) + .await + .map_err(|err| Error(err.to_string())), + Self::Raw { setting_name, key } => { + let mut inner = HashMap::new(); + inner.insert( + key, + OwnedValue::from(Str::from(secret.unsecure().to_string())), + ); + responder + .raw(setting_name, inner) + .await + .map_err(|err| Error(err.to_string())) + } + } + } + } + + async fn respond_with_stored( + request: SecretRequest, + stored: HashMap, + ) -> Result<(), Error> { + match &request.setting { + SecretSetting::WifiPsk { .. } => { + if let Some(psk) = stored.get("psk") { + request + .responder + .wifi_psk(psk.unsecure().to_string()) + .await + .map_err(|err| Error(err.to_string()))?; + } else { + request + .responder + .no_secrets() + .await + .map_err(|err| Error(err.to_string()))?; + } + } + SecretSetting::WifiEap { identity, .. } => { + if let Some(password) = stored.get("password") { + request + .responder + .wifi_eap(identity.clone(), password.unsecure().to_string()) + .await + .map_err(|err| Error(err.to_string()))?; + } else { + request + .responder + .no_secrets() + .await + .map_err(|err| Error(err.to_string()))?; + } + } + SecretSetting::Vpn { .. } => { + let secrets = stored + .into_iter() + .map(|(key, value)| (key, value.unsecure().to_string())) + .collect(); + request + .responder + .vpn_secrets(secrets) + .await + .map_err(|err| Error(err.to_string()))?; + } + _ => { + let setting_name = setting_name(&request.setting).to_string(); + let inner = stored + .into_iter() + .map(|(key, value)| { + ( + key, + OwnedValue::from(Str::from(value.unsecure().to_string())), + ) + }) + .collect(); + request + .responder + .raw(setting_name, inner) + .await + .map_err(|err| Error(err.to_string()))?; + } + } + + Ok(()) + } + + fn setting_name(setting: &SecretSetting) -> &'static str { + match setting { + SecretSetting::WifiPsk { .. } => "802-11-wireless-security", + SecretSetting::WifiEap { .. } => "802-1x", + SecretSetting::Vpn { .. } => "vpn", + SecretSetting::Gsm => "gsm", + SecretSetting::Cdma => "cdma", + SecretSetting::Pppoe => "pppoe", + SecretSetting::Other(_) => "connection", + _ => "connection", + } + } + + async fn unlock_collection() -> Result<(), Error> { + let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) + .await + .map_err(|err| Error(err.to_string()))?; + let collection = ss + .get_default_collection() + .await + .map_err(|err| Error(err.to_string()))?; + if collection + .is_locked() + .await + .map_err(|err| Error(err.to_string()))? + { + collection + .unlock() + .await + .map_err(|err| Error(err.to_string()))?; + } + Ok(()) + } + + async fn store_secrets( + uuid: &str, + setting_name: &str, + secrets: &HashMap, + ) -> Result<(), Error> { + let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) + .await + .map_err(|err| Error(err.to_string()))?; + let collection = ss + .get_default_collection() + .await + .map_err(|err| Error(err.to_string()))?; + + for (name, secret) in secrets { + let mut attributes = HashMap::new(); + attributes.insert("application", SECRET_ID); + attributes.insert("uuid", uuid); + attributes.insert("setting_name", setting_name); + attributes.insert("name", name.as_str()); + collection + .create_item( + "NetworkManager Secret", + attributes, + secret.unsecure().as_bytes(), + true, + "text/plain", + ) + .await + .map_err(|err| Error(err.to_string()))?; + } + + Ok(()) + } + + async fn get_secrets( + uuid: &str, + setting_name: &str, + ) -> Result, Error> { + let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) + .await + .map_err(|err| Error(err.to_string()))?; + let collection = ss + .get_default_collection() + .await + .map_err(|err| Error(err.to_string()))?; + let mut attributes = HashMap::new(); + attributes.insert("application", SECRET_ID); + attributes.insert("uuid", uuid); + attributes.insert("setting_name", setting_name); + + let search_items = collection + .search_items(attributes) + .await + .map_err(|err| Error(err.to_string()))?; + let mut secrets = HashMap::new(); + for item in &search_items { + let name = item + .get_attributes() + .await + .map_err(|err| Error(err.to_string()))? + .get("name") + .cloned() + .unwrap_or_else(|| "unknown".to_string()); + let secret = item + .get_secret() + .await + .map_err(|err| Error(err.to_string()))?; + let secret = String::from_utf8(secret).map_err(|err| Error(err.to_string()))?; + secrets.insert(name, SecureString::from(secret)); + } + Ok(secrets) + } + + async fn delete_secrets(uuid: &str) -> Result<(), Error> { + let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) + .await + .map_err(|err| Error(err.to_string()))?; + let collection = ss + .get_default_collection() + .await + .map_err(|err| Error(err.to_string()))?; + let mut attributes = HashMap::new(); + attributes.insert("application", SECRET_ID); + attributes.insert("uuid", uuid); + + let search_items = collection + .search_items(attributes) + .await + .map_err(|err| Error(err.to_string()))?; + for item in &search_items { + item.delete().await.map_err(|err| Error(err.to_string()))?; + } + Ok(()) + } +} diff --git a/cosmic-settings/src/pages/networking/mod.rs b/cosmic-settings/src/pages/networking/mod.rs index 8382e38..84748ce 100644 --- a/cosmic-settings/src/pages/networking/mod.rs +++ b/cosmic-settings/src/pages/networking/mod.rs @@ -1,24 +1,24 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only +pub mod backend; pub mod vpn; pub mod wifi; pub mod wired; -use std::{ffi::OsStr, process::Stdio, sync::Arc}; +use std::process::Stdio; +use std::sync::Arc; use anyhow::Context; use cosmic::{Apply, Element, Task, widget}; -use cosmic_dbus_networkmanager::{ - interface::enums::{DeviceState, DeviceType}, - nm::NetworkManager, -}; -use cosmic_settings_network_manager_subscription as network_manager; use cosmic_settings_page::{self as page, Section, section}; use futures::{SinkExt, StreamExt}; use secure_string::SecureString; use slotmap::SlotMap; +use self::backend as network_manager; +use self::backend::devices::{DeviceState, DeviceType}; + pub type SecretSender = Arc>>>; static NM_CONNECTION_EDITOR: &str = "nm-connection-editor"; @@ -37,8 +37,8 @@ pub struct Page { pub enum Message { /// An error occurred. Error(String), - /// Successfully connected to the system dbus. - NetworkManagerConnect(zbus::Connection), + /// Successfully connected to NetworkManager. + NetworkManagerConnect(nmrs::NetworkManager), /// Open the wifi settings page with the selected device. OpenPage { page: page::Entity, @@ -143,6 +143,7 @@ impl page::Page for Page { fl!("network-device-state", "unavailable") } DeviceState::Unknown => fl!("network-device-state", "unknown"), + DeviceState::Other(_) => fl!("network-device-state", "unknown"), DeviceState::Unmanaged => fl!("network-device-state", "unmanaged"), }, "preferences-wireless-symbolic", @@ -190,6 +191,7 @@ impl page::Page for Page { fl!("network-device-state", "unplugged") } DeviceState::Unknown => fl!("network-device-state", "unknown"), + DeviceState::Other(_) => fl!("network-device-state", "unknown"), DeviceState::Unmanaged => fl!("network-device-state", "unmanaged"), }, "preferences-wired-symbolic", @@ -225,9 +227,9 @@ impl page::Page for Page { fn on_enter(&mut self) -> cosmic::Task { if self.nm_task.is_none() { return cosmic::Task::future(async move { - zbus::Connection::system() + nmrs::NetworkManager::new() .await - .context("failed to create system dbus connection") + .context("failed to connect to NetworkManager") .map_or_else( |why| Message::Error(why.to_string()), Message::NetworkManagerConnect, @@ -310,33 +312,47 @@ impl Page { Task::none() } - fn connect(&mut self, conn: zbus::Connection) -> Task { + fn connect(&mut self, nm: nmrs::NetworkManager) -> Task { if self.nm_task.is_none() { let (canceller, task) = crate::utils::forward_event_loop(move |mut sender| async move { - let network_manager = match NetworkManager::new(&conn).await { - Ok(n) => n, - Err(why) => { - tracing::error!( - why = why.to_string(), - "failed to connect to network_manager" - ); - - return futures::future::pending().await; + match network_manager::devices::list(&nm, |_| true).await { + Ok(devices) => { + _ = sender + .send(crate::pages::Message::Networking(Message::UpdateDevices( + devices.into_iter().map(Arc::new).collect(), + ))) + .await; } - }; + Err(why) => { + _ = sender + .send(crate::pages::Message::Networking(Message::Error( + why.to_string(), + ))) + .await; + } + } - let mut devices_changed = - std::pin::pin!(network_manager.receive_devices_changed().await.then( - |_| async { - match network_manager::devices::list(&conn, |_| true).await { - Ok(devices) => Message::UpdateDevices( + let Ok(events) = nm.network_events().await else { + return futures::future::pending().await; + }; + let devices_changed = events.filter_map(|event| async { + match event { + Ok(nmrs::NetworkEvent::DeviceChanged { .. }) + | Ok(nmrs::NetworkEvent::SettingsChanged(_)) + | Ok(nmrs::NetworkEvent::NetworkManagerRestarted) => { + match network_manager::devices::list(&nm, |_| true).await { + Ok(devices) => Some(Message::UpdateDevices( devices.into_iter().map(Arc::new).collect(), - ), - Err(why) => Message::Error(why.to_string()), + )), + Err(why) => Some(Message::Error(why.to_string())), } } - )); + Ok(_) => None, + Err(why) => Some(Message::Error(why.to_string())), + } + }); + futures::pin_mut!(devices_changed); while let Some(message) = devices_changed.next().await { _ = sender @@ -353,16 +369,6 @@ impl Page { } } -async fn nm_add_vpn_file>(type_: &str, path: P) -> Result<(), String> { - tokio::process::Command::new("nmcli") - .args(["connection", "import", "type", type_, "file"]) - .arg(path) - .stderr(Stdio::piped()) - .output() - .await - .apply(crate::utils::map_stderr_output) -} - async fn nm_add_wired() -> Result<(), String> { nm_connection_editor(&["--type=802-3-ethernet", "-c"]).await } diff --git a/cosmic-settings/src/pages/networking/vpn/mod.rs b/cosmic-settings/src/pages/networking/vpn/mod.rs index 651022e..6c2c9e7 100644 --- a/cosmic-settings/src/pages/networking/vpn/mod.rs +++ b/cosmic-settings/src/pages/networking/vpn/mod.rs @@ -1,30 +1,27 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -pub mod nmcli; - use std::collections::HashMap; use std::sync::{Arc, LazyLock}; use anyhow::Context; use cosmic::dialog::file_chooser::FileFilter; -use cosmic::task; -use cosmic::{ - Apply, Element, Task, - iced::core::text::Wrapping, - iced::{Alignment, Length}, - widget::{self, icon, space::horizontal as horizontal_space, text_input::focus}, -}; -use cosmic_settings_network_manager_subscription::nm_secret_agent::{self, PasswordFlag}; -use cosmic_settings_network_manager_subscription::{ - self as network_manager, NetworkManagerState, UUID, current_networks::ActiveConnectionInfo, -}; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::space::horizontal as horizontal_space; +use cosmic::widget::text_input::focus; +use cosmic::widget::{self, icon}; +use cosmic::{Apply, Element, Task, task}; use cosmic_settings_page::{self as page, Section, section}; use futures::{FutureExt, SinkExt, StreamExt}; use indexmap::IndexMap; use secure_string::SecureString; use tokio::sync::Mutex; +use super::backend as network_manager; +use super::backend::current_networks::ActiveConnectionInfo; +use super::backend::nm_secret_agent::{self, PasswordFlag}; +use super::backend::{NetworkManagerState, UUID}; use crate::pages::networking::SecretSender; pub static SECURE_INPUT_VPN: LazyLock = LazyLock::new(widget::Id::unique); @@ -60,8 +57,8 @@ pub enum Message { NetworkManager(network_manager::Event), /// An update from the secret agent SecretAgent(network_manager::nm_secret_agent::Event), - /// Successfully connected to the system dbus. - NetworkManagerConnect(zbus::Connection), + /// Successfully connected to NetworkManager. + NetworkManagerConnect(nmrs::NetworkManager), /// Updates the password text input PasswordUpdate(SecureString), /// Refresh devices and their connection profiles @@ -95,6 +92,7 @@ pub enum ErrorKind { ConnectionEditor, ConnectionSettings, DbusConnection, + OpenVpnConfigPath, UpdatingState, WireGuardConfigPath, WireGuardDevice, @@ -109,6 +107,7 @@ impl ErrorKind { ErrorKind::ConnectionEditor => fl!("vpn-error", "connection-editor"), ErrorKind::ConnectionSettings => fl!("vpn-error", "connection-settings"), ErrorKind::DbusConnection => fl!("dbus-connection-error"), + ErrorKind::OpenVpnConfigPath => fl!("vpn-error", "openvpn-config-path"), ErrorKind::UpdatingState => fl!("vpn-error", "updating-state"), ErrorKind::WireGuardConfigPath => fl!("vpn-error", "wireguard-config-path"), ErrorKind::WireGuardDevice => fl!("vpn-error", "wireguard-device"), @@ -179,7 +178,7 @@ pub enum VpnDialog { #[derive(Debug)] pub struct NmState { - conn: zbus::Connection, + conn: nmrs::NetworkManager, sender: futures::channel::mpsc::UnboundedSender, active_conns: Vec, devices: Vec, @@ -369,20 +368,22 @@ impl page::Page for Page { let (tx, rx) = tokio::sync::mpsc::channel(4); self.secret_tx = Some(tx); if self.nm_task.is_none() { - return cosmic::Task::batch([cosmic::task::future(async move { - zbus::Connection::system() - .await - .context("failed to create system dbus connection") - .map_or_else( - |why| Message::Error(ErrorKind::DbusConnection, why.to_string()), - Message::NetworkManagerConnect, - ) - }), - cosmic::Task::stream( - cosmic_settings_network_manager_subscription::nm_secret_agent::secret_agent_stream("com.system76.CosmicSettings.VPN.NetworkManager.SecretAgent", rx), - ) - .map(|m| crate::pages::Message::Vpn(Message::SecretAgent(m))), - ]); + return cosmic::Task::batch([ + cosmic::task::future(async move { + nmrs::NetworkManager::new() + .await + .context("failed to connect to NetworkManager") + .map_or_else( + |why| Message::Error(ErrorKind::DbusConnection, why.to_string()), + Message::NetworkManagerConnect, + ) + }), + cosmic::Task::stream(nm_secret_agent::secret_agent_stream( + "com.system76.CosmicSettings.VPN.NetworkManager.SecretAgent", + rx, + )) + .map(|m| crate::pages::Message::Vpn(Message::SecretAgent(m))), + ]); } cosmic::Task::none() @@ -428,7 +429,19 @@ impl Page { } } Message::KnownConnections(connections) => { - self.known_connections = connections; + let mut connections: Vec<_> = connections.into_iter().collect(); + connections.sort_by(|a, b| { + let name_a = match &a.1 { + ConnectionSettings::Vpn(s) => s.id.as_str(), + ConnectionSettings::Wireguard { id } => id.as_str(), + }; + let name_b = match &b.1 { + ConnectionSettings::Vpn(s) => s.id.as_str(), + ConnectionSettings::Wireguard { id } => id.as_str(), + }; + name_a.to_lowercase().cmp(&name_b.to_lowercase()) + }); + self.known_connections = connections.into_iter().collect(); } Message::UpdateDevices(devices) => { self.update_devices(devices); @@ -481,9 +494,8 @@ impl Page { Message::WireGuardConfig => { if let Some(VpnDialog::WireGuardName(device, filename, path)) = self.dialog.take() { return cosmic::task::future(async move { - let new_path = path.replace(&filename, &device); - _ = std::fs::rename(&path, &new_path); - match super::nm_add_vpn_file("wireguard", new_path).await { + let _ = filename; + match network_manager::import_wireguard(path, &device).await { Ok(_) => Message::Refresh, Err(why) => Message::Error(ErrorKind::Config, why.to_string()), } @@ -496,18 +508,12 @@ impl Page { if let Some(settings) = self.known_connections.get(&uuid) { let settings = match settings { ConnectionSettings::Vpn(settings) => settings, - ConnectionSettings::Wireguard { id } => { - let connection_name = id.clone(); - return cosmic::task::future(async move { - if let Err(why) = nmcli::connect(&connection_name).await { - return Message::Error( - ErrorKind::Connect, - format!("failed to connect to WireGuard VPN: {why}"), - ); - } - - Message::Refresh - }); + ConnectionSettings::Wireguard { .. } => { + if let Some(NmState { ref sender, .. }) = self.nm_state { + _ = sender + .unbounded_send(network_manager::Request::ActivateVpn(uuid)); + } + return Task::none(); } }; @@ -527,28 +533,10 @@ impl Page { return task::message(Message::FocusSecureInput); } _ => { - let connection_name = settings.id.clone(); - let username = settings.username.clone(); - return cosmic::task::future(async move { - if let Err(why) = nmcli::connect(&connection_name).await { - return Message::VpnDialogError(VpnDialog::Password { - error: Some(( - ErrorKind::Connect, - format!("failed to connect to VPN: {why}"), - )), - id: connection_name.clone(), - uuid, - username: username.clone(), - description: None, - password: SecureString::from(""), - password_hidden: true, - // TODO grab from the current dialog - tx: Arc::new(Mutex::new(None)), - }); - } - - Message::Refresh - }); + if let Some(NmState { ref sender, .. }) = self.nm_state { + _ = sender + .unbounded_send(network_manager::Request::ActivateVpn(uuid)); + } } } } @@ -615,89 +603,55 @@ impl Page { }; if let VpnDialog::Password { - id, + id: _, uuid, username, password, tx, .. } = dialog + && let Some(NmState { ref sender, .. }) = self.nm_state { let username_unwrapped = username.clone().unwrap_or_default(); - let task = self.activate_with_password( - id.clone(), - uuid.clone(), - username_unwrapped.clone(), - password.clone(), - ); let sec_tx = self.secret_tx.clone(); - return task - .then(move |_| { - let sec_tx = sec_tx.clone(); - let uuid = uuid.clone(); - let username = username.clone(); - let password = password.clone(); - let tx = tx.clone(); - let id = id.clone(); - Task::future(async move { - let mut guard = tx.lock().await; - if let Some(sender) = guard.take() { - let _ = sender.send(password); - } else { - // apply password and username then - if let Some(sec_tx) = sec_tx { - let (applied_tx, applied_rx) = - tokio::sync::oneshot::channel(); - if let Err(err) = sec_tx - .send(nm_secret_agent::Request::SetSecrets { - setting_name: "vpn".to_string(), - uuid: uuid.to_string(), - secrets: HashMap::from_iter([ - // username and password - ( - "username".to_string(), - username.clone().unwrap_or_default().into(), - ), - ("password".to_string(), password.clone()), - ]), - applied_tx, - }) - .await - { - tracing::error!(%err, "failed to apply secret"); - } - // wait max 1s for the applied signal - if let Err(err) = tokio::time::timeout( - std::time::Duration::from_secs(1), - applied_rx, - ) - .await - { - tracing::error!(%err, "failed to apply secret"); - } - } - // activate - if let Err(why) = nmcli::connect(&id).await { - return Message::VpnDialogError(VpnDialog::Password { - error: Some(( - ErrorKind::Connect, - format!("failed to connect to VPN: {why}"), - )), - id: id.clone(), - uuid, - username: username.clone(), - description: None, - password, - password_hidden: true, - tx: Arc::new(Mutex::new(None)), - }); - } + let nm_sender = sender.clone(); + return Task::future(async move { + let mut guard = tx.lock().await; + if let Some(sender) = guard.take() { + let _ = sender.send(password); + } else { + if let Some(sec_tx) = sec_tx { + let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); + if let Err(err) = sec_tx + .send(nm_secret_agent::Request::SetSecrets { + setting_name: "vpn".to_string(), + uuid: uuid.to_string(), + secrets: HashMap::from_iter([ + ("username".to_string(), username_unwrapped.into()), + ("password".to_string(), password), + ]), + applied_tx, + }) + .await + { + tracing::error!(%err, "failed to apply secret"); } + if let Err(err) = tokio::time::timeout( + std::time::Duration::from_secs(1), + applied_rx, + ) + .await + { + tracing::error!(%err, "failed to apply secret"); + } + } + _ = nm_sender + .unbounded_send(network_manager::Request::ActivateVpn(uuid)); + } - Message::Refresh - }) - }) - .map(crate::app::Message::from); + Message::Refresh + }) + .map(crate::app::Message::from); } } Message::RetryWithPassword => { @@ -706,53 +660,39 @@ impl Page { }; if let VpnDialog::Password { - id, + id: _, uuid, username, password, .. } = dialog + && let Some(NmState { ref sender, .. }) = self.nm_state { let username_unwrapped = username.unwrap_or_default(); let sec_tx = self.secret_tx.clone(); - let task = self.activate_with_password( - id.clone(), - uuid.clone(), - username_unwrapped.clone(), - password.clone(), - ); - return task - .then(move |_| { - let sec_tx = sec_tx.clone(); - let uuid = uuid.clone(); - let username = username_unwrapped.clone(); - let password = password.clone(); - Task::future(async move { - if let Some(sec_tx) = sec_tx { - let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); - let _ = sec_tx - .send(nm_secret_agent::Request::SetSecrets { - setting_name: "vpn".to_string(), - uuid: uuid.to_string(), - secrets: HashMap::from_iter([ - // username and password - ("username".to_string(), username.clone().into()), - ("password".to_string(), password.clone()), - ]), - applied_tx, - }) - .await; - // wait max 1s for the applied signal - let _ = tokio::time::timeout( - std::time::Duration::from_secs(1), - applied_rx, - ) + let nm_sender = sender.clone(); + return Task::future(async move { + if let Some(sec_tx) = sec_tx { + let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); + let _ = sec_tx + .send(nm_secret_agent::Request::SetSecrets { + setting_name: "vpn".to_string(), + uuid: uuid.to_string(), + secrets: HashMap::from_iter([ + ("username".to_string(), username_unwrapped.into()), + ("password".to_string(), password), + ]), + applied_tx, + }) + .await; + let _ = + tokio::time::timeout(std::time::Duration::from_secs(1), applied_rx) .await; - } - Message::Activate(uuid) - }) - }) - .map(crate::app::Message::from); + } + _ = nm_sender.unbounded_send(network_manager::Request::ActivateVpn(uuid)); + Message::Refresh + }) + .map(crate::app::Message::from); } } Message::UsernameUpdate(user) => { @@ -859,56 +799,14 @@ impl Page { Task::none() } - fn activate_with_password( - &mut self, - connection_name: String, - uuid: Arc, - username: String, - password: SecureString, - ) -> Task { - cosmic::task::future(async move { - if let Err(why) = nmcli::set_username(&connection_name, &username).await { - return Message::VpnDialogError(VpnDialog::Password { - error: Some((ErrorKind::WithPassword("username"), why.to_string())), - id: connection_name.clone(), - uuid, - username: Some(username), - description: None, - password, - password_hidden: true, - tx: Arc::new(Mutex::new(None)), - }); - } - - if let Err(why) = nmcli::add_fallback(&connection_name).await { - return Message::VpnDialogError(VpnDialog::Password { - error: Some((ErrorKind::Config, why.to_string())), - id: connection_name.clone(), - uuid, - username: Some(username), - password, - description: None, - password_hidden: true, - tx: Arc::new(Mutex::new(None)), - }); - } - - Message::Refresh - }) - } - - fn connect(&mut self, conn: zbus::Connection) -> Task { + fn connect(&mut self, conn: nmrs::NetworkManager) -> Task { if self.nm_task.is_none() { let (canceller, task) = crate::utils::forward_event_loop(move |mut sender| async move { let (tx, mut rx) = futures::channel::mpsc::channel(1); let watchers = std::pin::pin!(async move { - futures::join!( - network_manager::watch(conn.clone(), tx.clone()), - network_manager::active_conns::watch(conn.clone(), tx.clone()), - network_manager::devices::watch(conn, true, tx) - ) + network_manager::watch(conn, tx).await; }); let forwarder = std::pin::pin!(async move { @@ -1005,7 +903,20 @@ fn devices_view() -> Section { widget::text::body(fl!("no-vpn")).into(), ]))); } else { - let known_networks = page.known_connections.iter().fold( + let mut known_connections: Vec<_> = page.known_connections.iter().collect(); + known_connections.sort_by(|a, b| { + let name_a = match a.1 { + ConnectionSettings::Vpn(s) => s.id.as_str(), + ConnectionSettings::Wireguard { id } => id.as_str(), + }; + let name_b = match b.1 { + ConnectionSettings::Vpn(s) => s.id.as_str(), + ConnectionSettings::Wireguard { id } => id.as_str(), + }; + name_a.to_lowercase().cmp(&name_b.to_lowercase()) + }); + + let known_networks = known_connections.into_iter().fold( vpn_connections, |networks, (uuid, connection)| { let id = match connection { @@ -1114,7 +1025,7 @@ fn popup_button(message: Message, text: &str) -> Element<'_, Message> { .into() } -fn update_state(conn: zbus::Connection) -> Task { +fn update_state(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { match NetworkManagerState::new(&conn).await { Ok(state) => Message::UpdateState(state), @@ -1123,7 +1034,7 @@ fn update_state(conn: zbus::Connection) -> Task { }) } -fn update_devices(conn: zbus::Connection) -> Task { +fn update_devices(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { let filter = |device_type| matches!(device_type, network_manager::devices::DeviceType::WireGuard); @@ -1174,8 +1085,16 @@ fn add_network() -> Task { return Message::AddWireGuardDevice(device, filename.to_owned(), path); } else { - super::nm_add_vpn_file("openvpn", response.url().to_file_path().unwrap()) + let Ok(path) = response.url().to_file_path() else { + return Message::Error( + ErrorKind::OpenVpnConfigPath, + fl!("vpn-error", "openvpn-config-path-desc"), + ); + }; + + network_manager::import_openvpn(path) .await + .map_err(|why| why.to_string()) }; match result { @@ -1190,108 +1109,96 @@ fn add_network() -> Task { .apply(cosmic::task::future) } -fn connection_settings(conn: zbus::Connection) -> Task { - let settings = async move { - let settings = network_manager::dbus::settings::NetworkManagerSettings::new(&conn).await?; - - _ = settings.load_connections(&[]).await; - - let settings = settings - // Get a list of known connections. - .list_connections() - .await? - // Prepare for wrapping in a concurrent stream. - .into_iter() - .map(|conn| async move { conn }) - // Create a concurrent stream for each connection. - .apply(futures::stream::FuturesOrdered::from_iter) - // Concurrently fetch settings for each connection, and filter for VPN. - .filter_map(|conn| async move { - let settings = conn.get_settings().await.ok()?; - - let connection = settings.get("connection")?; - - match connection - .get("type")? - .downcast_ref::() - .ok()? - .as_str() - { - "vpn" => (), - - "wireguard" => { - let id = connection.get("id")?.downcast_ref::().ok()?; - let uuid = connection.get("uuid")?.downcast_ref::().ok()?; - return Some((Arc::from(uuid), ConnectionSettings::Wireguard { id })); - } - - _ => return None, - } - - let vpn = settings.get("vpn")?; - let id = connection.get("id")?.downcast_ref::().ok()?; - let uuid = connection.get("uuid")?.downcast_ref::().ok()?; - - let (connection_type, username, password_flag) = vpn - .get("data") - .and_then(|data| data.downcast_ref::().ok()) - .map(|dict| { - let (mut connection_type, mut password_flag) = (None, None); - let mut username = vpn - .get("user-name") - .and_then(|u| u.downcast_ref::().ok()); - if dict - .get::(&String::from("connection-type")) - .ok() - .flatten() - .as_deref() - // may be "password" or "password-tls" - .is_some_and(|p| p.starts_with("password")) - { - connection_type = Some(ConnectionType::Password); - username = Some(username.unwrap_or_default()); - - password_flag = dict - .get::(&String::from("password-flags")) - .ok() - .flatten() - .and_then(|value| match value.as_str() { - "0" => Some(PasswordFlag::None), - "1" => Some(PasswordFlag::AgentOwned), - "2" => Some(PasswordFlag::NotSaved), - "4" => Some(PasswordFlag::NotRequired), - _ => None, - }); - } - - (connection_type, username, password_flag) - }) - .unwrap_or_default(); - - Some(( - Arc::from(uuid), - ConnectionSettings::Vpn(VpnConnectionSettings { - id, - connection_type, - password_flag, - username, - }), - )) - }) - // Reduce the settings list into - .fold(IndexMap::new(), |mut set, (uuid, data)| async move { - set.insert(uuid, data); - set - }) - .await; - - Ok::<_, zbus::Error>(settings) - }; - +fn connection_settings(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { + let settings = async move { + let vpns = conn.list_vpn_connections().await?; + let mut settings = IndexMap::new(); + + for vpn in vpns { + let uuid = Arc::from(vpn.uuid.as_str()); + let data = match vpn.vpn_type { + nmrs::VpnType::WireGuard { .. } => ConnectionSettings::Wireguard { id: vpn.id }, + nmrs::VpnType::OpenVpn { + connection_type, + user_name, + password_flags, + .. + } => ConnectionSettings::Vpn(VpnConnectionSettings { + id: vpn.id, + username: user_name, + connection_type: connection_type + .filter(|ct| { + matches!( + ct, + nmrs::OpenVpnConnectionType::Password + | nmrs::OpenVpnConnectionType::PasswordTls + ) + }) + .map(|_| ConnectionType::Password), + password_flag: Some(password_flag(password_flags.0)), + }), + nmrs::VpnType::OpenConnect { + user_name, + password_flags, + .. + } + | nmrs::VpnType::StrongSwan { + user_name, + password_flags, + .. + } + | nmrs::VpnType::Pptp { + user_name, + password_flags, + .. + } + | nmrs::VpnType::L2tp { + user_name, + password_flags, + .. + } => ConnectionSettings::Vpn(VpnConnectionSettings { + id: vpn.id, + username: user_name, + connection_type: Some(ConnectionType::Password), + password_flag: Some(password_flag(password_flags.0)), + }), + nmrs::VpnType::Generic { + user_name, + password_flags, + .. + } => ConnectionSettings::Vpn(VpnConnectionSettings { + id: vpn.id, + username: user_name, + connection_type: Some(ConnectionType::Password), + password_flag: Some(password_flag(password_flags.0)), + }), + _ => ConnectionSettings::Vpn(VpnConnectionSettings { + id: vpn.id, + username: None, + connection_type: None, + password_flag: None, + }), + }; + settings.insert(uuid, data); + } + + Ok::<_, nmrs::ConnectionError>(settings) + }; + settings.await.map_or_else( |why| Message::Error(ErrorKind::ConnectionSettings, why.to_string()), Message::KnownConnections, ) }) } + +fn password_flag(value: u32) -> PasswordFlag { + match value { + 0 => PasswordFlag::None, + 1 => PasswordFlag::AgentOwned, + 2 => PasswordFlag::NotSaved, + 4 => PasswordFlag::NotRequired, + _ => PasswordFlag::AgentOwned, + } +} diff --git a/cosmic-settings/src/pages/networking/vpn/nmcli.rs b/cosmic-settings/src/pages/networking/vpn/nmcli.rs deleted file mode 100644 index c759c14..0000000 --- a/cosmic-settings/src/pages/networking/vpn/nmcli.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: GPL-3.0-only - -use cosmic::Apply; -use std::process::Stdio; - -pub async fn set_username(connection_name: &str, username: &str) -> Result<(), String> { - tokio::process::Command::new("nmcli") - .args(["con", "mod", connection_name, "vpn.user-name", username]) - .stderr(Stdio::piped()) - .output() - .await - .apply(crate::utils::map_stderr_output) -} - -pub async fn add_fallback(connection_name: &str) -> Result<(), String> { - tokio::process::Command::new("nmcli") - .args([ - "con", - "mod", - connection_name, - "+vpn.data", - "data-ciphers=AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305:AES-256-CBC:AES-128-CBC", - ]) - .stderr(Stdio::piped()) - .output() - .await - .apply(crate::utils::map_stderr_output) -} - -pub async fn connect(connection_name: &str) -> Result<(), String> { - tokio::process::Command::new("nmcli") - .args(["con", "up", connection_name]) - .stderr(Stdio::piped()) - .output() - .await - .apply(crate::utils::map_stderr_output) -} diff --git a/cosmic-settings/src/pages/networking/wifi.rs b/cosmic-settings/src/pages/networking/wifi.rs index cc1f43b..a715fda 100644 --- a/cosmic-settings/src/pages/networking/wifi.rs +++ b/cosmic-settings/src/pages/networking/wifi.rs @@ -1,31 +1,27 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::{ - collections::{BTreeMap, BTreeSet}, - sync::{Arc, LazyLock}, -}; +use std::collections::{BTreeMap, BTreeSet}; +use std::sync::{Arc, LazyLock}; use anyhow::Context; -use cosmic::{ - Apply, Element, Task, - app::ContextDrawer, - iced::core::text::Wrapping, - iced::{Alignment, Length, widget::operation::focus_next}, - task, - widget::{self, column, icon, space::horizontal, text_input::focus}, -}; -use cosmic_settings_network_manager_subscription::{ - self as network_manager, NetworkManagerState, - available_wifi::{AccessPoint, NetworkType}, - current_networks::ActiveConnectionInfo, - nm_secret_agent, -}; +use cosmic::app::ContextDrawer; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::widget::operation::focus_next; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::space::horizontal; +use cosmic::widget::text_input::focus; +use cosmic::widget::{self, column, icon}; +use cosmic::{Apply, Element, Task, task}; use cosmic_settings_page::{self as page, Section, section}; use futures::{SinkExt, StreamExt}; use secure_string::SecureString; use tokio::sync::Mutex; +use super::backend as network_manager; +use super::backend::available_wifi::{AccessPoint, NetworkType}; +use super::backend::current_networks::ActiveConnectionInfo; +use super::backend::{NetworkManagerState, nm_secret_agent}; use crate::pages::networking::SecretSender; pub static SECURE_INPUT_WIFI: LazyLock = LazyLock::new(widget::Id::unique); @@ -58,8 +54,8 @@ pub enum Message { NetworkManager(network_manager::Event), /// An update from the secret agent SecretAgent(network_manager::nm_secret_agent::Event), - /// Successfully connected to the system dbus. - NetworkManagerConnect(zbus::Connection), + /// Successfully connected to NetworkManager. + NetworkManagerConnect(nmrs::NetworkManager), /// Request an auth dialog PasswordRequest(network_manager::SSID), /// Update the password from the dialog @@ -105,6 +101,7 @@ enum WiFiDialog { ssid: network_manager::SSID, identity: Option, password: SecureString, + network_type: NetworkType, password_hidden: bool, tx: SecretSender, }, @@ -144,7 +141,7 @@ pub struct Page { #[derive(Debug)] pub struct NmState { - conn: zbus::Connection, + conn: nmrs::NetworkManager, sender: futures::channel::mpsc::UnboundedSender, state: network_manager::NetworkManagerState, devices: Vec, @@ -297,19 +294,23 @@ impl page::Page for Page { let (tx, rx) = tokio::sync::mpsc::channel(4); self.secret_tx = Some(tx); if self.nm_task.is_none() { - return Task::batch(vec![cosmic::Task::future(async move { - zbus::Connection::system() - .await - .context("failed to create system dbus connection") - .map_or_else( - |why| Message::Error(why.to_string()), - Message::NetworkManagerConnect, - ) - .apply(crate::pages::Message::WiFi) - }), cosmic::Task::stream( - cosmic_settings_network_manager_subscription::nm_secret_agent::secret_agent_stream("com.system76.CosmicSettings.WiFi.NetworkManager.SecretAgent", rx), - ) - .map(|m| crate::pages::Message::WiFi(Message::SecretAgent(m)))]); + return Task::batch(vec![ + cosmic::Task::future(async move { + nmrs::NetworkManager::new() + .await + .context("failed to connect to NetworkManager") + .map_or_else( + |why| Message::Error(why.to_string()), + Message::NetworkManagerConnect, + ) + .apply(crate::pages::Message::WiFi) + }), + cosmic::Task::stream(nm_secret_agent::secret_agent_stream( + "com.system76.CosmicSettings.WiFi.NetworkManager.SecretAgent", + rx, + )) + .map(|m| crate::pages::Message::WiFi(Message::SecretAgent(m))), + ]); } Task::none() @@ -355,15 +356,22 @@ impl Page { } match req { - network_manager::Request::Authenticate { ssid, identity, .. } => { + network_manager::Request::Authenticate { + ssid, + identity, + network_type, + .. + } => { if success { self.connecting.remove(ssid.as_str()); } else { + self.connecting.remove(ssid.as_str()); // Request to retry self.dialog = Some(WiFiDialog::Password { ssid: ssid.into(), identity, password: SecureString::from(""), + network_type, password_hidden: true, tx: Arc::new(Mutex::new(None)), }); @@ -380,11 +388,13 @@ impl Page { if success || matches!(network_type, NetworkType::Open) { self.connecting.remove(ssid.as_ref()); } else { + self.connecting.remove(ssid.as_ref()); self.dialog = Some(WiFiDialog::Password { ssid, identity: matches!(network_type, NetworkType::EAP) .then(String::new), password: SecureString::from(""), + network_type, password_hidden: true, tx: Arc::new(Mutex::new(None)), }); @@ -452,6 +462,7 @@ impl Page { let qr_string = if let Some(ref pass) = password { let security = match security_type { NetworkType::PskOrSae => "WPA", + NetworkType::Sae => "WPA", NetworkType::EAP => "WPA", NetworkType::Open => "", }; @@ -524,6 +535,7 @@ impl Page { ssid, identity: matches!(ap.network_type, NetworkType::EAP).then(String::new), password: SecureString::from(""), + network_type: ap.network_type, password_hidden: true, tx: Arc::new(Mutex::new(None)), }); @@ -547,6 +559,7 @@ impl Page { ssid, identity, password, + network_type, tx, .. } = dialog @@ -565,6 +578,7 @@ impl Page { ssid: ssid.to_string(), identity, password, + network_type, secret_tx, interface, }); @@ -617,6 +631,7 @@ impl Page { } Message::Disconnect(ssid) => { self.close_popup_and_apply_updates(); + self.connecting.remove(ssid.as_ref()); if let Some(nm) = self.nm_state.as_mut() { _ = nm .sender @@ -630,6 +645,7 @@ impl Page { Message::Forget(ssid) => { self.dialog = None; self.close_popup_and_apply_updates(); + self.connecting.remove(ssid.as_ref()); if let Some(nm) = self.nm_state.as_mut() { _ = nm .sender @@ -651,6 +667,9 @@ impl Page { } } Message::WiFiEnable(enable) => { + if !enable { + self.connecting.clear(); + } if let Some(nm) = self.nm_state.as_mut() { _ = nm .sender @@ -659,7 +678,9 @@ impl Page { } } Message::CancelDialog => { - self.dialog = None; + if let Some(WiFiDialog::Password { ssid, .. }) = self.dialog.take() { + self.connecting.remove(ssid.as_ref()); + } } Message::Error(why) => { tracing::error!(why); @@ -718,15 +739,20 @@ impl Page { password: previous, password_hidden: true, identity: matches!(ap.network_type, NetworkType::EAP).then(String::new), + network_type: ap.network_type, tx, }); return task::message(Message::FocusSecureInput); } nm_secret_agent::Event::CancelGetSecrets { uuid: _, name: _ } => { - self.dialog = self - .dialog - .take() - .filter(|d| !matches!(d, &WiFiDialog::Password { .. })); + match self.dialog.take() { + Some(WiFiDialog::Password { ssid, .. }) => { + self.connecting.remove(ssid.as_ref()); + } + other => { + self.dialog = other; + } + } } nm_secret_agent::Event::Failed(error) => { tracing::error!(%error, "secret agent failure"); @@ -734,15 +760,18 @@ impl Page { ssid, password, identity, + network_type, .. }) = self.dialog.take() { + self.connecting.remove(ssid.as_ref()); self.dialog = Some(WiFiDialog::Password { password, password_hidden: true, tx: Arc::new(Mutex::new(None)), ssid, identity, + network_type, }); return task::message(Message::FocusSecureInput); } @@ -773,19 +802,14 @@ impl Page { Task::none() } - fn connect(&mut self, conn: zbus::Connection) -> Task { + fn connect(&mut self, conn: nmrs::NetworkManager) -> Task { if self.nm_task.is_none() { let (canceller, task) = crate::utils::forward_event_loop(move |mut sender| async move { let (tx, mut rx) = futures::channel::mpsc::channel(1); let watchers = std::pin::pin!(async move { - futures::join!( - network_manager::watch(conn.clone(), tx.clone()), - network_manager::active_conns::watch(conn.clone(), tx.clone()), - network_manager::wireless_enabled::watch(conn.clone(), tx.clone()), - network_manager::watch_connections_changed(conn, tx) - ); + network_manager::watch(conn, tx).await; }); let forwarder = std::pin::pin!(async move { @@ -835,6 +859,12 @@ impl Page { /// Withholds updates if the view more popup is displayed. fn update_state(&mut self, state: NetworkManagerState) { + for active in &state.active_conns { + if let ActiveConnectionInfo::WiFi { name, .. } = active { + self.connecting.remove(name.as_str()); + } + } + if let Some(ref mut nm_state) = self.nm_state { if self.view_more_popup.is_some() { self.withheld_state = Some(state); @@ -1176,10 +1206,9 @@ fn devices_view() -> Section { // Search input (only shown when 15+ networks) if show_search { - let search_input = - widget::search_input(fl!("type-to-search"), &page.search_query) - .on_input(Message::SearchQuery) - .on_clear(Message::SearchQuery(String::new())); + let search_input = widget::search_input("", &page.search_query) + .on_input(Message::SearchQuery) + .on_clear(Message::SearchQuery(String::new())); visible_section = visible_section.push(search_input); } @@ -1275,51 +1304,9 @@ fn popup_button(message: Message, text: &str) -> Element<'_, Message> { .into() } -fn connection_settings(conn: zbus::Connection) -> Task { - let settings = async move { - let settings = network_manager::dbus::settings::NetworkManagerSettings::new(&conn).await?; - - _ = settings.load_connections(&[]).await; - - let settings = settings - // Get a list of known connections. - .list_connections() - .await? - // Prepare for wrapping in a concurrent stream. - .into_iter() - .map(|conn| async move { conn }) - // Create a concurrent stream for each connection. - .apply(futures::stream::FuturesOrdered::from_iter) - // Concurrently fetch settings for each connection. - .filter_map(|conn| async move { - conn.get_settings() - .await - .map(network_manager::Settings::new) - .ok() - }) - // Reduce the settings list into a SSID->UUID map. - .fold(BTreeMap::new(), |mut set, settings| async move { - if let Some(ref wifi) = settings.wifi - && let Some(ssid) = wifi - .ssid - .clone() - .and_then(|ssid| String::from_utf8(ssid).ok()) - && let Some(ref connection) = settings.connection - && let Some(uuid) = connection.uuid.clone() - { - set.insert(ssid.into(), uuid.into()); - return set; - } - - set - }) - .await; - - Ok::<_, zbus::Error>(settings) - }; - +fn connection_settings(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { - settings + network_manager::wifi_connection_settings(conn) .await .context("failed to get connection settings") .map_or_else( @@ -1330,7 +1317,7 @@ fn connection_settings(conn: zbus::Connection) -> Task { }) } -pub fn update_state(conn: zbus::Connection) -> Task { +pub fn update_state(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { match NetworkManagerState::new(&conn).await { Ok(state) => Message::UpdateState(state), @@ -1339,7 +1326,7 @@ pub fn update_state(conn: zbus::Connection) -> Task { }) } -pub fn update_devices(conn: zbus::Connection) -> Task { +pub fn update_devices(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { let filter = |device_type| matches!(device_type, network_manager::devices::DeviceType::Wifi); diff --git a/cosmic-settings/src/pages/networking/wired.rs b/cosmic-settings/src/pages/networking/wired.rs index 18bb8af..3a1bf86 100644 --- a/cosmic-settings/src/pages/networking/wired.rs +++ b/cosmic-settings/src/pages/networking/wired.rs @@ -1,22 +1,23 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::{collections::BTreeSet, sync::Arc}; +use std::collections::BTreeSet; +use std::sync::Arc; use anyhow::Context; -use cosmic::{ - Apply, Element, Task, - iced::core::text::Wrapping, - iced::{Alignment, Length}, - widget::{self, icon, space::horizontal as horizontal_space}, -}; -use cosmic_dbus_networkmanager::interface::enums::DeviceState; -use cosmic_settings_network_manager_subscription::{ - self as network_manager, NetworkManagerState, current_networks::ActiveConnectionInfo, -}; +use cosmic::iced::core::text::Wrapping; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::space::horizontal as horizontal_space; +use cosmic::widget::{self, icon}; +use cosmic::{Apply, Element, Task}; use cosmic_settings_page::{self as page, Section, section}; use futures::{SinkExt, StreamExt}; +use super::backend as network_manager; +use super::backend::NetworkManagerState; +use super::backend::current_networks::ActiveConnectionInfo; +use super::backend::devices::DeviceState; + pub type ConnectionId = Arc; #[derive(Clone, Debug)] @@ -33,8 +34,8 @@ pub enum Message { Error(String), /// An update from the network manager daemon NetworkManager(network_manager::Event), - /// Successfully connected to the system dbus. - NetworkManagerConnect(zbus::Connection), + /// Successfully connected to NetworkManager. + NetworkManagerConnect(nmrs::NetworkManager), /// Refresh devices and their connection profiles Refresh, /// Create a dialog to ask for confirmation of removal. @@ -92,7 +93,7 @@ pub struct Page { #[derive(Debug)] pub struct NmState { - conn: zbus::Connection, + conn: nmrs::NetworkManager, sender: futures::channel::mpsc::UnboundedSender, active_conns: Vec, devices: Vec>, @@ -155,9 +156,9 @@ impl page::Page for Page { fn on_enter(&mut self) -> cosmic::Task { if self.nm_task.is_none() { return cosmic::task::future(async move { - zbus::Connection::system() + nmrs::NetworkManager::new() .await - .context("failed to create system dbus connection") + .context("failed to connect to NetworkManager") .map_or_else( |why| Message::Error(why.to_string()), Message::NetworkManagerConnect, @@ -357,18 +358,14 @@ impl Page { Task::none() } - fn connect(&mut self, conn: zbus::Connection) -> Task { + fn connect(&mut self, conn: nmrs::NetworkManager) -> Task { if self.nm_task.is_none() { let (canceller, task) = crate::utils::forward_event_loop(move |mut sender| async move { let (tx, mut rx) = futures::channel::mpsc::channel(1); let watchers = std::pin::pin!(async move { - futures::join!( - network_manager::watch(conn.clone(), tx.clone()), - network_manager::active_conns::watch(conn.clone(), tx.clone()), - network_manager::devices::watch(conn, true, tx) - ) + network_manager::watch(conn, tx).await; }); let forwarder = std::pin::pin!(async move { @@ -623,7 +620,7 @@ fn popup_button(message: Message, text: &str) -> Element<'_, Message> { .into() } -fn update_state(conn: zbus::Connection) -> Task { +fn update_state(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { match NetworkManagerState::new(&conn).await { Ok(state) => Message::UpdateState(state), @@ -632,7 +629,7 @@ fn update_state(conn: zbus::Connection) -> Task { }) } -fn update_devices(conn: zbus::Connection) -> Task { +fn update_devices(conn: nmrs::NetworkManager) -> Task { cosmic::task::future(async move { let filter = |device_type| matches!(device_type, network_manager::devices::DeviceType::Ethernet); diff --git a/cosmic-settings/src/pages/power/backend/mod.rs b/cosmic-settings/src/pages/power/backend/mod.rs index fd9ca73..afff003 100644 --- a/cosmic-settings/src/pages/power/backend/mod.rs +++ b/cosmic-settings/src/pages/power/backend/mod.rs @@ -1,7 +1,9 @@ -use futures::{FutureExt, Stream, StreamExt, future::join_all}; +use futures::future::join_all; +use futures::{FutureExt, Stream, StreamExt}; use jiff::{Span, SpanRelativeTo, SpanRound, ToSpan, Unit}; use upower_dbus::{BatteryState, BatteryType, DeviceProxy}; -use zbus::{Connection, zvariant::ObjectPath}; +use zbus::Connection; +use zbus::zvariant::ObjectPath; mod ppdaemon; mod s76powerdaemon; diff --git a/cosmic-settings/src/pages/power/mod.rs b/cosmic-settings/src/pages/power/mod.rs index b68b135..33e75d6 100644 --- a/cosmic-settings/src/pages/power/mod.rs +++ b/cosmic-settings/src/pages/power/mod.rs @@ -3,12 +3,11 @@ mod backend; use self::backend::{GetCurrentPowerProfile, SetPowerProfile}; use backend::{Battery, ConnectedDevice, PowerProfile}; -use cosmic::Task; use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit}; use cosmic::iced::widget::{column, row}; use cosmic::iced::{self, Alignment, Length, stream}; use cosmic::widget::{self, settings, space, text}; -use cosmic::{Apply, surface}; +use cosmic::{Apply, Task, surface}; use cosmic_config::{Config, CosmicConfigEntry}; use cosmic_idle_config::CosmicIdleConfig; use cosmic_settings_page::{self as page, Section, section}; diff --git a/cosmic-settings/src/pages/sound/device_profiles.rs b/cosmic-settings/src/pages/sound/device_profiles.rs index 4e4e627..66c1045 100644 --- a/cosmic-settings/src/pages/sound/device_profiles.rs +++ b/cosmic-settings/src/pages/sound/device_profiles.rs @@ -1,13 +1,26 @@ // Copyright 2025 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{Apply, widget}; +use super::model; +use cosmic::iced::futures; +use cosmic::{Apply, iced, widget}; +use cosmic_settings_audio_client::{self as audio_client, CosmicAudioProxy}; use cosmic_settings_page::{self as page, Section, section}; -use cosmic_settings_sound_subscription::{self as subscription}; +use futures::executor::block_on; use slotmap::SlotMap; +use std::cell::RefCell; +use std::rc::Rc; +use std::sync::Arc; #[derive(Clone, Debug)] -pub enum Message {} +pub enum Message { + /// Update for the model. + Model(cosmic_settings_sound::Message), + /// Set the profile of a sound device. + SetProfile(u32, u32), + /// Surface Action + Surface(cosmic::surface::Action), +} impl From for crate::pages::Message { fn from(message: Message) -> Self { @@ -24,6 +37,8 @@ impl From for crate::Message { #[derive(Default)] pub struct Page { entity: page::Entity, + model: model::Model, + client: Option>>, } impl page::AutoBind for Page {} @@ -41,55 +56,83 @@ impl page::Page for Page { Some(vec![sections.insert(view())]) } - fn on_leave(&mut self) -> cosmic::Task { - cosmic::Task::done(crate::pages::Message::Sound(super::Message::Reload)) - } - fn set_id(&mut self, entity: cosmic_settings_page::Entity) { self.entity = entity; } - fn subscription( - &self, - _core: &cosmic::Core, - ) -> cosmic::iced::Subscription { - cosmic::iced::Subscription::run(subscription::watch) - .map(|message| super::Message::Subscription(message).into()) + fn on_leave(&mut self) -> cosmic::Task { + *self = Page { + entity: self.entity, + ..Page::default() + }; + cosmic::Task::none() + } + + fn subscription(&self, _core: &cosmic::Core) -> iced::Subscription { + iced::Subscription::run(|| { + iced::stream::channel( + 1, + move |emitter: futures::channel::mpsc::Sender| async move { + cosmic_settings_sound::subscribe(emitter, |m| Message::Model(m).into()).await + }, + ) + }) } } impl Page { - pub fn update(&mut self, _message: Message) -> cosmic::Task { + pub fn update(&mut self, message: Message) -> cosmic::Task { + match message { + Message::Model(cosmic_settings_sound::Message::Subscription(message)) => { + self.model.update(message); + } + + Message::Model(cosmic_settings_sound::Message::Client(client)) => { + if let Some(client) = Arc::into_inner(client) { + self.client = Some(Rc::new(RefCell::new(client))); + self.model = model::Model { + text: model::Text { + hd_audio: fl!("sound-hd-audio"), + usb_audio: fl!("sound-usb-audio"), + }, + ..model::Model::default() + }; + } + } + + Message::Surface(a) => return cosmic::task::message(crate::app::Message::Surface(a)), + + Message::SetProfile(id, index) => { + if let Some(client) = self.client.clone() { + block_on(async move { + _ = client.borrow_mut().conn.set_profile(id, index, true).await; + }); + } + } + } + cosmic::Task::none() } } pub fn view() -> Section { - Section::default().view::(move |binder, _page, _section| { - let sound_page_id = binder.find_page_by_id("sound").unwrap().0; - let sound_page = binder.page[sound_page_id] - .downcast_ref::() - .unwrap(); - - let devices = sound_page - .model - .device_profile_dropdowns - .iter() - .cloned() - .map(|(device_id, name, active_profile, indexes, descriptions)| { + Section::default().view::(move |_, page, _section| { + let devices = page.model.device_profile_dropdowns.iter().cloned().map( + |(device_id, name, active_profile, indexes, descriptions)| { let dropdown = widget::dropdown::popup_dropdown( descriptions, active_profile, - move |id| super::Message::SetProfile(device_id, indexes[id]), + move |id| Message::SetProfile(device_id, indexes[id]), cosmic::iced::window::Id::RESERVED, - super::Message::Surface, + Message::Surface, crate::Message::from, ) .apply(cosmic::Element::from) .map(crate::pages::Message::from); widget::settings::item::builder(name).control(dropdown) - }); + }, + ); widget::settings::section().extend(devices).into() }) diff --git a/cosmic-settings/src/pages/sound/mod.rs b/cosmic-settings/src/pages/sound/mod.rs index a2a7699..6f15634 100644 --- a/cosmic-settings/src/pages/sound/mod.rs +++ b/cosmic-settings/src/pages/sound/mod.rs @@ -3,16 +3,19 @@ pub mod device_profiles; -use cosmic::{ - Apply, Element, Task, - iced::{Alignment, Length, window}, - surface, - widget::{self, settings, space::horizontal as horizontal_space}, -}; +use cosmic::iced::{self, Alignment, Length, window}; +use cosmic::widget::space::horizontal as horizontal_space; +use cosmic::widget::{self, settings}; +use cosmic::{Apply, Element, Task, surface}; use cosmic_config::{Config, ConfigGet, ConfigSet}; +use cosmic_settings_audio_client::{self as audio_client, Client, CosmicAudioProxy}; use cosmic_settings_page::{self as page, Section, section}; -use cosmic_settings_sound_subscription as subscription; +use cosmic_settings_sound::model; +use futures::executor::block_on; use slotmap::SlotMap; +use std::sync::atomic::AtomicU32; +use std::sync::{Arc, atomic}; +use std::time::Duration; const AUDIO_CONFIG: &str = "com.system76.CosmicAudio"; const AMPLIFICATION_SINK: &str = "amplification_sink"; @@ -20,22 +23,20 @@ const AMPLIFICATION_SOURCE: &str = "amplification_source"; #[derive(Clone, Debug)] pub enum Message { - /// Reload the model - Reload, + /// Updates for the model. + Model(cosmic_settings_sound::Message), + /// Reattach the client + ReattachClient(Arc), /// Change the default output. SetDefaultSink(usize), /// Change the default input output. SetDefaultSource(usize), - /// Set the profile of a sound device. - SetProfile(u32, u32), /// Change the balance of the active sink. - SetSinkBalance(u32), + SetSinkBalance(f32), /// Request to change the default output volume. SetSinkVolume(u32), /// Request to change the input volume. SetSourceVolume(u32), - /// Messages handled by the sound module in cosmic-settings-subscriptions - Subscription(subscription::Message), /// Surface Action Surface(surface::Action), /// Toggle the mute status of the output. @@ -60,32 +61,36 @@ impl From for crate::Message { } } -impl From for Message { - fn from(val: subscription::Message) -> Self { - Message::Subscription(val) - } -} - pub struct Page { entity: page::Entity, device_profiles: page::Entity, - pub(self) model: subscription::Model, + client: Option, + model: model::Model, sound_config: Option, + applied_sink_volume: Arc, + applied_sink_volume_balance: Arc, + applied_source_volume: Arc, amplification_sink: bool, amplification_source: bool, } impl Default for Page { fn default() -> Self { - let mut model = subscription::Model::default(); - model.unplugged_text = fl!("sound-device-port-unplugged"); - model.hd_audio_text = fl!("sound-hd-audio"); - model.usb_audio_text = fl!("sound-usb-audio"); Self { entity: page::Entity::default(), device_profiles: page::Entity::default(), - model, + client: None, + model: model::Model { + text: model::Text { + hd_audio: fl!("sound-hd-audio"), + usb_audio: fl!("sound-usb-audio"), + }, + ..model::Model::default() + }, sound_config: None, + applied_sink_volume: Arc::new(AtomicU32::new(0)), + applied_sink_volume_balance: Arc::new(AtomicU32::new(0)), + applied_source_volume: Arc::new(AtomicU32::new(0)), amplification_sink: false, amplification_source: false, } @@ -131,12 +136,15 @@ impl page::Page for Page { self.entity = entity; } - fn subscription( - &self, - _core: &cosmic::Core, - ) -> cosmic::iced::Subscription { - cosmic::iced::Subscription::run(subscription::watch) - .map(|message| Message::Subscription(message).into()) + fn subscription(&self, _core: &cosmic::Core) -> iced::Subscription { + iced::Subscription::run(|| { + iced::stream::channel( + 1, + move |emitter: futures::channel::mpsc::Sender| async move { + cosmic_settings_sound::subscribe(emitter, |m| Message::Model(m).into()).await + }, + ) + }) } fn on_leave(&mut self) -> Task { @@ -163,53 +171,126 @@ impl page::AutoBind for Page { impl Page { pub fn update(&mut self, message: Message) -> Task { + tracing::debug!(target: "sound", ?message, "update"); match message { Message::Surface(a) => return cosmic::task::message(crate::app::Message::Surface(a)), - Message::Subscription(message) => { - return self - .model - .update(message) - .map(|message| Message::Subscription(message).into()); + Message::Model(cosmic_settings_sound::Message::Subscription(message)) => { + self.model.update(message); } - Message::SetSinkBalance(balance) => { - return self - .model - .set_sink_balance(balance) - .map(|message| Message::Subscription(message).into()); + Message::Model(cosmic_settings_sound::Message::Client(client)) => { + if let Some(client) = Arc::into_inner(client) { + self.client = Some(client); + self.model = model::Model { + text: model::Text { + hd_audio: fl!("sound-hd-audio"), + usb_audio: fl!("sound-usb-audio"), + }, + ..model::Model::default() + }; + } + } + + Message::ReattachClient(client) => { + if let Some(client) = Arc::into_inner(client) { + self.client = Some(client); + } } Message::SetDefaultSink(pos) => { - return self - .model - .set_default_sink(pos) - .map(|message| Message::Subscription(message).into()); + if let Some(&pos) = self.model.sinks.sorted_index.get(pos) + && let Some(&node_id) = self.model.sinks.id.get(pos as usize) + && let Some(client) = self.client.as_mut() + { + block_on(async { + _ = client.conn.set_default(node_id, true).await; + }); + } } Message::SetDefaultSource(pos) => { - return self - .model - .set_default_source(pos) - .map(|message| Message::Subscription(message).into()); + if let Some(&pos) = self.model.sources.sorted_index.get(pos) + && let Some(&node_id) = self.model.sources.id.get(pos as usize) + && let Some(client) = self.client.as_mut() + { + block_on(async { + _ = client.conn.set_default(node_id, true).await; + }); + } } - Message::ToggleSinkMute => self.model.toggle_sink_mute(), + Message::ToggleSinkMute => { + if let Some(ref mut client) = self.client { + block_on(async { + _ = client.conn.sink_mute_toggle().await; + }); + } + } - Message::ToggleSourceMute => self.model.toggle_source_mute(), + Message::ToggleSourceMute => { + if let Some(ref mut client) = self.client { + block_on(async { + _ = client.conn.source_mute_toggle().await; + }); + } + } Message::SetSinkVolume(volume) => { - return self - .model - .set_sink_volume(volume) - .map(|message| Message::Subscription(message).into()); + self.applied_sink_volume + .store(volume, atomic::Ordering::Relaxed); + self.model.active_sink.volume = volume; + self.model.active_sink.volume_text = volume.to_string(); + if let Some(mut client) = self.client.take() { + let volume = Arc::clone(&self.applied_sink_volume); + return cosmic::Task::future(async move { + tokio::time::sleep(Duration::from_millis(128)).await; + _ = client + .conn + .set_sink_volume(volume.load(atomic::Ordering::Relaxed)) + .await; + Message::ReattachClient(Arc::new(client)).into() + }); + } } Message::SetSourceVolume(volume) => { - return self - .model - .set_source_volume(volume) - .map(|message| Message::Subscription(message).into()); + self.applied_source_volume + .store(volume, atomic::Ordering::Relaxed); + self.model.active_source.volume = volume; + self.model.active_source.volume_text = volume.to_string(); + if let Some(mut client) = self.client.take() { + let volume = Arc::clone(&self.applied_source_volume); + return cosmic::Task::future(async move { + tokio::time::sleep(Duration::from_millis(128)).await; + _ = client + .conn + .set_sink_volume(volume.load(atomic::Ordering::Relaxed)) + .await; + Message::ReattachClient(Arc::new(client)).into() + }); + } + } + + Message::SetSinkBalance(balance) => { + self.applied_sink_volume_balance + .store((balance * 1000.0) as u32, atomic::Ordering::Relaxed); + self.model.active_sink.balance = Some(balance); + if let Some((mut client, sink_id)) = self.client.take().zip(self.model.default_sink) + { + let balance = Arc::clone(&self.applied_sink_volume_balance); + return cosmic::Task::future(async move { + tokio::time::sleep(Duration::from_millis(128)).await; + _ = client + .conn + .set_node_volume_balance( + sink_id, + Some(balance.load(atomic::Ordering::Relaxed) as f32 / 1000.0), + ) + .await; + Message::ReattachClient(Arc::new(client)).into() + }); + } } Message::ToggleOverAmplificationSink(enabled) => { @@ -231,18 +312,6 @@ impl Page { tracing::error!(?why, "Failed to save over amplification setting"); } } - - Message::SetProfile(object_id, index) => { - self.model.set_profile(object_id, index, true); - } - - Message::Reload => { - let mut model = subscription::Model::default(); - model.hd_audio_text = std::mem::take(&mut self.model.hd_audio_text); - model.unplugged_text = std::mem::take(&mut self.model.unplugged_text); - model.usb_audio_text = std::mem::take(&mut self.model.usb_audio_text); - self.model = model; - } } Task::none() @@ -262,17 +331,17 @@ fn input() -> Section { .title(fl!("sound-input")) .descriptions(descriptions) .view::(move |_binder, page, section| { - if page.model.sources().is_empty() { + if page.model.sources.id.is_empty() { return widget::space().into(); } let slider = if page.amplification_source { - widget::slider(0..=150, page.model.source_volume, |change| { + widget::slider(0..=150, page.model.active_source.volume, |change| { Message::SetSourceVolume(change).into() }) .breakpoints(&[100]) } else { - widget::slider(0..=100, page.model.source_volume, |change| { + widget::slider(0..=100, page.model.active_source.volume, |change| { Message::SetSourceVolume(change).into() }) } @@ -283,23 +352,25 @@ fn input() -> Section { let volume_control = widget::row::with_capacity(4) .align_y(Alignment::Center) .push( - widget::button::icon(widget::icon::from_name(if page.model.source_mute { - "microphone-sensitivity-muted-symbolic" - } else { - "audio-input-microphone-symbolic" - })) + widget::button::icon(widget::icon::from_name( + if page.model.active_source.mute { + "microphone-sensitivity-muted-symbolic" + } else { + "audio-input-microphone-symbolic" + }, + )) .on_press(Message::ToggleSourceMute.into()), ) .push( - widget::text::body(&page.model.source_volume_text) + widget::text::body(&page.model.active_source.volume_text) .width(Length::Fixed(22.0)) .align_x(Alignment::Center), ) .push(horizontal_space().width(8.)) .push(slider); let devices = widget::dropdown::popup_dropdown( - page.model.sources(), - Some(page.model.active_source().unwrap_or(0)), + &page.model.sources.sorted_display, + page.model.sources.active(), Message::SetDefaultSource, window::Id::RESERVED, Message::Surface, @@ -346,12 +417,12 @@ fn output() -> Section { .descriptions(descriptions) .view::(move |_binder, page, section| { let slider = if page.amplification_sink { - widget::slider(0..=150, page.model.sink_volume, |change| { + widget::slider(0..=150, page.model.active_sink.volume, |change| { Message::SetSinkVolume(change).into() }) .breakpoints(&[100]) } else { - widget::slider(0..=100, page.model.sink_volume, |change| { + widget::slider(0..=100, page.model.active_sink.volume, |change| { Message::SetSinkVolume(change).into() }) } @@ -362,7 +433,7 @@ fn output() -> Section { let volume_control = widget::row::with_capacity(4) .align_y(Alignment::Center) .push( - widget::button::icon(if page.model.sink_mute { + widget::button::icon(if page.model.active_sink.mute { widget::icon::from_name("audio-volume-muted-symbolic") } else { widget::icon::from_name("audio-volume-high-symbolic") @@ -370,7 +441,7 @@ fn output() -> Section { .on_press(Message::ToggleSinkMute.into()), ) .push( - widget::text::body(&page.model.sink_volume_text) + widget::text::body(&page.model.active_sink.volume_text) .width(Length::Fixed(22.0)) .align_x(Alignment::Center), ) @@ -378,8 +449,8 @@ fn output() -> Section { .push(slider); let devices = widget::dropdown::popup_dropdown( - page.model.sinks(), - Some(page.model.active_sink().unwrap_or(0)), + &page.model.sinks.sorted_display, + page.model.sinks.active(), Message::SetDefaultSink, window::Id::RESERVED, Message::Surface, @@ -412,12 +483,12 @@ fn output() -> Section { .push(horizontal_space().width(8.)) .push( widget::slider( - 0..=200, - (page.model.sink_balance.unwrap_or(1.0).max(0.) * 100.).round() - as u32, + 0.0..=2.0, + page.model.active_sink.balance.unwrap_or(1.0), |change| Message::SetSinkBalance(change).into(), ) - .breakpoints(&[100]), + .step(0.01) + .breakpoints(&[1.0]), ) .push(horizontal_space().width(8.)) .push( @@ -453,24 +524,13 @@ fn device_profiles() -> Section { .descriptions(descriptions) .view::(move |_binder, page, section| { let descriptions = §ion.descriptions; - let button = widget::row::with_children(vec![ - horizontal_space().into(), - widget::icon::from_name("go-next-symbolic").size(16).into(), - ]); - let device_profiles = settings::item::builder(&*descriptions[button_txt]) - .control(button) - .spacing(16) - .apply(widget::container) - .width(Length::Fill) - .class(cosmic::theme::Container::List) - .apply(widget::button::custom) - .width(Length::Fill) - .class(cosmic::theme::Button::Transparent) - .on_press(crate::pages::Message::Page(page.device_profiles)) - .width(Length::Fill); - - settings::section().add(device_profiles).into() + settings::section() + .add(crate::widget::go_next_item( + &descriptions[button_txt], + crate::pages::Message::Page(page.device_profiles), + )) + .into() }) } diff --git a/cosmic-settings/src/pages/system/about.rs b/cosmic-settings/src/pages/system/about.rs index 0ee99d0..d169ddb 100644 --- a/cosmic-settings/src/pages/system/about.rs +++ b/cosmic-settings/src/pages/system/about.rs @@ -66,7 +66,8 @@ impl page::Page for Page { fn on_enter(&mut self) -> Task { let (task, handle) = Task::future(async move { - crate::pages::Message::About(Message::Info(Box::new(Info::load()))) + let info = Info::load().await; + crate::pages::Message::About(Message::Info(Box::new(info))) }) .abortable(); diff --git a/cosmic-settings/src/pages/system/info.rs b/cosmic-settings/src/pages/system/info.rs index 2ea3ac5..a227fb2 100644 --- a/cosmic-settings/src/pages/system/info.rs +++ b/cosmic-settings/src/pages/system/info.rs @@ -3,7 +3,9 @@ #[cfg(feature = "wgpu")] use cosmic::iced::wgpu; -use std::{collections::HashMap, collections::HashSet, ffi::OsStr, process::Command}; +use std::collections::{HashMap, HashSet}; +use std::ffi::OsStr; +use std::process::Command; #[must_use] #[derive(Clone, Debug, Default)] @@ -29,7 +31,7 @@ impl Info { } #[cfg(feature = "wgpu")] - fn wgpu_graphics() -> Vec { + async fn wgpu_graphics() -> Vec { let mut graphics = Vec::new(); // Use wgpu to enumerate GPUs. Works cross-platform and doesn't require external tools @@ -43,7 +45,7 @@ impl Info { let mut seen_devices = HashSet::new(); let mut seen_names = HashSet::new(); - for adapter in adapters { + for adapter in adapters.await { let adapter_info = adapter.get_info(); if adapter_info.device_type == wgpu::DeviceType::Cpu { @@ -140,7 +142,7 @@ impl Info { graphics } - pub fn load() -> Info { + pub async fn load() -> Info { let mut info = Info { os_architecture: architecture(), kernel_version: kernel_version(), @@ -192,7 +194,7 @@ impl Info { #[cfg(feature = "wgpu")] { - info.graphics = Self::wgpu_graphics(); + info.graphics = Self::wgpu_graphics().await; } info diff --git a/cosmic-settings/src/pages/system/users/mod.rs b/cosmic-settings/src/pages/system/users/mod.rs index 5d23597..2e48195 100644 --- a/cosmic-settings/src/pages/system/users/mod.rs +++ b/cosmic-settings/src/pages/system/users/mod.rs @@ -4,25 +4,22 @@ mod getent; use crate::pages; -use cosmic::{ - Apply, Element, - dialog::file_chooser, - iced::{Alignment, Length}, - widget::{self, column, icon, list, row, settings, space::horizontal, text}, -}; +use cosmic::dialog::file_chooser; +use cosmic::iced::{Alignment, Length}; +use cosmic::widget::space::horizontal; +use cosmic::widget::{self, column, icon, list, row, settings, text}; +use cosmic::{Apply, Element}; use cosmic_settings_page::{self as page, Section, section}; use image::GenericImageView; use pwhash::{bcrypt, md5_crypt, sha256_crypt, sha512_crypt}; use regex::Regex; use slotmap::SlotMap; -use std::{ - collections::HashMap, - fs::File, - future::Future, - io::{BufRead, BufReader}, - path::{Path, PathBuf}, - sync::Arc, -}; +use std::collections::HashMap; +use std::fs::File; +use std::future::Future; +use std::io::{BufRead, BufReader}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; use url::Url; use zbus_polkit::policykit1::CheckAuthorizationFlags; diff --git a/cosmic-settings/src/pages/time/date.rs b/cosmic-settings/src/pages/time/date.rs index 16cc382..8127127 100644 --- a/cosmic-settings/src/pages/time/date.rs +++ b/cosmic-settings/src/pages/time/date.rs @@ -2,24 +2,19 @@ // SPDX-License-Identifier: GPL-3.0-only use crate::widget::selection_context_item; -use cosmic::{ - Apply, Element, Task, - app::ContextDrawer, - cosmic_config::{self, ConfigGet, ConfigSet}, - iced::core::text::Wrapping, - surface, - widget::{self, dropdown, list, settings}, -}; +use cosmic::app::ContextDrawer; +use cosmic::cosmic_config::{self, ConfigGet, ConfigSet}; +use cosmic::iced::core::text::Wrapping; +use cosmic::widget::{self, dropdown, settings}; +use cosmic::{Apply, Element, Task, surface}; use cosmic_settings_page::{self as page, Section, section}; -use icu::{ - calendar::{Gregorian, types::Weekday, week}, - datetime::{ - DateTimeFormatter, DateTimeFormatterPreferences, fieldsets, - input::{Date, DateTime, Time}, - options::TimePrecision, - }, - locale::{Locale, preferences::extensions::unicode::keywords::HourCycle}, -}; +use icu::calendar::types::Weekday; +use icu::calendar::{Gregorian, week}; +use icu::datetime::input::{Date, DateTime, Time}; +use icu::datetime::options::TimePrecision; +use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets}; +use icu::locale::Locale; +use icu::locale::preferences::extensions::unicode::keywords::HourCycle; use slotmap::{Key, SlotMap}; pub use timedate_zbus::TimeDateProxy; use tracing::error; diff --git a/cosmic-settings/src/pages/time/region.rs b/cosmic-settings/src/pages/time/region.rs index 36128f7..7da958a 100644 --- a/cosmic-settings/src/pages/time/region.rs +++ b/cosmic-settings/src/pages/time/region.rs @@ -7,22 +7,20 @@ use std::sync::Arc; use crate::widget::selection_context_item; use cosmic::app::{ContextDrawer, context_drawer}; use cosmic::iced::{Alignment, Length}; -use cosmic::widget::{self, button, list}; +use cosmic::widget::{self, button}; use cosmic::{Apply, Element}; use cosmic_config::{ConfigGet, ConfigSet}; -use cosmic_settings_page::Section; -use cosmic_settings_page::{self as page, section}; +use cosmic_settings_page::{self as page, Section, section}; use eyre::Context; -use icu::{ - calendar::{types::Weekday, week}, - datetime::{ - DateTimeFormatter, DateTimeFormatterPreferences, fieldsets, - input::{Date, DateTime, Time}, - }, - decimal::{DecimalFormatter, input::Decimal}, - locale::Locale, -}; +use icu::calendar::types::Weekday; +use icu::calendar::week; +use icu::datetime::input::{Date, DateTime, Time}; +use icu::datetime::{DateTimeFormatter, DateTimeFormatterPreferences, fieldsets}; +use icu::decimal::DecimalFormatter; +use icu::decimal::input::Decimal; +use icu::locale::Locale; use locales_rs as locale; +use regex::Regex; use slotmap::{DefaultKey, SlotMap}; static GNOME_LANGUAGE_SELECTOR: &str = "gnome-language-selector"; @@ -242,9 +240,7 @@ impl Page { let region = region.lang_code.clone(); return cosmic::task::future(async move { - if let Ok(exit_status) = set_locale(lang, region.clone()).await - && exit_status.success() - { + if set_locale(lang, region.clone()).await.is_ok() { update_time_settings_after_region_change(region); } @@ -498,11 +494,8 @@ mod preferred_languages { use crate::pages::time::region::localized_iso_codes; use super::Message; - use cosmic::{ - Apply, - iced::{Alignment, Length}, - widget, - }; + use cosmic::iced::{Alignment, Length}; + use cosmic::{Apply, widget}; use cosmic_settings_page::Section; pub fn section() -> Section { @@ -710,20 +703,26 @@ pub async fn page_reload() -> eyre::Result { let mut available_languages_set = BTreeSet::new(); - let output = tokio::process::Command::new("localectl") - .arg("list-locales") + // Use 'locale -a' instead of 'localectl list-locales' for OpenRC compatibility + let output_result = tokio::process::Command::new("locale") + .arg("-a") .output() - .await - .expect("Failed to run localectl"); + .await; - let output = String::from_utf8(output.stdout).unwrap_or_default(); - for line in output.lines() { - if line == "C.UTF-8" { - continue; + let locale_list = match output_result { + Ok(output) => { + let output_str = String::from_utf8(output.stdout).unwrap_or_default(); + parse_locale_output(&output_str) } + Err(why) => { + tracing::error!(?why, "failed to list available locales using 'locale -a'"); + Vec::new() + } + }; - if let Some(locale) = registry.locale(line) { - available_languages_set.insert(localized_locale(&locale, line.to_owned())); + for line in locale_list { + if let Some(locale) = registry.locale(&line) { + available_languages_set.insert(localized_locale(&locale, line)); } } @@ -841,27 +840,28 @@ fn popover_menu_row( .apply(Element::from) } -pub async fn set_locale( - lang: String, - region: String, -) -> Result { - eprintln!("setting locale lang={lang}, region={region}"); - tokio::process::Command::new("localectl") - .arg("set-locale") - .args(&[ - ["LANG=", &lang].concat(), - ["LC_ADDRESS=", ®ion].concat(), - ["LC_IDENTIFICATION=", ®ion].concat(), - ["LC_MEASUREMENT=", ®ion].concat(), - ["LC_MONETARY=", ®ion].concat(), - ["LC_NAME=", ®ion].concat(), - ["LC_NUMERIC=", ®ion].concat(), - ["LC_PAPER=", ®ion].concat(), - ["LC_TELEPHONE=", ®ion].concat(), - ["LC_TIME=", ®ion].concat(), - ]) - .status() +/// Sets the system locale using D-Bus instead of localectl for OpenRC compatibility. +pub async fn set_locale(lang: String, region: String) -> eyre::Result<()> { + tracing::debug!("setting locale lang={lang}, region={region}"); + + let conn = zbus::Connection::system() .await + .wrap_err("failed to connect to system D-Bus")?; + + let proxy = locale1::locale1Proxy::new(&conn) + .await + .wrap_err("failed to create locale1 D-Bus proxy")?; + + let locale_settings = build_locale_settings(&lang, ®ion); + let locale_strs: Vec<&str> = locale_settings.iter().map(|s| s.as_str()).collect(); + + proxy + .set_locale(&locale_strs, true) + .await + .wrap_err("failed to set locale via D-Bus")?; + + tracing::debug!("successfully set locale via D-Bus"); + Ok(()) } /// Sets the user's preferred language list via AccountsService D-Bus. @@ -883,7 +883,7 @@ pub async fn set_user_language(language_list: String) -> eyre::Result<()> { .await .wrap_err("failed to set language via AccountsService")?; - eprintln!("set user language via AccountsService: {language_list}"); + tracing::debug!("set user language via AccountsService: {language_list}"); Ok(()) } @@ -1016,3 +1016,206 @@ fn strip_locale_suffix(locale: &str) -> String { .unwrap_or(without_codeset) .to_string() } + +/// Parses the output from `locale -a` command and returns a vector of locale strings. +/// Filters out pseudo-locales (C, POSIX) and accepts only allowed character encodings. +fn parse_locale_output(output: &str) -> Vec { + // Regex to match pseudo-locales: C or POSIX, optionally followed by .anything + let pseudo_locale_re = Regex::new(r"^(C|POSIX)(\.|$)").unwrap(); + + // Regex to match UTF-8 encoded locales (case-insensitive) + // Supports optional modifiers after encoding (e.g., @euro, @valencia) + let utf8_encoding_re = Regex::new(r"(?i)\.(utf-?8)(@.*)?$").unwrap(); + + output + .lines() + .map(|line| line.trim()) + .filter(|line| !pseudo_locale_re.is_match(line)) + .filter(|line| utf8_encoding_re.is_match(line)) + .map(|line| line.to_string()) + .collect() +} + +/// Builds the locale settings array for D-Bus SetLocale call. +/// Sets LANG to the language parameter and all LC_* variables to the region parameter. +fn build_locale_settings(lang: &str, region: &str) -> Vec { + vec![ + format!("LANG={}", lang), + format!("LC_ADDRESS={}", region), + format!("LC_IDENTIFICATION={}", region), + format!("LC_MEASUREMENT={}", region), + format!("LC_MONETARY={}", region), + format!("LC_NAME={}", region), + format!("LC_NUMERIC={}", region), + format!("LC_PAPER={}", region), + format!("LC_TELEPHONE={}", region), + format!("LC_TIME={}", region), + ] +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_parse_locale_output_handles_empty_input() { + let output = ""; + let result = parse_locale_output(output); + assert_eq!(result.len(), 0); + } + + #[test] + fn test_parse_locale_output_preserves_locale_strings() { + let output = "en_US.utf8\nde_DE.utf8\nfr_FR.utf8\n"; + let result = parse_locale_output(output); + assert_eq!(result.len(), 3); + assert!(result.contains(&"en_US.utf8".to_string())); + } + + #[test] + fn test_build_locale_settings_includes_all_lc_variables() { + let lang = "en_US.UTF-8"; + let region = "de_DE.UTF-8"; + let settings = build_locale_settings(lang, region); + + assert_eq!(settings.len(), 10); + assert!(settings.contains(&format!("LANG={}", lang))); + assert!(settings.contains(&format!("LC_ADDRESS={}", region))); + assert!(settings.contains(&format!("LC_IDENTIFICATION={}", region))); + assert!(settings.contains(&format!("LC_MEASUREMENT={}", region))); + assert!(settings.contains(&format!("LC_MONETARY={}", region))); + assert!(settings.contains(&format!("LC_NAME={}", region))); + assert!(settings.contains(&format!("LC_NUMERIC={}", region))); + assert!(settings.contains(&format!("LC_PAPER={}", region))); + assert!(settings.contains(&format!("LC_TELEPHONE={}", region))); + assert!(settings.contains(&format!("LC_TIME={}", region))); + } + + #[test] + fn test_build_locale_settings_uses_correct_values() { + let lang = "fr_FR.UTF-8"; + let region = "en_GB.UTF-8"; + let settings = build_locale_settings(lang, region); + + // LANG should use the lang parameter + assert!(settings.iter().any(|s| s == "LANG=fr_FR.UTF-8")); + // LC_* variables should use the region parameter + assert!(settings.iter().any(|s| s == "LC_TIME=en_GB.UTF-8")); + } + + #[test] + fn test_parse_locale_output_filters_pseudo_locales() { + let output = "C\nC.utf8\nC.UTF-8\nPOSIX\nen_US.utf8\nde_DE.UTF-8\n"; + let result = parse_locale_output(output); + + // Should filter out all C and POSIX variants + assert!(!result.contains(&"C".to_string())); + assert!(!result.contains(&"C.utf8".to_string())); + assert!(!result.contains(&"C.UTF-8".to_string())); + assert!(!result.contains(&"POSIX".to_string())); + + // Should keep actual locales + assert!(result.contains(&"en_US.utf8".to_string())); + assert!(result.contains(&"de_DE.UTF-8".to_string())); + assert_eq!(result.len(), 2); + } + + #[test] + fn test_parse_locale_output_accepts_only_utf8_locales() { + let output = + "en_US\nen_US.utf8\nen_US.UTF-8\nar_IN\nar_IN.utf8\nde_DE.iso88591\nfr_FR.UTF-8\n"; + let result = parse_locale_output(output); + + // Should accept UTF-8 variants + assert!(result.contains(&"en_US.utf8".to_string())); + assert!(result.contains(&"en_US.UTF-8".to_string())); + assert!(result.contains(&"ar_IN.utf8".to_string())); + assert!(result.contains(&"fr_FR.UTF-8".to_string())); + + // Should filter out non-UTF-8 encoded locales + assert!(!result.contains(&"en_US".to_string())); + assert!(!result.contains(&"ar_IN".to_string())); + assert!(!result.contains(&"de_DE.iso88591".to_string())); + + assert_eq!(result.len(), 4); + } + + #[test] + fn test_parse_locale_output_filters_any_c_posix_variant() { + let output = "C\nC.iso88591\nC.anything\nPOSIX\nPOSIX.utf8\nen_US.utf8\n"; + let result = parse_locale_output(output); + + // Should filter out any C or POSIX variant regardless of encoding + assert!(!result.contains(&"C".to_string())); + assert!(!result.contains(&"C.iso88591".to_string())); + assert!(!result.contains(&"C.anything".to_string())); + assert!(!result.contains(&"POSIX".to_string())); + assert!(!result.contains(&"POSIX.utf8".to_string())); + + // Should keep actual locales + assert!(result.contains(&"en_US.utf8".to_string())); + assert_eq!(result.len(), 1); + } + + #[test] + fn test_parse_locale_output_handles_whitespace() { + let output = " en_US.utf8 \n\t de_DE.UTF-8\t\n fr_FR.utf8 \n"; + let result = parse_locale_output(output); + + // Should handle leading/trailing whitespace + assert!(result.contains(&"en_US.utf8".to_string())); + assert!(result.contains(&"de_DE.UTF-8".to_string())); + assert!(result.contains(&"fr_FR.utf8".to_string())); + assert_eq!(result.len(), 3); + } + + #[test] + fn test_parse_locale_output_handles_empty_lines() { + let output = "en_US.utf8\n\n\nde_DE.UTF-8\n\n"; + let result = parse_locale_output(output); + + // Should skip empty lines + assert!(result.contains(&"en_US.utf8".to_string())); + assert!(result.contains(&"de_DE.UTF-8".to_string())); + assert_eq!(result.len(), 2); + } + + #[test] + fn test_parse_locale_output_catalan_not_filtered_as_pseudo() { + let output = "C\nca_ES.UTF-8\nca_ES.utf8\ncs_CZ.UTF-8\nen_US.utf8\n"; + let result = parse_locale_output(output); + + // Should filter out C but not Catalan (ca_*) or Czech (cs_*) + assert!(!result.contains(&"C".to_string())); + assert!(result.contains(&"ca_ES.UTF-8".to_string())); + assert!(result.contains(&"ca_ES.utf8".to_string())); + assert!(result.contains(&"cs_CZ.UTF-8".to_string())); + assert_eq!(result.len(), 4); + } + + #[test] + fn test_parse_locale_output_handles_locale_modifiers() { + let output = "en_US.UTF-8@euro\nca_ES.UTF-8@valencia\nde_DE.utf8\n"; + let result = parse_locale_output(output); + + // Locales with modifiers should be accepted + assert!(result.contains(&"en_US.UTF-8@euro".to_string())); + assert!(result.contains(&"ca_ES.UTF-8@valencia".to_string())); + assert!(result.contains(&"de_DE.utf8".to_string())); + assert_eq!(result.len(), 3); + } + + #[test] + fn test_parse_locale_output_case_variations() { + let output = "en_US.UTF-8\nen_US.utf-8\nen_US.utf8\nen_US.UTF8\nde_DE.Utf8\n"; + let result = parse_locale_output(output); + + // All case variations should be accepted (case-insensitive regex) + assert!(result.contains(&"en_US.UTF-8".to_string())); + assert!(result.contains(&"en_US.utf-8".to_string())); + assert!(result.contains(&"en_US.utf8".to_string())); + assert!(result.contains(&"en_US.UTF8".to_string())); + assert!(result.contains(&"de_DE.Utf8".to_string())); + assert_eq!(result.len(), 5); + } +} diff --git a/cosmic-settings/src/service_manager.rs b/cosmic-settings/src/service_manager.rs new file mode 100644 index 0000000..2090fe8 --- /dev/null +++ b/cosmic-settings/src/service_manager.rs @@ -0,0 +1,631 @@ +// Copyright 2023 System76 +// SPDX-License-Identifier: GPL-3.0-only + +//! Service manager abstraction for managing system services. +//! +//! This module provides a trait-based interface for interacting with system +//! service managers (like systemd, OpenRC, etc.), allowing for testability +//! and flexibility across different init systems. + +use std::future::Future; +use std::pin::Pin; + +/// Trait for managing system services. +/// +/// Implementations are bound to a specific service name and provide +/// methods to query service state and perform lifecycle operations. +pub trait ServiceManager { + /// Whether the service is configured to start on boot. + fn is_enabled(&self) -> bool; + + /// Whether the service is currently running. + fn is_active(&self) -> bool; + + /// Start the service. + fn activate(&self) -> Pin + Send>>; + + /// Enable the service to start on boot and start it now. + fn enable(&self) -> Pin + Send>>; + + /// Whether the service is installed on this system. + fn is_installed(&self) -> bool; +} + +/// A newtype around `Box` that enables `#[derive(Default)]` +/// on containing structs. Methods on `ServiceManager` are accessible via `Deref`. +/// +/// The `Default` impl creates a manager for the `"bluetooth"` service, which is +/// currently the only consumer. If other services need this in the future the +/// default can be made configurable. +pub struct ServiceManagerHandle(Box); + +impl ServiceManagerHandle { + pub fn new(manager: Box) -> Self { + Self(manager) + } +} + +impl std::ops::Deref for ServiceManagerHandle { + type Target = dyn ServiceManager; + fn deref(&self) -> &Self::Target { + &*self.0 + } +} + +impl Default for ServiceManagerHandle { + fn default() -> Self { + Self(create_default_service_manager("bluetooth")) + } +} + +/// Log a warning or error after a privileged command completes. +fn log_command_result( + result: &Result, + description: &str, + service: &str, +) { + match result { + Ok(status) if status.success() => {} + Ok(status) => tracing::warn!( + "{} for '{}' failed with exit code: {:?}", + description, + service, + status.code(), + ), + Err(e) => tracing::error!("Failed to execute {} for '{}': {}", description, service, e,), + } +} + +/// Run a privileged command via `pkexec`. +/// +/// This is the common async entry point for service management actions +/// that require elevated privileges. +async fn run_pkexec_command(args: &[&str], description: &str, service: &str) { + let result = tokio::process::Command::new("pkexec") + .args(args) + .status() + .await; + log_command_result(&result, description, service); +} + +/// Mock ServiceManager that returns configurable boolean values. +#[cfg(test)] +pub struct MockServiceManager { + enabled: bool, + active: bool, + installed: bool, +} + +#[cfg(test)] +impl MockServiceManager { + pub fn new(enabled: bool, active: bool) -> Self { + Self { + enabled, + active, + installed: true, + } + } + + pub fn with_installed(mut self, installed: bool) -> Self { + self.installed = installed; + self + } +} + +#[cfg(test)] +impl ServiceManager for MockServiceManager { + fn is_enabled(&self) -> bool { + self.enabled + } + + fn is_active(&self) -> bool { + self.active + } + + fn activate(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn enable(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn is_installed(&self) -> bool { + self.installed + } +} + +/// SystemD implementation of ServiceManager. +#[cfg(feature = "systemd")] +pub struct SystemDServiceManager { + service_name: String, +} + +#[cfg(feature = "systemd")] +impl SystemDServiceManager { + pub fn new(service_name: impl Into) -> Self { + Self { + service_name: service_name.into(), + } + } +} + +#[cfg(feature = "systemd")] +impl ServiceManager for SystemDServiceManager { + fn is_enabled(&self) -> bool { + std::process::Command::new("systemctl") + .args(["is-enabled", &self.service_name]) + .status() + .map(|status| status.success()) + .unwrap_or(true) + } + + fn is_active(&self) -> bool { + std::process::Command::new("systemctl") + .args(["is-active", &self.service_name]) + .status() + .map(|status| status.success()) + .unwrap_or(true) + } + + fn activate(&self) -> Pin + Send>> { + let service = self.service_name.clone(); + Box::pin(async move { + run_pkexec_command( + &["systemctl", "start", &service], + "systemctl start", + &service, + ) + .await; + }) + } + + fn enable(&self) -> Pin + Send>> { + let service = self.service_name.clone(); + Box::pin(async move { + run_pkexec_command( + &["systemctl", "enable", "--now", &service], + "systemctl enable --now", + &service, + ) + .await; + }) + } + + fn is_installed(&self) -> bool { + std::process::Command::new("systemctl") + .args(["cat", &self.service_name]) + .status() + .map(|status| status.success()) + .unwrap_or(false) + } +} + +/// OpenRC implementation of ServiceManager. +#[cfg(feature = "openrc")] +pub struct OpenRcServiceManager { + service_name: String, +} + +#[cfg(feature = "openrc")] +impl OpenRcServiceManager { + pub fn new(service_name: impl Into) -> Self { + Self { + service_name: service_name.into(), + } + } +} + +/// Parses `rc-update show` output to check if a service is in any runlevel. +/// +/// Uses exact service name matching to avoid false positives from prefix matches +/// (e.g., "bluetoothd" should not match a lookup for "bluetooth"). +#[cfg(any(feature = "openrc", test))] +fn is_service_in_runlevel_output(output: &str, service_name: &str) -> bool { + output.lines().any(|line| { + line.split('|') + .next() + .map(|name| name.trim() == service_name) + .unwrap_or(false) + }) +} + +#[cfg(feature = "openrc")] +impl ServiceManager for OpenRcServiceManager { + fn is_enabled(&self) -> bool { + std::process::Command::new("rc-update") + .args(["show"]) + .output() + .map(|output| { + is_service_in_runlevel_output( + &String::from_utf8_lossy(&output.stdout), + &self.service_name, + ) + }) + .unwrap_or(true) + } + + fn is_active(&self) -> bool { + std::process::Command::new("rc-service") + .args([&self.service_name, "status"]) + .status() + .map(|status| status.success()) + .unwrap_or(true) + } + + fn activate(&self) -> Pin + Send>> { + let service = self.service_name.clone(); + Box::pin(async move { + run_pkexec_command( + &["rc-service", &service, "start"], + "rc-service start", + &service, + ) + .await; + }) + } + + fn enable(&self) -> Pin + Send>> { + let service = self.service_name.clone(); + Box::pin(async move { + run_pkexec_command( + &["rc-update", "add", &service, "default"], + "rc-update add", + &service, + ) + .await; + run_pkexec_command( + &["rc-service", &service, "start"], + "rc-service start", + &service, + ) + .await; + }) + } + + fn is_installed(&self) -> bool { + std::path::Path::new("/etc/init.d") + .join(&self.service_name) + .exists() + } +} + +/// Detect the running service manager and create a manager for the named service. +/// +/// Checks runtime directories (`/run/systemd/system`, `/run/openrc`) to determine +/// which service manager is actively running, rather than relying on which binaries +/// are installed. This avoids false detections when multiple service managers are +/// installed but only one is actively managing services. +pub fn detect_service_manager( + service_name: impl Into, +) -> Result, String> { + let service_name = service_name.into(); + + #[cfg(feature = "systemd")] + { + if std::path::Path::new("/run/systemd/system").exists() { + tracing::debug!("Detected systemd service manager via /run/systemd/system"); + return Ok(Box::new(SystemDServiceManager::new(service_name))); + } + } + + #[cfg(feature = "openrc")] + { + if std::path::Path::new("/run/openrc").exists() { + tracing::debug!("Detected OpenRC service manager via /run/openrc"); + return Ok(Box::new(OpenRcServiceManager::new(service_name))); + } + } + + { + let mut checked = Vec::new(); + #[cfg(feature = "systemd")] + checked.push("systemd (/run/systemd/system)"); + #[cfg(feature = "openrc")] + checked.push("openrc (/run/openrc)"); + + Err(format!( + "Could not detect a running service manager. Checked for: {}. \ + None of these service managers appear to be running on this system.", + checked.join(", ") + )) + } +} + +/// Factory: returns `MockServiceManager` in tests, detects the running service manager in production. +#[cfg(test)] +pub fn create_default_service_manager(_service_name: impl Into) -> Box { + Box::new(MockServiceManager::new(false, false)) +} + +#[cfg(not(test))] +pub fn create_default_service_manager(service_name: impl Into) -> Box { + let service_name = service_name.into(); + detect_service_manager(&service_name).unwrap_or_else(|e| { + tracing::warn!( + "Failed to detect service manager: {}. Service management features will not be available.", + e + ); + tracing::warn!( + "Using no-op service manager for '{}'. Service status will always report as enabled/active, but operations will not actually execute.", + service_name + ); + // Graceful degradation — app continues but service management won't work + Box::new(NoOpServiceManager) + }) +} + +/// Fallback when no service manager is detected — reports everything as active but does nothing. +struct NoOpServiceManager; + +impl ServiceManager for NoOpServiceManager { + fn is_enabled(&self) -> bool { + true + } + + fn is_active(&self) -> bool { + true + } + + fn activate(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn enable(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn is_installed(&self) -> bool { + false + } +} + +#[cfg(test)] +mod tests { + use super::*; + use tracing_subscriber::util::SubscriberInitExt; + + #[test] + fn test_service_manager_trait_is_enabled() { + struct TestServiceManager { + enabled: bool, + installed: bool, + } + + impl ServiceManager for TestServiceManager { + fn is_enabled(&self) -> bool { + self.enabled + } + + fn is_active(&self) -> bool { + true + } + + fn activate(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn enable(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn is_installed(&self) -> bool { + self.installed + } + } + + let test_service = TestServiceManager { + enabled: true, + installed: true, + }; + + assert!(test_service.is_enabled()); + + let disabled_service = TestServiceManager { + enabled: false, + installed: true, + }; + assert!(!disabled_service.is_enabled()); + } + + #[test] + fn test_service_manager_trait_is_active() { + struct TestServiceManager { + active: bool, + installed: bool, + } + + impl ServiceManager for TestServiceManager { + fn is_enabled(&self) -> bool { + true + } + + fn is_active(&self) -> bool { + self.active + } + + fn activate(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn enable(&self) -> Pin + Send>> { + Box::pin(async {}) + } + + fn is_installed(&self) -> bool { + self.installed + } + } + + let test_service = TestServiceManager { + active: true, + installed: true, + }; + + assert!(test_service.is_active()); + + let inactive_service = TestServiceManager { + active: false, + installed: true, + }; + assert!(!inactive_service.is_active()); + } + + #[test] + fn test_mock_service_manager_returns_configured_values() { + let bluetooth = MockServiceManager::new(true, true); + assert!(bluetooth.is_enabled()); + assert!(bluetooth.is_active()); + + let disabled_bluetooth = MockServiceManager::new(false, false); + assert!(!disabled_bluetooth.is_enabled()); + assert!(!disabled_bluetooth.is_active()); + } + + #[test] + #[cfg(feature = "systemd")] + fn test_systemd_service_manager_implements_trait() { + let bluetooth = SystemDServiceManager::new("bluetooth"); + + // Can't test actual systemd calls in unit tests, but verify the struct exists + let _enabled: bool = bluetooth.is_enabled(); + let _active: bool = bluetooth.is_active(); + } + + #[tokio::test] + async fn test_service_manager_trait_has_activate_method() { + let bluetooth = MockServiceManager::new(false, false); + bluetooth.activate().await; + } + + #[tokio::test] + async fn test_service_manager_trait_has_enable_method() { + let bluetooth = MockServiceManager::new(false, false); + bluetooth.enable().await; + } + + #[tokio::test] + async fn test_service_manager_activate_returns_future() { + let bluetooth = MockServiceManager::new(false, false); + let future = bluetooth.activate(); + future.await; + } + + #[tokio::test] + async fn test_service_manager_enable_returns_future() { + let bluetooth = MockServiceManager::new(false, false); + let future = bluetooth.enable(); + future.await; + } + + #[test] + fn test_default_service_manager_uses_mock_in_tests() { + let bluetooth = create_default_service_manager("bluetooth"); + + assert!(!bluetooth.is_enabled()); + assert!(!bluetooth.is_active()); + } + + #[test] + #[cfg(feature = "openrc")] + fn test_openrc_service_manager_implements_trait() { + let bluetooth = OpenRcServiceManager::new("bluetooth"); + + // Can't test actual OpenRC calls in unit tests, but verify the struct exists + let _enabled: bool = bluetooth.is_enabled(); + let _active: bool = bluetooth.is_active(); + } + + #[test] + fn test_detect_service_manager_returns_result() { + let result = detect_service_manager("test-service"); + + match result { + Ok(_) => {} + Err(e) => { + assert!(!e.is_empty()); + assert!( + e.contains("service manager"), + "Error message should mention service manager: {}", + e + ); + } + } + } + + #[test] + fn test_mock_service_manager_accepts_service_name() { + let bluetooth = MockServiceManager::new(true, true); + assert!(bluetooth.is_enabled()); + } + + #[test] + fn test_mock_service_manager_is_installed_defaults_to_true() { + let bluetooth = MockServiceManager::new(true, true); + assert!(bluetooth.is_installed()); + } + + #[test] + fn test_mock_service_manager_with_installed_configures_state() { + let not_installed = MockServiceManager::new(true, true).with_installed(false); + assert!(!not_installed.is_installed()); + + let installed = MockServiceManager::new(true, true).with_installed(true); + assert!(installed.is_installed()); + } + + #[test] + fn test_no_op_service_manager_reports_not_installed() { + let no_op = NoOpServiceManager; + + // When no service manager is detected at runtime, the fallback must report + // not-installed so DBusServiceUnknown falls through to the unknown-service path + // instead of showing a non-functional toggle. + assert!(!no_op.is_installed()); + } + + #[test] + fn test_parse_rc_update_output_exact_service_name() { + // Must use exact matching, not prefix matching — "bluetoothd" must not match "bluetooth". + let output = " bluetoothd | default\n"; + let found = is_service_in_runlevel_output(output, "bluetooth"); + assert!(!found); + } + + #[test] + fn test_parse_rc_update_output_matches_exact_name() { + let output = " bluetooth | default\n"; + let found = is_service_in_runlevel_output(output, "bluetooth"); + assert!(found); + } + + #[test] + fn test_parse_rc_update_output_not_found() { + let output = " dbus | default\n network | sysinit\n"; + let found = is_service_in_runlevel_output(output, "bluetooth"); + assert!(!found); + } + + #[test] + fn test_log_command_result_logs_all_branches() { + let _guard = tracing_subscriber::fmt().with_test_writer().set_default(); + + let err_result: Result = Err( + std::io::Error::new(std::io::ErrorKind::NotFound, "command not found"), + ); + log_command_result(&err_result, "test command", "test-service"); + + let fail_result = std::process::Command::new("false").status(); + log_command_result(&fail_result, "test false", "test-service"); + + let ok_result = std::process::Command::new("true").status(); + log_command_result(&ok_result, "test true", "test-service"); + } + + #[test] + fn test_parse_rc_update_output_multi_line() { + let output = " dbus | default\n bluetooth | default\n network | sysinit\n"; + let found = is_service_in_runlevel_output(output, "bluetooth"); + assert!(found); + } +} diff --git a/cosmic-settings/src/subscription/daytime.rs b/cosmic-settings/src/subscription/daytime.rs index 00b8159..06915d3 100644 --- a/cosmic-settings/src/subscription/daytime.rs +++ b/cosmic-settings/src/subscription/daytime.rs @@ -2,11 +2,9 @@ use std::any::TypeId; use ashpd::desktop::location::{Location, LocationProxy}; use chrono::NaiveDate; -use cosmic::iced::{ - Subscription, - futures::{SinkExt, StreamExt, channel::mpsc::Sender, future}, - stream, -}; +use cosmic::iced::futures::channel::mpsc::Sender; +use cosmic::iced::futures::{SinkExt, StreamExt, future}; +use cosmic::iced::{Subscription, stream}; use sunrise::{Coordinates, SolarDay, SolarEvent}; use tokio::select; diff --git a/cosmic-settings/src/subscription/desktop_files.rs b/cosmic-settings/src/subscription/desktop_files.rs index 61b439d..2f04488 100644 --- a/cosmic-settings/src/subscription/desktop_files.rs +++ b/cosmic-settings/src/subscription/desktop_files.rs @@ -1,8 +1,5 @@ -use cosmic::iced::{ - Subscription, - futures::{self, SinkExt}, - stream, -}; +use cosmic::iced::futures::{self, SinkExt}; +use cosmic::iced::{Subscription, stream}; use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher}; use std::fmt::Debug; use std::hash::Hash; diff --git a/cosmic-settings/src/subscription/wallpapers.rs b/cosmic-settings/src/subscription/wallpapers.rs index 5e062b1..b424219 100644 --- a/cosmic-settings/src/subscription/wallpapers.rs +++ b/cosmic-settings/src/subscription/wallpapers.rs @@ -1,10 +1,8 @@ use std::path::PathBuf; -use cosmic::iced::{ - Subscription, - futures::{SinkExt, StreamExt, channel::mpsc::Sender, future}, - stream, -}; +use cosmic::iced::futures::channel::mpsc::Sender; +use cosmic::iced::futures::{SinkExt, StreamExt, future}; +use cosmic::iced::{Subscription, stream}; use image::{ImageBuffer, Rgba}; #[derive(Clone, Debug)] diff --git a/cosmic-settings/src/theme.rs b/cosmic-settings/src/theme.rs index df074d1..ab21f41 100644 --- a/cosmic-settings/src/theme.rs +++ b/cosmic-settings/src/theme.rs @@ -1,7 +1,8 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{iced::Border, theme}; +use cosmic::iced::Border; +use cosmic::theme; #[must_use] pub fn display_container_frame() -> cosmic::theme::Container<'static> { diff --git a/cosmic-settings/src/utils.rs b/cosmic-settings/src/utils.rs index 6286b8b..ac1e413 100644 --- a/cosmic-settings/src/utils.rs +++ b/cosmic-settings/src/utils.rs @@ -1,4 +1,5 @@ -use std::{future::Future, io, process}; +use std::future::Future; +use std::{io, process}; use futures::future::select; diff --git a/cosmic-settings/src/widget/mod.rs b/cosmic-settings/src/widget/mod.rs index a5b8322..e53b151 100644 --- a/cosmic-settings/src/widget/mod.rs +++ b/cosmic-settings/src/widget/mod.rs @@ -8,10 +8,9 @@ use cosmic::cosmic_theme::Spacing; use cosmic::iced::core::text::Wrapping; use cosmic::iced::{Alignment, Length}; use cosmic::widget::color_picker::ColorPickerUpdate; +use cosmic::widget::space::{horizontal, vertical}; use cosmic::widget::{ - self, ColorPickerModel, button, column, container, divider, icon, list, row, settings, - space::{horizontal, vertical}, - text, + self, ColorPickerModel, button, column, container, divider, icon, list, row, settings, text, }; use cosmic::{Apply, Element, theme}; use cosmic_settings_page as page; @@ -206,8 +205,10 @@ pub fn go_next_with_item<'a, Msg: 'static>( msg_opt: impl Into>, ) -> list::ListButton<'a, Msg> { settings::item_row(vec![ - text::body(description).wrapping(Wrapping::Word).into(), - horizontal().into(), + text::body(description) + .width(Length::Fill) + .wrapping(Wrapping::Word) + .into(), row::with_capacity(2) .push(item) .push(icon::from_name("go-next-symbolic").size(16).icon()) diff --git a/crates/cosmic-pipewire/Cargo.toml b/crates/cosmic-pipewire/Cargo.toml deleted file mode 100644 index bcea9fb..0000000 --- a/crates/cosmic-pipewire/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "cosmic-pipewire" -version = "1.0.7" -edition = "2024" -repository = "https://github.com/pop-os/cosmic-settings" -rust-version.workspace = true -license = "MPL-2.0" -publish = true - -[dependencies] -intmap = "3.1.3" -libspa = "0.9.2" -libspa-sys = "0.9.2" -pipewire = "0.9" -serde = { version = "1.0.228", features = ["derive"]} -serde_json = "1.0.149" -tracing = "0.1.44" - -[features] -# Cache route port types -route-port-type = [] diff --git a/crates/cosmic-pipewire/LICENSE.md b/crates/cosmic-pipewire/LICENSE.md deleted file mode 100644 index d141fe4..0000000 --- a/crates/cosmic-pipewire/LICENSE.md +++ /dev/null @@ -1,358 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -## 1. Definitions - -### 1.1. "Contributor" -means each individual or legal entity that creates, contributes to -the creation of, or owns Covered Software. - -### 1.2. "Contributor Version" -means the combination of the Contributions of others (if any) used -by a Contributor and that particular Contributor's Contribution. - -### 1.3. "Contribution" -means Covered Software of a particular Contributor. - -### 1.4. "Covered Software" -means Source Code Form to which the initial Contributor has attached -the notice in Exhibit A, the Executable Form of such Source Code -Form, and Modifications of such Source Code Form, in each case -including portions thereof. - -### 1.5. "Incompatible With Secondary Licenses" -means - -+ (a) that the initial Contributor has attached the notice described -in Exhibit B to the Covered Software; or - -+ (b) that the Covered Software was made available under the terms of -version 1.1 or earlier of the License, but not also under the -terms of a Secondary License. - -### 1.6. "Executable Form" -means any form of the work other than Source Code Form. - -### 1.7. "Larger Work" -means a work that combines Covered Software with other material, in -a separate file or files, that is not Covered Software. - -### 1.8. "License" -means this document. - -### 1.9. "Licensable" -means having the right to grant, to the maximum extent possible, -whether at the time of the initial grant or subsequently, any and -all of the rights conveyed by this License. - -### 1.10. "Modifications" -means any of the following: - -+ (a) any file in Source Code Form that results from an addition to, -deletion from, or modification of the contents of Covered -Software; or - -+ (b) any new file in Source Code Form that contains any Covered -Software. - -### 1.11. "Patent Claims" of a Contributor -means any patent claim(s), including without limitation, method, -process, and apparatus claims, in any patent Licensable by such -Contributor that would be infringed, but for the grant of the -License, by the making, using, selling, offering for sale, having -made, import, or transfer of either its Contributions or its -Contributor Version. - -### 1.12. "Secondary License" -means either the GNU General Public License, Version 2.0, the GNU -Lesser General Public License, Version 2.1, the GNU Affero General -Public License, Version 3.0, or any later versions of those -licenses. - -### 1.13. "Source Code Form" -means the form of the work preferred for making modifications. - -### 1.14. "You" (or "Your") -means an individual or a legal entity exercising rights under this -License. For legal entities, "You" includes any entity that -controls, is controlled by, or is under common control with You. For -purposes of this definition, "control" means (a) the power, direct -or indirect, to cause the direction or management of such entity, -whether by contract or otherwise, or (b) ownership of more than -fifty percent (50%) of the outstanding shares or beneficial -ownership of such entity. - -## 2. License Grants and Conditions - -### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -+ (a) under intellectual property rights (other than patent or trademark) -Licensable by such Contributor to use, reproduce, make available, -modify, display, perform, distribute, and otherwise exploit its -Contributions, either on an unmodified basis, with Modifications, or -as part of a Larger Work; and - -+ (b) under Patent Claims of such Contributor to make, use, sell, offer -for sale, have made, import, and otherwise transfer either its -Contributions or its Contributor Version. - -### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -+ (a) for any code that a Contributor has removed from Covered Software; -or - -+ (b) for infringements caused by: (i) Your and any other third party's -modifications of Covered Software, or (ii) the combination of its -Contributions with other software (except as part of its Contributor -Version); or - -+ (c) under Patent Claims infringed by Covered Software in the absence of -its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -## 3. Responsibilities - -### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -+ (a) such Covered Software must also be made available in Source Code -Form, as described in Section 3.1, and You must inform recipients of -the Executable Form how they can obtain a copy of such Source Code -Form by reasonable means in a timely manner, at a charge no more -than the cost of distribution to the recipient; and - -+ (b) You may distribute such Executable Form under the terms of this -License, or sublicense it under different terms, provided that the -license for the Executable Form does not attempt to limit or alter -the recipients' rights in the Source Code Form under this License. - -### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -## 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -## 5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -## 6. Disclaimer of Warranty - -**Covered Software is provided under this License on an "as is" -basis, without warranty of any kind, either expressed, implied, or -statutory, including, without limitation, warranties that the -Covered Software is free of defects, merchantable, fit for a -particular purpose or non-infringing. The entire risk as to the -quality and performance of the Covered Software is with You. -Should any Covered Software prove defective in any respect, You -(not any Contributor) assume the cost of any necessary servicing, -repair, or correction. This disclaimer of warranty constitutes an -essential part of this License. No use of any Covered Software is -authorized under this License except under this disclaimer.** - - -#7. Limitation of Liability - -**Under no circumstances and under no legal theory, whether tort -(including negligence), contract, or otherwise, shall any -Contributor, or anyone who distributes Covered Software as -permitted above, be liable to You for any direct, indirect, -special, incidental, or consequential damages of any character -including, without limitation, damages for lost profits, loss of -goodwill, work stoppage, computer failure or malfunction, or any -and all other commercial damages or losses, even if such party -shall have been informed of the possibility of such damages. This -limitation of liability shall not apply to liability for death or -personal injury resulting from such party's negligence to the -extent applicable law prohibits such limitation. Some -jurisdictions do not allow the exclusion or limitation of -incidental or consequential damages, so this exclusion and -limitation may not apply to You.** - - -## 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -## 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -## 10. Versions of the License - -### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -### 10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - "Incompatible With Secondary Licenses" Notice - - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/crates/cosmic-pipewire/src/device.rs b/crates/cosmic-pipewire/src/device.rs deleted file mode 100644 index a456fd5..0000000 --- a/crates/cosmic-pipewire/src/device.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2025 System76 -// SPDX-License-Identifier: MPL-2.0 - -use pipewire::device::DeviceInfoRef; - -/// Device information -#[must_use] -#[derive(Clone, Debug)] -pub struct Device { - pub id: u32, - pub name: String, -} - -impl Device { - /// Attains process info from a pipewire info node. - #[must_use] - pub fn from_device(info: &DeviceInfoRef) -> Option { - let props = info.props()?; - - let device = Device { - id: props.get("object.id")?.parse::().ok()?, - name: props.get("device.description")?.to_owned(), - }; - - Some(device) - } -} diff --git a/crates/cosmic-pipewire/src/lib.rs b/crates/cosmic-pipewire/src/lib.rs index 3aefd1e..9cf2538 100644 --- a/crates/cosmic-pipewire/src/lib.rs +++ b/crates/cosmic-pipewire/src/lib.rs @@ -21,20 +21,19 @@ pub use route::{Route, RouteProps}; mod spa_utils; pub use spa_utils::Channel; -use libspa::{ - param::{ParamType, format::FormatProperties}, - pod::{self, Pod, serialize::PodSerializer}, - utils::SpaTypes, -}; -use pipewire::{ - device::{DeviceChangeMask, DeviceListener}, - main_loop::MainLoopWeak, - metadata::MetadataListener, - node::NodeListener, - proxy::{ProxyListener, ProxyT}, - types::ObjectType, -}; -use std::{cell::RefCell, rc::Rc}; +use libspa::param::ParamType; +use libspa::param::format::FormatProperties; +use libspa::pod::serialize::PodSerializer; +use libspa::pod::{self, Pod}; +use libspa::utils::SpaTypes; +use pipewire::device::{DeviceChangeMask, DeviceListener}; +use pipewire::main_loop::MainLoopWeak; +use pipewire::metadata::MetadataListener; +use pipewire::node::NodeListener; +use pipewire::proxy::{ProxyListener, ProxyT}; +use pipewire::types::ObjectType; +use std::cell::RefCell; +use std::rc::Rc; pub type NodeId = u32; pub type RouteId = u32; diff --git a/crates/cosmic-pipewire/src/node.rs b/crates/cosmic-pipewire/src/node.rs index 5536f30..5bf7ff0 100644 --- a/crates/cosmic-pipewire/src/node.rs +++ b/crates/cosmic-pipewire/src/node.rs @@ -1,8 +1,10 @@ // Copyright 2025 System76 // SPDX-License-Identifier: MPL-2.0 -use crate::{Channel, spa_utils::array_from_pod}; -use libspa::{pod::Pod, utils::Id}; +use crate::Channel; +use crate::spa_utils::array_from_pod; +use libspa::pod::Pod; +use libspa::utils::Id; use pipewire::node::{NodeInfoRef, NodeState}; use std::ffi::c_float; diff --git a/crates/cosmic-pipewire/src/port.rs b/crates/cosmic-pipewire/src/port.rs deleted file mode 100644 index e2fc957..0000000 --- a/crates/cosmic-pipewire/src/port.rs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2025 System76 -// SPDX-License-Identifier: MPL-2.0 - -//! Currently unusued - -use crate::pipewire::Direction; -use pipewire::port::PortInfoRef; - -#[must_use] -#[derive(Clone, Debug)] -pub struct Port { - pub node_id: u32, - pub object_id: u32, - pub port_id: u32, - pub audio_channel: String, - pub format_dsp: String, - pub object_path: String, - pub port_direction: Direction, - pub port_group: String, - pub port_name: String, - pub port_alias: String, - pub port_physical: bool, - pub port_terminal: bool, - pub port_monitor: bool, -} - -impl Port { - /// Attains process info from a pipewire info port. - #[must_use] - pub fn from_port(info: &PortInfoRef) -> Option { - let props = info.props()?; - let object_id = info.id(); - let port_direction = match info.direction() { - libspa::utils::Direction::Input => Direction::Input, - libspa::utils::Direction::Output => Direction::Output, - _ => return None, - }; - - let mut node_id = 0; - let mut port_id = 0; - let mut port_monitor = false; - let mut port_physical = false; - let mut port_terminal = false; - - let mut audio_channel = String::new(); - let mut format_dsp = String::new(); - let mut object_path = String::new(); - let mut port_alias = String::new(); - let mut port_group = String::new(); - let mut port_name = String::new(); - - for (entry, value) in props.iter() { - match entry { - // 32 bit float mono audio - "format.dsp" => format_dsp = value.to_owned(), - // FR - "audio.channel" => audio_channel = value.to_owned(), - // playback - "port.group" => port_group = value.to_owned(), - // 1 - "port.id" => port_id = value.parse::().ok()?, - // false - "port.monitor" => port_monitor = value == "true", - // true - "port.physical" => port_physical = value == "true", - // true - "port.terminal" => port_terminal = value == "true", - // alsa:acp:Device:3:playback:playback_1 - "object.path" => object_path = value.to_owned(), - // playback_FR - "port.name" => port_name = value.to_owned(), - // MosArt USB Audio Device:playback_FR - "port.alias" => port_alias = value.to_owned(), - // 59 - "node.id" => node_id = value.parse::().ok()?, - _ => (), - } - } - - let port = Port { - format_dsp, - audio_channel, - port_id, - port_direction, - object_path, - port_name, - port_alias, - port_group, - port_monitor, - port_physical, - port_terminal, - node_id, - object_id, - }; - - Some(port) - } -} diff --git a/crates/cosmic-pipewire/src/profile.rs b/crates/cosmic-pipewire/src/profile.rs index aabad61..c6bf75d 100644 --- a/crates/cosmic-pipewire/src/profile.rs +++ b/crates/cosmic-pipewire/src/profile.rs @@ -1,7 +1,8 @@ // Copyright 2025 System76 // SPDX-License-Identifier: MPL-2.0 -use crate::{Availability, spa_utils::string_from_pod}; +use crate::Availability; +use crate::spa_utils::string_from_pod; use libspa::pod::Pod; #[derive(Clone, Debug, Default)] diff --git a/crates/cosmic-pipewire/src/route.rs b/crates/cosmic-pipewire/src/route.rs index 961a7eb..cf370c6 100644 --- a/crates/cosmic-pipewire/src/route.rs +++ b/crates/cosmic-pipewire/src/route.rs @@ -3,11 +3,10 @@ use std::ffi::{c_float, c_int}; -use crate::{ - Availability, Channel, Direction, - spa_utils::{array_from_pod, string_from_pod}, -}; -use libspa::{pod::Pod, utils::Id}; +use crate::spa_utils::{array_from_pod, string_from_pod}; +use crate::{Availability, Channel, Direction}; +use libspa::pod::Pod; +use libspa::utils::Id; #[derive(Clone, Debug, Default)] pub struct Route { diff --git a/crates/cosmic-pipewire/src/spa_utils.rs b/crates/cosmic-pipewire/src/spa_utils.rs deleted file mode 100644 index 0593dfe..0000000 --- a/crates/cosmic-pipewire/src/spa_utils.rs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2025 System76 -// SPDX-License-Identifier: MPL-2.0 - -use libspa::pod::Pod; -use std::ffi::CStr; - -/// Read a `Pod`'s string if it contains a string. -pub fn string_from_pod(pod: &Pod) -> Option { - if !pod.is_string() { - return None; - } - - let mut cstr = std::ptr::null(); - - unsafe { - // SAFETY: Pod is checked to be a string beforehand - if libspa_sys::spa_pod_get_string(pod.as_raw_ptr(), &mut cstr) == 0 && !cstr.is_null() { - return Some(String::from_utf8_lossy(CStr::from_ptr(cstr).to_bytes()).into_owned()); - } - } - - None -} - -/// SAFETY: Must be absolutely certain that the array is a compatible array. -pub unsafe fn array_from_pod(pod: &Pod) -> Option> { - if !pod.is_array() { - return None; - } - - let mut len = 0; - - unsafe { - let array: *mut CType = libspa_sys::spa_pod_get_array(pod.as_raw_ptr(), &mut len).cast(); - - if array.is_null() { - return None; - } - - Some(std::slice::from_raw_parts(array, len as usize).to_vec()) - } -} - -#[repr(u32)] -#[derive(Copy, Clone, Debug, Default, Hash, Eq, PartialEq)] -pub enum Channel { - #[default] - UNKNOWN = 0, // unspecified - NA, // N/A, silent - MONO, // mono stream - FL, // front left - FR, // front right - FC, // front center - LFE, // LFE - SL, // side left - SR, // side right - FLC, // front left center - FRC, // front right center - RC, // rear center - RL, // rear left - RR, // rear right - TC, // top center - TFL, // top front left - TFC, // top front center - TFR, // top front right - TRL, // top rear left - TRC, // top rear center - TRR, // top rear right - RLC, // rear left center - RRC, // rear right center - FLW, // front left wide - FRW, // front right wide - LFE2, // LFE 2 - FLH, // front left high - FCH, // front center high - FRH, // front right high - TFLC, // top front left center - TFRC, // top front right center - TSL, // top side left - TSR, // top side right - LLFE, // left LFE - RLFE, // right LFE - BC, // bottom center - BLC, // bottom left center - BRC = 37, // bottom right center - AUX0 = 4096, // aux channels - AUX1, - AUX2, - AUX3, - AUX4, - AUX5, - AUX6, - AUX7, - AUX8, - AUX9, - AUX10, - AUX11, - AUX12, - AUX13, - AUX14, - AUX15, - AUX16, - AUX17, - AUX18, - AUX19, - AUX20, - AUX21, - AUX22, - AUX23, - AUX24, - AUX25, - AUX26, - AUX27, - AUX28, - AUX29, - AUX30, - AUX31, - AUX32, - AUX33, - AUX34, - AUX35, - AUX36, - AUX37, - AUX38, - AUX39, - AUX40, - AUX41, - AUX42, - AUX43, - AUX44, - AUX45, - AUX46, - AUX47, - AUX48, - AUX49, - AUX50, - AUX51, - AUX52, - AUX53, - AUX54, - AUX55, - AUX56, - AUX57, - AUX58, - AUX59, - AUX60, - AUX61, - AUX62, - AUX63 = 4159, -} diff --git a/debian/changelog b/debian/changelog index 1e3759c..02e319d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cosmic-settings (1.0.12) noble; urgency=medium + + * release: 1.0.12 + + -- Michael Murphy Mon, 27 Apr 2026 15:24:27 +0200 + cosmic-settings (1.0.7) noble; urgency=medium * release: 1.0.7 diff --git a/debian/control b/debian/control index c04ab78..703a847 100644 --- a/debian/control +++ b/debian/control @@ -8,15 +8,14 @@ Build-Depends: fonts-open-sans, just, libclang-dev, + libdav1d-dev, libexpat1-dev, libfontconfig-dev, libfreetype-dev, libinput-dev, - libpipewire-0.3-dev, libudev-dev, libwayland-dev, libxkbcommon-dev, - mold, pkg-config, rust-all, Standards-Version: 4.6.2 @@ -29,6 +28,7 @@ Depends: ${shlibs:Depends}, accountsservice, cosmic-randr, + cosmic-settings-daemon, gettext, iso-codes, network-manager-gnome, diff --git a/debian/rules b/debian/rules index 6f3ef8c..c7e848f 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,7 @@ #!/usr/bin/make -f export DESTDIR = debian/tmp +OS_VERSION = $(shell rg VERSION_ID /etc/os-release | awk -F\" '{print $2}') %: dh $@ @@ -9,7 +10,11 @@ override_dh_auto_clean: ischroot || just vendor override_dh_auto_build: - test -e vendor.tar && just build-vendored || just +ifeq ($(OS_VERSION),22.04) + test -e vendor.tar && just build-vendored || just build-release --no-default-features +else + test -e vendor.tar && just build-vendored || just build-release +endif override_dh_auto_install: just rootdir=$(DESTDIR) install diff --git a/i18n/ar/cosmic_settings.ftl b/i18n/ar/cosmic_settings.ftl index 88be08f..68a03c8 100644 --- a/i18n/ar/cosmic_settings.ftl +++ b/i18n/ar/cosmic_settings.ftl @@ -107,6 +107,8 @@ vpn-error = خطأ في VPN .connect = فشل الاتصال بـ VPN .connection-editor = فشل محرر الاتصال .connection-settings = فشل الحصول على إعدادات الاتصالات النشطة + .openvpn-config-path = مسار ملف غير صالح لإعدادات OpenVPN + .openvpn-config-path-desc = يجب أن يكون الملف المختار موجودًا على نظام الملفات المحلي. .updating-state = فشل تحديث حالة مدير الشبكة .wireguard-config-path = مسار ملف غير صالح لتكوين WireGuard .wireguard-config-path-desc = يجب أن يكون الملف المختار موجودًا على نظام ملفات محلي. @@ -911,3 +913,9 @@ xdg-entry-displays-keywords = COSMIC;عرض; xdg-entry-workspaces = مساحات العمل xdg-entry-wired-comment = الاتصالات السلكية وملفات تعريف الاتصال no-search-results = لا توجد شبكات تطابق بحثك. +workspaces-navigation = التنقل + .wraparound = تنقل بين مساحة العمل الأولى والأخيرة باستخدام اختصارات لوحة المفاتيح والإيماءات +bluetooth-display-passkey = إقران البلوتوث + .description = يُرجى إدخال مفتاح المرور التالي على { $device }، ثم الضغط على مفتاح Enter +bluetooth-display-pin = إقتران البلوتوث + .description = يُرجى إدخال رمز PIN التالي على { $device }، ثم الضغط على Enter diff --git a/i18n/ca/cosmic_settings.ftl b/i18n/ca/cosmic_settings.ftl index e69de29..23264a3 100644 --- a/i18n/ca/cosmic_settings.ftl +++ b/i18n/ca/cosmic_settings.ftl @@ -0,0 +1,7 @@ +cancel = Cancel·lar +confirm = Confirmar +password = Contrasenya +identity = Identitat +password-confirm = Confirmeu la contrasenya +connected = Connectat +settings = Configuració diff --git a/i18n/cs/cosmic_settings.ftl b/i18n/cs/cosmic_settings.ftl index bc33e86..9e4d95f 100644 --- a/i18n/cs/cosmic_settings.ftl +++ b/i18n/cs/cosmic_settings.ftl @@ -280,7 +280,7 @@ keyboard-sources = Vstupní zdroje keyboard-special-char = Zadávání speciálních znaků .alternate = Klávesa pro náhradní znaky .compose = Klávesa Compose - .compose-desc = Klávesa Compose umožňuje zadávat širokou škálu znaků. Pro její použití stiskněte Compose a poté zadejte sekvenci znaků. Například [Compose, C, O] vloží znak „©“, zatímco [Compose, A, ‘] znak „á“. + .compose-desc = Klávesa Compose umožňuje zadávat širokou škálu znaků. Pro její použití stiskněte Compose a poté zadejte sekvenci znaků. Například Compose, C, O vloží znak „©“, zatímco Compose, A, ‘ vloží znak „á“. .caps = Klávesa Caps Lock ## Input: Keyboard: Shortcuts @@ -418,6 +418,8 @@ vpn-error = Chyba VPN .connect = Nepodařilo se připojit k VPN .connection-editor = Editor připojení selhal .connection-settings = Nepodařilo se získat nastavení aktivních připojení + .openvpn-config-path = Chybně zadaná cesta souboru nastavení OpenVPN + .openvpn-config-path-desc = Vybraný soubor musí být na lokálním souborovém systému .updating-state = Nepodařilo se aktualizovat stav správce sítě .wireguard-config-path = Chybně zadaná cesta souboru nastavení WireGuard .wireguard-config-path-desc = Vybraný soubor musí být na lokálním souborovém systému @@ -627,13 +629,13 @@ power-saving = Možnosti úspory energie disable-while-typing = Zakázat při psaní input-devices = Vstupní zařízení modified = { $count } změněných -slow = Pomalá -fast = Rychlá -short = Krátké -long = Dlouhé +slow = Pomalu +fast = Rychle +short = Krátká +long = Dlouhá keyboard-typing-assist = Psaní - .repeat-rate = Frekvence opakování - .repeat-delay = Zpoždění opakování + .repeat-rate = Rychlost opakování + .repeat-delay = Prodleva před opakováním keyboard-numlock-boot = Num Lock .boot-state = Stav klávesy při spuštění systému .last-boot = Poslední spuštění systému @@ -893,3 +895,9 @@ xdg-entry-displays-keywords = COSMIC;Obrazovka;Obrazovky;Displeje;Monitory;Zobra xdg-entry-workspaces-keywords = COSMIC;Pracovní;Plocha;Plochy;Orientace;Přehled;Sledování; xdg-entry-x11-applications-keywords = COSMIC;X11;Aplikace;Hra;Hry;Kompatibilita; no-search-results = Žádné sítě neodpovídají vašemu vyhledávání. +workspaces-navigation = Navigace + .wraparound = Přecházet mezi první a poslední pracovní plochou pomocí klávesových zkratek a gest +bluetooth-display-passkey = Párování Bluetooth + .description = Zadejte prosím následující párovací kód na zařízení { $device } a poté stiskněte Enter +bluetooth-display-pin = Párování Bluetooth + .description = Zadejte prosím následující PIN na zařízení { $device } a poté stiskněte Enter diff --git a/i18n/de/cosmic_settings.ftl b/i18n/de/cosmic_settings.ftl index 6c0dfdf..197208a 100644 --- a/i18n/de/cosmic_settings.ftl +++ b/i18n/de/cosmic_settings.ftl @@ -60,6 +60,8 @@ vpn-error = VPN-Fehler .connect = Verbinden mit dem VPN ist fehlgeschlagen .connection-editor = Verbindungseditor ist fehlgeschlagen .connection-settings = Abrufen der Einstellungen für aktive Verbindungen ist fehlgeschlagen + .openvpn-config-path = Ungültiger Dateipfad für OpenVPN-Konfiguration + .openvpn-config-path-desc = Die ausgewählte Datei muss sich im lokalen Dateisystem befinden. .updating-state = Aktualisieren des Netzwerkmanager-Status ist fehlgeschlagen .wireguard-config-path = Ungültiger Dateipfad für WireGuard-Konfiguration .wireguard-config-path-desc = Die ausgewählte Datei muss sich im lokalen Dateisystem befinden. @@ -912,3 +914,9 @@ xdg-entry-desktop-keywords = COSMIC;Desktop; xdg-entry-desktop = Desktop xdg-entry-a11y-keywords = COSMIC;Barrierefreiheit;A11y;Bildschirm;Leser;Vergrößerungsglas;Kontrast;Farbe; xdg-entry-a11y-comment = Bildschirmleser, Vergrößerungsglas, hoher Kontrast und Farbfilter +workspaces-navigation = Navigation + .wraparound = Mit Tastenkombinationen und Gesten zwischen der ersten und letzten Arbeitsfläche wechseln +bluetooth-display-passkey = Bluetooth-Kopplung + .description = Bitte gib den folgenden Passkey auf { $device } ein und drücke dann die Eingabetaste +bluetooth-display-pin = Bluetooth-Kopplung + .description = Bitte gib die folgende PIN auf { $device } ein und drücke dann die Eingabetaste diff --git a/i18n/el/cosmic_settings.ftl b/i18n/el/cosmic_settings.ftl index a167994..f455222 100644 --- a/i18n/el/cosmic_settings.ftl +++ b/i18n/el/cosmic_settings.ftl @@ -1 +1,828 @@ share = Κοινοποίηση δικτύου +connect = Σύνδεση +close = Κλείσιμο +save = Αποθήκευση +password = Κωδικός πρόσβασης +remove = Αφαίρεση +import = Εισαγωγή +username = Όνομα χρήστη +light = Ανοιχτόχρωμο +ok = OK +applets = Μικροεφαρμογές +dbus-connection-error = Αποτυχία σύνδεσης στο DBus +dark = Σκουρόχρωμο +cancel = Ακύρωση +settings = Ρυθμίσεις +replace = Αντικατάσταση +add = Προσθήκη +appearance = Εμφάνιση +panel-left = Αριστερά +panel-top = Πάνω +region = Περιοχή +forget-dialog = Διαγραφή αυτού του δικτύου Wi-Fi; + .description = Θα χρειαστεί να εισαγάγετε ξανά τον κωδικό πρόσβασης για να χρησιμοποιήσετε αυτό το δίκτυο Wi-Fi στο μέλλον. +default = Προεπιλογή +unknown = Άγνωστο +connecting = Σύνδεση… +export = Εξαγωγή +panel-right = Δεξιά +rgb = RGB +desktop = Επιφάνεια εργασίας +identity = Ταυτότητα +disconnect = Αποσύνδεση +app = Ρυθμίσεις COSMIC +debug = Εντοπισμός σφαλμάτων +number = { $number } +small = Μικρό +terminate = Τερματισμός +password-confirm = Επιβεβαίωση κωδικού πρόσβασης +applications = Εφαρμογές +connected = Συνδέθηκε +large = Μεγάλο +confirm = Επιβεβαίωση +enable = Ενεργοποίηση +never = Ποτέ +activate = Ενεργοποίηση +dialog-add = Προσθήκη +command = Εντολή +panel-bottom = Κάτω +navigate = Πλοήγηση +colors = Χρώματα +xdg-entry-touchpad = Επιφάνεια αφής +xdg-entry-bluetooth-comment = Διαχείριση συσκευών Bluetooth +xdg-entry-appearance-keywords = Έμφαση;Χρώμα;Εικονίδιο;Γραμματοσειρά;Θέμα;COSMIC;Accent;Color;Icon;Font;Theme +xdg-entry-mouse = Ποντίκι +firmware = Υλικολογισμικό +xdg-entry-a11y = Προσβασιμότητα +xdg-entry-desktop-keywords = Επιφάνεια;Εργασίας;COSMIC;Desktop; +xdg-entry-users = Χρήστες +xdg-entry-default-apps = Προεπιλεγμένες εφαρμογές +xdg-entry-applications-comment = Προεπιλεγμένες εφαρμογές, εφαρμογές εκκίνησης και ρυθμίσεις συμβατότητας εφαρμογών με το X11 +xdg-entry-about-keywords = Πληροφορίες;Σχετικά;Περί;COSMIC;About +xdg-entry-notifications = Ειδοποιήσεις +xdg-entry-a11y-keywords = Προσβασιμότητα;Προσιτότητα;Οθόνη;Ανάγνωση;Αναγνώστης;Μεγεθυντικός;Φακός;Αντίθεση;Χρώμα;COSMIC;Accessibility;A11y;Screen;Reader;Magnifier;Contrast;Color; +xdg-entry-desktop = Επιφάνεια εργασίας +xdg-entry-date-time-keywords = Ζώνη;Ώρα;COSMIC;Time;Zone; +xdg-entry-wallpaper = Ταπετσαρία +xdg-entry-keyboard = Πληκτρολόγιο +xdg-entry-a11y-comment = Ανάγνωση οθόνης, μεγεθυντικός φακός, υψηλή αντίθεση και χρωματικά φίλτρα +xdg-entry-displays = Οθόνες +sound = Ήχος +xdg-entry-date-time = Ημερομηνία και ώρα +notifications = Ειδοποιήσεις +xdg-entry-bluetooth-keywords = Σύνδεση;COSMIC;Bluetooth; +about = Πληροφορίες +workspaces = Χώροι εργασίας +xdg-entry-wireless = Wi-Fi +xdg-entry-about-comment = Όνομα συσκευής, πληροφορίες υλικού, προεπιλογές λειτουργικού συστήματος +xdg-entry-appearance-comment = Χρώματα έμφασης και θέματα +xdg-entry-comment = Εφαρμογή ρυθμίσεων για το περιβάλλον επιφάνειας εργασίας COSMIC +xdg-entry-applications = Εφαρμογές +xdg-entry-default-apps-keywords = Προεπιλογή;Προεπιλεγμένη;Εφαρμογή;COSMIC;Default;Application +xdg-entry-keywords = Προτιμήσεις;Ρυθμίσεις;COSMIC;Settings; +xdg-entry-about = Πληροφορίες +xdg-entry-input = Συσκευές εισόδου +keyboard = Πληκτρολόγιο +xdg-entry-appearance = Εμφάνιση +xdg-entry-sound = Ήχος +xdg-entry-displays-keywords = Οθόνη;COSMIC;Display; +xdg-entry-workspaces = Χώροι εργασίας +xdg-entry-date-time-comment = Ζώνη ώρας, αυτόματη ρύθμιση ρολογιού και μορφοποίηση ώρας +system-shortcut = Σύστημα + .app-library = Άνοιγμα βιβλιοθήκης εφαρμογών + .brightness-down = Μείωση φωτεινότητας οθόνης + .brightness-up = Αύξηση φωτεινότητας οθόνης + .display-toggle = Εναλλαγή εσωτερικής οθόνης + .home-folder = Άνοιγμα προσωπικού φακέλου + .keyboard-brightness-down = Μείωση φωτεινότητας πληκτρολογίου + .keyboard-brightness-up = Αύξηση φωτεινότητας πληκτρολογίου + .launcher = Άνοιγμα εκκινητή + .log-out = Αποσύνδεση + .lock-screen = Κλείδωμα οθόνης + .mute = Σίγαση εξόδου ήχου + .mute-mic = Σίγαση εισόδου μικροφώνου + .play-pause = Αναπαραγωγή/παύση + .play-next = Επόμενο κομμάτι + .play-prev = Προηγούμενο κομμάτι + .poweroff = Τερματισμός λειτουργίας + .screenshot = Λήψη στιγμιότυπου οθόνης + .suspend = Αναστολή λειτουργίας + .terminal = Άνοιγμα τερματικού + .touchpad-toggle = Εναλλαγή λειτουργίας επιφάνειας αφής + .volume-lower = Μείωση έντασης εξόδου ήχου + .volume-raise = Αύξηση έντασης εξόδου ήχου + .web-browser = Άνοιγμα προγράμματος περιήγησης ιστού + .window-switcher = Εναλλαγή μεταξύ των ανοικτών παραθύρων + .window-switcher-previous = Εναλλαγή μεταξύ των ανοικτών παραθύρων (αντίστροφα) + .workspace-overview = Άνοιγμα επισκόπησης χώρων εργασίας +super-key = Ενέργεια πλήκτρου Super + .launcher = Άνοιγμα μενού εκκίνησης + .workspaces = Άνοιγμα χώρων εργασίας + .applications = Άνοιγμα εφαρμογών + .disable = Απενεργοποίηση +x-minutes = + { $number } { $number -> + [one] λεπτό + *[other] λεπτά + } +vrr = Μεταβλητός ρυθμός ανανέωσης + .enabled = Ενεργός + .force = Πάντα + .auto = Αυτόματα + .disabled = Ανενεργός +window-hint-accent = Χρώμα ένδειξης ενεργού παραθύρου +fit-to-screen = Προσαρμογή στην οθόνη +control-tint = Απόχρωση στοιχείων ελέγχου + .desc = Χρησιμοποιείται για το φόντο των τυπικών κουμπιών, εισόδων αναζήτησης, εισόδων κειμένου και παρόμοιων στοιχείων +vpn-error = Σφάλμα VPN + .config = Αποτυχία προσθήκης διαμόρφωσης VPN + .connect = Αποτυχία σύνδεσης στο VPN + .connection-editor = Αποτυχία επεξεργαστή συνδέσεων + .connection-settings = Αποτυχία λήψης ρυθμίσεων για ενεργές συνδέσεις + .openvpn-config-path = Μη έγκυρη διαδρομή αρχείου για τη διαμόρφωση του OpenVPN + .openvpn-config-path-desc = Το επιλεγμένο αρχείο πρέπει να βρίσκεται σε τοπικό σύστημα αρχείων. + .updating-state = Αποτυχία ενημέρωσης κατάστασης διαχειριστή δικτύου + .wireguard-config-path = Μη έγκυρη διαδρομή αρχείων για τη διαμόρφωση του WireGuard + .wireguard-config-path-desc = Το επιλεγμένο αρχείο πρέπει να βρίσκεται στο τοπικό σύστημα αρχείων. + .wireguard-device = Αποτυχία δημιουργίας συσκευής WireGuard + .with-password = + Αποτυχία ορισμού { $field -> + *[username] ονόματος χρήστη + [password] κωδικού πρόσβασης + [password-flags] σημαιών κωδικού πρόσβασης + } VPN με το nmcli +toggle-stacking = Εναλλαγή στοίβαξης παραθύρων +no-applets-found = Δεν βρέθηκαν μικροεφαρμογές... +zoom-in = Μεγέθυνση +place-here = Τοποθετήστε τις μικροεφαρμογές εδώ +-requires-restart = Απαιτεί επανεκκίνηση +workspaces-orientation = Προσανατολισμός χώρων εργασίας + .vertical = Κάθετος + .horizontal = Οριζόντιος +acceleration-desc = Προσαρμόζει αυτόματα την ευαισθησία ιχνηλάτησης με βάση την ταχύτητα +all-displays = Όλες οι οθόνες +scheduling = Προγραμματισμός + .manual = Χειροκίνητο πρόγραμμα +frosted = Εφέ ημιδιαφανούς γυαλιού στο περιβάλλον συστήματος + .desc = Εφαρμόζει θόλωση του φόντου της γραμμής συστήματος, της μπάρας εφαρμογών, του μενού εκκίνησης και της βιβλιοθήκης εφαρμογών +about-hardware = Υλικό + .model = Μοντέλο υλικού + .memory = Μνήμη + .processor = Επεξεργαστής + .graphics = Γραφικά + .disk-capacity = Χωρητικότητα δίσκου +short = Σύντομη +vpn = VPN + .connections = Συνδέσεις VPN + .error = Αποτυχία προσθήκης διαμόρφωσης VPN + .remove = Αφαίρεση προφίλ σύνδεσης + .select-file = Επιλογή αρχείου διαμόρφωσης VPN +power-mode = Λειτουργία ενέργειας + .battery = Εκτεταμένη διάρκεια μπαταρίας + .battery-desc = Μειωμένη χρήση ενέργειας και χαμηλές επιδόσεις + .balanced = Ισορροπημένη + .balanced-desc = Μέτριες επιδόσεις και ήπια χρήση ενέργειας + .performance = Υψηλές επιδόσεις + .performance-desc = Κορυφαίες επιδόσεις και υψηλή χρήση ενέργειας + .no-backend = Δεν βρέθηκε υπηρεσία παρασκηνίου. Εγκαταστήστε το system76-power ή το power-profiles-daemon. +wired = Ενσύρματη δικτύωση + .adapter = Προσαρμογέας ενσύρματου δικτύου { $id } + .connections = Ενσύρματες συνδέσεις + .devices = Ενσύρματες συσκευές + .remove = Αφαίρεση προφίλ σύνδεσης +bluetooth-available = Κοντινές συσκευές +cable-unplugged = Αποσυνδεδεμένο καλώδιο +color-picker = Εργαλείο επιλογής χρωμάτων +interface-font = Γραμματοσειρά συστήματος +zoom-out = Σμίκρυνση +hot-corner = Γωνία συντόμευσης + .top-left-corner = Ενεργοποίηση της πάνω αριστερής γωνίας συντόμευσης για τους χώρους εργασίας +keyboard-typing-assist = Πληκτρολόγηση + .repeat-rate = Ρυθμός επανάληψης + .repeat-delay = Καθυστέρηση επανάληψης +edge-gravity = Έλξη αιωρούμενων παραθύρων στις κοντινές άκρες +amplification = Ενίσχυση ήχου + .desc = Επιτρέπει την αύξηση της έντασης στο 150% +recent-colors = Πρόσφατα χρώματα +about-os = Λειτουργικό σύστημα + .os = Λειτουργικό σύστημα + .os-architecture = Αρχιτεκτονική λειτουργικού συστήματος + .kernel = Έκδοση πυρήνα + .desktop-environment = Περιβάλλον επιφάνειας εργασίας + .windowing-system = Σύστημα διαχείρισης παραθύρων +panel-behavior-and-position = Συμπεριφορά και θέσεις + .autohide = Αυτόματη απόκρυψη γραμμής συστήματος + .dock-autohide = Αυτόματη απόκρυψη μπάρας εφαρμογών + .position = Θέση στην οθόνη + .display = Εμφάνιση στην οθόνη +add-language = Προσθήκη γλώσσας + .context = Προσθήκη γλώσσας +password-mismatch = Ο κωδικός πρόσβασης και το πεδίο επιβεβαίωσης θα πρέπει να είναι ίδια +accessibility = Προσβασιμότητα + .vision = Όραση + .on = Ενεργό + .off = Ανενεργό + .unavailable = Μη διαθέσιμο + .screen-reader = Ανάγνωση οθόνης + .high-contrast = Λειτουργία υψηλής αντίθεσης + .invert-colors = Αναστροφή χρωμάτων + .color-filters = Φίλτρα χρωμάτων +container-background = Φόντο πλαισίων + .desc-detail = Το χρώμα φόντου πλαισίων χρησιμοποιείται για την πλαϊνή στήλη πλοήγησης, το πλευρικό συρτάρι, τα παράθυρα διαλόγων και παρόμοια γραφικά στοιχεία. Από προεπιλογή, το χρώμα φόντου πλαισίων προκύπτει αυτόματα από το φόντο των παραθύρων. + .reset = Επαναφορά στο αυτόματο + .desc = Χρησιμοποιείται για την πλαϊνή στήλη πλοήγησης, το πλευρικό συρτάρι, τα παράθυρα διαλόγων και παρόμοια γραφικά στοιχεία +primary-button = Κύριο κουμπί + .desc = Ορίζει τη σειρά των φυσικών κουμπιών + .left = Αριστερό + .right = Δεξί +sound-alerts = Ειδοποιήσεις + .volume = Ένταση ήχου ειδοποιήσεων + .sound = Ήχος ειδοποιήσεων +icon-theme = Θέμα εικονιδίων + .desc = Εφαρμόζει ένα διαφορετικό σύνολο εικονιδίων για εφαρμογές +keyboard-shortcuts = Συντομεύσεις πληκτρολογίου + .desc = Προβολή και προσαρμογή συντομεύσεων +switch-between-windows = Εναλλαγή μεταξύ των παραθύρων +text-tint = Απόχρωση κειμένου περιβάλλοντος χρήστη + .desc = Χρησιμοποιείται για τον προσδιορισμό των χρωμάτων του κειμένου του περιβάλλοντος χρήστη ώστε να έχουν επαρκή αντίθεση σε διάφορες επιφάνειες +online-accounts = Διαδικτυακοί λογαριασμοί + .desc = Προσθήκη λογαριασμών, IMAP και SMTP, εταιρικών συνδέσεων +open-workspaces-view = Άνοιγμα επισκόπησης χώρων εργασίας +all = Όλα +remove-user = Αφαίρεση χρήστη +sound-input = Είσοδος ήχου + .volume = Ένταση εισόδου + .device = Συσκευή εισόδου + .level = Επίπεδο εισόδου +add-another-keybinding = Προσθήκη άλλου συνδυασμού πλήκτρων +copy-to-clipboard = Αντιγραφή στο πρόχειρο +monospace-font = Γραμματοσειρά σταθερού πλάτους +experimental-settings = Πειραματικές ρυθμίσεις +recent-folders = Πρόσφατοι φάκελοι +color-filter = Τύπος φίλτρου χρωμάτων + .unknown = Άγνωστο φίλτρο ενεργό + .greyscale = Κλίμακα του γκρι + .deuteranopia = Πράσινο/κόκκινο (αδυναμία στο πράσινο, Δευτερανοπία) + .protanopia = Κόκκινο/πράσινο (αδυναμία στο κόκκινο, Πρωτανοπία) + .tritanopia = Μπλε/κίτρινο (αδυναμία στο μπλε, Τριτανοπία) +migrate-workspace = + Μεταφορά χώρου εργασίας { $direction -> + *[down] στην κάτω έξοδο + [left] στην αριστερή έξοδο + [right] στη δεξιά έξοδο + [up] στην πάνω έξοδο + } +battery = Μπαταρία + .minute = + { $value } { $value -> + [one] λεπτό + *[other] λεπτά + } + .hour = + { $value } { $value -> + [one] ώρα + *[other] ώρες + } + .day = + { $value } { $value -> + [one] ημέρα + *[other] ημέρες + } + .less-than-minute = Λιγότερο από ένα λεπτό + .and = και + .remaining-time = + { $time } μέχρι την { $action -> + [full] πλήρη φόρτιση + *[other] αποφόρτιση + } +search-applets = Αναζήτηση μικροεφαρμογών... +pinch-to-zoom = Τσίμπημα για ζουμ + .desc = Χρησιμοποιήστε δύο δάχτυλα για να κάνετε ζουμ στο περιεχόμενο, σε εφαρμογές που το υποστηρίζουν +wifi = Wi-Fi + .adapter = Προσαρμογέας Wi-Fi { $id } + .forget = Διαγραφή αυτού του δικτύου +x-hours = + { $number } { $number -> + [one] ώρα + *[other] ώρες + } +added = Προστέθηκε +input-source-switch = Εναλλαγή πηγών εισόδου γλώσσας πληκτρολογίου +focus-navigation = Πλοήγηση εστίασης + .focus-follows-cursor = Η εστίαση ακολουθεί τον κέρσορα + .focus-follows-cursor-delay = Η εστίαση ακολουθεί την καθυστέρηση του κέρσορα σε ms + .cursor-follows-focus = Ο κέρσορας ακολουθεί την εστίαση +full-name = Ονοματεπώνυμο +app-background = Φόντο παραθύρων +keyboard-sources = Πηγές εισόδου + .desc = Μπορείτε να αλλάξετε τις πηγές εισόδου με τον συνδυασμό πλήκτρων Super+Space, τον οποίο μπορείτε να προσαρμόσετε στις ρυθμίσεις συντομεύσεων πληκτρολογίου. + .move-up = Μετακίνηση πάνω + .move-down = Μετακίνηση κάτω + .settings = Ρυθμίσεις + .view-layout = Προβολή διάταξης πληκτρολογίου + .remove = Αφαίρεση + .add = Προσθήκη πηγής εισόδου +nav-shortcuts = Πλοήγηση + .prev-output = Εστίαση στην προηγούμενη έξοδο + .next-output = Εστίαση στην επόμενη έξοδο + .last-workspace = Εστίαση στον τελευταίο χώρο εργασίας + .prev-workspace = Εστίαση στον προηγούμενο χώρο εργασίας + .next-workspace = Εστίαση στον επόμενο χώρο εργασίας + .focus = + Εστίαση κατά ένα παράθυρο { $direction -> + *[down] προς τα κάτω + [in] προς τα μέσα + [left] προς τα αριστερά + [out] προς τα έξω + [right] προς τα δεξιά + [up] προς τα πάνω + } + .output = + Εναλλαγή { $direction -> + *[down] στην κάτω έξοδο + [left] στην αριστερή έξοδο + [right] στη δεξιά έξοδο + [up] στην πάνω έξοδο + } + .workspace = Μετάβαση στον χώρο εργασίας { $num } +hearing = Ακοή + .mono = Αναπαραγωγή στερεοφωνικού ήχου ως μονοφωνικού +preferred-languages = Προτιμώμενες γλώσσες + .desc = Η σειρά των γλωσσών καθορίζει ποια γλώσσα θα χρησιμοποιείται για το περιβάλλον χρήστη. Οι αλλαγές θα εφαρμοστούν στην επόμενη σύνδεση. +panel-style = Στυλ + .anchor-gap = Κενό ανάμεσα στη γραμμή συστήματος και στις άκρες της οθόνης + .dock-anchor-gap = Κενό ανάμεσα στην μπάρα εφαρμογών και στις άκρες της οθόνης + .extend = Επέκταση της γραμμής συστήματος στις άκρες της οθόνης + .dock-extend = Επέκταση της μπάρας εφαρμογών στις άκρες της οθόνης + .appearance = Εμφάνιση + .size = Μέγεθος + .background-opacity = Αδιαφάνεια φόντου +panel-appearance = Εμφάνιση + .match = Συμφωνία με την επιφάνεια εργασίας + .light = Ανοιχτόχρωμη + .dark = Σκουρόχρωμη +workspaces-multi-behavior = Συμπεριφορά πολλαπλών οθονών + .span = Κοινοί χώροι εργασίας σε όλες τις οθόνες + .separate = Ξεχωριστοί χώροι εργασίας ανά οθόνη +replace-shortcut-dialog = Αντικατάσταση συντόμευσης; + .desc = Η συντόμευση { $shortcut } χρησιμοποιείται από το { $name }. Εάν την αντικαταστήσετε, το { $name } θα απενεργοποιηθεί. +about-device = Όνομα συσκευής + .desc = Αυτό το όνομα εμφανίζεται σε άλλα δίκτυα ή συσκευές Bluetooth +no-vpn = Δεν διατίθενται συνδέσεις VPN. +start-segment = Αρχικό τμήμα +reset-to-default = Επαναφορά προεπιλογών +enable-export = Εφαρμογή τρέχοντος θέματος σε εφαρμογές GNOME + .desc = Δεν υποστηρίζουν όλα τα σύνολα εργαλείων την αυτόματη εναλλαγή. Ενδέχεται να χρειαστεί επανεκκίνηση των μη-COSMIC εφαρμογών μετά από αλλαγή του θέματος. +shortcut-name = Όνομα συντόμευσης +style = Στυλ + .round = Στρογγυλό + .slightly-round = Ελαφρώς στρογγυλό + .square = Τετράγωνο +panel-applets = Διαμόρφωση + .dock-desc = Διαμόρφωση των μικροεφαρμογών της μπάρας εφαρμογών + .desc = Διαμόρφωση των μικροεφαρμογών της γραμμής συστήματος +qr-code-unavailable = Δεν διατίθεται κωδικός QR +window-tiling = Παράθεση παραθύρων + .horizontal = Ορισμός οριζόντιου προσανατολισμού + .vertical = Ορισμός κάθετου προσανατολισμού + .swap-window = Εναλλαγή παραθύρου + .toggle-tiling = Εναλλαγή παράθεσης παραθύρων + .toggle-stacking = Εναλλαγή στοίβαξης παραθύρων + .toggle-floating = Εναλλαγή αιώρησης παραθύρων + .toggle-orientation = Εναλλαγή προσανατολισμού +change-password = Αλλαγή κωδικού πρόσβασης +disable-while-typing = Απενεργοποίηση κατά την πληκτρολόγηση +long = Μεγάλη +copied-to-clipboard = Αντιγράφηκε στο πρόχειρο +bluetooth-confirm-pin = Επιβεβαίωση PIN για σύνδεση Bluetooth + .description = Επιβεβαιώστε ότι το ακόλουθο PIN είναι ίδιο με αυτό που εμφανίζεται στο { $device } +legacy-app-scaling = Κλιμάκωση εφαρμογών στο σύστημα παραθύρων X11 + .scaled-gaming = Βελτιστοποίηση για παιχνίδια και εφαρμογές πλήρους οθόνης + .gaming-description = Οι εφαρμογές σε X11 ενδέχεται να εμφανίζονται ελαφρώς μεγαλύτερες/μικρότερες σε σύγκριση με τις εφαρμογές σε Wayland + .scaled-applications = Βελτιστοποίηση για εφαρμογές + .applications-description = Τα παιχνίδια και οι εφαρμογές πλήρους οθόνης σε X11 ενδέχεται να μην αντιστοιχούν στην ανάλυση της οθόνης σας + .scaled-compatibility = Λειτουργία μέγιστης συμβατότητας + .compatibility-description = Οι εφαρμογές σε X11 ενδέχεται να εμφανίζονται θολές σε οθόνες HiDPI + .preferred-display = Προτιμώμενη οθόνη για παιχνίδια και εφαρμογές πλήρους οθόνης σε X11 + .no-display = Καμία +night-light = Νυχτερινός φωτισμός + .auto = Αυτόματα (από τη δύση έως την ανατολή) + .desc = Μείωση του μπλε φωτός με θερμότερα χρώματα +custom-shortcuts = Προσαρμοσμένες συντομεύσεις + .add = Προσθήκη συντόμευσης + .context = Προσθήκη προσαρμοσμένης συντόμευσης + .none = Δεν υπάρχουν προσαρμοσμένες συντομεύσεις +visible-networks = Ορατά δίκτυα +window-hint-accent-toggle = Χρήση του χρώματος έμφασης για την ένδειξη ενεργού παραθύρου +type-to-search = Πληκτρολογήστε για αναζήτηση... +workspaces-behavior = Συμπεριφορά χώρων εργασίας + .dynamic = Δυναμικοί χώροι εργασίας + .dynamic-desc = Αυτόματη κατάργηση των κενών χώρων εργασίας. + .fixed = Σταθερός αριθμός χώρων εργασίας + .fixed-desc = Προσθήκη ή κατάργηση χώρων εργασίας στην επισκόπηση. +wireguard-dialog = Προσθήκη συσκευής WireGuard + .description = Επιλέξτε ένα όνομα συσκευής για τη διαμόρφωση του WireGuard. +remove-connection-dialog = Αφαίρεση προφίλ σύνδεσης; + .vpn-description = Θα χρειαστεί να εισαγάγετε ξανά τον κωδικό πρόσβασης για να χρησιμοποιήσετε αυτό το δίκτυο στο μέλλον. + .wired-description = Θα χρειαστεί να δημιουργήσετε εκ νέου αυτό το προφίλ για να το χρησιμοποιήσετε στο μέλλον. +click-behavior = Συμπεριφορά κλικ + .click-finger = Δευτερεύον κλικ με δύο δάχτυλα και μεσαίο κλικ με τρία δάχτυλα + .button-areas = Δευτερεύον κλικ στην κάτω δεξιά γωνία και μεσαίο κλικ στο κάτω κεντρικό μέρος +move-windows = Μετακίνηση παραθύρων + .direction = + Μετακίνηση παραθύρου { $direction -> + *[down] προς τα κάτω + [left] προς τα αριστερά + [right] προς τα δεξιά + [up] προς τα πάνω + } + .display = + Μετακίνηση παραθύρου κατά μία οθόνη { $direction -> + *[down] προς τα κάτω + [left] προς τα αριστερά + [right] προς τα δεξιά + [up] προς τα πάνω + } + .workspace = + Μετακίνηση παραθύρου κατά έναν χώρο εργασίας { $direction -> + *[below] προς τα κάτω + [left] προς τα αριστερά + [right] προς τα δεξιά + [above] προς τα πάνω + } + .workspace-num = Μετακίνηση παραθύρου στον χώρο εργασίας { $num } + .prev-workspace = Μετακίνηση παραθύρου στον προηγούμενο χώρο εργασίας + .next-workspace = Μετακίνηση παραθύρου στον επόμενο χώρο εργασίας + .last-workspace = Μετακίνηση παραθύρου στον τελευταίο χώρο εργασίας + .next-display = Μετακίνηση παραθύρου στην επόμενη οθόνη + .prev-display = Μετακίνηση παραθύρου στην προηγούμενη οθόνη + .send-to-prev-workspace = Μετακίνηση παραθύρου στον προηγούμενο χώρο εργασίας + .send-to-next-workspace = Μετακίνηση παραθύρου στον επόμενο χώρο εργασίας +switch-workspaces = Εναλλαγή χώρων εργασίας + .horizontal = Ολίσθηση με τέσσερα δάχτυλα προς τα αριστερά/δεξιά + .vertical = Ολίσθηση με τέσσερα δάχτυλα προς τα πάνω/κάτω +system-controls = Έλεγχος συστήματος +auto-switch = Αυτόματη εναλλαγή μεταξύ ανοιχτόχρωμης και σκουρόχρωμης λειτουργίας + .sunrise = Εναλλαγή στην ανοιχτόχρωμη λειτουργία την ανατολή + .sunset = Εναλλαγή στη σκουρόχρωμη λειτουργία τη δύση + .next-sunrise = Εναλλαγή στην ανοιχτόχρωμη λειτουργία στην επόμενη ανατολή + .next-sunset = Εναλλαγή στην ανοιχτόχρωμη λειτουργία στην επόμενη δύση +add-vpn = Προσθήκη VPN +keyboard-numlock-boot = Πλήκτρο Numlock + .boot-state = Κατάσταση κατά την εκκίνηση + .last-boot = Τελευταία εκκίνηση + .on = Ενεργό + .off = Ανενεργό + .set = Ορισμός κατάστασης Numlock κατά την εκκίνηση +about-related = Σχετικές ρυθμίσεις + .support = Λήψη υποστήριξης +tap-to-click = Πάτημα για κλικ + .desc = Ενεργοποιεί το πάτημα με ένα δάχτυλο για κύριο κλικ, με δύο δάχτυλα για δευτερεύον κλικ και με τρία δάχτυλα για μεσαίο κλικ +interface-density = Πυκνότητα περιβάλλοντος χρήστη + .comfortable = Άνετο + .compact = Πυκνό + .spacious = Ευρύχωρο +open-application-library = Άνοιγμα βιβλιοθήκης εφαρμογών +slow = Αργός +network-name = Όνομα δικτύου +scrolling = Κύλιση + .two-finger = Κύλιση με δύο δάχτυλα + .edge = Κύλιση κατά μήκος της άκρης με ένα δάχτυλο + .speed = Ταχύτητα κύλισης + .natural = Φυσική κατεύθυνση κύλισης + .natural-desc = Κύλιση του περιεχομένου, αντί της προβολής +auth-dialog = Απαιτείται πιστοποίηση + .vpn-description = Εισαγάγετε το όνομα χρήστη και τον κωδικό πρόσβασης που απαιτούνται από την υπηρεσία VPN. + .wifi-description = Εισαγάγετε τον κωδικό πρόσβασης ή το κλειδί κρυπτογράφησης. Μπορείτε επίσης να συνδεθείτε πατώντας το κουμπί «WPS» του δρομολογητή. +add-user = Προσθήκη χρήστη +add-image = Προσθήκη εικόνας +migrate-workspace-next = Μεταφορά χώρου εργασίας στην επόμενη έξοδο +airplane-on = Η λειτουργία πτήσης είναι ενεργή. +formatting = Μορφοποίηση + .dates = Ημερομηνίες + .time = Ώρα + .date-and-time = Ημερομηνία και ώρα + .numbers = Αριθμοί + .measurement = Μονάδα μέτρησης + .paper = Χαρτί +disabled = Ανενεργό +add-applet = Προσθήκη μικροεφαρμογής +show-extended-input-sources = Εμφάνιση εκτεταμένων πηγών εισόδου +mode-and-colors = Λειτουργία και χρώματα +forget = Διαγραφή +center-segment = Κεντρικό τμήμα +panel-missing = Απουσία διαμόρφωσης γραμμής συστήματος + .desc = Το αρχείο διαμόρφωσης της γραμμής συστήματος απουσιάζει λόγω της χρήσης μιας προσαρμοσμένης διαμόρφωσης ή είναι κατεστραμμένο. + .fix = Επαναφορά προεπιλογής +invalid-username = Μη έγκυρο όνομα χρήστη +mirroring = Κατοπτρισμός + .id = Κατοπτρισμός { $id } + .dont = Να μην γίνει κατοπτρισμός + .mirror = Κατοπτρισμός { $display } + .project = + Προβολή σε { $display -> + [all] όλες τις οθόνες + *[other] { $display } + } + .project-count = + Προβολή σε { $count } { $count -> + [1] άλλη οθόνη + *[other] άλλες οθόνες + } +orientation = Προσανατολισμός + .standard = Τυπικός + .rotate-90 = Περιστροφή 90° + .rotate-180 = Περιστροφή 180° + .rotate-270 = Περιστροφή 270° +auto = Αυτόματο +end-segment = Τελικό τμήμα +bluetooth-adapters = Προσαρμογείς Bluetooth +time-format = Μορφή ημερομηνίας και ώρας + .twenty-four = 24ωρη μορφή + .show-seconds = Εμφάνιση δευτερολέπτων + .first = Πρώτη ημέρα εβδομάδας + .show-date = Εμφάνιση ημερομηνίας στη μικροεφαρμογή ώρας + .friday = Παρασκευή + .saturday = Σάββατο + .sunday = Κυριακή + .monday = Δευτέρα +accent-color = Χρώμα έμφασης +type-key-combination = Εισαγάγετε τον συνδυασμό πλήκτρων +manage-windows = Διαχείριση παραθύρων + .close = Κλείσιμο παραθύρου + .maximize = Μεγιστοποίηση παραθύρου + .fullscreen = Παράθυρο σε πλήρη οθόνη + .minimize = Ελαχιστοποίηση παραθύρου + .resize-inwards = Αλλαγή μεγέθους παραθύρου προς τα μέσα + .resize-outwards = Αλλαγή μεγέθους παραθύρου προς τα έξω + .toggle-sticky = Εναλλαγή καρφιτσωμένου παραθύρου +install-additional-languages = Εγκατάσταση πρόσθετων γλωσσών +sound-output = Έξοδος ήχου + .volume = Ένταση εξόδου + .device = Συσκευή εξόδου + .level = Επίπεδο εξόδου + .config = Διαμόρφωση + .balance = Ισορροπία + .left = Αριστερό + .right = Δεξί +window-controls = Στοιχεία ελέγχου παραθύρων + .maximize = Εμφάνιση κουμπιού μεγιστοποίησης + .minimize = Εμφάνιση κουμπιού ελαχιστοποίησης + .active-window-hint = Εμφάνιση ένδειξης ενεργού παραθύρου +window-management-appearance = Διαχείριση παραθύρων + .active-hint = Μέγεθος ένδειξης ενεργού παραθύρου + .gaps = Κενά γύρω από τα παράθυρα σε παράθεση +migrate-workspace-prev = Μεταφορά χώρου εργασίας στην προηγούμενη έξοδο +legacy-app-global-shortcuts = Καθολικές συντομεύσεις σε εφαρμογές X11 + .desc = Οι καθολικές συντομεύσεις επιτρέπουν σε πατήματα πλήκτρων και συμβάντα κουμπιών ποντικιού που εκτελούνται στις εφαρμογές να αναγνωρίζονται από άλλες εφαρμογές για λειτουργίες, όπως πάτημα για ομιλία ή πάτημα για σίγαση. Από προεπιλογή, οι καθολικές συντομεύσεις είναι απενεργοποιημένες στις εφαρμογές X11 για να διασφαλιστεί ότι οι άλλες εφαρμογές δεν μπορούν να παρακολουθούν τα συμβάντα πληκτρολογίου και ποντικιού που περιέχουν ευαίσθητες πληροφορίες. + .none = Κανένα πλήκτρο + .modifiers = Πλήκτρα τροποποίησης (Super, Shift, Control, Alt) + .combination = Όλα τα πλήκτρα, ενώ είναι πατημένα τα Super, Control ή Alt + .all = Όλα τα πλήκτρα + .mouse = Συμβάντα κουμπιών ποντικιού σε εφαρμογές X11 +power-saving = Επιλογές εξοικονόμησης ενέργειας + .turn-off-screen-after = Απενεργοποίηση οθόνης μετά από + .auto-suspend = Αυτόματη αναστολή + .auto-suspend-ac = Αυτόματη αναστολή με τροφοδοσία ρεύματος + .auto-suspend-battery = Αυτόματη αναστολή με τροφοδοσία μπαταρίας +connected-devices = Συνδεδεμένες συσκευές + .unknown = Άγνωστη συσκευή +icons-and-toolkit = Εικονίδια και θέματα συνόλου εργαλείων +sound-applications = Εφαρμογές + .desc = Ένταση και ρυθμίσεις ήχου εφαρμογών +time-zone = Ζώνη ώρας + .auto = Αυτόματη ζώνη ώρας + .auto-info = Απαιτεί τη χρήση υπηρεσιών τοποθεσίας και πρόσβαση στο διαδίκτυο +fast = Γρήγορος +add-color = Προσθήκη χρώματος +add-network = Προσθήκη δικτύου + .profile = Προσθήκη προφίλ +network-device-state = + .activated = Συνδεδεμένο + .config = Σύνδεση + .deactivating = Αποσύνδεση + .disconnected = Αποσυνδεδεμένο + .failed = Αποτυχία σύνδεσης + .ip-check = Έλεγχος σύνδεσης + .ip-config = Αίτημα για διεύθυνση IP και πληροφορίες δρομολόγησης + .need-auth = Απαιτεί πιστοποίηση + .prepare = Προετοιμασία για σύνδεση + .secondaries = Αναμονή για δευτερεύουσα σύνδεση + .unavailable = Μη διαθέσιμο + .unknown = Άγνωστη κατάσταση + .unmanaged = Χωρίς διαχείριση + .unplugged = Αποσυνδεδεμένο καλώδιο +gestures = Χειρονομίες + .four-finger-down = Ολίσθηση με τέσσερα δάχτυλα προς τα κάτω + .four-finger-left = Ολίσθηση με τέσσερα δάχτυλα προς τα αριστερά + .four-finger-right = Ολίσθηση με τέσσερα δάχτυλα προς τα δεξιά + .four-finger-up = Ολίσθηση με τέσσερα δάχτυλα προς τα πάνω + .three-finger-any = Ολίσθηση με τρία δάχτυλα προς κάθε κατεύθυνση +system = Σύστημα και λογαριασμοί +no-networks = Δεν βρέθηκαν δίκτυα. +open-new-folder = Άνοιγμα νέου φακέλου +fill = Συμπλήρωση +custom = Προσαρμοσμένες +bluetooth-paired = Παλαιότερες συνδεδεμένες συσκευές + .connect = Σύνδεση + .battery = { $percentage }% μπαταρία +dialog = Παράθυρο διαλόγου + .title = Διατήρηση αυτών των ρυθμίσεων οθόνης; + .keep-changes = Διατήρηση αλλαγών + .change-prompt = Οι αλλαγές των ρυθμίσεων θα αναιρεθούν αυτόματα σε { $time } δευτερόλεπτα. + .revert-settings = Επαναφορά ρυθμίσεων +workspaces-overview-thumbnails = Μικρογραφίες επισκόπησης χώρων εργασίας + .show-number = Εμφάνιση αριθμού χώρων εργασίας + .show-name = Εμφάνιση ονόματος χώρων εργασίας +color = Χρώμα + .depth = Βάθος χρωμάτων + .profile = Προφίλ χρωμάτων + .sidebar = Προφίλ χρωμάτων + .temperature = Θερμοκρασία χρωμάτων +hex = Δεκαεξαδικό +magnifier = Μεγεθυντικός φακός + .controls = + Ή χρησιμοποιήστε αυτές τις συντομεύσεις: { $zoom_in -> + [zero] { "" } + *[other] + { "" } + { $zoom_in } για μεγέθυνση, + }{ $zoom_out -> + [zero] { "" } + *[other] + { "" } + { $zoom_out } για σμίκρυνση, + } + Super + κύλιση με το ποντίκι + .scroll_controls = Ενεργοποίηση ζουμ ποντικιού ή επιφάνειας αφής με Super + κύλιση + .show_overlay = Εμφάνιση της επικάλυψης μεγεθυντικού φακού + .increment = Αύξηση ζουμ + .signin = Έναρξη μεγεθυντικού φακού κατά τη σύνδεση + .applet = Εναλλαγή μεγεθυντικού φακού στη γραμμή συστήματος + .movement = Η ζουμαρισμένη προβολή μετακινείται + .continuous = Συνέχεια με τον κέρσορα + .onedge = Όταν ο κέρσορας φτάνει στην άκρη + .centered = Για να διατηρεί τον κέρσορα στο κέντρο +administrator = Διαχειριστής + .desc = Οι διαχειριστές μπορούν να αλλάζουν ρυθμίσεις για όλους τους χρήστες, να προσθέτουν και να καταργούν άλλους χρήστες +scan-to-connect-description = Σαρώστε τον κωδικό QR για να συνδεθείτε σε αυτό το δίκτυο. +modified = { $count } τροποποιήσεις +sound-usb-audio = Ήχος USB +sound-device-profiles = Προφίλ συσκευών +sound-hd-audio = Ήχος HD +shadow-and-corners = Σκίαση και γωνίες παραθύρων +shadows-tiling = Παράθεση παραθύρων + .clip = Συμφωνία με τις γωνίες συστήματος + .shadow = Εφαρμογή σκιών +shadows-floating = Αιωρούμενα παράθυρα + .clip = Συμφωνία με τις γωνίες συστήματος και εφαρμογή σκιών +sound-device-port-unplugged = Αποσυνδεδεμένο +workspaces-overview = Επισκόπηση χώρων εργασίας + .action-on-typing = Ενέργεια κατά την πληκτρολόγηση + .none = Καμία + .launcher = Άνοιγμα μενού εκκίνησης + .applications = Άνοιγμα εφαρμογών +time-region = Περιοχή και γλώσσα +power = Ενέργεια και μπαταρία +xdg-entry-wired = Ενσύρματη δικτύωση +xdg-entry-startup-apps-comment = Διαμόρφωση των εφαρμογών που εκτελούνται κατά τη σύνδεση +xdg-entry-region-language = Περιοχή και γλώσσα +time-date = Ημερομηνία και ώρα + .auto = Αυτόματη ρύθμιση + .auto-ntp = Η ημερομηνία και η ώρα θα ενημερώνονται αυτόματα όταν οριστεί ζώνη ώρας +xdg-entry-mouse-keywords = Ποντίκι;Επιτάχυνση;Κύλιση;COSMIC;Mouse;Acceleration;Scrolling; +xdg-entry-notifications-keywords = Ειδοποίηση;Κλείδωμα;COSMIC;Notification;Lock; +xdg-entry-startup-apps-keywords = Εφαρμογή;Εκκίνηση;COSMIC;Startup;Application; +xdg-entry-default-apps-comment = Προεπιλεγμένο πρόγραμμα περιήγησης ιστού, πρόγραμμα ηλεκτρονικού ταχυδρομείου, εφαρμογή περιήγησης αρχείων και άλλες εφαρμογές +xdg-entry-keyboard-comment = Πηγές εισόδου, εναλλαγή, εισαγωγή ειδικών χαρακτήρων, συντομεύσεις +xdg-entry-wired-keywords = Σύνδεση;Δίκτυο;Ενσύρματο;COSMIC;Wired;LAN;Network;Connection; +xdg-entry-power = Ενέργεια και μπαταρία +xdg-entry-dock-keywords = Μικροεφαρμογή;Μπάρα;Εφαρμογών;Γραμμή;Συστήματος;COSMIC;Dock;Panel;Applet +bluetooth = Bluetooth + .status = Αυτό το σύστημα είναι ορατό ως { $aliases } όσο είναι ανοικτές οι ρυθμίσεις του Bluetooth. + .connected = Συνδεδεμένο + .connecting = Σύνδεση + .disconnecting = Αποσύνδεση + .connect = Σύνδεση + .disconnect = Αποσύνδεση + .forget = Διαγραφή + .dbus-error = Προέκυψε σφάλμα κατά την αλληλεπίδραση με το DBus: { $why } + .disabled = Η υπηρεσία Bluetooth είναι απενεργοποιημένη + .inactive = Η υπηρεσία Bluetooth δεν είναι ενεργή + .unknown = Δεν ήταν δυνατή η ενεργοποίηση της υπηρεσίας Bluetooth. Είναι εγκατεστημένο το BlueZ; +xdg-entry-mouse-comment = Ταχύτητα ποντικιού, επιτάχυνση και φυσική κατεύθυνση κύλισης +xdg-entry-system = Σύστημα και λογαριασμοί +xdg-entry-panel-keywords = Μικροεφαρμογή;Γραμμή;Συστήματος;COSMIC;Panel;Applet +xdg-entry-window-management = Διαχείριση παραθύρων +xdg-entry-time-language-comment = Διαχείριση ημερομηνίας, ώρας, περιοχής και γλώσσας συστήματος +default-apps = Προεπιλεγμένες εφαρμογές + .web-browser = Περιήγηση ιστού + .file-manager = Διαχείριση αρχείων + .mail-client = Ηλεκτρονικό ταχυδρομείο + .music = Μουσική + .video = Βίντεο + .photos = Φωτογραφίες + .calendar = Ημερολόγιο + .terminal = Τερματικό + .other-associations = Άλλες συσχετίσεις + .text-editor = Επεξεργασία κειμένου + .not-installed = Δεν έχει εγκατασταθεί +xdg-entry-x11-applications-keywords = Εφαρμογή;Παιχνίδι;Συμβατότητα;COSMIC;X11;Application;Game;Compatibility; +xdg-entry-displays-comment = Διαχείριση ρυθμίσεων διαμόρφωσης οθονών +xdg-entry-touchpad-keywords = Επιφάνεια;Αφή;Χειρονομία;COSMIC;Touchpad;Gesture; +xdg-entry-time-language = Ώρα και γλώσσα +window-management = Διαχείριση παραθύρων +xdg-entry-system-keywords = Σύστημα;Πληροφορίες;Λογαριασμοί;Υλικολογισμικό;COSMIC;System;Info;Accounts;Firmware; +xdg-entry-wireless-keywords = Σύνδεση;Δίκτυο;COSMIC;WiFi;Wi-Fi;Network;Connection; +mouse = Ποντίκι + .speed = Ταχύτητα ποντικιού + .acceleration = Ενεργοποίηση επιτάχυνσης ποντικιού +dock = Μπάρα εφαρμογών +xdg-entry-panel = Γραμμή συστήματος +display = Οθόνες + .arrangement = Διάταξη οθονών + .arrangement-desc = Σύρετε τις οθόνες για να τις αναδιατάξετε + .enable = Ενεργοποίηση οθόνης + .external = Εξωτερική οθόνη { $size } { $output } + .laptop = Οθόνη φορητού υπολογιστή { $size } + .options = Επιλογές οθόνης + .refresh-rate = Ρυθμός ανανέωσης + .resolution = Ανάλυση + .scale = Κλίμακα + .additional-scale-options = Πρόσθετες επιλογές κλίμακας +xdg-entry-wireless-comment = Συνδέσεις Wi-Fi και προφίλ σύνδεσης +xdg-entry-desktop-comment = Ρυθμίσεις ταπετσαρίας, εμφάνισης, γραμμής συστήματος, μπάρας εφαρμογών, διαχείρισης παραθύρων και χώρων εργασίας +xdg-entry-network = Δίκτυα και ασύρματη σύνδεση +xdg-entry-users-comment = Πιστοποίηση και λογαριασμοί χρηστών +startup-apps = Εφαρμογές εκκίνησης + .add = Προσθήκη εφαρμογής + .user = Εφαρμογές που εκκινούνται όταν κάνετε σύνδεση + .none = Δεν έχουν προστεθεί εφαρμογές εκκίνησης + .remove-dialog-title = Αφαίρεση του «{ $name }»; + .remove-dialog-description = Αφαίρεση αυτής της εφαρμογής εκκίνησης; + .add-startup-app = Προσθήκη εφαρμογής εκκίνησης +xdg-entry-input-comment = Ρυθμίσεις πληκτρολογίου και ποντικιού +input-devices = Συσκευές εισόδου +xdg-entry-dock-comment = Μια προαιρετική μπάρα για εφαρμογές και μικροεφαρμογές +xdg-entry-network-keywords = Δίκτυο;Δικτύωση;Ασύρματο;COSMIC;Network;Wireless;WiFi;VPN; +xdg-entry-wallpaper-comment = Εικόνες ταπετσαρίας, χρώματα και επιλογές παρουσίασης διαφανειών +xdg-entry-dock = Μπάρα εφαρμογών +xdg-entry-startup-apps = Εφαρμογές εκκίνησης +xdg-entry-workspaces-keywords = Χώρος;Εργασίας;Προσανατολισμός;Επισκόπηση;Οθόνη;COSMIC;Workspace;Orientation;Overview;Monitor; +xdg-entry-system-comment = Πληροφορίες συστήματος, λογαριασμοί και ενημερώσεις υλικολογισμικού +xdg-entry-x11-applications-comment = Κλιμάκωση εφαρμογών συστήματος παραθύρων X11, κύρια οθόνη και καθολικές συντομεύσεις +xdg-entry-region-language-comment = Μορφοποίηση ημερομηνιών, ώρας και αριθμών με βάση την περιοχή σας +panel = Γραμμή συστήματος +xdg-entry-wallpaper-keywords = Ταπετσαρία;Φόντο;Παρουσίαση;Διαφανειών;COSMIC;Wallpaper;Background;Slideshow; +xdg-entry-users-keywords = Λογαριασμός;Χρήστης;COSMIC;User;Account; +xdg-entry-vpn-keywords = Δίκτυο;Σύνδεση;COSMIC;VPN;Network;Connection;OpenVPN;OpenConnect; +users = Χρήστες + .admin = Διαχειριστής + .standard = Τυπικός + .profile-add = Επιλογή εικόνας προφίλ +xdg-entry-time-language-keywords = Σύστημα;Ώρα;Ημερομηνία;Περιοχή;Γλώσσα;COSMIC;System;Time;Date;Region;Language; +xdg-entry-input-keywords = Εισαγωγή;Είσοδος;Πληκτρολόγιο;Ποντίκι;Ποντίκια;COSMIC;Input;Keyboard;Mouse;Mice; +xdg-entry-notifications-comment = Λειτουργία «Μην ενοχλείτε», ειδοποιήσεις οθόνης κλειδώματος και ρυθμίσεις ανά εφαρμογή +xdg-entry-sound-keywords = Ήχος;Ειδοποίηση;COSMIC;Sound;Audio;Alert;Pipewire; +xdg-entry-power-keywords = Μπαταρία;Ισχύς;Ενέργεια;COSMIC;Power;Battery +legacy-applications = Συμβατότητα εφαρμογών X11 +xdg-entry-region-language-keywords = Περιοχή;Γλώσσα;Ημερομηνία;Μορφή;Ώρα;Τοπικές;Τοπικοποίηση;COSMIC;Region;Language;Date;Format;Time;Locale;Localization; +xdg-entry-applications-keywords = Προεπιλογή;Προεπιλεγμένες;Εφαρμογές;Εφαρμογή;Εκκίνηση;Συμβατότητα;COSMIC;Default;Application;Startup;X11;Compatibility +xdg-entry-sound-comment = Ρυθμίσεις ήχου για συσκευές, ειδοποιήσεις και εφαρμογές +wallpaper = Ταπετσαρία + .change = Αλλαγή εικόνας κάθε + .fit = Προσαρμογή ταπετσαρίας + .folder-dialog = Επιλογή φακέλου ταπετσαριών + .image-dialog = Επιλογή εικόνας ταπετσαρίας + .plural = Ταπετσαρίες + .same = Κοινή ταπετσαρία για όλες τις οθόνες + .slide = Παρουσίαση διαφανειών +xdg-entry-touchpad-comment = Ταχύτητα επιφάνειας αφής, επιλογές κλικ και χειρονομίες +xdg-entry-keyboard-keywords = Πληκτρολόγιο;Είσοδος;Πηγή;Συντομεύσεις;COSMIC;Keyboard;Input;Source;Shortcuts; +xdg-entry-vpn-comment = Συνδέσεις VPN και προφίλ σύνδεσης +xdg-entry-window-management-keywords = Παράθυρο;Διαχείριση;Παράθεση;Πλήκτρο;COSMIC;Window;Management;Tiling;Super;Key; +xdg-entry-workspaces-comment = Προσανατολισμός χώρων εργασίας, επισκόπηση και συμπεριφορά πολλαπλών οθονών +xdg-entry-network-comment = Διαχείριση συνδέσεων δικτύου +xdg-entry-panel-comment = Η κύρια γραμμή του συστήματος για μενού και μικροεφαρμογές +touchpad = Επιφάνεια αφής + .acceleration = Ενεργοποίηση επιτάχυνσης επιφάνειας αφής + .speed = Ταχύτητα επιφάνειας αφής +xdg-entry-power-comment = Λειτουργίες ενέργειας και επιλογές εξοικονόμησης ενέργειας +time = Ώρα και γλώσσα +xdg-entry-x11-applications = Συμβατότητα εφαρμογών X11 +xdg-entry-window-management-comment = Ενέργεια πλήκτρου Super, επιλογές ελέγχου παραθύρων και πρόσθετες επιλογές παράθεσης παραθύρων +xdg-entry-wired-comment = Ενσύρματες συνδέσεις και προφίλ σύνδεσης +known-networks = Γνωστά δίκτυα +network-and-wireless = Δίκτυα και ασύρματη δικτύωση +keyboard-special-char = Εισαγωγή ειδικών χαρακτήρων + .alternate = Πλήκτρο εναλλακτικών χαρακτήρων + .compose = Πλήκτρο σύνθεσης + .compose-desc = Το πλήκτρο σύνθεσης επιτρέπει την εισαγωγή μιας ευρείας ποικιλίας χαρακτήρων. Για να το χρησιμοποιήσετε, πατήστε το πλήκτρο σύνθεσης και έπειτα, μια ακολουθία χαρακτήρων. Για παράδειγμα, μπορείτε να εισαγάγετε τον χαρακτήρα «©» πατώντας το πλήκτρο σύνθεσης, ακολουθούμενο από τα «C» και «o», ή τον χαρακτήρα «á» πατώντας το πλήκτρο σύνθεσης, ακολουθούμενο από τα «a» και «‘» . + .caps = Πλήκτρο Caps Lock +no-search-results = Δεν αντιστοιχεί κανένα δίκτυο στην αναζήτησή σας. +workspaces-navigation = Πλοήγηση + .wraparound = Μετακίνηση μεταξύ του πρώτου και του τελευταίου χώρου εργασίας με συντομεύσεις πληκτρολογίου και χειρονομίες +bluetooth-display-passkey = Σύζευξη Bluetooth + .description = Πληκτρολογήστε το ακόλουθο κλειδί πρόσβασης στο { $device } και πατήστε Enter +bluetooth-display-pin = Σύζευξη Bluetooth + .description = Πληκτρολογήστε το ακόλουθο PIN στο { $device } και πατήστε Enter diff --git a/i18n/en/cosmic_settings.ftl b/i18n/en/cosmic_settings.ftl index 535477b..b77f075 100644 --- a/i18n/en/cosmic_settings.ftl +++ b/i18n/en/cosmic_settings.ftl @@ -198,6 +198,8 @@ vpn-error = VPN Error .connect = Failed to connect to VPN .connection-editor = Connection editor failed .connection-settings = Failed to get settings for active connections + .openvpn-config-path = Invalid file path for OpenVPN config + .openvpn-config-path-desc = Chosen file must be on a local file system. .updating-state = Failed to update network manager state .wireguard-config-path = Invalid file path for WireGuard config .wireguard-config-path-desc = Chosen file must be on a local file system. @@ -252,6 +254,12 @@ bluetooth-paired = Previously connected devices bluetooth-confirm-pin = Confirm Bluetooth PIN .description = Please confirm that the following PIN matches the one displayed on { $device } +bluetooth-display-passkey = Bluetooth Pairing + .description = Please type the following passkey on { $device }, then press Enter + +bluetooth-display-pin = Bluetooth Pairing + .description = Please type the following PIN on { $device }, then press Enter + bluetooth-available = Nearby devices bluetooth-adapters = Bluetooth adapters @@ -393,7 +401,20 @@ style = Style .round = Round .slightly-round = Slightly round .square = Square - + .frosted-glass = Frosted glass + .frosted-system-interface = System interface + .frosted-system-interface-desc = Applies frosted glass to Launcher, application library, workspace overview, on-screen controls + .frosted-windows = Windows + .frosted-windows-desc = Applies frosted glass to windows and dialogs + .frosted-panels = Panels + .frosted-panels-desc = Applies frosted glass to panel and dock + .frosted-applets = Applets + .frosted-applets-desc = Applies frosted glass to applet menus on panel and dock + .frosted-thickness = Frost thickness + .less = less + .more = more + .glass-opacity = Glass opacity + interface-density = Interface density .comfortable = Comfortable .compact = Compact @@ -476,7 +497,7 @@ super-key = Super key action .launcher = Open Launcher .workspaces = Open Workspaces .applications = Open Applications - .disable = Disable + .none = None edge-gravity = Floating windows gravitate to nearby edges @@ -704,6 +725,22 @@ keyboard-special-char = Special Character Entry .compose = Compose key .compose-desc = The compose key allows a wide variety of characters to be entered. To use it, press compose and then a sequence of characters. For example, compose key followed by C and o will enter ©, while compose key followed by a and ‘ will enter á. .caps = Caps Lock key + .ctrl = Control + .ctrl-right = Right Ctrl + .swap-with-ctrl = Swap with Control + .alt = Alt + .alt-left = Left Alt + .alt-right = Right Alt + .super = Super + .super-left = Left Super + .super-right = Right Super + .menu = Menu key + .backspace = Backspace + .escape = Escape + .swap-with-escape = Swap with Escape + .print-screen = Print Screen + .scroll-lock = Scroll Lock + .none = None keyboard-typing-assist = Typing .repeat-rate = Repeat rate diff --git a/i18n/fi/cosmic_settings.ftl b/i18n/fi/cosmic_settings.ftl index 58b2efb..3dd3588 100644 --- a/i18n/fi/cosmic_settings.ftl +++ b/i18n/fi/cosmic_settings.ftl @@ -818,3 +818,5 @@ shadows-tiling = Asetellut ikkunat .clip = Sovita järjestelmän kulmiin .shadow = Käytä varjoja no-search-results = Hakuasi vastaavia verkkoja ei löytynyt. +workspaces-navigation = Liikkuminen + .wraparound = Siirry ensimmäisen ja viimeisen työtilan välillä käyttäen pikanäppäimiä ja eleitä diff --git a/i18n/fr/cosmic_settings.ftl b/i18n/fr/cosmic_settings.ftl index 419dc72..bce82d1 100644 --- a/i18n/fr/cosmic_settings.ftl +++ b/i18n/fr/cosmic_settings.ftl @@ -117,6 +117,8 @@ vpn-error = Erreur VPN .connect = Échec de la connexion au VPN .connection-editor = Échec de l'éditeur de connexion .connection-settings = Échec de l'obtention des paramètres des connexions actives + .openvpn-config-path = Chemin du fichier de configuration OpenVPN invalide + .openvpn-config-path-desc = Le fichier sélectionné doit se trouver sur un système de fichiers local. .updating-state = Échec de la mise à jour de l'état du gestionnaire de réseau .wireguard-config-path = Chemin de fichier invalide pour la configuration WireGuard .wireguard-config-path-desc = Le fichier choisi doit se trouver sur un système de fichiers local. @@ -902,3 +904,9 @@ xdg-entry-keyboard-keywords = COSMIC;Clavier;Saisie;Source;Raccourcis; xdg-entry-window-management-keywords = COSMIC;Fenêtre;Gestion;Agencement;Super;Touche; xdg-entry-displays-keywords = COSMIC;Écran; no-search-results = Aucun réseau ne correspond à votre recherche. +workspaces-navigation = Navigation + .wraparound = Passez du premier au dernier espace de travail à l'aide des raccourcis clavier et des gestes +bluetooth-display-passkey = Appairage Bluetooth + .description = Veuillez saisir le code d’association sur { $device }, puis appuyer sur Entrée +bluetooth-display-pin = Appairage Bluetooth + .description = Veuillez saisir le code PIN suivant sur { $device }, puis appuyer sur Entrée diff --git a/i18n/ga/cosmic_settings.ftl b/i18n/ga/cosmic_settings.ftl index ace1bf1..6f7571a 100644 --- a/i18n/ga/cosmic_settings.ftl +++ b/i18n/ga/cosmic_settings.ftl @@ -911,3 +911,5 @@ xdg-entry-x11-applications = Comhoiriúnacht Feidhmchláir X11 xdg-entry-window-management-comment = Gníomh na sár-eochrach, roghanna rialaithe fuinneoige, agus roghanna breise tíleála fuinneoige xdg-entry-wired-comment = Naisc sreangaithe agus próifílí nasc no-search-results = Níl aon líonra ag teacht leis an gcuardach seo. +workspaces-navigation = Nascleanúint + .wraparound = Bog idir an chéad spás oibre agus an spás oibre deireanach ag baint úsáide as aicearraí méarchláir agus gothaí diff --git a/i18n/hu/cosmic_settings.ftl b/i18n/hu/cosmic_settings.ftl index a3d2e76..004f0fb 100644 --- a/i18n/hu/cosmic_settings.ftl +++ b/i18n/hu/cosmic_settings.ftl @@ -1,5 +1,5 @@ app = COSMIC Beállítások -dbus-connection-error = Nem sikerült csatlakozni a DBus-hoz +dbus-connection-error = Nem sikerült csatlakozni a D-Bushoz ok = OK unknown = Ismeretlen number = { $number } @@ -23,7 +23,7 @@ xdg-entry-desktop = Asztal xdg-entry-displays = Kijelzők xdg-entry-displays-comment = Kijelzőbeállítások kezelése xdg-entry-dock = Dokk -xdg-entry-dock-comment = Egy opcionális sáv alkalmazásokhoz és kisalkalmazásokhoz +xdg-entry-dock-comment = Választható sáv alkalmazásokhoz és kisalkalmazásokhoz xdg-entry-input = Beviteli eszközök xdg-entry-input-comment = Billentyűzet- és egérbeállítások xdg-entry-keyboard = Billentyűzet @@ -33,7 +33,7 @@ xdg-entry-mouse-comment = Egérsebesség, gyorsítás és természetes görgeté xdg-entry-network = Hálózat és Wi-Fi xdg-entry-network-comment = Hálózati kapcsolatok kezelése xdg-entry-notifications = Értesítések -xdg-entry-notifications-comment = Ne zavarjanak, zárolási képernyő értesítések és alkalmazásonkénti beállítások +xdg-entry-notifications-comment = Ne zavarjanak mód, a zárolási képernyő értesítései és alkalmazásonkénti beállítások xdg-entry-panel-comment = Fő rendszersáv menükhöz és kisalkalmazásokhoz xdg-entry-power = Energia és akkumulátor xdg-entry-power-comment = Energiagazdálkodási módok és energiagazdálkodási beállítások @@ -56,10 +56,10 @@ xdg-entry-window-management = Ablakkezelés xdg-entry-window-management-comment = Super billentyű funkció, ablakkezelési és csempézési beállítások xdg-entry-wired = Vezetékes kapcsolatok xdg-entry-wired-comment = Vezetékes kapcsolatok és kapcsolódási profilok -xdg-entry-wireless-comment = Wi-Fi kapcsolatok és kapcsolódási profilok +xdg-entry-wireless-comment = Wi-Fi-kapcsolatok és kapcsolódási profilok xdg-entry-workspaces = Munkaterületek -xdg-entry-workspaces-comment = Munkaterület-tájolás, áttekintés és többképernyős viselkedés -xdg-entry-x11-applications = X11 alkalmazások támogatása +xdg-entry-workspaces-comment = Munkaterület-tájolás, áttekintés és többmonitoros viselkedés +xdg-entry-x11-applications = X11-alkalmazások támogatása xdg-entry-x11-applications-comment = X11 ablakrendszer alkalmazásméretezés, elsődleges kijelző és globális gyorsbillentyűk ## Network & Wireless @@ -67,17 +67,17 @@ xdg-entry-x11-applications-comment = X11 ablakrendszer alkalmazásméretezés, e add-network = Hálózat hozzáadása .profile = Profil hozzáadása add-vpn = VPN hozzáadása -airplane-on = A repülőgép üzemmód be van kapcsolva +airplane-on = A repülőgép üzemmód be van kapcsolva. cable-unplugged = Kábel kihúzva -connect = Csatlakozás -connected = Csatlakoztatva -connecting = Csatlakozás… +connect = Kapcsolódás +connected = Kapcsolódva +connecting = Kapcsolódás… disconnect = Bontás forget = Elfelejtés known-networks = Ismert hálózatok network-and-wireless = Hálózat és Wi-Fi no-networks = Nem található hálózat. -no-vpn = Nincs elérhető VPN-kapcsolat +no-vpn = Nincs elérhető VPN-kapcsolat. password = Jelszó password-confirm = Jelszó megerősítése remove = Eltávolítás @@ -88,20 +88,20 @@ identity = Azonosító auth-dialog = Azonosítás szükséges .vpn-description = Írd be a VPN szolgáltatáshoz szükséges felhasználónevet és jelszót. .wifi-description = Add meg a jelszót vagy a titkosítókulcsot. A router „WPS” gombjának megnyomásával is csatlakozhatsz. -forget-dialog = El akarod felejteni ezt a Wi-Fi hálózatot? - .description = A jelszót ismét meg kell adnod, ha újra csatlakozni szeretnél. +forget-dialog = Elfelejted ezt a Wi-Fi-hálózatot? + .description = A jelszót ismét meg kell majd adnod a kapcsolódáshoz. network-device-state = - .activated = Csatlakoztatva - .config = Csatlakozás… + .activated = Kapcsolódva + .config = Kapcsolódás… .deactivating = Bontás… .disconnected = Kapcsolat bontva - .failed = Csatlakozás sikertelen + .failed = Nem sikerült kapcsolódni .ip-check = Kapcsolat ellenőrzése .ip-config = IP és router információk lekérése .need-auth = Hitelesítés szükséges .prepare = Felkészülés a kapcsolódáshoz .secondaries = Várakozás másodlagos kapcsolatra - .unavailable = Nem elérhető + .unavailable = Nem érhető el .unknown = Ismeretlen állapot .unmanaged = Kezeletlen .unplugged = Kábel kihúzva @@ -113,11 +113,13 @@ vpn = VPN .error = Nem sikerült hozzáadni a VPN-konfigurációt .remove = Kapcsolati profil törlése .select-file = VPN-konfigurációs fájl kiválasztása -vpn-error = VPN hiba +vpn-error = VPN-hiba .config = Nem sikerült hozzáadni a VPN-konfigurációt - .connect = Nem sikerült csatlakozni a VPN-hez - .connection-editor = A hálózati beállító nem működik + .connect = Nem sikerült kapcsolódni a VPN-hez + .connection-editor = A kapcsolatszerkesztő nem működik .connection-settings = Nem sikerült lekérni az aktív kapcsolatok beállításait + .openvpn-config-path = Érvénytelen OpenVPN-konfiguráció-útvonal + .openvpn-config-path-desc = A kiválasztott fájlnak helyi fájlrendszeren kell lennie. .updating-state = Nem sikerült frissíteni a hálózatkezelő állapotát .wireguard-config-path = Érvénytelen fájlelérési út a WireGuard konfigurációhoz .wireguard-config-path-desc = A kiválasztott fájlnak helyi fájlrendszeren kell lennie. @@ -129,15 +131,15 @@ vpn-error = VPN hiba [password-flags] jelszóbeállításait } az nmclivel wired = Vezetékes - .adapter = Vezetékes adapter { $id } + .adapter = { $id }. vezetékes adapter .connections = Vezetékes kapcsolatok .devices = Vezetékes eszközök .remove = Kapcsolati profil törlése wifi = Wi-Fi - .adapter = Wi-Fi adapter { $id } + .adapter = { $id }. Wi-Fi-adapter .forget = Hálózat elfelejtése wireguard-dialog = WireGuard eszköz hozzáadása - .description = Válassz egy eszköznevet a WireGuard-konfigurációhoz. + .description = Válassz egy eszköznevet a WireGuard konfigurációhoz. ## Networking: Online Accounts @@ -150,19 +152,19 @@ activate = Aktiválás confirm = Megerősítés enable = Engedélyezés bluetooth = Bluetooth - .status = Ez a rendszer { $aliases } néven látható, amíg a Bluetooth beállítások vannak megnyitva. - .connected = Csatlakoztatva - .connecting = Csatlakozás… + .status = Ez a rendszer { $aliases } néven látható, amíg a Bluetooth-beállítások meg vannak nyitva. + .connected = Kapcsolódva + .connecting = Kapcsolódás… .disconnecting = Bontás… - .connect = Csatlakozás + .connect = Kapcsolódás .disconnect = Bontás .forget = Elfelejtés - .dbus-error = Hiba történt a DBus-szal való kommunikáció során: { $why } + .dbus-error = Hiba történt a D-Busszal való kommunikáció során: { $why } .disabled = A Bluetooth szolgáltatás le van tiltva .inactive = A Bluetooth szolgáltatás nem aktív .unknown = A Bluetooth szolgáltatást nem sikerült aktiválni. A BlueZ telepítve van? -bluetooth-paired = Korábban párosított eszközök - .connect = Csatlakozás +bluetooth-paired = Korábban csatlakoztatott eszközök + .connect = Kapcsolódás .battery = { $percentage }% töltöttség bluetooth-confirm-pin = Bluetooth PIN megerősítése .description = Erősítsd meg, hogy a következő PIN megegyezik a(z) { $device } eszközön megjelenített PIN-kóddal @@ -175,7 +177,7 @@ accessibility = Akadálymentesség .vision = Látás .on = Bekapcsolva .off = Kikapcsolva - .unavailable = Nem elérhető + .unavailable = Nem érhető el .screen-reader = Képernyőolvasó .high-contrast = Magas kontraszt mód .invert-colors = Színek invertálása @@ -222,8 +224,8 @@ desktop = Asztal wallpaper = Háttérkép .change = Háttérkép váltásának gyakorisága .fit = Háttérkép illeszkedése - .folder-dialog = Válassz mappát a háttérképekhez - .image-dialog = Válassz képet a háttérképnek + .folder-dialog = Háttérkép-mappa kiválasztása + .image-dialog = Háttérkép kiválasztása .plural = Háttérképek .same = Ugyanaz a háttérkép legyen minden kijelzőn .slide = Diavetítés @@ -272,10 +274,10 @@ window-hint-accent-toggle = Kiemelőszín használata az aktív ablak kiemelés auto-switch = Automatikus váltás világos és sötét mód között .sunrise = Napkeltekor világos módra váltás .sunset = Napnyugtakor sötét módra váltás - .next-sunrise = Következő napfelkeltekor világos módra váltás + .next-sunrise = Következő napkeltekor világos módra váltás .next-sunset = Következő napnyugtakor sötét módra váltás container-background = Felületi elemek háttere - .desc-detail = A felületi elemek háttérszínét a navigációs oldalsáv, az oldalsó menü, a párbeszédablakok és hasonló modulok használják. Alapértelmezés szerint a felületi elemek háttérszíne automatikusan az ablak hátteréből származnak. + .desc-detail = A felületi elemek háttérszínét a navigációs oldalsáv, az oldalsó menü, a párbeszédablakok és hasonló modulok használják. Alapértelmezés szerint a felületi elemek háttérszíne automatikusan az ablak hátteréből származik. .reset = Visszaállítás automatikusra .desc = Navigációs oldalsávhoz, oldalsó menühöz, párbeszédablakhoz és hasonló modulokhoz használandó control-tint = Vezérlőelemek színezése @@ -283,22 +285,22 @@ control-tint = Vezérlőelemek színezése frosted = Tejüveg hatás a rendszerfelületen .desc = A háttér elmosását alkalmazza a panelre, a dokkra, a kisalkalmazásokra, az indítóra és az alkalmazáskönyvtárra enable-export = Jelenlegi téma alkalmazása a GNOME-alkalmazásokra - .desc = Nem minden eszközkészlet támogatja az automatikus váltást. Előfordulhat, hogy a téma módosítása után újra kell indítani a nem COSMIC-alapú alkalmazásokat. + .desc = Nem minden eszközkészlet támogatja az automatikus váltást. Előfordulhat, hogy a téma módosítása után újra kell indítani a nem COSMIC-alkalmazásokat. icon-theme = Ikontéma .desc = Más ikonkészletet alkalmaz az alkalmazásokra text-tint = Felületi szöveg árnyalata .desc = A felület szövegszíneinek meghatározására szolgál, hogy azok megfelelő kontrasztot biztosítsanak különböző felületeken style = Stílus .round = Lekerekített - .slightly-round = Némileg lekerekített - .square = Négyzetes + .slightly-round = Enyhén lekerekített + .square = Szögletes interface-density = Felületsűrűség .comfortable = Kényelmes .compact = Kompakt .spacious = Tágas window-management-appearance = Ablakkezelés .active-hint = Aktív ablak kiemelésének mérete - .gaps = Rések a csempézett ablakok körül + .gaps = Hézagok a csempézett ablakok körül ### Experimental @@ -371,7 +373,7 @@ window-controls = Ablakvezérlés .minimize = Minimalizálás gomb megjelenítése .active-window-hint = Aktív ablak kiemelése focus-navigation = Fókusznavigáció - .focus-follows-cursor = Fókusz követi az egeret + .focus-follows-cursor = Fókusz követi a mutatót .focus-follows-cursor-delay = Fókuszálás késleltetése (ms) .cursor-follows-focus = Mutató követi a fókuszt @@ -382,7 +384,7 @@ workspaces-behavior = Munkaterületek viselkedése .dynamic = Dinamikus munkaterületek .dynamic-desc = Üres munkaterületek automatikus eltávolítása .fixed = Megadott számú munkaterület - .fixed-desc = Munkaterületek hozzáadása vagy eltávolítása az áttekintésben + .fixed-desc = Munkaterületek hozzáadása vagy eltávolítása az áttekintésben. workspaces-multi-behavior = Többmonitoros viselkedés .span = A munkaterületek kiterjednek a kijelzőkre .separate = A kijelzők külön munkaterülettel rendelkeznek @@ -393,7 +395,7 @@ workspaces-orientation = Munkaterületek tájolása .vertical = Függőleges .horizontal = Vízszintes hot-corner = Aktív sarok - .top-left-corner = A munkaterületek bal felső aktív sarkának engedélyezése + .top-left-corner = Bal felső aktív sarok engedélyezése a munkaterületekhez ## Displays @@ -408,16 +410,16 @@ display = Kijelzők .arrangement-desc = Húzd a kijelzőket az átrendezésükhöz .enable = Kijelző engedélyezése .external = { $size } { $output } külső kijelző - .laptop = { $size } laptop kijelző - .options = Kijelző lehetőségek + .laptop = { $size } laptopkijelző + .options = Kijelzőbeállítások .refresh-rate = Frissítési gyakoriság .resolution = Felbontás .scale = Skálázás .additional-scale-options = További skálázás mirroring = Tükrözés .id = Tükrözés { $id } - .dont = Ne tükrözzön - .mirror = Tükrözze a(z) { $display } kijelzőt + .dont = Tükrözés kikapcsolása + .mirror = A(z) { $display } kijelző tükrözése .project = Kivetítés { $display -> [all] az összes kijelzőre @@ -426,16 +428,16 @@ mirroring = Tükrözés .project-count = Kivetítés { $count } további { $count -> [1] kijelzőre - *[other] kijelzőkre + *[other] kijelzőre } night-light = Éjszakai fény .auto = Automatikus (naplementétől napkeltéig) .desc = Kék fény csökkentése melegebb színekkel orientation = Tájolás .standard = Normál - .rotate-90 = 90 fokos elforgatás - .rotate-180 = 180 fokos elforgatás - .rotate-270 = 270 fokos elforgatás + .rotate-90 = Elforgatás 90°-kal + .rotate-180 = Elforgatás 180°-kal + .rotate-270 = Elforgatás 270°-kal vrr = Változó frissítési gyakoriság .enabled = Engedélyezve .force = Mindig @@ -489,11 +491,11 @@ battery = Akkumulátor [one] nap *[other] nap } - .less-than-minute = Kevesebb, mint egy perc + .less-than-minute = Kevesebb mint egy perc .and = és .remaining-time = { $time } { $action -> - [full] a teljes töltöttségig + [full] a teljes feltöltésig *[other] a lemerülésig } connected-devices = Csatlakoztatott eszközök @@ -546,7 +548,7 @@ keyboard-sources = Bemeneti források keyboard-special-char = Speciális karakter beírása .alternate = Alternatív karakterek billentyűje .compose = Kombináló billentyű - .compose-desc = A kombináló billentyű lehetővé teszi számos karakter bevitelét. Használatához nyomd meg a billentyűt, majd gépeld be a karakterek sorozatát. Például a kombináló billentyű, majd C és o lenyomásával a © jelet kapod, míg a és ‘ után á jelenik meg. + .compose-desc = A kombináló billentyű lehetővé teszi számos karakter bevitelét. Használatához nyomd meg a billentyűt, majd gépeld be a karakterek sorozatát. Például a kombináló billentyű, majd „C” és „o” lenyomásával a „©” jelet kapod, míg „a” és „‘” után „á” jelenik meg. .caps = Caps Lock billentyű keyboard-typing-assist = Gépelés .repeat-rate = Ismétlési sebesség @@ -586,7 +588,7 @@ replace = Csere shortcut-name = Gyorsbillentyű neve system-controls = Rendszervezérlés terminate = Befejezés -toggle-stacking = Az ablakok egymásra helyezésének be- és kikapcsolása +toggle-stacking = Ablakok egymásra helyezése be/ki type-key-combination = Billentyűkombináció custom-shortcuts = Egyéni gyorsbillentyűk .add = Gyorsbillentyű hozzáadása @@ -623,7 +625,7 @@ manage-windows = Ablakok kezelése .minimize = Ablak minimalizálása .resize-inwards = Ablak átméretezése befelé .resize-outwards = Ablak átméretezése kifelé - .toggle-sticky = Ragadós ablak be- és kikapcsolása + .toggle-sticky = Ragadós ablak be/ki move-windows = Ablakok mozgatása .direction = Ablakok mozgatása { $direction -> @@ -650,15 +652,15 @@ move-windows = Ablakok mozgatása .prev-workspace = Ablak áthelyezése az előző munkaterületre .next-workspace = Ablak áthelyezése a következő munkaterületre .last-workspace = Ablak áthelyezése az utolsó munkaterületre - .next-display = Ablak áthelyezése a következő monitorra - .prev-display = Ablak áthelyezése az előző monitorra + .next-display = Ablak áthelyezése a következő kijelzőre + .prev-display = Ablak áthelyezése az előző kijelzőre .send-to-prev-workspace = Ablak áthelyezése az előző munkaterületre .send-to-next-workspace = Ablak áthelyezése a következő munkaterületre system-shortcut = Rendszer .app-library = Alkalmazáskönyvtár megnyitása .brightness-down = Kijelző fényerejének csökkentése .brightness-up = Kijelző fényerejének növelése - .display-toggle = Belső kijelző be- vagy kikapcsolása + .display-toggle = Belső kijelző be/ki .home-folder = Saját mappa megnyitása .keyboard-brightness-down = Billentyűzet fényerejének csökkentése .keyboard-brightness-up = Billentyűzet fényerejének növelése @@ -674,20 +676,20 @@ system-shortcut = Rendszer .screenshot = Képernyőkép készítése .suspend = Felfüggesztés .terminal = Terminál megnyitása - .touchpad-toggle = Érintőpárna be- vagy kikapcsolása + .touchpad-toggle = Érintőpárna be/ki .volume-lower = Hangkimenet hangerejének csökkentése .volume-raise = Hangkimenet hangerejének növelése - .web-browser = Böngésző megnyitása + .web-browser = Webböngésző megnyitása .window-switcher = Váltás a nyitott ablakok között .window-switcher-previous = Váltás a nyitott ablakok között fordított sorrendben .workspace-overview = Munkaterület áttekintésének megnyitása window-tiling = Ablakcsempézés .horizontal = Vízszintes tájolás beállítása .vertical = Függőleges tájolás beállítása - .swap-window = Ablak felcserélése - .toggle-tiling = Az ablakok csempézésének be- és kikapcsolása - .toggle-stacking = Az ablakok egymásra helyezésének be- és kikapcsolása - .toggle-floating = Az ablakok lebegtetésének be- és kikapcsolása + .swap-window = Ablakok felcserélése + .toggle-tiling = Ablakcsempézés be/ki + .toggle-stacking = Ablakok egymásra helyezése be/ki + .toggle-floating = Ablakok lebegtetése be/ki .toggle-orientation = Tájolás váltása replace-shortcut-dialog = Lecseréled a billentyűt? .desc = A(z) { $shortcut } billentyűt a(z) { $name } használja. Ha lecseréled, a(z) { $name } le lesz tiltva. @@ -697,20 +699,20 @@ zoom-out = Kicsinyítés ## Input: Mouse mouse = Egér - .speed = Egér sebessége + .speed = Egérsebesség .acceleration = Egérgyorsítás engedélyezése ## Input: Touchpad click-behavior = Kattintási viselkedés .click-finger = Másodlagos kattintás két ujjal és középső kattintás három ujjal - .button-areas = Másodlagos kattintás a jobb alsó sarokban, középső kattintás az alsó középső sarokban + .button-areas = Másodlagos kattintás a jobb alsó sarokban és középső kattintás alul középen pinch-to-zoom = Csippentéses nagyítás - .desc = Két ujjal belenagyíthatsz a tartalomba azokban az alkalmazásokban, amik támogatják a nagyítást + .desc = Két ujjal belenagyíthatsz a tartalomba azokban az alkalmazásokban, amelyek támogatják a nagyítást tap-to-click = Koppintás a kattintáshoz - .desc = Engedélyezi az egyujjas koppintást az elsődleges kattintáshoz, a kétujjas koppintást a másodlagos kattintáshoz és a háromujjas érintést a középső kattintáshoz + .desc = Engedélyezi az egyujjas koppintást az elsődleges kattintáshoz, a kétujjas koppintást a másodlagos kattintáshoz és a háromujjas koppintást a középső kattintáshoz touchpad = Érintőpárna - .acceleration = Az Érintőpárna gyorsításának engedélyezése + .acceleration = Az érintőpárna gyorsításának engedélyezése .speed = Érintőpárna sebessége ## Input: Gestures @@ -768,7 +770,7 @@ applications = Alkalmazások ## Applications: Default Applications default-apps = Alapértelmezett alkalmazások - .web-browser = Böngésző + .web-browser = Webböngésző .file-manager = Fájlkezelő .mail-client = Levelezőprogram .music = Zene @@ -786,27 +788,27 @@ startup-apps = Indítási alkalmazások .add = Alkalmazás hozzáadása .user = Bejelentkezéskor indított alkalmazások .none = Nincs indítási alkalmazás hozzáadva - .remove-dialog-title = { $name } eltávolítása? + .remove-dialog-title = Eltávolítod a(z) { $name } alkalmazást? .remove-dialog-description = Eltávolítod ezt az indítási alkalmazást? .add-startup-app = Indítási alkalmazás hozzáadása ## Applications: Legacy Applications -legacy-applications = X11 alkalmazások támogatása -legacy-app-global-shortcuts = Globális gyorsbillentyűk X11 alkalmazásokban - .desc = A globális gyorsbillentyűk lehetővé teszik, hogy az alkalmazásokban a billentyűleütéseket és egérkattintásokat más alkalmazások is felismerjék, például a „push-to-talk” vagy a „push-to-mute” funkciókhoz. Alapértelmezés szerint a globális gyorsbillentyűk az X11 alkalmazásokban le van tiltva, hogy más alkalmazások ne figyelhessék a billentyű- és egéreseményeket, amelyek érzékeny információkat tartalmazhatnak. +legacy-applications = X11-alkalmazások támogatása +legacy-app-global-shortcuts = Globális gyorsbillentyűk X11-alkalmazásokban + .desc = A globális gyorsbillentyűk lehetővé teszik, hogy az alkalmazásokban a billentyűleütéseket és egérkattintásokat más alkalmazások is felismerjék, például a „push-to-talk” vagy a „push-to-mute” funkciókhoz. Alapértelmezés szerint a globális gyorsbillentyűk az X11-alkalmazásokban le van tiltva, hogy más alkalmazások ne figyelhessék a billentyű- és egéreseményeket, amelyek érzékeny információkat tartalmazhatnak. .none = Nincs billentyű .modifiers = Módosítók (Super, Shift, Control, Alt) .combination = Minden billentyű, miközben a Super, Control vagy Alt módosítók lenyomva vannak .all = Minden billentyű - .mouse = Egérgomb-események X11 alkalmazásokban -legacy-app-scaling = X11-ablakrendszer alkalmazásméretezés + .mouse = Egérgomb-események X11-alkalmazásokban +legacy-app-scaling = X11-alkalmazások méretezése .scaled-gaming = Optimalizálás játékokra és teljes képernyős alkalmazásokra - .gaming-description = Az X11 alkalmazások kicsit nagyobbnak/kisebbnek tűnhetnek a Wayland alkalmazásokhoz képest + .gaming-description = Az X11-alkalmazások kicsit nagyobbnak/kisebbnek tűnhetnek a Wayland-alkalmazásokhoz képest .scaled-applications = Optimalizálás alkalmazásokra - .applications-description = A játékok és a teljes képernyős X11 alkalmazások felbontása eltérhet a kijelző natív felbontásától + .applications-description = A játékok és a teljes képernyős X11-alkalmazások felbontása eltérhet a kijelző natív felbontásától .scaled-compatibility = Maximális kompatibilitási mód - .compatibility-description = Az X11 alkalmazások elmosódottan jelenhetnek meg HiDPI képernyőkön + .compatibility-description = Az X11-alkalmazások elmosódottan jelenhetnek meg HiDPI képernyőkön .preferred-display = Preferált kijelző játékokhoz és teljes képernyős X11-alkalmazásokhoz .no-display = Nincs @@ -817,7 +819,7 @@ system = Rendszer és fiókok ## System: About about = Rendszerinformáció -about-device = Eszköz neve +about-device = Eszköznév .desc = Ez a név más hálózati vagy Bluetooth-eszközök számára látható about-hardware = Hardver .model = Hardvermodell @@ -827,8 +829,8 @@ about-hardware = Hardver .disk-capacity = Tárhely about-os = Operációs rendszer .os = Operációs rendszer - .os-architecture = Operációs rendszer architektúra - .kernel = Kernel verzió + .os-architecture = Operációs rendszer architektúrája + .kernel = Kernelverzió .desktop-environment = Asztali környezet .windowing-system = Ablakrendszer about-related = Kapcsolódó beállítások @@ -858,7 +860,7 @@ amplification = Erősítés qr-code-unavailable = Nem érhető el a QR-kód network-name = Hálózat neve share = Hálózat megosztása -scan-to-connect-description = Olvasd be a QR-kódot a hálózathoz való csatlakozáshoz. +scan-to-connect-description = Olvasd be a QR-kódot a hálózathoz való kapcsolódáshoz. place-here = Helyezd ide a kisalkalmazásokat sound-device-port-unplugged = Nincs csatlakoztatva sound-hd-audio = HD-hang @@ -884,7 +886,7 @@ xdg-entry-panel-keywords = COSMIC;Panel;Kisalkalmazás; xdg-entry-time-language-comment = Rendszerdátum, idő, régió és a nyelv kezelése xdg-entry-desktop-keywords = COSMIC;Asztal; xdg-entry-system-keywords = COSMIC;Rendszer;Információk;Fiókok;Firmware; -xdg-entry-about-keywords = COSMIC;Névjegy +xdg-entry-about-keywords = COSMIC;Névjegy; xdg-entry-panel = Panel xdg-entry-a11y-keywords = COSMIC;Akadálymentesség;Képernyő;Olvasó;Nagyító;Kontraszt;Szín; xdg-entry-date-time-keywords = COSMIC;Idő;Zóna; @@ -907,10 +909,16 @@ xdg-entry-x11-applications-keywords = COSMIC;X11;Alkalmazás;Játék;Támogatás xdg-entry-touchpad-keywords = COSMIC;Érintőpárna;Mozdulat; xdg-entry-wireless-keywords = COSMIC;WiFi;Wi-Fi;Hálózat;Kapcsolat; xdg-entry-wireless = Wi-Fi -xdg-entry-workspaces-keywords = COSMIC;Munkaterület;Tájolás;Áttekintés;Monitor; +xdg-entry-workspaces-keywords = COSMIC;Munkaterület;Tájolás;Áttekintés;Monitor;Kijelző;Képernyő; xdg-entry-wallpaper-keywords = COSMIC;Háttérkép;Háttér;Diavetítés; xdg-entry-users-keywords = COSMIC;Felhasználó;Fiók; xdg-entry-vpn-keywords = COSMIC;VPN;Hálózat;Kapcsolat;OpenVPN;OpenConnect; xdg-entry-comment = Beállításalkalmazás a COSMIC asztalhoz -xdg-entry-window-management-keywords = COSMIC;Ablak;Kezelés;Csempézés;Super;BIllentyű; +xdg-entry-window-management-keywords = COSMIC;Ablak;Kezelés;Csempézés;Super;Billentyű; no-search-results = Nem található a keresésnek megfelelő hálózat. +workspaces-navigation = Navigáció + .wraparound = Váltás az első és az utolsó munkaterület között gyorsbillentyűkkel és gesztusokkal +bluetooth-display-passkey = Bluetooth-párosítás + .description = Írd be a következő párosítási kulcsot a(z) { $device } eszközön, majd nyomd meg az Enter billentyűt +bluetooth-display-pin = Bluetooth-párosítás + .description = Írd be a következő PIN-kódot a(z) { $device } eszközön, majd nyomd meg az Enter billentyűt diff --git a/i18n/id/cosmic_settings.ftl b/i18n/id/cosmic_settings.ftl index 8ae3b70..a6f6a8f 100644 --- a/i18n/id/cosmic_settings.ftl +++ b/i18n/id/cosmic_settings.ftl @@ -61,6 +61,8 @@ vpn-error = Galat VPN .connect = Gagal menyambungkan ke VPN .connection-editor = Penyunting sambungan gagal .connection-settings = Gagal mendapatkan pengaturan untuk sambungan aktif + .openvpn-config-path = Jalur berkas tidak valid untuk konfig OpenVPN + .openvpn-config-path-desc = Berkas dipilih harus berada di sistem berkas lokal. .updating-state = Gagal memperbarui status pengelola jaringan .wireguard-config-path = Jalur berkas tidak valid untuk konfigurasi WireGuard .wireguard-config-path-desc = Berkas yang dipiih harus di sistem berkas lokal. @@ -818,3 +820,9 @@ xdg-entry-x11-applications = Kompatibilitas Aplikasi X11 xdg-entry-window-management-comment = Tindakan tombol Super, opsi kontrol jendela, dan pengubinan jendela tambahan xdg-entry-wired-comment = Sambungan berkabel dan profil sambungan no-search-results = Tidak ada jaringan yang sesuai pencarian anda. +workspaces-navigation = Navigasi + .wraparound = Pindahkan antara ruang kerja pertama dan terakhir menggunakan pintasan papan ketik dan gerakan +bluetooth-display-passkey = Pemasangan Bluetooth + .description = Silakan ketik kunci sandi berikut pada { $device }, kemudian tekan Enter +bluetooth-display-pin = Pemasangan Bluetooth + .description = Silakan ketik PIN berikut pada { $device }, kemudian tekan Enter diff --git a/i18n/kk/cosmic_settings.ftl b/i18n/kk/cosmic_settings.ftl index 2b58689..37aa0ec 100644 --- a/i18n/kk/cosmic_settings.ftl +++ b/i18n/kk/cosmic_settings.ftl @@ -818,3 +818,5 @@ xdg-entry-x11-applications = X11 қолданбаларының үйлесімд xdg-entry-window-management-comment = Super пернесінің әрекеті, терезелерді басқару опциялары және терезелерді қатар қоюдың қосымша опциялары xdg-entry-wired-comment = Сымды қосылымдар және қосылымдар профильдері no-search-results = Сіздің іздеуіңізге ешбір желі сәйкес келмейді. +workspaces-navigation = Навигация + .wraparound = Бірінші және соңғы жұмыс орындары арасында пернетақта жарлықтары мен ым қимылдар арқылы ауысу diff --git a/i18n/kmr/cosmic_settings.ftl b/i18n/kmr/cosmic_settings.ftl index e69de29..9ddde9a 100644 --- a/i18n/kmr/cosmic_settings.ftl +++ b/i18n/kmr/cosmic_settings.ftl @@ -0,0 +1,828 @@ +save = Tomar bike +cancel = Têk bibe +close = Bigire +password = Borînpeyv +forget-dialog = Ev tora Wi-Fi ji bîr bike? + .description = Ji bo ku tu di pêşerojê de vê tora Wi-Fi bikar bînî, divê tu dîsa borînpeyvekê binivîsî. +remove = Rake +import = Têxîne +export = Derxîne +username = Navê bikarhêner +light = Ronî +identity = Nasname +applets = Sepanok +password-confirm = Borînpeyvê biperjîne +dark = Tarî +confirm = Bipejirîne +settings = Sazkarî +replace = Biguhêrîne +add = Tevlî bike +appearance = Xuyang +panel = Destgeh +connect = Girê bide +unknown = Nenas +connected = Hat girêdan +panel-left = Çep +super-key = Çalakiya bişkoka Super + .launcher = Destpêkerê veke + .workspaces = Cîhên xebatê veke + .applications = Sepanan veke + .disable = Neçalak bike +x-minutes = + { $number } { $number -> + [one] xulek + *[other] xulek + } +vrr = Rêjeya nûkirina guhêrbar + .enabled = Çalak e + .force = Her dem + .auto = Xweber + .disabled = Neçalak e +window-hint-accent = Rengê nîşana çarçoveya çalak +fit-to-screen = Li gorî dîmenderê tije bike +control-tint = Rengkirina hêmanên kontrolê + .desc = Ji bo paşrûyê bişkokên standard, ketanên lêgerînê, ketanên nivîsê û hêmanên wekhev tê bikaranîn +toggle-stacking = Komkirina çarçoveyê biguhêrîne +panel-top = Jor +no-applets-found = Tu sepanok nehatin dîtin... +region = Herêm +zoom-in = Nêzîk bike +place-here = Sepanokan li vir bi cih bike +-requires-restart = Pêdivî bi jinûve despêkirinê heye +workspaces-orientation = Arasteya qadên xebatê + .vertical = Stûnî + .horizontal = Asoyî +acceleration-desc = Hestiyariya şopandinê li gorî lezê xweber diguhêrîne +all-displays = Hemû dîmender +scheduling = Demsazkirin + .manual = Demsazkirina destî +frosted = Bandora cama qeşa li ser navrûya pergalê + .desc = Li ser destgeh, bender, sepanok, destpêker û pirtûkxaneya sepanan bandora mijîkirina paşrûyê disepîne +about-hardware = Reqalav + .model = Modêla reqalavê + .memory = Bîrdank + .processor = Pêvajoker + .graphics = Grafîk + .disk-capacity = Kapasîteya dîskê +short = Kurt +vpn = VPN + .connections = Girêdanên VPNê + .error = Tevlîkirina rêkxistinê VPNê têk çû + .remove = Profîla girêdanê rake + .select-file = Peleke rêkxistinê VPNê hilbijêre +power-mode = Awaya hêzê + .battery = Jiyana betariyê dirêj bike + .battery-desc = Bikaranîna hêzê kêmkirî û performansa bêdeng + .balanced = Hevseng + .balanced-desc = Performansa bêdeng û bikaranîna hêzê navîn + .performance = Performansa bilind + .performance-desc = Performansa bilind û bikaranîna hêzê + .no-backend = Backend nehat dîtin. system76-power an jî power-profiles-daemon saz bike. +wired = Têlkirî + .adapter = Adaptorê têlkirî { $id } + .connections = Girêdanên têlkirî + .devices = Amûrên têlkirî + .remove = Profîla girêdanê rake +bluetooth-available = Amûrên nêzîk +cable-unplugged = Kebl nehatiye girêdan +color-picker = Hilbijêrê rengan +interface-font = Cûrenivîsa pergalê +default = Berdest +zoom-out = Dûr bixe +hot-corner = Quncika germ + .top-left-corner = Ji bo qadên xebatê quncika çepê ya jorîn çalak bike +keyboard-typing-assist = Nivîsandin + .repeat-rate = Rêjeya dûbarekirinê + .repeat-delay = Derengiya dûbarekirinê +edge-gravity = Çarçoveyên herikbar ber bi qeraxên nêzîk ve tê kişandin +amplification = Bilindkirina dengê + .desc = Mafê dide ku deng heya 150% were bilindkirin +recent-colors = Rengên dawîn +about-os = Pergala xebatê + .os = Pergala xebatê + .os-architecture = Avasaziya pergala xebatê + .kernel = Guhertoya kernelê + .desktop-environment = Hawirdora sermaseyê + .windowing-system = Pergala çarçoveyê +panel-behavior-and-position = Tevger û cih + .autohide = Destgehê xweber veşêre + .dock-autohide = Benderê xweber veşêre + .position = Cihê li ser dîmenderê + .display = Li ser dîmenderê nîşan bide +add-language = Zimên tevlî bike + .context = Zimên tevlî bike +password-mismatch = Borînpeyv û piştrastkirin divê li hev bikin +accessibility = Gihîştin + .vision = Dîtin + .on = Vekirî ye + .off = Girtî ye + .unavailable = Ne pêkan e + .screen-reader = Xwînerê dîmenderê + .high-contrast = Awayê berevajiya bilind + .invert-colors = Rengan berevajî bike + .color-filters = Parzûnên rengan +container-background = Paşrûyê konteynirê + .desc-detail = Rengê paşrûyêa konteynirê ji bo gerandina darika kêlekê, kaşoya alî, gotûbêj û alavokên wekhev tê bikaranîn. Bi berdestî, rengê paşrûya konteynirê xweber ji paşrûyê çarçoveyê tê girtin. + .reset = Vegere awayê xweber + .desc = Ji bo gerandina benda kêlekê, kaşoya alî, gotûbêj û alavokên wekhev tê bikaranîn +primary-button = Bişkoka sereke + .desc = Rêza bişkokên fîzîkî diyar dike + .left = Çep + .right = Rast +sound-alerts = Hişyarî + .volume = Asta dengê hişyariyan + .sound = Dengê hişyariyan +icon-theme = Rûkara îkonan + .desc = Komkeke cûda ya îkonan li ser sepanan disepîne +keyboard-shortcuts = Kurteriyên kilîtdankê + .desc = Kurteriyan nîşan bide û kesane bike +switch-between-windows = Di navbera çarçoveyan de biguhêrîne +sound-usb-audio = Dengê USB +text-tint = Rengkirina nivîsa navrûyê + .desc = Ji bo bidestxistina rengên nivîsa navrûyê ku li ser rûyên cûda berevajiyeke têrker pêşkêş dikin tê bikaranîn +online-accounts = Jimarên serhêl + .desc = Jimar, IMAP û SMTP û têketinên pargîdaniyê tevlî bike +open-workspaces-view = Pêşdîtina qadên xebatê veke +all = Hemû +remove-user = Bikarhêner rake +sound-input = Ketan + .volume = Asta dengê ketanê + .device = Amûra ketanê + .level = Asta ketanê +add-another-keybinding = Kurteriyeke din tevlî bike +copy-to-clipboard = Bo jêgirtankê jê bigire +monospace-font = Cûrenivîsa monospace +experimental-settings = Sazkariyên ezmûnkirî +recent-folders = Peldankên dawîn +color-filter = Cûreyê parzûna rengan + .unknown = Parzûna nenas çalak e + .greyscale = Rengên gewr + .deuteranopia = Kesk/Sor (kêmbûna kesk, Deuteranopia) + .protanopia = Sor/Kesk (kêmbûna sor, Protanopia) + .tritanopia = Şîn/Zer (kêmbûna şîn, Tritanopia) +migrate-workspace = + Qada xebatê bibe derana { $direction -> + *[down] jêr + [left] çep + [right] rast + [up] jor + } +battery = Betarî + .minute = + { $value } { $value -> + [one] xulek + *[other] xulek + } + .hour = + { $value } { $value -> + [one] demjimêr + *[other] demjimêr + } + .day = + { $value } { $value -> + [one] roj + *[other] roj + } + .less-than-minute = Kêmtir ji xulekekê + .and = û + .remaining-time = + { $time } heya { $action -> + [full] tije + *[other] vala + } +search-applets = Sepanokan bigere... +pinch-to-zoom = Ji bo nêzîkbûnê bitikîne + .desc = Ji bo sepanên ku piştgiriya zoomê dikin, du tiliyan bikar bîne da ku nêzî naverokê bibe +wifi = Wi-Fi + .adapter = Adaptorê Wi-Fi { $id } + .forget = Ev tor ji bîr bike +x-hours = + { $number } { $number -> + [one] demjimêr + *[other] demjimêr + } +added = Hate tevlîkirin +input-source-switch = Çavkaniya ketanê zimanê kilîtdankê biguhêrîne +focus-navigation = Gerandina balkişandinê + .focus-follows-cursor = Balkêşî nîşanderê dişopîne + .focus-follows-cursor-delay = Derengiya balkêşiyê nîşanderê dişopîne di mç de + .cursor-follows-focus = Nîşander balkêşiyê dişopîne +full-name = Navê tije +app-background = Paşrûyê çarçoveyê +panel-right = Rast +sound-device-profiles = Profîlên amûrê +keyboard-sources = Çavkaniyên ketanê + .desc = Çavkaniyên ketanê dikarin bi riya bikaranîna kombînasyona kilîtên Super+Space werin guhertin. Ev dikare di sazkariyên kurteriyên kilîtdankê de were kesanekirin. + .move-up = Bilivîne jor + .move-down = Bilivîne jêr + .settings = Sazkarî + .view-layout = Awayê kilîtdankê nîşan bide + .remove = Rake + .add = Çavkaniya ketanê tevlî bike +nav-shortcuts = Gerandin + .prev-output = Balê bikişîne ser derana paş + .next-output = Balê bikişîne ser derana pêş + .last-workspace = Balê bikişîne ser qada xebatê ya dawî + .prev-workspace = Balê bikişîne ser qada xebatê ya paş + .next-workspace = Balê bikişîne ser qada xebatê ya pêş + .focus = + Balkişandina çarçoveyê { $direction -> + *[down] jêr + [in] hundir + [left] çep + [out] derve + [right] rast + [up] jor + } + .output = + Deranê biguhêrîne { $direction -> + *[down] jêr + [left] çep + [right] rast + [up] jor + } + .workspace = Biguhêrîne bo qada xebatê { $num } +hearing = Guhdarîkirin + .mono = Dengê stereo wekî mono bilîze +preferred-languages = Zimanên bijarte + .desc = Rêza zimanan diyar dike ka kîjan ziman ji bo navrûya bikarhêner tê bikaranîn. Guhertin di têketina din de dikevin bandorê. +sound-hd-audio = Dengê HD +network-and-wireless = Tor & Bêtêlî +panel-style = Şêwaz + .anchor-gap = Valahiya di navbera destgeh û qeraxên dîmenderê de + .dock-anchor-gap = Valahiya di navbera bender û qeraxên dîmenderê de + .extend = Destgehê dirêjî qeraxên dîmenderê bike + .dock-extend = Benderê dirêjî qeraxên dîmenderê bike + .appearance = Xuyang + .size = Mezinahî + .background-opacity = Ronahiya paşrûyê +panel-appearance = Xuyang + .match = Li gorî sermaseyê li hev bîne + .light = Ronî + .dark = Tarî +workspaces-multi-behavior = Tevgera pir-dîmender + .span = Dîmender qadên xebatê yên hevpar parve dikin + .separate = Her dîmender xwedî qadên xebatê yên serbixwe ye +replace-shortcut-dialog = Kurteriyê biguherîne? + .desc = { $shortcut } ji aliyê { $name } ve tê bikaranîn. Ku tu wê biguhêrînî, { $name } wê were neçalakkirin. +rgb = RGB +about-device = Navê amûrê + .desc = Ev nav ji bo amûrên din ên torê an Bluetoothê xuya dike +no-vpn = Tu girêdanên VPNê heyî tune ne. +start-segment = Beşa destpêkê +desktop = Sermase +reset-to-default = Vegere rewşa berdest +debug = Debug +enable-export = Rûkara heyî li ser sepanên GNOME disepîne + .desc = Ne hemû amûr piştgiriya guhertina xweber dikin. Sepanên ne-COSMIC dibe ku piştî guhertina rûkarê pêdivî bi jinûvedestpêkirinê bike. +shortcut-name = Navê kurteriyê +style = Şêwaz + .round = Gilover + .slightly-round = Nîv gilover + .square = Çargoşe +panel-applets = Rêkxistin + .dock-desc = Sepanokên benderê bi rêk bixe + .desc = Sepanokên destgehê bi rêk bixe +qr-code-unavailable = Koda QR ne pêkan e +small = Biçûk +window-tiling = Berhevkirina çarçoveyê + .horizontal = Berhevkirina asoyî saz bike + .vertical = Berhevkirina stûnî saz bike + .swap-window = Berhevkirina biguhêrîne + .toggle-tiling = Berhevkirina çarçoveyê biguhêrîne + .toggle-stacking = Komkirina çarçoveyê biguhêrîne + .toggle-floating = Çarçoveyê herikbar biguhêrîne + .toggle-orientation = Arasteyê biguherîne +change-password = Borînpeyvê biguhêrîne +disable-while-typing = Di dema nivîsandinê de asteng bike +long = Dirêj +copied-to-clipboard = Bo jêgirtankê hate jêgirtin +bluetooth-confirm-pin = PINa Bluetoothê bipejirîne + .description = Tika ye piştrast bike ka PINa jêrîn bi ya ku li ser { $device } xuya dibe re yek e +legacy-app-scaling = Pîvandina sepanên pergala çarçoveyê X11 + .scaled-gaming = Ji bo lîstik û sepanên dîmendera tije baştir bike + .gaming-description = Dibe ku sepanên X11 li gorî sepanên Wayland hinekî mezintir/biçûktir xuya bibin + .scaled-applications = Ji bo sepanan baştir bike + .applications-description = Dibe ku lîstik û sepanên X11 ên dîmendera tije bi çareseriya dîmenderê re nelihevhatî bin + .scaled-compatibility = Awaya lihevhatinê ya herî pir + .compatibility-description = Dibe ku sepanên X11 li ser dîmenderên HiDPI mijok xuya bibin + .preferred-display = Dîmenderê bijarte ji bo lîstik û sepanên X11 ên dîmendera tije + .no-display = Ne yek +night-light = Ronahiya şevê + .auto = Xweber (rojavabûn heya hilatina rojê) + .desc = Bi rengên germ ronahiya şîn kêm bike +custom-shortcuts = Kurteriyên kesane + .add = Kurteriyê tevlî bike + .context = Kurteriya kesane tevlî bike + .none = Tu kurteriyên kesane tune ne +visible-networks = Torên dîtbar +terminate = Biqedîne +window-hint-accent-toggle = Rengê sereke yê rûkarê wekî nîşana çarçoveya çalak bi kar bîne +type-to-search = Ji bo lêgerînê binivîse... +workspaces-behavior = Tevgera qada xebatê + .dynamic = Qadên xebatê yên dînamîk + .dynamic-desc = Qadên xebatê yên vala xweber radike. + .fixed = Jimara guhertî ya qadên xebatê + .fixed-desc = Di pêşdîtinê de qadên xebatê tevlî bike yan jî rake. +wireguard-dialog = Amûra WireGuard tevlî bike + .description = Ji bo rêkxistina WireGuard navekî amûrê hilbijêre. +remove-connection-dialog = Profîla girêdanê rake? + .vpn-description = Ji bo ku tu di pêşerojê de vê torê bi kar bînî, divê tu dîsa borînpeyvekê têxînî. + .wired-description = Ji bo ku tu di pêşerojê de vê profîlê bi kar bînî, divê tu dîsa biafirînî. +click-behavior = Tevgera tikandinê + .click-finger = Tikandinê duyemîn bi du tiliyan û tikandinê navîn bi sê tiliyan + .button-areas = Tikandinê duyemîn li quncika rastê ya jêrîn û tikandinê navîn li navenda jêrîn +move-windows = Çarçoveyan bilivîne + .direction = + Çarçoveyê bilivîne { $direction -> + *[down] jêr + [left] çep + [right] rast + [up] jor + } bilivîne + .display = + Çarçoveyê bilivîne dîmendera din { $direction -> + *[down] jêr + [left] çep + [right] rast + [up] jor + } + .workspace = + Çarçoveyê bilivîne qada xebatê ya din { $direction -> + *[below] jêr + [left] çep + [right] rast + [above] jor + } + .workspace-num = Çarçoveyê bilivîne qada xebatê { $num } + .prev-workspace = Çarçoveyê bilivîne qada xebatê ya paş + .next-workspace = Çarçoveyê bilivîne qada xebatê ya pêş + .last-workspace = Çarçoveyê bilivîne qada xebatê ya dawî + .next-display = Çarçoveyê bilivîne dîmenderê pêş + .prev-display = Çarçoveyê bilivîne dîmenderê paş + .send-to-prev-workspace = Çarçoveyê bilivîne qada xebatê ya paş + .send-to-next-workspace = Çarçoveyê bilivîne qada xebatê ya pêş +switch-workspaces = Qadên xebatê biguhêrîne + .horizontal = Bi çar tiliyan ber bi çepê/rastê ve bikişîne + .vertical = Bi çar tiliyan ber bi jor/jêr ve bikişîne +applications = Sepan +shadow-and-corners = Sî û quncikên çarçoveyê +system-controls = Kontrolên pergalê +auto-switch = Di navbera awayên ronî û tarî de xweber biguhêrîne + .sunrise = Di dema hilatina rojê de derbasî awayê ronî dibe + .sunset = Di dema rojavabûnê de derbasî awayê tarî dibe + .next-sunrise = Di hilatina rojê ya bê de derbasî awayê ronî dibe + .next-sunset = Di rojavabûna bê de derbasî awayê tarî dibe +keyboard-numlock-boot = Numlock + .boot-state = Rewşa dema vêxistinê + .last-boot = Vêxistina dawî + .on = Vekirî ye + .off = Girtî ye + .set = Rewşa Numlock a dema vêxistinê saz bike +about-related = Sazkariyên têkildar + .support = Piştgiriyê werbigire +tap-to-click = Ji bo tikandinê pê lê bike + .desc = Ji bo tikandinê sereke bi yek tilî, ji bo tikandinê duyemîn bi du tilî, û ji bo tikandinê navîn bi sê tilî çalak dike +interface-density = Tîrbûna navrûyê + .comfortable = Hedar + .compact = Pêkhatî + .spacious = Fereh +open-application-library = Pirtûkxaneya sepanê veke +slow = Hêdî +system-shortcut = Pergal + .app-library = Pirtûkxaneya sepanan veke + .brightness-down = Ronahiya dîmenderê kêm bike + .brightness-up = Ronahiya dîmenderê bêtir bike + .display-toggle = Dîmenderê navxweyî biguhêrîne + .home-folder = Peldanka rûpela sereke veke + .keyboard-brightness-down = Ronahiya kilîtdankê kêm bike + .keyboard-brightness-up = Ronahiya kilîtdankê bêtir bike + .launcher = Destpêkerê veke + .log-out = Derkeve + .lock-screen = Dîmenderê kilît bike + .mute = Dengê deranê qut bike + .mute-mic = Dengê ketanê mîkrofonê qut bike + .play-pause = Bilizîne/rawestîne + .play-next = Strana pêş + .play-prev = Strana paş + .poweroff = Vemrîne + .screenshot = Wêneyê dîmenderê bigire + .suspend = Rawestîne + .terminal = Termînalê veke + .touchpad-toggle = Touchpadê biguhêrîne + .volume-lower = Asta dengê derana kêm bike + .volume-raise = Asta dengê derana bêtir bike + .web-browser = Gerokeke tevnê veke + .window-switcher = Di navbera çarçoveyên vekirî de biguhêrîne + .window-switcher-previous = Di navbera çarçoveyên vekirî de berevajî biguhêrîne + .workspace-overview = Pêşdîtina qadên xebatê veke +network-name = Navê torê +large = Mezin +scrolling = Şemitandin + .two-finger = Bi du tiliyan bişemtîne + .edge = Bi tilîyekê li ser qeraxê bişemtîne + .speed = Leza şemitandinê + .natural = Şemitandinê xwezayî + .natural-desc = Li şûna nîşandanê, naverokê bişemtîne +auth-dialog = Rastandin pêdivî ye + .vpn-description = Navê bikarhêner û borînpeyva ku ji bo rajekarê VPNê pêdivî ye têxîne. + .wifi-description = Borînpeyv an koda şîfrekirinê têxîne. Tu dikarî her wiha bi riya tikandina bişkoka "WPS" ya li ser routerê jî girê bidî. +add-user = Bikarhêner tevlî bike +enable = Çalak bike +add-image = Wêneyê tevlî bike +migrate-workspace-next = Qada xebatê bibe derana pêş +formatting = Awa + .dates = Dîrok + .time = Dem + .date-and-time = Dîrok & Dem + .numbers = Jimmar + .measurement = Pîvan + .paper = Pelik +disabled = Neçalakkirî +add-applet = Sepanokê tevlî bike +show-extended-input-sources = Çavkaniyên ketanê yên dirêjkirî nîşan bide +mode-and-colors = Awa û reng +center-segment = Beşa navîn +panel-missing = Rêkxistina destgehê wenda ye + .desc = Pelê rêkxistinê destgehê ji ber bikaranîna rêkxistin kesane yan jî xerabûna wê wenda ye. + .fix = Bo rewşa berdest ji nû ve saz bike +invalid-username = Navê bikarhêner nederbasdar e +mirroring = Dûbarekirin + .id = Dûbarekirin { $id } + .dont = Dûbarekirinê neke + .mirror = Dûbarekirin { $display } + .project = + Bişîne bo { $display -> + [all] hemû dîmenderan + *[other] { $display } + } + .project-count = + bo { $count } dîmenderên dinbişîne { $count -> + [1] dîmender + *[other] dîmender + } +orientation = Araste + .standard = Standard + .rotate-90 = 90° bizivirîne + .rotate-180 = 180° bizivirîne + .rotate-270 = 270° bizivirîne +auto = Xweber +end-segment = Beşa dawîn +bluetooth-adapters = Adaptorên Bluetoothê +time-format = Awaya dîrok û demê + .twenty-four = Dema 24-demjimêr + .show-seconds = Çirkeyan nîşan bide + .first = Roja yekem a hefteyê + .show-date = Dîrokê di sepanoka demê de nîşan bide + .friday = Înî + .saturday = Şemî + .sunday = Yekşem + .monday = Duşem +accent-color = Rengê sereke +type-key-combination = Kombînasyona kilîtan binivîse +keyboard-special-char = Têketina tîpên taybet + .alternate = Kilîta tîpên alternatîf + .compose = Kilîta taybet + .compose-desc = Kilîta compose mafê dide ku tîpên cûda werin nivîsandin. Ji bo bikaranînê, pêşî compose û paşê rêzek tîpan bitikîne. Bo mînak, kilîta compose li dû C û o wê © binivîse, dema ku kilîta compose li dû a û ‘ wê á binivîse. + .caps = Kilîta Caps Lock +manage-windows = Rêveberê çarçoveyan + .close = Çarçoveyê bigire + .maximize = Çarçoveyê mezin bike + .fullscreen = Çarçoveyê dîmendera tije + .minimize = Çarçoveyê biçûk bike + .resize-inwards = Çarçoveyê ber bi hundir veji nû ve mezinahiyê biguhêrîn + .resize-outwards = Çarçoveyê ber bi derve ve ji nû ve mezinahiyê biguhêrîne + .toggle-sticky = Çarçoveyê daliqandî biguhêrîne +never = Tu car +install-additional-languages = Zimanên vebijêrkî saz bike +sound-output = Derketin + .volume = Asta dengê deranê + .device = Amûra deranê + .level = Asta deranê + .config = Rêkxistin + .balance = Balans + .left = Çep + .right = Rast +window-controls = Kontrolên çarçoveyan + .maximize = Bişkoka mezinkirinê nîşan bide + .minimize = Bişkoka biçûkkirinê nîşan bide + .active-window-hint = Nîşana çarçoveya çalak nîşan bide +shadows-tiling = Çarçoveyên berhevkirî + .clip = Li gorî quncikên pergalê li hev bîne + .shadow = Sî bisepîne +window-management-appearance = Rêveberê çarçoveyê + .active-hint = Mezinahiya nîşana çarçoveyê çalak + .gaps = Valahiyên li derdora çarçoveyên berhevkirî +migrate-workspace-prev = Qada xebatê bibe derana paş +legacy-app-global-shortcuts = Kurteriyên gerdûnî di sepanên X11 de + .desc = Kurteriyên gerdûnî rê didin ku bûyerên kilîtdank û mişkê yên di sepanekê de, ji bo taybetmendiyên wekî push-to-talk an jî push-to-mute ji aliyê sepanên din ve werin naskirin. Bi awayê berdest, kurteriyên gerdûnî di sepanên X11 de hatine girtin da ku sepanên din nikaribin çalakiyên te yên hestiyar bişopînin. + .none = Tu kilît tune ne + .modifiers = Guherîner (Super, Shift, Control, Alt) + .combination = Hemû kilît dema ku guherînerên Super, Control an Alt tên pêlkirin + .all = Hemû kilît + .mouse = Bûyerên bişkoka mişkê di sepanên X11 de +activate = Çalak bike +power-saving = Vebijêrkên parastina hêzê + .turn-off-screen-after = Dîmenderê vemirîne piştî ... + .auto-suspend = Rawestanina xweber + .auto-suspend-ac = Dema bi keblê hêzê ve were girêdan xweber rawestîne + .auto-suspend-battery = Dema betarî kêm be xweber rawestîne +connected-devices = Amûrên girêdayî + .unknown = Amûra nenas +icons-and-toolkit = Rûkara îkon û amûran +sound-applications = Sepan + .desc = Dengê sepanan û sazkarî +time-zone = Herêma demê + .auto = Herêma dema xweber + .auto-info = Pêdiviya wê bi rajekarên cîh û gihîştina înternetê heye +dialog-add = Tevlî bike +fast = Bilez +add-color = Rengê tevlî bike +shadows-floating = Çarçoveyên herikbar + .clip = Quncikên pergalê bişopîne û sî bisepîne +network-device-state = + .activated = Hate girêdan + .config = Tê girêdan + .deactivating = Tê qutkirin + .disconnected = Qut bû + .failed = Girêdan têk çû + .ip-check = Girêdan tê kontrolkirin + .ip-config = IP û zanyariyên routing tê xwestin + .need-auth = Rastandin pêdivî ye + .prepare = Ji bo girêdanê tê amadekirin + .secondaries = Li benda girêdana duyemîn e + .unavailable = Ne pêkan e + .unknown = Rewşa nenas + .unmanaged = Nehatiye birêvebirin + .unplugged = Kebl nehatiye girêdan +command = Ferman +gestures = Tevger + .four-finger-down = Bi çar tiliyan ber bi jêr ve bikişîne + .four-finger-left = Bi çar tiliyan ber bi çepê ve bikişîne + .four-finger-right = Bi çar tiliyan ber bi rastê ve bikişîne + .four-finger-up = Bi çar tiliyan ber bi jor ve bikişîne + .three-finger-any = Bi sê tiliyan her alî bikişîne +system = Pergal & Jimar +no-networks = Tu tor nehatin dîtin. +open-new-folder = Peldanka nû veke +panel-bottom = Jêr +share = Torê parve bike +fill = Tije bike +custom = Kesane +bluetooth-paired = Amûrên berê hatine girêdan + .connect = Girê bide + .battery = { $percentage }% betarî +dialog = Gotûbêj + .title = Van sazkariyên dîmenderê bihêle? + .keep-changes = Guhertinan bihêle + .change-prompt = Guhertinên sazkariyan wê di { $time } çirek de xweber werin têkbirin. + .revert-settings = Sazkariyan têk bibe +sound-device-port-unplugged = Hatiye qutkirin +navigate = Gerandin +workspaces-overview-thumbnails = Wêneyên piçûk ên pêşdîtina qadê xebatê + .show-number = Jimara qadê xebatê nîşan bide + .show-name = Navê qadê xebatê nîşan bide +color = Reng + .depth = Kûrahiya rengê + .profile = Profîla rengê + .sidebar = Profîlên Rengê + .temperature = Germahiya rengê +hex = Hex +magnifier = Mezinker + .controls = + An van kurteriyan bi kar bîne: { $zoom_in -> + [zero] { "" } + *[other] + { "" } + { $zoom_in } ji bo nêzîk bibe, + }{ $zoom_out -> + [zero] { "" } + *[other] + { "" } + { $zoom_out } ji bo dûr bibe, + } + Super + bi mişka xwe bişemtîne + .scroll_controls = Bi Super + şemitandin, nêzîkbûnê bi mişk an touchpadê çalak bike + .show_overlay = Rûpûşa mezinkerê nîşan bide + .increment = Asta mezinkirinê + .signin = Di dema têketinê de mezinkerê bide destpêkirin + .applet = Mezinkerê li ser destgehê çalak bike/neke + .movement = Dîmena nêzîkirî livandinê nîşan dide + .continuous = Bi mayînde ligel nîşander + .onedge = Dema nîşander digihêje qeraxê + .centered = Ji bo ku nîşanderê li navîn bimîne +colors = Reng +administrator = Rêveber + .desc = Rêveber dikarin sazkariyan ji bo hemû bikarhêneran biguhêrînin, bikarhênerên din tevlî bikin an jî rakin +scan-to-connect-description = Ji bo girêdana bi vê torê ve, koda QRê bixwîne. +modified = { $count } hatiyê guhertin +workspaces-overview = Pêşdîtina qadên xebatê + .action-on-typing = Çalakî di dema nivîsandinê de + .none = Ne yek + .launcher = Destpêkerê veke + .applications = Sepanan veke +xdg-entry-touchpad = Touchpad +time-region = Herêm & Ziman +power = Hêz & Betarî +xdg-entry-wired = Têlkirî +xdg-entry-startup-apps-comment = Sepanên ku di dema têketinê de dixebitin bi rêk bixîne +xdg-entry-region-language = Herêm & Ziman +time-date = Dîrok & Dem + .auto = Xweber saz bike + .auto-ntp = Dîrok û dem wê dema herêma demê were sazkirin, xweber werin rojanekirin +xdg-entry-mouse-keywords = COSMIC;Mişk;Lezbûn;Şemitandin; +xdg-entry-bluetooth-comment = Amûrên Bluetoothê bi rê ve bibe +xdg-entry-notifications-keywords = COSMIC;Agahdarî;Kilîtkirin; +xdg-entry-startup-apps-keywords = COSMIC;Destpêk;Sepan; +xdg-entry-default-apps-comment = Geroka tevnê ya berdest, rajegirê enameyê, geroka pelê, û sepanên din +xdg-entry-keyboard-comment = Çavkaniyên ketanê, guhertin, ketanê tîpên taybet, kurterê +xdg-entry-wired-keywords = COSMIC;Têlkirî;LAN;Tor;Girêdan; +xdg-entry-power = Hêz & Betarî +xdg-entry-appearance-keywords = COSMIC;Reng;Îkon;Cûrenivîs;Rûkar +xdg-entry-mouse = Mişk +xdg-entry-dock-keywords = COSMIC;Bender;Destgeh;Sepanok +bluetooth = Bluetooth + .status = Dema sazkiryên Bluetoothê vekirî bin, ev pergal wekî { $aliases } xuya dibe. + .connected = Hate girêdan + .connecting = Tê girêdan + .disconnecting = Tê qutkirin + .connect = Girê bide + .disconnect = Qut bike + .forget = Ji bîr bike + .dbus-error = Di dema danûstandina bi DBus re şaşetiyek çê bû: { $why } + .disabled = Rajekara Bluetoothê neçalak e + .inactive = Rajekara Bluetoothê ne çalak e + .unknown = Rajekara Bluetoothê nehate çalakkirin. Gelo BlueZ hatiye sazkirin? +xdg-entry-mouse-comment = Leza mişkê, lezbûn û şemitandina xwezayî +xdg-entry-system = Pergal & Jimar +firmware = Firmware +xdg-entry-panel-keywords = COSMIC;Destgeh;Sepanok +xdg-entry-window-management = Rêveberê çarçoveyê +xdg-entry-a11y = Gihîştin +xdg-entry-time-language-comment = Dîroka pergalê, dem, herêm û ziman bi rê ve bibe +xdg-entry-desktop-keywords = COSMIC;Sermase; +default-apps = Sepanên berdest + .web-browser = Geroka tevnê + .file-manager = Rêveberê pelê + .mail-client = Rajigera enameyê + .music = Muzîk + .video = Vîdyo + .photos = Wêne + .calendar = Salname + .terminal = Termînal + .other-associations = Têkiliyên din + .text-editor = Edîtorê nivîsê + .not-installed = Ne sazkirî ye +xdg-entry-x11-applications-keywords = COSMIC;X11;Sepan;Lîstik;Lihevhatin; +xdg-entry-displays-comment = Sazkariyên rêkxistinê yên dîmenderê bi rê ve bibe +xdg-entry-touchpad-keywords = COSMIC;Touchpad;Tevger; +xdg-entry-time-language = Dem & Ziman +xdg-entry-users = Bikarhêner +window-management = Rêveberê çarçoveyê +xdg-entry-system-keywords = COSMIC;Pergal;Zanyarî;Jimar;Firmware; +xdg-entry-default-apps = Sepanên berdest +xdg-entry-wireless-keywords = COSMIC;WiFi;Wi-Fi;Tor;Girêdan; +xdg-entry-applications-comment = Sepanên kesane, sepanên destpêkê, û sazkariyên lihevhatina sepanên X11 +mouse = Mişk + .speed = Leza mişkê + .acceleration = Lezgîniya mişkê çalak bike +dock = Bender +xdg-entry-about-keywords = COSMIC;Derbar +xdg-entry-panel = Destgeh +xdg-entry-notifications = Agahdarî +display = Dîmender + .arrangement = Bicihkirina dîmenderê + .arrangement-desc = Ji bo ji nû ve bicihkirina dîmenderan bikşîne + .enable = Dîmenderê çalak bike + .external = { $size } { $output } dîmenderê derveyî + .laptop = { $size } dîmenderê laptopê + .options = Vebijêrkên dîmenderê + .refresh-rate = Rêjeya nûkirinê + .resolution = Çareserî + .scale = Pîvan + .additional-scale-options = Vebijêrkên pîvanê yên din +xdg-entry-a11y-keywords = COSMIC;Gihîştin;A11y;Dîmender;Xwîner;Mezinker;Berevajî;Reng; +xdg-entry-wireless-comment = Girêdanên Wi-Fi û profîlên girêdanê +xdg-entry-desktop = Sermase +xdg-entry-date-time-keywords = COSMIC;Dem;Herêm; +xdg-entry-desktop-comment = Wêneya dîwêr, xuyang, destgeh, bender, rêveberê çarçoveyê û sazkairyên qada xebatê +xdg-entry-wallpaper = Wêneya dîwêr +xdg-entry-keyboard = Kilîtdank +xdg-entry-a11y-comment = Xwînerê dîmenderê, mezinker, berevajiya bilind, û parzûnên rengan +xdg-entry-displays = Dîmender +xdg-entry-network = Tor & Bêtêlî +sound = Deng +xdg-entry-date-time = Dîrok & Dem +notifications = Agahdarî +xdg-entry-users-comment = Rastandin û jimarên bikarhêner +startup-apps = Sepanên destpêkê + .add = Sepan tevlî bike + .user = Sepanên ku dema tu têdikevî pergala dixebitin + .none = Tu sepanên destpêkê nehatin tevlîkirin + .remove-dialog-title = { $name } rake? + .remove-dialog-description = Ev sepana destpêkê rake? + .add-startup-app = Sepana destpêkê tevlî bike +xdg-entry-input-comment = Sazkariyên kilîtdankê û mişkê +xdg-entry-bluetooth-keywords = COSMIC;Bluetooth; +about = Derbar +input-devices = Amûrên ketanê +xdg-entry-dock-comment = Bendeke vebijêrkî ji bo sepan û sepanokan +xdg-entry-network-keywords = COSMIC;Tor;Bêtêlî;WiFi;VPN; +xdg-entry-wallpaper-comment = Wêneyên dîwêr, reng û vebijêrkên pêşandana wêneyan +xdg-entry-dock = Bender +xdg-entry-startup-apps = Sepanên destpêkê +workspaces = Qadên xebatê +xdg-entry-wireless = Wi-Fi +xdg-entry-workspaces-keywords = COSMIC;Qada xebatê;Araste;Pêşdîtin;Dîmender; +xdg-entry-system-comment = Zanyariyên pergalê, jimar û rojanekirinên firmwareyê +xdg-entry-x11-applications-comment = Pîvandina sepanên pergala çarçoveya X11, dîmenderê sereke û kurteriyên gerdûnî +xdg-entry-region-language-comment = Li gorî herêma xwe dîrok, dem û jimaran saz bike +xdg-entry-wallpaper-keywords = COSMIC;Wêneya dîwêr;Paşrû;Pêşandan; +xdg-entry-users-keywords = COSMIC;Bikarhêner;Jimar; +xdg-entry-about-comment = Navê amûrê, zanyariyên reqalavê, sazkariyên kesane yên pergala xebitandinê +xdg-entry-vpn-keywords = COSMIC;VPN;Tor;Girêdan;OpenVPN;OpenConnect; +users = Bikarhêner + .admin = Rêveber + .standard = Standard + .profile-add = Wêneyê profîlê hilbijêre +xdg-entry-appearance-comment = Rengên taybet û rûkar +xdg-entry-time-language-keywords = COSMIC;Pergal;Dem;Dîrok;Herêm;Ziman; +xdg-entry-input-keywords = COSMIC;Ketan;Kilîtdank;Mişk; +xdg-entry-comment = Sepana sazkariyan ji bo sermaseya COSMIC +xdg-entry-notifications-comment = Sazkariyên rawestandina balkêşiyê, agahdariyên dîmendera kilîtê û sazkariyên taybetî yên sepanan +xdg-entry-applications = Sepan +xdg-entry-sound-keywords = COSMIC;Deng;Deng;Hişyarî;Pipewire; +xdg-entry-power-keywords = COSMIC;Hêz;Betarî +legacy-applications = Lihevhatina sepanên X11 +xdg-entry-default-apps-keywords = COSMIC;Berdest;Sepan +xdg-entry-keywords = COSMIC;Sazkarî; +xdg-entry-region-language-keywords = COSMIC;Herêm;Ziman;Dîrok;Awa;Dem;Sazkariyên herêmî;Herêmîkirin; +xdg-entry-about = Derbar +xdg-entry-input = Amûrên ketanê +xdg-entry-applications-keywords = COSMIC;Berdest;Sepan;Destpêk;X11;Lihevhatin +xdg-entry-sound-comment = Sazkariyên dengê yên ji bo amûr, hişyarî û sepanan +wallpaper = Wêneya dîwêr + .change = Wêneyê biguhêrîne her + .fit = Lihevhatîna wêneyê + .folder-dialog = Peldanka wêneyên dîwêr hilbijêre + .image-dialog = Wêneya dîwêr hilbijêre + .plural = Wêneyên dîwêr + .same = Li ser hemû dîmenderan heman wêneya dîwêr + .slide = Pêşandana wêneyan +xdg-entry-touchpad-comment = Leza touchpadê, vebijêrkên tikandinê û tevger +xdg-entry-keyboard-keywords = COSMIC;Kilîtdank;Ketan;Çavkanî;Kurterê; +xdg-entry-vpn-comment = Girêdanên VPN û profîlên girêdanê +keyboard = Kilîtdank +xdg-entry-appearance = Xuyang +xdg-entry-window-management-keywords = COSMIC;Çarçove;Rêveberî;Berhevkirin;Super;Kilît; +xdg-entry-workspaces-comment = Arasteya qada xebatê, pêşdîtin û tevgerên pir-dîmender +xdg-entry-network-comment = Girêdanên torê bi rê ve bibe +xdg-entry-panel-comment = Benda pergalê sereke ya ji bo menu û sepanokan +touchpad = Touchpad + .acceleration = Lezgîniya touchpadê çalak bike + .speed = Leza touchpadê +xdg-entry-sound = Deng +xdg-entry-power-comment = Awayên hêzê û vebijêrkên parastina hêzê +xdg-entry-displays-keywords = COSMIC;Dîmender; +time = Dem & ziman +xdg-entry-workspaces = Qadên xebatê +xdg-entry-date-time-comment = Herêma demê, sazkariyên demjimêra xweber û awaya demê +xdg-entry-x11-applications = Lihevhatina sepanên X11 +xdg-entry-window-management-comment = Çalakiya bişkoka Super, vebijêrkên kontrolkirina çarçoveyan û vebijêrkên din ên berhevkirina çarçoveyan +xdg-entry-wired-comment = Girêdanên têlkirî û profîlên girêdanê +app = Sazkariyên COSMIC +dbus-connection-error = Girêdana bi DBus re têk çû +known-networks = Torên naskirî +connecting = Tê girêdan… +disconnect = Qut bike +ok = Baş e +number = { $number } +add-vpn = VPNê tevlî bike +airplane-on = Awaya balafirê vekirî ye. +forget = Ji bîr bike +add-network = Torê tevlî bike + .profile = Profîlê tevlî bike +vpn-error = Şaşetiya VPN + .config = Tevlîkirina rêkxistinê VPNê têk çû + .connect = Girêdana bi VPNê re têk çû + .connection-editor = Edîtorê girêdanê têk çû + .connection-settings = Sazkariyên ji bo girêdanên çalak nehatin standin + .openvpn-config-path = Rêgeha pelê OpenVPNê nederbasdar e + .openvpn-config-path-desc = Pela hilbijartî divê li ser pergala pelan a xwecihî be. + .updating-state = Rewşa rêveberiyê torê nehat rojanekirin + .wireguard-config-path = Rêgeha pelê WireGuard nederbasdar e + .wireguard-config-path-desc = Pela hilbijartî divê li ser pergala pelan a xwecihî be. + .wireguard-device = Amûra WireGuard nehate afirandin + .with-password = + VPN nehate sazkirin { $field -> + *[username] navê bikarhêner + [password] borînpeyv + [password-flags] alên-borînpeyvê + } bi nmcli re +bluetooth-display-passkey = Cotkirina Bluetoothê + .description = Tika ye kilîta borandinê ya jêrîn li ser { $device } binivîse, paşê Enterê bitikîne +bluetooth-display-pin = Cotkirina Bluetoothê + .description = Tika ye PINa jêrîn li ser { $device } binivîse, paşê Enterê bitikîne +workspaces-navigation = Gerandin + .wraparound = Di navbera yekem û dawîn qadê xebatê de digere bi riya bikaranîna kurteriyên kilîtdankê û tevgeran +no-search-results = Tu tor li lêgerînên te li hev nakin . diff --git a/i18n/ko/cosmic_settings.ftl b/i18n/ko/cosmic_settings.ftl index 77d04a2..476cb4a 100644 --- a/i18n/ko/cosmic_settings.ftl +++ b/i18n/ko/cosmic_settings.ftl @@ -764,3 +764,20 @@ xdg-entry-workspaces = 작업 공간 xdg-entry-date-time-comment = 시간대와 자동 시계 설정 및 시간 형식 xdg-entry-x11-applications = X11 앱 호환성 xdg-entry-wired-comment = 유선 연결 및 연결 프로필 +xdg-entry-touchpad = 터치패드 +xdg-entry-startup-apps-comment = 로그인 시 실행할 앱 설정 +xdg-entry-region-language = 지역 & 언어 +xdg-entry-startup-apps-keywords = COSMIC;시작;앱; +xdg-entry-system = 시스템 & 계정 +xdg-entry-time-language-comment = 시스템 날짜와 시간, 지역 및 언어 관리 +xdg-entry-touchpad-keywords = COSMIC;터치패드;제스처; +xdg-entry-time-language = 시간 & 언어 +xdg-entry-users = 사용자 +xdg-entry-system-keywords = COSMIC;시스템;정보;계정;펌웨어; +xdg-entry-users-comment = 인증 및 사용자 계정 +xdg-entry-startup-apps = 시작 앱 +xdg-entry-system-comment = 시스템 정보와 계정 및 펌웨어 업데이트 +xdg-entry-region-language-comment = 지역에 기반한 날짜와 시간 및 숫자 형식 +xdg-entry-time-language-keywords = COSMIC;시스템;시간;날짜;지역;언어; +xdg-entry-sound-keywords = COSMIC;소리;오디오;알림;Pipewire; +xdg-entry-sound = 소리 diff --git a/i18n/lo/cosmic_settings.ftl b/i18n/lo/cosmic_settings.ftl new file mode 100644 index 0000000..e69de29 diff --git a/i18n/lt/cosmic_settings.ftl b/i18n/lt/cosmic_settings.ftl index 880dc9f..3d3e1bd 100644 --- a/i18n/lt/cosmic_settings.ftl +++ b/i18n/lt/cosmic_settings.ftl @@ -1,9 +1,9 @@ time-region = Regionas ir kalba panel-left = Kairė super-key = Super klavišo veiksmas - .launcher = Atidaryti aplikacijų paleidėją + .launcher = Atverti programų leistuką .workspaces = Atidaryti darbo sritis - .applications = Atidaryti aplikaciją + .applications = Atidaryti programą .disable = Neaktyvus x-minutes = { $number } { $number -> @@ -28,8 +28,8 @@ save = Išsaugoti vpn-error = VPN klaida .config = Nepavyko pridėti VPN konfigūracijos .connect = Nepavyko prisijungti prie VPN - .connection-editor = Prisijungimo redaguoklės problema - .connection-settings = Nepavyko gauti aktyvaus prisijungimo nustatymų + .connection-editor = Ryšio rengyklės triktis + .connection-settings = Nepavyko gauti veikiančių ryšių nuostatų .updating-state = Nepavyko atnaujinti tinklo valdytojo būsenos .wireguard-config-path = Klaidingas WireGuard nustatymų failo kelio vardas .wireguard-config-path-desc = Pasirinktas failas turi būti lokalioje failų sistemoje. @@ -46,7 +46,7 @@ no-applets-found = Apletų nerasta... region = Regionas zoom-in = Priartinti place-here = Padėti apletą čia --requires-restart = Reikalingas paleidimas iš naujo +-requires-restart = Reikia paleisti iš naujo workspaces-orientation = Darbo sričių orientacija .vertical = Vertikali .horizontal = Horizontali @@ -55,7 +55,7 @@ all-displays = Visi ekranai scheduling = Planavimas .manual = Rankininis planavimas frosted = Apšalusio stiklo efektas sistemos komponentuose - .desc = Taikomas fono suliejimas panelėje, aplikacijos doke, apletuose, programų paleidyklėje ir aplikacijų bibliotekoje + .desc = Taikomas fono suliejimas skydelyje, doke, apletuose, programų paleidyklėje ir programų bibliotekoje password = Slaptažodis about-hardware = Aparatinė įranga .model = Modelis @@ -66,9 +66,9 @@ about-hardware = Aparatinė įranga short = Trumpas vpn = VPN .connections = VPN prisijungimai - .error = Nepavyko pridėti VPN nustatymų + .error = Nepavyko pridėti VPN nuostatų .remove = Pašalinti prisijungimo profilį - .select-file = Pasirinkti VPN konfigūracinė failą + .select-file = Pasirinkti VPN konfigūracijos failą power-mode = Maitinimo režimas .battery = Ilgesnis baterijos veikimo laikas .battery-desc = Mažesnis energijos suvartojimas ir tylus veikimas @@ -83,7 +83,7 @@ wired = Laidinis .devices = Laidiniai įrenginiai .remove = Pašalinti ryšio profilį bluetooth-available = Įrenginiai netoliese -cable-unplugged = Kabelis neprijungtas +cable-unplugged = Kabelis atjungtas color-picker = Spalvų pipetė interface-font = Sistemos šriftas forget-dialog = Pamirštį šį Wi-Fi tinklą? @@ -96,19 +96,19 @@ hot-corner = Aktyvusis Kampas (Hot Corner) keyboard-typing-assist = Rašymas .repeat-rate = Pakartojimo dažnis .repeat-delay = Pakartojimo uždelsimas -edge-gravity = Slankių langų trauka prie artimiausių kraštų +edge-gravity = Slankūs langai traukiami prie artimiausių kraštų bluetooth = Bluetooth - .status = Jūsų įrenginys matomas kaip { $aliases }, kol Bluetooth nustatymai bus įjungti. + .status = Jūsų įrenginys matomas kaip { $aliases }, kol Bluetooth nuostatos bus įjungtos. .connected = Prisijungta .connecting = Jungiamasi .disconnecting = Atsijungiama .connect = Prisijungti .disconnect = Atsijungti .forget = Pamiršti - .dbus-error = Įvyko klaida procese su DBus: { $why } - .disabled = Bluetooth funkcionalumas išjungtas - .inactive = Bluetooth functionalumas neaktyvus - .unknown = Bluetooth functionalumas negali būti aktyvuotas. Ar jūsų įrenginys įdiegtas BlueZ paketas? + .dbus-error = Klaida veikiant su DBus: { $why } + .disabled = Bluetooth tarnyba išjungta + .inactive = Bluetooth tarnyba neaktyvi + .unknown = Nepavyksta altyvuoti Bluetooth tarnybos. Ar jūsų įrenginyje įdiegtas BlueZ paketas? amplification = Stiprinimas .desc = Leidžia padidinti garsumą iki 150% recent-colors = Pastarosios spalvos @@ -119,7 +119,7 @@ about-os = Operacinė sistema .desktop-environment = Darbalaukio aplinka .windowing-system = Langų valdymo sistema panel-behavior-and-position = Elgsena ir pozicija - .autohide = Automatiškai slėpti panelę + .autohide = Automatiškai slėpti skydelį .dock-autohide = Automatiškai slėpti doką .position = Pozicija ekrane .display = Rodyti ekrane @@ -137,9 +137,9 @@ accessibility = Prieinamumas .color-filters = Spalvų filtrai firmware = Programinė aparatinė įranga container-background = Įrankių fono spalva - .desc-detail = Įrankių fono spalva naudojama navigavimo šonjuostėse, šoniniame stalčiuje, iššokančiuose languose ir panašiuose komponentuose. Pagal numatytus nustatymus, ši fono spalva automatiškai parenkama pagal lango fono spalvą. + .desc-detail = Įrankių fono spalva naudojama naršymo šonjuostėse, šoniniame meniu, iššokančiuose languose ir panašiuose komponentuose. Pagal numatytus nustatymus, ši fono spalva automatiškai parenkama pagal lango fono spalvą. .reset = Atstatyti į automatinį - .desc = Naudojama navigavimo šonjuostėse, šoniniame stalčiuje, iššokančiuose languose ir panašiuose komponentuose + .desc = Naudojama naršymo šonjuostėse, šoniniame meniu, iššokančiuose languose ir panašiuose komponentuose primary-button = Pagrindiniai mygtukai .desc = Nustato fizinių mygtukų tvarką .left = Kairė @@ -148,7 +148,7 @@ sound-alerts = Įspėjimai .volume = Įspėjimo garsumas .sound = Įspėjimo garsas icon-theme = Piktogramų tema - .desc = Skirtingų piktogramų rinkinių taikymas aplikacijoms + .desc = Skirtingų piktogramų rinkinių taikymas programoms import = Importuoti keyboard-shortcuts = Klaviatūros spartieji klavišai .desc = Peržiūrėti ir modifikuoti sparčiuosius klavišus @@ -180,7 +180,7 @@ sound-input = Įvestis add-another-keybinding = Pridėti kitą klavišų kombinacija copy-to-clipboard = Kopijuoti į iškarpinę monospace-font = Lygiaplotis šriftas -experimental-settings = Eksperimentiniai nustatymai +experimental-settings = Eksperimentinės nuostatos recent-folders = Pastarieji aplankai color-filter = Spalvų filtrų tipai .unknown = Aktyvus nežinomas filtras @@ -234,10 +234,10 @@ x-hours = } added = Pridėta input-source-switch = Perjungti klaviatūros kalbos įvesties šaltinį -focus-navigation = Navigacija pagal fokusą - .focus-follows-cursor = Fokusas seka žymeklį - .focus-follows-cursor-delay = Fokusas seka žymeklį su atidėjimu (mikrosekundės) - .cursor-follows-focus = Žymeklis seka fokusą +focus-navigation = Aktyvaus lango vairavimas + .focus-follows-cursor = Aktyvuoti langą po žymekliu + .focus-follows-cursor-delay = Delsa ms kol langas po žymekliu bus aktyvuotas + .cursor-follows-focus = Perkelti žymeklį į aktyvų langą full-name = Vardas ir Pavardė app-background = Lango fonas panel-right = Dešinė @@ -283,19 +283,19 @@ preferred-languages = Pageidaujamos kalbos .desc = Kalbų tvarka nulemia, kuri kalba bus naudojama naudotojo sąsajoje. Pakeitimai įsigalios po kito prisijungimo. display = Monitoriai .arrangement = Monitorių išdėstyimas - .arrangement-desc = Pertvarkite monitorius velkant juos + .arrangement-desc = Perdėstykite monitorius juos vilkdami .enable = Įjungti monitorių .external = { $size } { $output } išorinis monitorius .laptop = { $size } nešiojamo kompiuterio monitorius .options = Monitoriaus parinktys .refresh-rate = Atnaujinimo dažnis - .resolution = Rezoliucija + .resolution = Raiška .scale = Mastelis .additional-scale-options = Papildomos mastelio parinktys panel-style = Stilius - .anchor-gap = Tarpas tarp panelės ir ekrano krašto + .anchor-gap = Tarpas tarp skydelio ir ekrano krašto .dock-anchor-gap = Tarpas tarp doko ir ekrano krašto - .extend = Ištęsti panelę iki ekrano kraštų + .extend = Ištęsti skydelį iki ekrano kraštų .dock-extend = Ištęsti doką iki ekrano kraštų .appearance = Išvaizda .size = Dydis @@ -305,35 +305,35 @@ panel-appearance = Išvaizda .match = Pagal darbalaukį .light = Šviesi .dark = Tamsi -workspaces-multi-behavior = Elgsena su keletais monitoriais +workspaces-multi-behavior = Darbas su keliais monitoriais .span = Darbo sritis tęsiasi per visus monitorius - .separate = Kiekvienas monitorius turi savo atskirą darbo sritį + .separate = Kiekvieno monitoriaus darbo sritis atskira replace-shortcut-dialog = Pakeisti spartųjį klavišą? .desc = { $shortcut } naudoja { $name }. Jeigu norite pakeisti, { $name } bus išjungtas. rgb = RŽM about-device = Įrenginio vardas .desc = Šis pavadinimas rodomas kitiems tinklo arba „Bluetooth“ įrenginiams -no-vpn = VPN ryšys nėra prieinamas. +no-vpn = Nėra prieinamų VPN ryšių start-segment = Pradžios segmentas desktop = Darbalaukis identity = Tapatybė reset-to-default = Atstatyti į numatytas reikšmes disconnect = Atjungti ok = Gerai -app = COSMIC Settings +app = COSMIC Nuostatos debug = Derinti sound = Garsas enable-export = Taikyti dabartinę temą GNOME aplikacijose - .desc = Ne visi programiniai rinkiniai palaiko automatinį perjungimą. Po temos pakeitimo , ne COSMIC tipo aplikacijoms gali prireikti paleidimo iš naujo. + .desc = Ne visi programiniai rinkiniai palaiko automatinį perjungimą. Pakeitus temą , gali reikėti iš naujo paleisti ne COSMIC tipo programas.. number = { $number } shortcut-name = Sparčių klavišų derinio pavadinimas style = Stilius .round = Apvalus - .slightly-round = Lengvai apvalus + .slightly-round = Truputį suapvalintas .square = Kampuotas panel-applets = Konfigūracija .dock-desc = Konfigūruoti doko apletus - .desc = Konfigūruoti panelės apletus + .desc = Konfigūruoti skydelio apletus qr-code-unavailable = QR kodas negalimas small = Mažas notifications = Pranešimai @@ -368,8 +368,8 @@ legacy-app-scaling = X11 langų sistemos programų mastelis .preferred-display = Pageidaujamas žaidimų ir viso ekrano X11 programų ekranas .no-display = Joks night-light = Nakties šviesa - .auto = Automatinė (nuo saulėlydžio iki saulėtekio) - .desc = Sumažinta mėlyna šviesa ir padidinamas spalvų šiltumas + .auto = Automatiškai (nuo saulėlydžio iki saulėtekio) + .desc = Mažiau mėlynos šviesos ir šiltesnės spalvos about = Apie input-devices = Įvesties įrenginiai custom-shortcuts = Pasirinktiniai sparčiųjų klavišų deriniai @@ -383,11 +383,11 @@ window-hint-accent-toggle = Naudoti temos akcento spalvą, kaip aktyvaus lango type-to-search = Norint ieškoti, pradėkite rašyti… workspaces-behavior = Darbo sričių elgsena .dynamic = Dinamiškos darbo sritys - .dynamic-desc = Automatiškai pašalinamos tuščios darbo sritys + .dynamic-desc = Tuščios darbo sritys pašalinamos automatiškai .fixed = Pastovus darbo sričių skaičius - .fixed-desc = Darbo sričių pridėjimas arba pašalinamas darbo sričių apžvalgos režime. + .fixed-desc = Peržiūrioje pridėkite arba pašalinkite darbo sritis. wireguard-dialog = Pridėti WireGuard įrenginį - .description = Pasirinkite įrenginio vardą WireGuard nustatymams. + .description = Pasirinkite įrenginio pavadinimą WireGuard nuostatoms. remove-connection-dialog = Pašalinti prisijungimo profilį .vpn-description = Jums reikės įvesti slaptažodį iš naujo, kad galėtumėte naudotis šiuo tinklu ateityje. .wired-description = Jums reikės atkurti šį profilį, kad galėtumėte naudotis šiuo prisijungimu. @@ -433,10 +433,10 @@ applications = Aplikacijos dbus-connection-error = Nepavyko prisijungti prie DBus system-controls = Sistemos valdymas auto-switch = Automatinis šviesaus ir tamsaus režimo valdymas - .sunrise = Įjungiamas šviesus režimas tekant saulei - .sunset = Įjungiamas tamsus režimas saulei leidžiantis - .next-sunrise = Įjungiamas šviesus režimas kitą kartą saulei tekant - .next-sunset = Įjungiamas tamsus režimas kitą kartą saulei leidžiantis + .sunrise = Šviesus režimas įjungiamas tekant saulei + .sunset = Tamsus režimas įjungiamas saulei leidžiantis + .next-sunrise = Šviesus režimas įjungiamas kitą kartą saulei tekant + .next-sunset = Tamsus režimas įjungiamas kitą kartą saulei leidžiantis add-vpn = Pridėti VPN cancel = Atšaukti keyboard-numlock-boot = Numlock @@ -456,9 +456,9 @@ interface-density = Sąsajos tankumas open-application-library = Atidaryti Aplikacijų Sąrašą connected = Prisijungta slow = Lėtas -network-name = Tinklo Pavadinimas +network-name = Tinklo pavadinimas large = Didelis -panel = Panelė +panel = Skydelis scrolling = Slinkimas .two-finger = Slinkimas dviem pirštais .edge = Vieno piršto slinkimas palei kraštą @@ -492,8 +492,8 @@ users = Naudotojai forget = Pamiršti center-segment = Centrinis segmentas panel-missing = Panelė nesukonfigūruota - .desc = Panelės konfigūraciniai failai nerasti dėl netinkamo jų modifikavimo arba tas failas buvo sugadintas. - .fix = Nustatyti į numatytus nustatymus + .desc = Skydelio konfigūracijos failas nerastas nes buvo netinkamai sukonfigūruotas arba sugadintas. + .fix = Grąžinti numatytas nuostatas invalid-username = Netinkamas naudotojo vardas mirroring = Veidrodinis atvaizdavimas .id = Atvaizduojamas { $id } @@ -539,7 +539,7 @@ manage-windows = Valdyti langus .toggle-sticky = Įjungti/išjungti lipnų langą never = Niekada install-additional-languages = Pridėti papildomas kalbas -settings = Nustatymai +settings = Nuostatos sound-output = Išvestis .volume = Išvesties garsumas .device = Išvesties įrenginys @@ -551,7 +551,7 @@ sound-output = Išvestis wallpaper = Darbalaukio fonas .change = Keisti paveiksliuką kas .fit = Darbalaukio fono talpinimas ekrane - .folder-dialog = Pasirinkite darbalaukio fono aplankalą + .folder-dialog = Pasirinkite darbalaukio fonų aplanką .image-dialog = Pasirinkite darbalaukio foną .plural = Darbalaukio fonai .same = Kiekvienam ekrane toks pat fonas @@ -573,15 +573,15 @@ legacy-app-global-shortcuts = Sparčiųjų klavišų kombinacijos X11 programose .all = Visi klavišai .mouse = Peles mygtuko veiksmai X11 programose activate = Aktyvuoti -replace = Pakeisti +replace = Keisti power-saving = Energijos taupymo parinktys - .turn-off-screen-after = Išjunkti ekraną po + .turn-off-screen-after = Išjungti ekraną po .auto-suspend = Automatinis miego režimas .auto-suspend-ac = Automatinis miego režimas, kai prijungtas maitinimas .auto-suspend-battery = Automatinis miego režimas, kai naudojama baterija connected-devices = Prijungti įrenginiai .unknown = Nežinomas įrenginys -icons-and-toolkit = Ikonų ir įrankių rinkinio temos +icons-and-toolkit = Piktogramų ir įrankių stiliai sound-applications = Aplikacijos .desc = Aplikacijų garsumas ir nustatymai time-zone = Laiko juosta @@ -599,10 +599,10 @@ network-device-state = .disconnected = Atsijungta .failed = Nepavyko prisijungti .ip-check = Tikrinamas ryšys - .ip-config = Vykdoma IP adreso and maršrutizavimo informacijos užklausa - .need-auth = Reikalinga autentifikacija + .ip-config = Užklausiama IP adreso ir maršrutizavimo informacijos + .need-auth = Reikja patvirtinti tapatumą .prepare = Ruošiamasi prisijungti - .secondaries = Laukiama antrinio ryšio + .secondaries = Laukiama prisijungiant antrąkart .unavailable = Nepasiekiama .unknown = Nežinoma būsena .unmanaged = Nevaldomas @@ -618,10 +618,10 @@ gestures = Gestai .four-finger-up = Keturių pirštų braukimas aukštyn .three-finger-any = Trijų pirštų braukimas system = Sistema ir paskyros -no-networks = Nebuvo rasta tinklų. -open-new-folder = Atidaryti naują aplanką +no-networks = Tinklų nerasta +open-new-folder = Atverti naują aplanką panel-bottom = Apačia -share = Pasidalinti tinklu +share = Dalintis tinklu add = Pridėti time = Laikas ir kalba fill = Užpildyti @@ -635,7 +635,7 @@ dialog = Dialogas .change-prompt = Nustatymai bus automatiškai atkurti po { $time } sekundžių. .revert-settings = Atkurti nustatymus navigate = Naviguoti -workspaces-overview-thumbnails = Darbo sričių apžvalgos režimo miniatiūros +workspaces-overview-thumbnails = Darbo sričių peržiūros miniatiūros .show-number = Rodyti darbo srities numerį .show-name = Rodyti darbo srities vardą color = Spalvos @@ -646,33 +646,33 @@ color = Spalvos hex = Šešioliktainis magnifier = Didinamasis stiklas .controls = - Arba pasinaudokite sparčiaisiais klavišais: { $zoom_in -> + Arba naudokite sparčiaisius klavišus: { $zoom_in -> [zero] { "" } *[other] { "" } - { $zoom_in } priartinimui, + { $zoom_in } priartinti, }{ $zoom_out -> [zero] { "" } *[other] { "" } - { $zoom_out } atitolinimui, + { $zoom_out } tolinti, } Super + slinkimas su pele .scroll_controls = Įgalinkite pelės ar jutiklinio pulto vaizdo mastelio keitimą su Super + slinkimas .show_overlay = Rodyti didinamojo stiklo perdangą .increment = Artinimo dydis .signin = Įjungti didinamąjį stiklą prisijungimo ekrane - .applet = Didinamojo stiklo jungiklio apletas panelėje - .movement = Priartinto vaizdo judėjimas - .continuous = Nuolatos su pelės žymekliu + .applet = Didinamojo stiklo jungiklio apletas skydelyje + .movement = Priartinto vaizdo judinimas + .continuous = Nuolat su pelės žymekliu .onedge = Kai žymeklis pasiekia ekrano ribą .centered = Laikyti žymeklį centre colors = Spalvos administrator = Administratorius .desc = Administratorius gali keisti nustatymus visiems naudotojams, pridėti ir pašalinti kitus naudotojus -scan-to-connect-description = Norinti prisijungti prie šio tinklo, skenuokite QR kodą. +scan-to-connect-description = Norėdami prisijungti prie šio tinklo, skenuokite QR kodą. modified = Pakeista: { $count } -known-networks = Žinomi tinklai +known-networks = Įsiminti tinklai network-and-wireless = Tinklas ir belaidis ryšys sound-device-port-unplugged = Neprijungta sound-hd-audio = HD garsas @@ -719,98 +719,98 @@ shadows-floating = Slankieji langai workspaces-overview = Darbo sričių apžvalga .action-on-typing = Veiksmas rašant .none = Jokia - .launcher = Atidaryti Aplikacijų leidyklę - .applications = Atidaryti Aplikacijas + .launcher = Atverti Leistuką + .applications = Atidaryti Programas connect = Prisijungti light = Šviesi dark = Tamsus xdg-entry-touchpad = Jutiklinis kilimėlis xdg-entry-wired = Laidinis -xdg-entry-startup-apps-comment = Konfigūruoti aplikacijas paleidžiamas prisijungus +xdg-entry-startup-apps-comment = Konfigūruoti programas paleidžiamas prisijungus xdg-entry-region-language = Regionas ir Kalba xdg-entry-mouse-keywords = COSMIC;Pelė;Pagreitis;Slinkimas; xdg-entry-bluetooth-comment = Valdyti Bluetooth įrenginius -xdg-entry-notifications-keywords = COSMIC;Pranešimai;Užrakinimas; -xdg-entry-startup-apps-keywords = COSMIC;Paleistis;Aplikacija; -xdg-entry-default-apps-comment = Numatytoji naršyklė, pašto programa, failų naršyklė ir kitos aplikacijos -xdg-entry-keyboard-comment = Įvesties šaltiniai, perjungimas, specialių ženklų įvestis, spartieji klavišai -xdg-entry-wired-keywords = COSMIC;Laidinis;LAN;Tinkas;Ryšys; +xdg-entry-notifications-keywords = COSMIC;Pranešimai;Užraktas; +xdg-entry-startup-apps-keywords = COSMIC;Paleistis;Programa; +xdg-entry-default-apps-comment = Numatytoji naršyklė, pašto programa, failų naršyklė ir kitos programos +xdg-entry-keyboard-comment = Įvesties įtaisai, perjungimas, specialių ženklų įvestis, spartieji klavišai +xdg-entry-wired-keywords = COSMIC;Laidinis;LAN;Tinklas;Ryšys; xdg-entry-power = Energija ir Baterija xdg-entry-mouse = Pelė -xdg-entry-dock-keywords = COSMIC;Dokas;Panelė;Apletas +xdg-entry-dock-keywords = COSMIC;Dokas;Skydelis;Apletas xdg-entry-mouse-comment = Pelės greitis, pagreitis ir natūralus slinkimas xdg-entry-system = Sistema ir Paskyros -xdg-entry-panel-keywords = COSMIC;Panelė;Apletas +xdg-entry-panel-keywords = COSMIC;Skydelis;Apletas xdg-entry-window-management = Langų Valdymas xdg-entry-a11y = Prieinamumas -xdg-entry-time-language-comment = Valdyti sistemos datą, laiką, regioną ir kalbą +xdg-entry-time-language-comment = Tvarkyti sistemos datą, laiką, regioną ir kalbą xdg-entry-desktop-keywords = COSMIC;Darbalaukis; -xdg-entry-x11-applications-keywords = COSMIC;X11;Aplikacijos;Žaidimas;Suderinamumas; -xdg-entry-displays-comment = Valdyti ekrano konfigūracijos nustatymus +xdg-entry-x11-applications-keywords = COSMIC;X11;Programa;Žaidimas;Suderinamumas; +xdg-entry-displays-comment = Tvarkyti ekrano nuostatas xdg-entry-touchpad-keywords = COSMIC;Jutiklinis kilimėlis; Gestai; xdg-entry-time-language = Laikas ir Kalba xdg-entry-users = Naudotojai xdg-entry-system-keywords = COSMIC;Sistema;Informacija;Paskyros;Programinė aparatinė įranga; -xdg-entry-default-apps = Numatytosios Aplikacijos +xdg-entry-default-apps = Numatytosios programos xdg-entry-wireless-keywords = COSMIC;WiFi-Wi-Fi;Tinklas;Ryšys; -xdg-entry-applications-comment = Numatytosios aplikacijos, pradžios aplikacijos ir X11 aplikacijų suderinamumo nustatymai +xdg-entry-applications-comment = Numatytosios programos, pradžios programos ir X11 programų suderinamumo nuostatos xdg-entry-about-keywords = COSMIC;Apie -xdg-entry-panel = Panelė +xdg-entry-panel = Skydelis xdg-entry-notifications = Pranešimai xdg-entry-a11y-keywords = COSMIC;Prieinamumas;A11y;Ekranas;Skaitytuvas;Didinamasis stiklas;Kontrastas;Spalva; xdg-entry-wireless-comment = Wi-Fi ryšiai ir ryšių profiliai xdg-entry-desktop = Darbalaukis xdg-entry-date-time-keywords = COSMIC;Laikas;Zona; -xdg-entry-desktop-comment = Darbalaukio fonas, išvaizda, panelė, dokas, langų valdymo ir darbo sričių nustatymai +xdg-entry-desktop-comment = Darbalaukio fonas, išvaizda, skydelis, dokas, langų valdymo ir darbo sričių nuostatos xdg-entry-wallpaper = Darbalaukio fonas xdg-entry-keyboard = Klaviatūra xdg-entry-a11y-comment = Ekrano Skaitytuvas, didinamasis stiklas, didelis kontrastas ir spalvų filtrai xdg-entry-displays = Ekranai xdg-entry-network = Tinklas ir Belaidis ryšys xdg-entry-date-time = Data ir Laikas -xdg-entry-users-comment = Autentifikacija ir naudotojų paskyros -xdg-entry-input-comment = Klaviatūros ir pelės nustatymai +xdg-entry-users-comment = Naudotojų tapatumo patvirtinimas ir paskyros +xdg-entry-input-comment = Klaviatūros ir pelės nuostatos xdg-entry-bluetooth-keywords = COSMIC;Bluetooth; -xdg-entry-dock-comment = Pasirinktina juosta aplikacijomis ir apletams +xdg-entry-dock-comment = Pasirinktinė juosta programoms ir apletams xdg-entry-network-keywords = COSMIC;Tinklas;Bevielis ryšys;WiFi;VPN; xdg-entry-wallpaper-comment = Darbalaukio paveikslėlis, spalvos ir skaidrių parinktys xdg-entry-dock = Dokas -xdg-entry-startup-apps = Pradžios Aplikacijos +xdg-entry-startup-apps = Paleisties programos xdg-entry-wireless = Wi-Fi xdg-entry-workspaces-keywords = COSMIC;Darbo sritis;Orientacija;Apžvalga;Monitorius; -xdg-entry-system-comment = Sistemos informacija, paskyros ir programinės aparatinės įrangos atnaujinimai -xdg-entry-x11-applications-comment = X11 langų sistemos aplikacijų mastelis, pagrindinis ekranas ir sistemos greitieji klavišai -xdg-entry-region-language-comment = Datų, laiko ir skaičių formatas pagal nustatytą regioną +xdg-entry-system-comment = Sistemos informacija, paskyros ir programinės aparatinės įrangos naujiniai +xdg-entry-x11-applications-comment = X11 langų sistemos programų mastelis, pagrindinis ekranas ir sistemos greitieji klavišai +xdg-entry-region-language-comment = Datų, laiko ir skaičių formatas pagal pasirinktą regioną xdg-entry-wallpaper-keywords = COSMIC;Darbalaukio fonas;Fonas;Skaidrės; xdg-entry-users-keywords = COSMIC;Naudotojas;Paskyra; -xdg-entry-about-comment = Įrenginio pavadinimas, techninė informacija, operacinės sistemos numatytieji nustatymai +xdg-entry-about-comment = Įrenginio pavadinimas, techninė informacija, operacinės sistemos numatytosios nuostatos xdg-entry-vpn-keywords = COSMIC;VPN;Ryšys;Prisijungimai;OpenVPN;OpenConnect; xdg-entry-time-language-keywords = COSMIC;Sistema;Laikas;Data;Regionas;Kalba; xdg-entry-input-keywords = COSMIC;Įvestis;Klaviatūra;Pelė;Pelytė; xdg-entry-comment = COSMIC desktop aplikacijų nustatymai -xdg-entry-notifications-comment = Netrukdyti režimas, užrakinto ekrano pranešimai ir programų nustatymai -xdg-entry-applications = Aplikacijos +xdg-entry-notifications-comment = Režimas „Netrukdyti“, užrakinto ekrano pranešimai ir programų nuostatos +xdg-entry-applications = Programos xdg-entry-sound-keywords = COSMIC;Garsas;Audio;Pranešimai;Pipewire; xdg-entry-power-keywords = COSMIC;Energija;Baterija -xdg-entry-default-apps-keywords = COSMIC;Numatyta;Aplikacija +xdg-entry-default-apps-keywords = COSMIC;Numatyta;Programa xdg-entry-keywords = COSMIC;Nustatymai; xdg-entry-region-language-keywords = COSMIC;Regionas;Kalba;Data;Formatas;Laikas;Vietovė;Lokalizavimas; xdg-entry-about = Apie xdg-entry-input = Įvesties Įrenginiai xdg-entry-applications-keywords = COSMIC;Numatytas;Aplikacija;Paleidimas;X11;Suderinamumas -xdg-entry-sound-comment = Audio nustatymai įrenginiams, pranešimams ir aplikacijoms +xdg-entry-sound-comment = Įrenginių, pranešimų ir programų garso nuostatos xdg-entry-touchpad-comment = Jutiklinis kilimėlio greitis, valdymo parinktys, gestai xdg-entry-keyboard-keywords = COSMIC;Klaviatūra;Įvestis;Šaltinis;Spartieji klavišai; xdg-entry-vpn-comment = VPN ryšiai ir prisijungimų profiliai xdg-entry-appearance = Išvaizda -xdg-entry-workspaces-comment = Darbo sričių orientacija, apžvalga ir keletos monitorių funkcionavimas -xdg-entry-network-comment = Valdyti tinklo ryšius -xdg-entry-panel-comment = Pagrindinė sistemos juosta apletams ir meniu +xdg-entry-workspaces-comment = Darbo sričių orientacija, peržiūra ir veikimas keliuose monitoriuose +xdg-entry-network-comment = Tvarkyti tinklo ryšius +xdg-entry-panel-comment = Pagrindinė sistemos meniu ir apletų juosta xdg-entry-sound = Garsas xdg-entry-power-comment = Energijos režimai ir energijos taupymo parinktys xdg-entry-displays-keywords = COSMIC;Ekranas; xdg-entry-workspaces = Darbo sritys -xdg-entry-date-time-comment = Laiko juosta, automatiniai laikrodžio nustatymai ir laiko formatavimas -xdg-entry-x11-applications = X11 Aplikacijų Suderinamumas +xdg-entry-date-time-comment = Laiko juosta, automatinės laikrodžio nuostatos ir laiko formatai +xdg-entry-x11-applications = Suderinamumas su X11 programomis xdg-entry-wired-comment = Laidiniai ryšiai ir ryšių profiliai no-search-results = Joks tinklas neatitinka jūsų paieškos. diff --git a/i18n/pl/cosmic_settings.ftl b/i18n/pl/cosmic_settings.ftl index 73ca92c..f7bcad2 100644 --- a/i18n/pl/cosmic_settings.ftl +++ b/i18n/pl/cosmic_settings.ftl @@ -116,6 +116,8 @@ vpn-error = Błąd VPN .connect = Nie udało się połączyć z VPN .connection-editor = Błąd edytora połączenia .connection-settings = Nie udało się uzyskać ustawień dla aktywnych połączeń + .openvpn-config-path = Nieprawidłowa ścieżka pliku konfiguracji OpenVPN + .openvpn-config-path-desc = Wybrany plik musi być w lokalnym systemie plików. .updating-state = Nie udało się zaktualizować stanu menedżera sieci .wireguard-config-path = Nieprawidłowa ścieżka pliku konfiguracji WireGuard .wireguard-config-path-desc = Wybrany plik musi znajdować się w lokalnym systemie plików system. @@ -928,3 +930,9 @@ xdg-entry-window-management-keywords = COSMIC;Okna;Zarządzanie;Kafelkowanie;Sup xdg-entry-panel-comment = Podstawowy panel z menu i apletami xdg-entry-displays-keywords = COSMIC;Wyświetlacz;Ekran; no-search-results = Żadna sieć nie odpowiada twojemu wyszukiwaniu. +workspaces-navigation = Navigation + .wraparound = Przemieszczaj się między pierwszym a ostatnim obszarem roboczym używając skrótów klawiszowych i gestów +bluetooth-display-passkey = Parowanie Bluetooth + .description = Wpisz ten kod na { $device } i naciśnij Enter +bluetooth-display-pin = Bluetooth Pairing + .description = Wpisz PIN na { $device } i naciśnij Enter diff --git a/i18n/pt-BR/cosmic_settings.ftl b/i18n/pt-BR/cosmic_settings.ftl index cfc2d69..45d9973 100644 --- a/i18n/pt-BR/cosmic_settings.ftl +++ b/i18n/pt-BR/cosmic_settings.ftl @@ -60,8 +60,10 @@ vpn-error = Erro de VPN .connect = Falha ao conectar na VPN .connection-editor = Falha de edição da conexão .connection-settings = Falha ao obter as configurações das conexões ativas + .openvpn-config-path = Caminho de arquivo inválido para a configuração do OpenVPN + .openvpn-config-path-desc = O arquivo escolhido deve estar em um sistema de arquivos local. .updating-state = Falha ao atualizar o status do gerenciador de rede - .wireguard-config-path = Caminho do arquivo inválido para a configuração do WireGuard + .wireguard-config-path = Caminho de arquivo inválido para a configuração do WireGuard .wireguard-config-path-desc = O arquivo selecionado deve estar em um sistema de arquivos local. .wireguard-device = Falha ao criar um dispositivo WireGuard .with-password = @@ -674,10 +676,10 @@ open-workspaces-view = Abrir a visão geral dos espaços de trabalho ## Time & Language time = Hora e Idioma -time-date = Data e Hora +time-date = Data e hora .auto = Definir automaticamente .auto-ntp = A data e a hora serão atualizadas automaticamente quando o fuso horário for definido -time-zone = Fuso Horário +time-zone = Fuso horário .auto = Fuso horário automático .auto-info = Requer um serviço de localização e acesso à Internet time-format = Formato de data e hora @@ -689,18 +691,18 @@ time-format = Formato de data e hora .saturday = Sábado .sunday = Domingo .monday = Segunda-feira -time-region = Região e Idioma +time-region = Região e idioma formatting = Formatação .dates = Datas .time = Horas - .date-and-time = Data e Hora + .date-and-time = Data e hora .numbers = Números .measurement = Medidas .paper = Papel preferred-languages = Idiomas preferidos .desc = A ordem dos idiomas determina qual idioma será usado para a tradução do desktop. As alterações entram em vigor no próximo início de sessão. add-language = Adicionar idioma - .context = Adicionar Idioma + .context = Adicionar idioma install-additional-languages = Instalar idiomas adicionais region = Região @@ -833,7 +835,7 @@ xdg-entry-appearance-keywords = COSMIC;Destaque;Accent;Cor;Ícone;Fonte;Tema xdg-entry-mouse = Mouse xdg-entry-dock-keywords = COSMIC;Dock;Painel;Applet;Miniaplicativo xdg-entry-mouse-comment = Velocidade do mouse, aceleração e rolagem natural -xdg-entry-system = Sistema e Contas +xdg-entry-system = Sistema e contas xdg-entry-panel-keywords = COSMIC;Painel;Applet;Miniaplicativo xdg-entry-window-management = Gerenciamento de janelas xdg-entry-a11y = Acessibilidade @@ -842,7 +844,7 @@ xdg-entry-desktop-keywords = COSMIC;Desktop;Área;Trabalho; xdg-entry-x11-applications-keywords = COSMIC;X11;Aplicativo;Jogos;Compatibilidade; xdg-entry-displays-comment = Gerenciar configurações de tela xdg-entry-touchpad-keywords = COSMIC;Touchpad;Gestos; -xdg-entry-time-language = Hora e Idioma +xdg-entry-time-language = Hora e idioma xdg-entry-users = Usuários xdg-entry-system-keywords = COSMIC;Sistema;Info;Contas;Firmware; xdg-entry-default-apps = Aplicativos padrão @@ -911,3 +913,9 @@ xdg-entry-x11-applications = Compatibilidade com aplicativos X11 xdg-entry-window-management-comment = Ação da tecla Super, opções de controle de janela e opções de janelas lado a lado (tiling) xdg-entry-wired-comment = Conexões de rede com fio e perfis de conexão no-search-results = Nenhuma rede corresponde à sua pesquisa. +workspaces-navigation = Navegação + .wraparound = Navegar entre o primeiro e o último espaço de trabalho usando atalhos de teclado e gestos +bluetooth-display-passkey = Emparelhamento Bluetooth + .description = Por favor, digite a seguinte chave em { $device }, depois pressione Enter +bluetooth-display-pin = Emparelhamento Bluetooth + .description = Por favor, digite o seguinte PIN em { $device }, depois pressione Enter diff --git a/i18n/pt/cosmic_settings.ftl b/i18n/pt/cosmic_settings.ftl index c5e60f3..e89df97 100644 --- a/i18n/pt/cosmic_settings.ftl +++ b/i18n/pt/cosmic_settings.ftl @@ -34,7 +34,7 @@ xdg-entry-notifications-comment = "Não Perturbe", notificações na tela de blo xdg-entry-panel = Panel xdg-entry-panel-comment = Barra superior com controles e menus xdg-entry-power = Energia e Bateria -xdg-entry-power-comment = Modos de energia e opções de economia de energia +xdg-entry-power-comment = Modos de energia e opções de poupança de energia xdg-entry-region-language = Região e Idioma xdg-entry-region-language-comment = Formatação de datas, horas e números baseados em sua região xdg-entry-sound = Som @@ -164,7 +164,6 @@ notifications = Notificações ## Desktop: Panel panel = Painel - .desc = Barra do sistema principal para menus e miniaplicativos. add = Adicionar add-applet = Adicionar miniaplicativo all = Todos @@ -207,7 +206,6 @@ panel-missing = A configuração do painel está em falta ## Desktop: Dock dock = Doca - .desc = Uma barra opcional para aplicações e miniaplicativos. ## Desktop: Window management @@ -494,7 +492,7 @@ system-shortcut = Sistema .keyboard-brightness-down = Diminuir o brilho do teclado .keyboard-brightness-up = Aumentar o brilho do teclado .launcher = Abrir o lançador - .log-out = Sair + .log-out = Terminar sessão .lock-screen = Bloquear o ecrã .mute = Silenciar saída de áudio .mute-mic = Silenciar entrada do microfone @@ -580,7 +578,6 @@ time-format = Formato de Data e Hora .sunday = Domingo .monday = Segunda-feira time-region = Região e Idioma - .desc = Formatar datas, horas e números baseado na sua região. ## System @@ -859,3 +856,4 @@ workspaces-overview = Visão geral das áreas de trabalho .none = Nenhuma .launcher = Abrir lançador .applications = Abrir aplicações +xdg-entry-power-keywords = COSMIC;Energia;Bateria diff --git a/i18n/ru/cosmic_settings.ftl b/i18n/ru/cosmic_settings.ftl index 6240086..dcb14af 100644 --- a/i18n/ru/cosmic_settings.ftl +++ b/i18n/ru/cosmic_settings.ftl @@ -112,11 +112,11 @@ notifications = Уведомления dock = Док hot-corner = Активные углы .top-left-corner = Открывать рабочие столы при наведении в левый верхний угол -super-key = Клавиша Super +super-key = Действие клавиши Super .launcher = Открывает панель запуска .workspaces = Открывает обзор рабочих столов .applications = Открывает приложения - .disable = Отключена + .disable = Отсутствует window-controls = Элементы управления окнами .minimize = Отображать кнопку «Свернуть» .maximize = Отображать кнопку «Развернуть» @@ -571,9 +571,11 @@ vpn-error = Ошибка VPN .connect = Не удалось подключиться к VPN .connection-editor = Сбой редактора соединений .connection-settings = Не удалось получить настройки активных подключений + .openvpn-config-path = Некорректный путь к файлу конфигурации OpenVPN + .openvpn-config-path-desc = Выбранный файл должен находиться в локальной файловой системе. .updating-state = Не удалось обновить состояние сетевого менеджера - .wireguard-config-path = Некорректный путь до файла конфигурации WireGuard - .wireguard-config-path-desc = Выбранный файл должен находиться на локальной файловой системе. + .wireguard-config-path = Некорректный путь к файлу конфигурации WireGuard + .wireguard-config-path-desc = Выбранный файл должен находиться в локальной файловой системе. .wireguard-device = Не удалось создать устройство WireGuard .with-password = Не удалось настроить { $field -> @@ -888,3 +890,9 @@ xdg-entry-x11-applications = Совместимость с приложения xdg-entry-window-management-comment = Действие кнопки Super, параметры размещения и управления окнами xdg-entry-wired-comment = Проводные соединения и профили no-search-results = По запросу не найдено ни одной сети. +workspaces-navigation = Навигация + .wraparound = Переход между крайними рабочими столами при помощи сочетаний клавиш и жестов +bluetooth-display-passkey = Сопряжение по Bluetooth + .description = Введите следующий код на { $device }, затем нажмите Enter +bluetooth-display-pin = Сопряжение по Bluetooth + .description = Введите следующий PIN-код на { $device }, затем нажмите Enter diff --git a/i18n/sr/cosmic_settings.ftl b/i18n/sr/cosmic_settings.ftl index e69de29..da3828d 100644 --- a/i18n/sr/cosmic_settings.ftl +++ b/i18n/sr/cosmic_settings.ftl @@ -0,0 +1,822 @@ +cancel = Откажи +connected = Повезано +confirm = Потврди +panel-left = Лево +connect = Повежи +super-key = Радња Супер тастера + .launcher = Отвори покретача + .workspaces = Отвори радне просторе + .applications = Отвори програме + .disable = Онемогући +x-minutes = + { $number } { $number -> + [one] минут + *[other] минута + } +vrr = Променљива стопа освежавања + .enabled = Омогућено + .force = Увек + .auto = Самостално + .disabled = Онемогућено +window-hint-accent = Боја наговештаја за активни прозор +fit-to-screen = Уклопи у екран +control-tint = Боја компоненте за управљање + .desc = Користи се за позадине уобичајених дугмади, поља за претрагу, поља за унос текста и сличних компоненти +close = Затвори +save = Сачувај +vpn-error = Грешка ВПН-а + .config = Неуспешно додавање поставки ВПН-а + .connect = Неуспешно повезивање на ВПН + .connection-editor = Уређивач везе није успео + .connection-settings = Неуспешно преузимање подешавања за активне везе + .updating-state = Неуспешно ажурирање стања руководиоца мреже + .wireguard-config-path = Неисправна путања до датотеке подешавања за Вајергард + .wireguard-config-path-desc = Изабрана датотека мора бити у локалном систему датотека. + .wireguard-device = Неуспешно стварање уређаја за Вајергард + .with-password = + Неуспешно постављање ВПН { $field -> + *[username] username + [password] password + [password-flags] password-flags + } помоћу nmcli +toggle-stacking = Окини слагање прозора +panel-top = Горе +no-applets-found = Није пронађен ниједан програмчић... +region = Област +zoom-in = Увећај +place-here = Поставите програмчиће овде +-requires-restart = Захтева поновно покретање +workspaces-orientation = Смер радних простора + .vertical = Усправно + .horizontal = Водоравно +acceleration-desc = Самостално прилагођава осетљивост праћења на основу брзине +all-displays = Сви екрани +scheduling = Заказивање + .manual = Ручно заказивање +frosted = Ефекат матираног стакла на системском прочељу + .desc = Примењује замућење позадине на окно, док, програмчиће, покретач и библиотеку програма +password = Лозинка +about-hardware = Хардвер + .model = Модел хардвера + .memory = Меморија + .processor = Процесор + .graphics = Графика + .disk-capacity = Капацитет диска +short = Кратко +vpn = ВПН + .connections = ВПН везе + .remove = Уклони профил везе + .select-file = Изабери датотеку са поставкама ВПН-а + .error = Неуспешно додавање ВПН подешавања +power-mode = Режим напајања + .battery = Продужено трајање батерије + .battery-desc = Смањена употреба напајања и утишан рад + .balanced = Уравнотежено + .balanced-desc = Тихи учинак и умерена потрошња енергије + .performance = Висок учинак + .performance-desc = Највећи учинак и потрошња енергије + .no-backend = Позадинац није пронађен. Инсталирај system76-power или power-profiles-daemon. +wired = Жичана + .adapter = Жичани адаптер { $id } + .connections = Жичане везе + .devices = Жичани уређаји + .remove = Уклони профил везе +bluetooth-available = Уређаји у близини +cable-unplugged = Кабел није прикључен +color-picker = Бирач боје +interface-font = Системски фонт +forget-dialog = Заборавити ову бежичну мрежу? + .description = Поново ћете морати да унесете лозинку да бисте у будућности користили ову бежичну мрежу. +remove = Уклони +default = Подразумевано +zoom-out = Умањи +hot-corner = Врући угао + .top-left-corner = Омогући горњи леви врући угао за радне просторе +keyboard-typing-assist = Куцање + .repeat-rate = Брзина понављања + .repeat-delay = Интервал понављања +edge-gravity = Лебдећи прозори теже ка најближим ивицама +amplification = Појачање + .desc = Омогућава повећање јачине звука на 150% +recent-colors = Недавне боје +about-os = Оперативни систем + .os = Оперативни систем + .os-architecture = Архитектура оперативног система + .kernel = Издање језгра + .desktop-environment = Радно окружење + .windowing-system = Прозорски систем +panel-behavior-and-position = Понашање и положаји + .autohide = Самостално сакриј траку + .dock-autohide = Самостално сакриј док + .position = Положај на екрану + .display = Прикажи на екрану +add-language = Додај језик + .context = Додај језик +password-mismatch = Лозинка и потврда се морају поклапати +accessibility = Приступачност + .vision = Вид + .on = Укључено + .off = Искључено + .unavailable = Недоступно + .screen-reader = Читач екрана + .high-contrast = Режим високог контраста + .invert-colors = Изврни боје + .color-filters = Филтери боје +container-background = Позадина контејнера + .desc-detail = Боја позадине контејнера се користи за бочни панел за навигацију, бочну фиоку, прозорчиће и сличне елементе. Подразумевано, боја позадине контејнера се самостално изводи из позадине прозора. + .reset = Врати на самостално + .desc = Користи се за бочни панел за навигацију, бочну фиоку, прозорчиће и сличне елементе +primary-button = Главно дугме + .desc = Подешава поредак физичких дугмади + .left = Лево + .right = Десно +sound-alerts = Упозорења + .volume = Јачина звука упозорења + .sound = Звук упозорења +icon-theme = Тема иконица + .desc = Примењује различит скуп иконица на програме +import = Увези +keyboard-shortcuts = Пречице тастатуре + .desc = Прикажи и прилагоди пречице +switch-between-windows = Пребацујте се између прозора +text-tint = Боја текста прочеља + .desc = Користи се за одређивање боја текста прочеља које имају довољан контраст на различитим површинама +online-accounts = Налози на мрежи + .desc = Додај налоге, ИМАП и СМТП, пословну пријаву +open-workspaces-view = Отвори преглед радних простора +all = Све +remove-user = Уклони корисника +unknown = Непознато +sound-input = Улаз + .volume = Јачина звука на улазу + .device = Улазни уређај + .level = Ниво улаза +add-another-keybinding = Додај још једну комбинацију тастера +copy-to-clipboard = Копирај у оставу +monospace-font = Фонт утврђене ширине +experimental-settings = Експериментална подешавања +recent-folders = Недавне фасцикле +color-filter = Врста филтера боје + .unknown = Непознат филтер је активан + .greyscale = Сива скала + .deuteranopia = Зелена/црвена (слабост зелене боје, деутеранопија) + .protanopia = Црвена/зелена (слабост црвене боје, протанопија) + .tritanopia = Плава/жута (слабост плаве боје, тританопија) +migrate-workspace = + Пресели радни простор на излаз { $direction -> + *[down] доле + [left] лево + [right] десно + [up] горе + } +connecting = Повезивање… +battery = Батерија + .minute = + { $value } { $value -> + [one] минут + *[other] минута + } + .hour = + { $value } { $value -> + [one] сат + *[other] сати + } + .day = + { $value } { $value -> + [one] дан + *[other] дана + } + .less-than-minute = Мање од једног минута + .and = и + .remaining-time = + { $time } до { $action -> + [full] пуног + *[other] празног + } +search-applets = Претрага програмчића... +export = Извези +pinch-to-zoom = Штипај за увећање + .desc = Користите два прста за увећање садржаја, за програме који подржавају увећање +wifi = Бежична + .adapter = Бежични адаптер { $id } + .forget = Заборави ову мрежу +x-hours = + { $number } { $number -> + [one] сат + *[other] сати + } +added = Додато +input-source-switch = Промени извор уноса језика тастатуре +focus-navigation = Навигација фокусом + .focus-follows-cursor = Фокус прати показивач + .focus-follows-cursor-delay = Интервал праћења фокуса показивачем у мс + .cursor-follows-focus = Показивач прати фокус +full-name = Име и презиме +app-background = Позадина прозора +panel-right = Десно +keyboard-sources = Извори уноса + .desc = Извори уноса се могу пребацити помоћу комбинације тастера Super+Space. Ово се може прилагодити у подешавањима пречица тастатуре. + .move-up = Помери горе + .move-down = Помери доле + .settings = Подешавања + .view-layout = Прикажи распоред тастатуре + .remove = Уклони + .add = Додај извор уноса +nav-shortcuts = Навигација + .prev-output = Усредсреди претходни излаз + .next-output = Усредсреди следећи излаз + .last-workspace = Усредсреди последњи радни простор + .prev-workspace = Усредсреди претходни радни простор + .next-workspace = Усредсреди следећи радни простор + .focus = + Усредсреди прозор { $direction -> + *[down] доле + [in] унутра + [left] лево + [out] напоље + [right] десно + [up] горе + } + .output = + Пребаци на излаз { $direction -> + *[down] доле + [left] лево + [right] десно + [up] горе + } + .workspace = Пребаци на радни простор { $num } +hearing = Слух + .mono = Пусти стерео звук као моно +preferred-languages = Жељени језици + .desc = Редослед језика одређује који се језик користи за корисничко прочеље. Измене ступају на снагу при следећој пријави. +panel-style = Стил + .anchor-gap = Размак између траке и ивица екрана + .dock-anchor-gap = Размак између дока и ивица екрана + .extend = Прошири траку до ивица екрана + .dock-extend = Прошири док до ивица екрана + .appearance = Изглед + .size = Величина + .background-opacity = Непровидност позадине +username = Корисничко име +light = Светла +panel-appearance = Изглед + .match = Поклопи радну површину + .light = Светла + .dark = Тамна +workspaces-multi-behavior = Понашање са више екрана + .span = Радни простори се протежу преко екрана + .separate = Екрани имају раздвојене радне просторе +replace-shortcut-dialog = Заменити пречицу? + .desc = { $name } користи { $shortcut }. Ако је замените, { $name } ће бити онемогућено. +rgb = РГБ +about-device = Назив уређаја + .desc = Овај назив се појављује другим мрежним или Блутут уређајима +no-vpn = Нема доступних ВПН веза. +start-segment = Почетак сегмента +desktop = Радна површ +identity = Идентитет +reset-to-default = Врати на подразумевано +disconnect = Прекини везу +ok = У реду +app = Космик подешавања +debug = Уклањање грешака +enable-export = Примени тренутну тему на Гномове програме + .desc = Не подржавају сви скупови алата самостално пребацивање. Програме који нису Космик може бити потребно поново покренути након промене теме. +number = { $number } +shortcut-name = Назив пречице +style = Стил + .round = Заобљено + .slightly-round = Благо заобљено + .square = Квадратно +panel-applets = Подешавање + .dock-desc = Подеси програмчиће дока + .desc = Подеси програмчиће траке +qr-code-unavailable = КР код није доступан +small = Мало +window-tiling = Поплочавање прозора + .horizontal = Подеси водоравни смер + .vertical = Подеси усправни смер + .swap-window = Замени прозор + .toggle-tiling = Промени стање поплочавања прозора + .toggle-stacking = Промени стање слагања прозора + .toggle-floating = Промени стање плутања прозора + .toggle-orientation = Промени смер +change-password = Промени лозинку +disable-while-typing = Онемогући током куцања +long = Дуго +copied-to-clipboard = Копирано у оставу +bluetooth-confirm-pin = Потврдите ПИН блутута + .description = Потврдите да се следећи ПИН подудара са оним који је приказан на { $device } +legacy-app-scaling = Скалирање програма у Икс-11 систему прозора + .scaled-gaming = Оптимизуј за игре и програме у пуном екрану + .gaming-description = Икс-11 програми се могу појавити благо већи/мањи у поређењу са Вејленд програмима + .scaled-applications = Оптимизуј за програме + .applications-description = Игре и Икс-11 програми у пуном екрану могу се не поклопити са резолуцијом вашег екрана + .scaled-compatibility = Режим максималне усаглашености + .compatibility-description = Икс-11 програми се могу појавити замућеним на HiDPI екранима + .preferred-display = Жељени екран за игре и Икс-11 програме у пуном екрану + .no-display = Ништа +night-light = Ноћно светло + .auto = Самостално (од заласка до изласка сунца) + .desc = Умањи плаво светло топлијим бојама +custom-shortcuts = Произвољне пречице + .add = Додај пречицу + .context = Додај произвољну пречицу + .none = Нема произвољних пречица +visible-networks = Видљиве мреже +applets = Програмчићи +terminate = Окончај +window-hint-accent-toggle = Употреби акцентну боју теме као наговештај за активни прозор +type-to-search = Куцајте за претрагу... +workspaces-behavior = Понашање радног простора + .dynamic = Динамички радни простори + .dynamic-desc = Самостално уклања празне радне просторе. + .fixed = Неизмењив број радних простора + .fixed-desc = Додај или уклони радне просторе у прегледу. +wireguard-dialog = Додај Вајергард уређај + .description = Изаберите назив уређаја за подешавање Вајергарда. +remove-connection-dialog = Уклонити профил везе? + .vpn-description = Биће потребно да поново унесете лозинку како бисте у будућности користили ову мрежу. + .wired-description = Мораћете поново да креирате овај профил да бисте га у будућности користили. +password-confirm = Потврди лозинку +click-behavior = Понашање клика + .click-finger = Секундарни клик са два прста и средњи клик са три прста + .button-areas = Секундарни клик у доњем десном углу и средњи клик у доњем центру +move-windows = Помери прозоре + .direction = + Помери прозор { $direction -> + *[down] доле + [left] лево + [right] десно + [up] горе + } + .display = + Помери прозор за један екран { $direction -> + *[down] доле + [left] лево + [right] десно + [up] горе + } + .workspace = + Помери прозор за један радни простор { $direction -> + *[below] испод + [left] лево + [right] десно + [above] изнад + } + .workspace-num = Помери прозор у радни простор { $num } + .prev-workspace = Помери прозор у претходни радни простор + .next-workspace = Помери прозор у следећи радни простор + .last-workspace = Премешта прозор на последњи радни простор + .next-display = Премешта прозор на следећи екран + .prev-display = Премешта прозор на претходни екран + .send-to-prev-workspace = Премешта прозор у претходни радни простор + .send-to-next-workspace = Премешта прозор у следећи радни простор +switch-workspaces = Пребаци радне просторе + .horizontal = Превлачење са четири прста лево/десно + .vertical = Превлачење са четири прста горе/доле +applications = Програми +dbus-connection-error = Није успело повезивање са Д-сабирницом +system-controls = Системске контроле +auto-switch = Самостално пребацивање између светлог и тамног режима + .sunrise = Пребацује на светли режим при изласку сунца + .sunset = Пребацује на тамни режим при заласку сунца + .next-sunrise = Пребацује на светли режим при следећем изласку сунца + .next-sunset = Пребацује на тамни режим при следећем заласку сунца +dark = Тамна +add-vpn = Додај ВПН +keyboard-numlock-boot = Num Lock + .boot-state = Стање при покретању + .last-boot = Последње покретање + .on = Укључено + .off = Искључено + .set = Постави стање Num Lock-а при подизању +about-related = Повезана подешавања + .support = Потражите подршку +tap-to-click = Тапни за клик + .desc = Омогућава тап једним прстом за примарни клик, тап два прста за секундарни клик и тап три прста за средњи клик +interface-density = Густина прочеља + .comfortable = Удобно + .compact = Збијено + .spacious = Пространо +open-application-library = Отвори библиотеку програма +slow = Споро +network-name = Назив мреже +large = Велико +scrolling = Помицање + .two-finger = Помицање са два прста + .edge = Помицање дуж ивице једним прстом + .speed = Брзина помицања + .natural = Природно помицање + .natural-desc = Помакни садржај, уместо приказа +auth-dialog = Потребно је потврђивање идентитета + .vpn-description = Унесите корисничко име и лозинку које захтева ВПН услуга. + .wifi-description = Унесите лозинку или кључ за шифровање. Такође се можете повезати притискањем дугмета „WPS“ на рутеру. +add-user = Додај корисника +enable = Омогући +add-image = Додај слику +migrate-workspace-next = Пресели радни простор на следећи излаз +airplane-on = Режим авиона је укључен. +formatting = Форматирање + .dates = Датуми + .time = Време + .date-and-time = Датум и време + .numbers = Бројеви + .measurement = Мерење + .paper = Папир +disabled = Онемогућено +add-applet = Додај програмчић +show-extended-input-sources = Прикажи проширене изворе улаза +mode-and-colors = Режим и боје +forget = Заборави +center-segment = Средишњи сегмент +panel-missing = Подешавање траке недостаје + .desc = Датотека са подешавањима траке недостаје због употребе прилагођеног подешавања или је оштећена. + .fix = Врати на подразумевано +invalid-username = Неисправно корисничко име +mirroring = Пресликавање + .id = Пресликавање { $id } + .dont = Немој пресликати + .mirror = Пресликај { $display } + .project = + Пројектуј на { $display -> + [all] све екране + *[other] { $display } + } + .project-count = + Пројектује на { $count } { $count -> + [1] други екран + *[other] других екрана + } +orientation = Смер + .standard = Обично + .rotate-90 = Заокрени за 90° + .rotate-180 = Заокрени за 180° + .rotate-270 = Заокрени за 270° +auto = Самостално +end-segment = Крајњи сегмент +bluetooth-adapters = Блутут адаптери +time-format = Формат датума и времена + .twenty-four = 24-часовни формат + .show-seconds = Прикажи секунде + .first = Први дан у недељи + .show-date = Прикажи датум у програмчићу за време + .friday = Петак + .saturday = Субота + .sunday = Недеља + .monday = Понедељак +accent-color = Боја за наглашавање +type-key-combination = Укуцај комбинацију тастера +manage-windows = Управљај прозорима + .close = Затвори прозор + .maximize = Увећај прозор + .fullscreen = Прозор преко целог екрана + .minimize = Умањи прозор + .resize-inwards = Промени величину прозора ка унутра + .resize-outwards = Промени величину прозора ка споља + .toggle-sticky = Окини лепљиви прозор +never = Никада +install-additional-languages = Инсталирај додатне језике +settings = Подешавања +sound-output = Излаз + .volume = Јачина излаза + .device = Излазни уређај + .level = Ниво излаза + .config = Поставка + .balance = Равнотежа + .left = Лево + .right = Десно +window-controls = Контроле прозора + .maximize = Прикажи дугме за увећање + .minimize = Прикажи дугме за умањење + .active-window-hint = Прикажи ознаку за активни прозор +window-management-appearance = Управљање прозорима + .active-hint = Величина ознаке за активни прозор + .gaps = Размаци око поређаних прозора +migrate-workspace-prev = Пресели радни простор на претходни излаз +legacy-app-global-shortcuts = Опште пречице у програмима Икс-11 + .desc = Опште пречице омогућавају да притисаци тастатура и догађаји дугмића миша у програмима буду препознати од стране других програма за функције као што су „притисни-за-говор“ или „притисни-за-утишавање“. Подразумевано, опште пречице су онемогућене у програмима Икс-11 како би се осигурало да други програми не могу пратити догађаје тастатуре и миша који садрже осетљиве податке. + .none = Нема кључева + .modifiers = Заменски тастери (Super, Shift, Control, Alt) + .combination = Сви тастери док су заменски тастери Super, Control или Alt притиснути + .all = Сви тастери + .mouse = Догађаји дугмади миша у Икс-11 програмима +activate = Покрени +replace = Замени +power-saving = Могућности штедње енергије + .turn-off-screen-after = Искључи екран након + .auto-suspend = Самостално обустављање + .auto-suspend-ac = Самостално обустављање када је прикључен + .auto-suspend-battery = Самостално обустављање при напајању батеријом +connected-devices = Повезани уређаји + .unknown = Непознат уређај +icons-and-toolkit = Иконице и теме скупа алата +sound-applications = Програми + .desc = Јачина звука и подешавања програма +time-zone = Временска зона + .auto = Самостална временска зона + .auto-info = Захтева услуге локације и приступ интернету +dialog-add = Додај +fast = Брзо +add-color = Додај боју +add-network = Додај мрежу + .profile = Додај профил +network-device-state = + .activated = Повезано + .config = Повезује се + .deactivating = Веза се прекида + .disconnected = Веза прекинута + .failed = Неуспешно повезивање + .ip-check = Провера везе + .ip-config = Захтевање ИП и информација о рутирању + .need-auth = Потребно је потврђивање идентитета + .prepare = Припрема за повезивање + .secondaries = Чекање секундарне везе + .unavailable = Недоступно + .unknown = Непознато стање + .unmanaged = Неуправљиво + .unplugged = Кабел није прикључен +command = Наредба +gestures = Гестови + .four-finger-down = Превлачење са четири прста на доле + .four-finger-left = Превлачење са четири прста на лево + .four-finger-right = Превлачење са четири прста на десно + .four-finger-up = Превлачење са четири прста на горе + .three-finger-any = Превлачење са три прста у било ком смеру +system = Систем и налози +no-networks = Ниједна мрежа није пронађена. +open-new-folder = Отвори нову фасциклу +panel-bottom = Доле +share = Дељење мреже +add = Додај +fill = Попуна +custom = Прилагођено +bluetooth-paired = Претходно повезани уређаји + .connect = Повежи + .battery = { $percentage }% батерија +dialog = Прозорче + .title = Задржати подешавања екрана? + .keep-changes = Задржи измене + .change-prompt = Измене подешавања ће се самостално вратити за { $time } секунди. + .revert-settings = Врати подешавања +navigate = Навигирај +workspaces-overview-thumbnails = Сличице прегледа радних простора + .show-number = Прикажи број радног простора + .show-name = Прикажи назив радног простора +color = Боја + .depth = Дубина боје + .profile = Профил боје + .sidebar = Профили боја + .temperature = Температура боје +hex = Хекс +magnifier = Лупа + .controls = + Или употребите ове пречице: { $zoom_in -> + [zero] { "" } + *[other] + { "" } + { $zoom_in } за увећање, + }{ $zoom_out -> + [zero] { "" } + *[other] + { "" } + { $zoom_out } за умањење, + } + Супер + помакните точком миша + .scroll_controls = Омогући увећање мишем или додирном таблом помоћу Супер + помицање + .show_overlay = Прикажи прекривање лупе + .increment = Корак увећања + .signin = Покрени лупу при пријави + .applet = Окини лупу у програмчићу на траци + .movement = Померање увећаног прегледа + .continuous = Континуирано показивачем + .onedge = Када показивач досегне ивицу + .centered = За задржавање показивача на средини +colors = Боје +administrator = Администратор + .desc = Администратори могу да промене подешавања за све кориснике, као и да додају и уклоне друге кориснике +scan-to-connect-description = Скенирај КР код да би се повезао на ову мрежу. +modified = { $count } измењено +sound-usb-audio = УСБ аудио +sound-device-profiles = Профили уређаја +sound-hd-audio = ХД аудио +shadow-and-corners = Сенка и углови прозора +shadows-tiling = Поплочани прозори + .clip = Поклопи системске углове + .shadow = Примени сенке +shadows-floating = Лебдећи прозори + .clip = Поклопи системске углове и примени сенке +sound-device-port-unplugged = Ископчано +workspaces-overview = Преглед радних простора + .action-on-typing = Радња при куцању + .none = Ништа + .launcher = Отвори покретач + .applications = Отварање програма +xdg-entry-touchpad = Додирна табла +time-region = Регион и језик +power = Напајање и батерија +xdg-entry-wired = Жичана +xdg-entry-startup-apps-comment = Подеси програме који се покрећу при пријави +xdg-entry-region-language = Регион и језик +time-date = Датум и време + .auto = Постави самостално + .auto-ntp = Датум и време ће се самостално ажурирати када се постави временска зона +xdg-entry-mouse-keywords = COSMIC;Mouse;Acceleration;Scrolling;Космик;миш;убрзање;помицање;Kosmik;miš;ubrzanje;pomicanje; +xdg-entry-bluetooth-comment = Управљај Блутут уређајима +xdg-entry-notifications-keywords = COSMIC;Notification;Lock;Космик;обавештење;закључавање;Kosmik;obaveštenje;zaključavanje; +xdg-entry-startup-apps-keywords = COSMIC;Startup;Application;Космик;Покретање;Програм;kosmik;pokretanje;program; +xdg-entry-default-apps-comment = Подразумевани веб-прегледач, програм за е-пошту, прегледач датотека и остали програми +xdg-entry-keyboard-comment = Извори уноса, пребацивање, унос посебних знакова, пречице +xdg-entry-wired-keywords = COSMIC;Wired;LAN;Network;Connection;Космик;Жичана;ЛАН;Мрежа;Веза;kosmik;žičana;lan;mreža;veza; +xdg-entry-power = Напајање и батерија +xdg-entry-appearance-keywords = COSMIC;Accent;Color;Icon;Font;Theme;Космик;Нагласак;Боја;Иконица;Фонт;Тема;kosmik;naglasak;boja;ikonica;font;tema +xdg-entry-mouse = Миш +xdg-entry-dock-keywords = COSMIC;Dock;Panel;Applet;Космик;Док;Окно;Програмчић;kosmik;dok;okno;programčić +bluetooth = Блутут + .status = Овај систем је видљив као { $aliases } док су подешавања за Блутут отворена. + .connected = Повезано + .connecting = Повезује се + .disconnecting = Веза се прекида + .connect = Повежи + .disconnect = Прекини везу + .forget = Заборави + .dbus-error = Дошло је до грешке при интеракцији са Д-сабирницом: { $why } + .disabled = Услуга блутута је онемогућена + .inactive = Услуга блутута није покренута + .unknown = Није могуће покренути услугу блутута. Да ли је BlueZ инсталиран? +xdg-entry-mouse-comment = Брзина миша, убрзање и природно помицање +xdg-entry-system = Систем и налози +firmware = Фирмвер +xdg-entry-panel-keywords = COSMIC;Panel;Applet;Космик;површ;програмчић;Kosmik;površ;programčić +xdg-entry-window-management = Управљање прозорима +xdg-entry-a11y = Приступачност +xdg-entry-time-language-comment = Управљај системским датумом, временом, облашћу и језиком +xdg-entry-desktop-keywords = COSMIC;Desktop;Космик;Радна површина;kosmik;radna površina; +default-apps = Подразумевани програми + .web-browser = Веб прегледач + .file-manager = Управник датотека + .mail-client = Програм за е-пошту + .music = Музика + .video = Видео + .photos = Фотографије + .calendar = Календар + .terminal = Терминал + .other-associations = Остала повезивања + .text-editor = Уређивач текста + .not-installed = Није инсталирано +xdg-entry-x11-applications-keywords = COSMIC;X11;Application;Game;Compatibility;Космик;Икс-11;Програм;Игрица;Усаглашеност;kosmik;iks-11;program;igrica;usaglašenost; +xdg-entry-displays-comment = Управљај подешавањима поставки екрана +xdg-entry-touchpad-keywords = COSMIC;Touchpad;Gesture;Космик;додирна табла;гест;Kosmik;dodirna tabla;gest; +xdg-entry-time-language = Време и језик +xdg-entry-users = Корисници +window-management = Управљање прозорима +xdg-entry-system-keywords = COSMIC;System;Info;Accounts;Firmware;Космик;Систем;Подаци;Налози;Фирмвер;kosmik;sistem;podaci;nalozi;firmver; +xdg-entry-default-apps = Подразумевани програми +xdg-entry-wireless-keywords = Космик;Бежична;Вај-фај;Мрежа;Веза; +xdg-entry-applications-comment = Подразумевани програми, почетни програми и подешавања усаглашености програма за Икс-11 +appearance = Изглед +mouse = Миш + .speed = Брзина миша + .acceleration = Омогући убрзање миша +dock = Док +xdg-entry-about-keywords = COSMIC;About;Космик;О програму;Kosmik;O programu +xdg-entry-panel = Површ +xdg-entry-notifications = Обавештења +display = Екрани + .arrangement = Распоред екрана + .arrangement-desc = Превуците екране да бисте их преуредили + .enable = Омогући екран + .external = { $size } { $output } спољни екран + .laptop = { $size } екран преносиног рачунара + .options = Подешавања приказа + .refresh-rate = Учесталост освежавања + .resolution = Резолуција + .scale = Размера + .additional-scale-options = Додатне могућности размере +xdg-entry-a11y-keywords = COSMIC;Accessibility;A11y;Screen;Reader;Magnifier;Contrast;Color;Космик;Приступачност;Екран;Читач;Лупа;Контраст;Боја;kosmik;pristupačnost;ekran;čitač;lupa;kontrast;boja; +xdg-entry-wireless-comment = Бежичне везе и профили везе +xdg-entry-desktop = Радна површина +xdg-entry-date-time-keywords = COSMIC;Time;Zone;Космик;Време;Зона;kosmik;vreme;zona; +xdg-entry-desktop-comment = Позадина, изглед, окно, док, управљање прозорима и подешавања радног простора +xdg-entry-wallpaper = Позадина +xdg-entry-keyboard = Тастатура +xdg-entry-a11y-comment = Читач екрана, лупа, велики контраст и филтери боја +xdg-entry-displays = Екрани +xdg-entry-network = Мрежа и бежична веза +sound = Звук +xdg-entry-date-time = Датум и време +notifications = Обавештења +xdg-entry-users-comment = Потврђивање идентитета и кориснички налози +startup-apps = Почетни програми + .add = Додај програм + .user = Програми који се покрећу када се пријавите + .none = Није додат ниједан програм за покретање + .remove-dialog-title = Уклонити { $name }? + .remove-dialog-description = Уклонити овај програм за покретање? + .add-startup-app = Додај програм за покретање +xdg-entry-input-comment = Подешавања тастатуре и миша +xdg-entry-bluetooth-keywords = COSMIC;Bluetooth;Космик;Блутут;kosmik;blutut; +about = О систему +input-devices = Улазни уређаји +xdg-entry-dock-comment = Необавезна трака за апликације и програмчиће +xdg-entry-network-keywords = COSMIC;Network;Wireless;WiFi;VPN;Космик;мрежа;бежична веза;бежична;ВПН;Kosmik;mreža;bežična veza;bežična;vpn; +xdg-entry-wallpaper-comment = Слике позадине, боје и могућности покретног приказа +xdg-entry-dock = Док +xdg-entry-startup-apps = Почетни програми +workspaces = Радни простори +xdg-entry-wireless = Бежична +xdg-entry-workspaces-keywords = COSMIC;WiFi;Wi-Fi;Network;Connection;Космик;Радни простор;Смер;Преглед;Монитор;kosmik;radni prostor;smer;pregled;monitor; +xdg-entry-system-comment = Подаци о систему, налози и ажурирања фирмвера +xdg-entry-x11-applications-comment = Размера програма прозорног система Икс-11, главни екран и опште пречице +xdg-entry-region-language-comment = Форматирајте датуме, време и бројеве на основу вашег региона +panel = Трака +xdg-entry-wallpaper-keywords = COSMIC;Wallpaper;Background;Slideshow;Космик;позадина;позадина;покретни приказ;Kosmik;pozadina;pozadina;pokretni prikaz; +xdg-entry-users-keywords = COSMIC;User;Account;Космик;корисник;налог;Kosmik;korisnik;nalog; +xdg-entry-about-comment = Назив уређаја, подаци о хардверу, подразумевана подешавања оперативног система +xdg-entry-vpn-keywords = COSMIC;VPN;Network;Connection;OpenVPN;OpenConnect;Космик;ВПН;мрежа;веза;ОпенВПН;ОпенКонект;kosmik;vpn;mreža;veza;openvpn;openkonekt; +users = Корисници + .admin = Админ + .standard = Обичан + .profile-add = Изаберите слику профила +xdg-entry-appearance-comment = Боје нагласка и теме +xdg-entry-time-language-keywords = COSMIC;System;Time;Date;Region;Language;Космик;систем;време;датум;област;језик;Kosmik;sistem;vreme;datum;oblast;jezik; +xdg-entry-input-keywords = COSMIC;Input;Keyboard;Mouse;Mice;Космик;Унос;Тастатура;Миш;Мишеви;kosmik;unos;tastatura;miš;miševi; +xdg-entry-comment = Програм Подешавања за Космик радну површину +xdg-entry-notifications-comment = Не узнемиравај, обавештења на закључаном екрану и подешавања по програмима +xdg-entry-applications = Програми +xdg-entry-sound-keywords = COSMIC;Sound;Audio;Alert;Pipewire;Космик;Звук;Аудио;Упозорење;Пајпвајер;kosmik;zvuk;audio;upozorenje;pajpvajer; +xdg-entry-power-keywords = COSMIC;Power;Battery;Космик;Напајање;Батерија;kosmik;napajanje;baterija +legacy-applications = Усаглашеност програма Икс-11 +xdg-entry-default-apps-keywords = COSMIC;Default;Application;Космик;Подразумевано;Програм;kosmik;podrazumevano;program +xdg-entry-keywords = COSMIC;Settings;Космик;Подешавања;kosmik;podešavanja; +xdg-entry-region-language-keywords = COSMIC;Region;Language;Date;Format;Time;Locale;Localization;Космик;Регион;Језик;Датум;Формат;Време;Локалитет;Локализација;kosmik;region;jezik;datum;format;vreme;lokalitet;lokalizacija; +xdg-entry-about = О програму +xdg-entry-input = Улазни уређаји +xdg-entry-applications-keywords = COSMIC;Default;Application;Startup;X11;Compatibility;Космик;Подразумевано;Програм;Покретање;Икс-11;Усаглашеност;kosmik;podrazumevano;program;pokretanje;iks-11;usaglašenost +xdg-entry-sound-comment = Подешавања звука за уређаје, упозорења и програме +wallpaper = Позадина + .change = Промени слику сваких + .fit = Уклапање позадине + .folder-dialog = Изаберите фасциклу позадине + .image-dialog = Изаберите слику позадине + .plural = Позадине + .same = Иста позадина на свим екранима + .slide = Покретни приказ +xdg-entry-touchpad-comment = Брзина додирне табле, могућности клика и гестова +xdg-entry-keyboard-keywords = COSMIC;Keyboard;Input;Source;Shortcuts;Космик;тастатура;унос;извор;пречице;Kosmik;tastatura;unos;izvor;prečice; +xdg-entry-vpn-comment = ВПН везе и профили везе +keyboard = Тастатура +xdg-entry-appearance = Изглед +xdg-entry-window-management-keywords = COSMIC;Window;Management;Tiling;Super;Key;Космик;Прозор;Управљање;Поплочавање;Супер;Тастер;kosmik;prozor;upravljanje;popločavanje;super;taster; +xdg-entry-workspaces-comment = Смер радних простора, преглед и понашање са више екрана +xdg-entry-network-comment = Управљај мрежним везама +xdg-entry-panel-comment = Примарна системска трака за изборнике и програмчиће +touchpad = Додирна табла + .acceleration = Омогући убрзање додирне табле + .speed = Брзина додирне табле +xdg-entry-sound = Звук +xdg-entry-power-comment = Режими напајања и могућности уштеде енергије +xdg-entry-displays-keywords = COSMIC;Display;Космик;Екран;kosmik;ekran; +time = Време и језик +xdg-entry-workspaces = Радни простори +xdg-entry-date-time-comment = Временска зона, самостална подешавања сата и форматирање времена +xdg-entry-x11-applications = Усаглашеност програма Икс-11 +xdg-entry-window-management-comment = Радња Супер тастера, могућности управљања прозором и додатне могућности поплочавања прозора +xdg-entry-wired-comment = Жичане везе и профили везе +known-networks = Познате мреже +network-and-wireless = Мрежа и бежична веза +keyboard-special-char = Унос посебних знакова + .alternate = Тастер заменских знакова + .compose = Саставни тастер + .compose-desc = Саставни тастер омогућава унос великого броја различитих знакова. Да бисте га користили, притисните саставни тастер, а затим низ знакова. На пример, саставни тастер праћено словима C и o унеће ©, док саставни тастер праћено словима a и ‘ унеће á. + .caps = Тастер Caps Lock +system-shortcut = Систем + .app-library = Отвори библиотеку програма + .brightness-down = Смањи осветљење екрана + .brightness-up = Повећај осветљење екрана + .display-toggle = Промени стање унутрашњег екрана + .home-folder = Отвори личну фасциклу + .keyboard-brightness-down = Смањи осветљење тастатуре + .keyboard-brightness-up = Повећај осветљење тастатуре + .launcher = Отвори покретач + .log-out = Одјави се + .lock-screen = Закључај екран + .mute = Утишај аудио излаз + .mute-mic = Утишај микрофонски улаз + .play-pause = Пусти/паузирај + .play-next = Следећа нумера + .play-prev = Претходна нумера + .poweroff = Искључи + .screenshot = Направи снимак екрана + .suspend = Обустави + .terminal = Отвори терминал + .touchpad-toggle = Промени стање додирне табле + .volume-lower = Смањи јачину звука на излазу + .volume-raise = Повећај јачину звука на излазу + .web-browser = Отвори веб прегледач + .window-switcher = Пребаци између отворених прозора + .window-switcher-previous = Пребаци између отворених прозора у обратном смеру + .workspace-overview = Отвори преглед радног простора +workspaces-navigation = Навигација + .wraparound = Померите се између првог и последњег радног простора помоћу пречица на тастатури и гестова +no-search-results = Ниједна мрежа се не поклопи са вашом претрагом. diff --git a/i18n/sv/cosmic_settings.ftl b/i18n/sv/cosmic_settings.ftl index 5f216c2..c2e5f33 100644 --- a/i18n/sv/cosmic_settings.ftl +++ b/i18n/sv/cosmic_settings.ftl @@ -926,3 +926,9 @@ xdg-entry-region-language-keywords = COSMIC;Region;Språk;Datum;Format;Tid;Lokal xdg-entry-keyboard-keywords = COSMIC;Tangentbord;Inmatning;Källa;Genvägar; xdg-entry-window-management-keywords = COSMIC;Fönster;Hantering;Kaklande;Super;Tangent; no-search-results = Inga nätverk matchar din sökning. +workspaces-navigation = Navigering + .wraparound = Flytta mellan första och sista arbetsytan med hjälp av tangentbordsgenvägar och gester +bluetooth-display-passkey = Bluetooth-koppling + .description = Mata in följande säkerhetskod på { $device }, tryck sedan Enter +bluetooth-display-pin = Bluetooth-koppling + .description = Ange följande PIN på { $device }, tryck sedan Enter diff --git a/i18n/uk/cosmic_settings.ftl b/i18n/uk/cosmic_settings.ftl index 82c9769..3a2ab8a 100644 --- a/i18n/uk/cosmic_settings.ftl +++ b/i18n/uk/cosmic_settings.ftl @@ -524,7 +524,7 @@ users = Користувачі .standard = Звичайний .profile-add = Вибрати зображення профілю remove = Вилучити -connect = З'єднати +connect = З’єднати password = Пароль username = Ім'я користувача settings = Налаштування @@ -544,10 +544,10 @@ no-networks = Мереж не знайдено. no-vpn = Немає доступних VPN-з'єднань. password-confirm = Підтвердити пароль visible-networks = Видимі мережі -auth-dialog = Авторизація обов'язкова +auth-dialog = Авторизація обов’язкова .vpn-description = Введіть ім’я користувача та пароль, необхідні для служби VPN. - .wifi-description = Введіть пароль або ключ шифрування. Також можна підключитися через кнопку «WPS» на маршрутизаторі. -forget-dialog = Забути цю Wi-Fi мережу? + .wifi-description = Введіть пароль або ключ шифрування. Також можна під’єднатися через кнопку «WPS» на маршрутизаторі. +forget-dialog = Забути цю Wi‑Fi-мережу? .description = Вам потрібно буде знову ввести пароль, щоб використовувати цю мережу в майбутньому. network-device-state = .activated = З'єднано @@ -564,9 +564,9 @@ network-device-state = .unknown = Невідомий стан .unmanaged = Некерований .unplugged = Дріт від'єднано -remove-connection-dialog = Вилучити профіль з'єднання? +remove-connection-dialog = Вилучити профіль з’єднання? .vpn-description = Щоб скористатися цією мережею знову, вам потрібно буде повторно ввести пароль. - .wired-description = Щоб скористатися цим підключенням знову, вам потрібно буде створити цей профіль повторно. + .wired-description = Щоб скористатися цим з’єднанням знову, вам потрібно буде створити цей профіль повторно. vpn = VPN .connections = VPN з'єднання .error = Не вдалося додати налаштування VPN @@ -591,7 +591,7 @@ wifi = Wi-Fi .adapter = Бездротовий адаптер { $id } .forget = Забути цю мережу wireguard-dialog = Додати пристрій WireGuard - .description = Оберіть ім'я пристрою для профілю WireGuard. + .description = Оберіть назву пристрою для профілю WireGuard. activate = Активувати confirm = Підтвердити enable = Увімкнути @@ -607,11 +607,11 @@ bluetooth = Bluetooth .disabled = Служба Bluetooth вимкнена .inactive = Служба Bluetooth неактивна .unknown = Неможливо активувати службу Bluetooth. Можливо, у вас не встановлено пакет BlueZ? -bluetooth-paired = З'єднані у минулому пристрої - .connect = З'єднати +bluetooth-paired = З’єднані у минулому пристрої + .connect = З’єднати .battery = { $percentage }% заряду bluetooth-confirm-pin = Перевірка PIN-коду між Bluetooth-пристроями - .description = Будь ласка, підтвердіть, що цей PIN-код збігається із тим, який відображається на іншому пристрої: { $device } + .description = Підтвердіть, що цей PIN-код збігається із тим, який показується на іншому пристрої: { $device } bluetooth-available = Пристрої поблизу bluetooth-adapters = Адаптери Bluetooth accessibility = Доступність @@ -630,7 +630,7 @@ dbus-connection-error = Не вдалося з'єднатися з DBus identity = Ідентичність magnifier = Лупа .controls = - Або скористайтеся такими скороченнями: { $zoom_in -> + Або скористайтеся такими сполученнями: { $zoom_in -> [zero] { "" } *[other] { "" } @@ -762,7 +762,7 @@ startup-apps = Автозапуск .add-startup-app = Додати застосунок до автозапуску legacy-applications = Сумісність із застосунками X11 legacy-app-global-shortcuts = Глобальні сполучення клавіш у застосунках X11 - .desc = Глобальні сполучення дозволяють іншим застосункам реагувати на натискання клавіш і кнопок миші, навіть якщо вони виконані в іншому застосунку, наприклад для функцій активації або вимкнення голосу кнопкою. За замовчуванням ця функція вимкнена у застосунках X11, щоб уникнути перехоплення чутливої інформації. + .desc = Глобальні сполучення дозволяють іншим застосункам реагувати на натискання клавіш і кнопок миші, навіть якщо вони виконані в іншому застосунку, наприклад, для функцій активації або вимкнення голосу кнопкою. Типово ця функція вимкнена у застосунках X11, щоб уникнути перехоплення чутливої інформації. .none = Ніякі клавіші .modifiers = Модифікатори (Super, Shift, Control, Alt) .combination = Усі клавіши у комбінації з клавішами Super, Control або Alt @@ -787,8 +787,8 @@ invalid-username = Неприпустиме ім'я користувача password-mismatch = Обидва паролі мусять збігатися save = Зберегти qr-code-unavailable = QR-код недоступний -network-name = Ім'я мережі -share = Ширити мережу +network-name = Назва мережі +share = Поділитись мережею scan-to-connect-description = Відскануйте QR-код, щоб з'єднатися з цією мережею. sound-hd-audio = HD Аудіо sound-usb-audio = USB Аудіо @@ -799,7 +799,7 @@ shadows-tiling = Укладені вікна .clip = Вирівняти до системних кутів .shadow = Застосувати тіні shadow-and-corners = Тіні й кути вікон -sound-device-port-unplugged = Відключено +sound-device-port-unplugged = Від’єднано place-here = Розмістити тут віджети workspaces-overview = Режим огляду робочих просторів .action-on-typing = Дія при введенні тексту @@ -864,7 +864,7 @@ xdg-entry-workspaces = Робочі простори xdg-entry-date-time-comment = Часовий пояс, автоматичне налаштування годинника та формат часу xdg-entry-x11-applications = Сумісність із застосунками X11 xdg-entry-window-management-comment = Дія клавіші Super, параметри керування вікнами та додаткові налаштування укладання вікон -xdg-entry-wired-comment = Дротове з'єднання і профілі підключень +xdg-entry-wired-comment = Дротове з’єднання і профілі з’єднань xdg-entry-desktop-comment = Тло, вигляд, панель, область завдань, керування вікнами та налаштування робочого простору xdg-entry-mouse-keywords = COSMIC;Миша;Прискорення;Прокручування;Гортання;КОСМІК;КОСМОС;КОСМІЧНЕ; xdg-entry-notifications-keywords = COSMIC;Сповіщення;Блокування;КОСМІК;КОСМОС;КОСМІЧНЕ; @@ -900,3 +900,5 @@ xdg-entry-displays-keywords = COSMIC;Дисплей;Екран;КОСМІК;КО xdg-entry-bluetooth-keywords = COSMIC;Bluetooth;Блютуз;Бездротове;З’єднання;КОСМІК;КОСМОС;КОСМІЧНЕ; xdg-entry-a11y-comment = Екранний читач, лупа, високий контраст і фільтри кольорів no-search-results = Пошук не дав результатів. +workspaces-navigation = Навігація + .wraparound = Перехід між першим і останнім робочим простором сполученнями клавіш і жестами diff --git a/i18n/zh-CN/cosmic_settings.ftl b/i18n/zh-CN/cosmic_settings.ftl index a8fab47..4b70052 100644 --- a/i18n/zh-CN/cosmic_settings.ftl +++ b/i18n/zh-CN/cosmic_settings.ftl @@ -120,6 +120,8 @@ vpn-error = VPN 错误 .connect = 连接 VPN 失败 .connection-editor = 连接编辑器失败 .connection-settings = 获取活跃连接设置失败 + .openvpn-config-path = OpenVPN 配置文件路径无效 + .openvpn-config-path-desc = 所选文件必须在本地文件系统上。 .updating-state = 更新网络管理器状态失败 .wireguard-config-path = WireGuard 配置文件路径无效 .wireguard-config-path-desc = 所选文件必须在本地文件系统上。 @@ -914,3 +916,9 @@ xdg-entry-keyboard-keywords = COSMIC;键盘;输入;输入源;快捷键; xdg-entry-window-management-keywords = COSMIC;窗口;管理;平铺;Super;键; xdg-entry-displays-keywords = COSMIC;显示器;屏幕; no-search-results = 无网络符合您的搜索。 +workspaces-navigation = 导航 + .wraparound = 使用快捷键和手势在第一个和最后个工作区间切换 +bluetooth-display-passkey = 蓝牙配对 + .description = 请在 { $device } 上输入以下密钥,然后按回车键 +bluetooth-display-pin = 蓝牙配对 + .description = 请在 { $device } 上输入以下 PIN 码,然后按回车键 diff --git a/i18n/zh-TW/cosmic_settings.ftl b/i18n/zh-TW/cosmic_settings.ftl index 413d3a4..5548cb8 100644 --- a/i18n/zh-TW/cosmic_settings.ftl +++ b/i18n/zh-TW/cosmic_settings.ftl @@ -60,6 +60,8 @@ vpn-error = VPN 錯誤 .connect = 連線至 VPN 失敗 .connection-editor = 連線編輯器失敗 .connection-settings = 取得活動連線的設定失敗 + .openvpn-config-path = OpenVPN 設定的檔案路徑無效 + .openvpn-config-path-desc = 所選檔案必須位於本機檔案系統上。 .updating-state = 更新網路管理員狀態失敗 .wireguard-config-path = WireGuard 設定的檔案路徑無效 .wireguard-config-path-desc = 所選檔案必須位於本機檔案系統上。 @@ -219,7 +221,7 @@ auto-switch = 在淺色與深色模式間自動切換 container-background = 容器背景 .desc-detail = 容器背景與導航列、側邊欄、對話方塊等元件相關,預設從應用程式或視窗背景進行衍生。 .reset = 重設至自動 - .desc = 容器背景色與導航列、側邊欄、對話方塊等元件相關 + .desc = 容器背景色與導覽列、側邊欄、對話方塊等元件相關 control-tint = 控制元件色調 .desc = 使用於標準按鈕、搜尋輸入、文字輸入和類似元件的背景 frosted = 系統介面呈現磨砂玻璃的透明效果 @@ -837,7 +839,7 @@ xdg-entry-power-keywords = COSMIC;電源;電池 xdg-entry-region-language-keywords = COSMIC;地區;語言;日期;格式;時間;本地;本地化; xdg-entry-sound-comment = 裝置、提醒和應用程式的音訊設定 xdg-entry-panel-comment = 主要系統列, 用於選單和工具程式 -xdg-entry-sound = 音響 +xdg-entry-sound = 音效 xdg-entry-power-comment = 電源模式和省電選項 xdg-entry-network-keywords = COSMIC;網路;無線;WiFi;VPN; xdg-entry-network-comment = 管理網路連線 @@ -911,3 +913,9 @@ shadows-tiling = 平鋪視窗 shadows-floating = 浮動視窗 .clip = 符合系統角型和套用陰影 no-search-results = 沒有網路符合您所要搜尋的。 +workspaces-navigation = 導覽 + .wraparound = 使用快捷鍵和手勢在第一個和最後個工作區間切換 +bluetooth-display-passkey = 藍牙配對 + .description = 請在 { $device } 上輸入密金鑰,然後按 Enter 鍵 +bluetooth-display-pin = 藍牙配對 + .description = 請在 { $device } 上輸入 PIN 碼,然後按 Enter 鍵 diff --git a/justfile b/justfile index deed88c..c25c959 100644 --- a/justfile +++ b/justfile @@ -53,26 +53,31 @@ heaptrack *args: check-features: #!/usr/bin/env bash set -ex - cargo check --no-default-features cargo check - for feature in \ - "page-accessibility" \ - "page-about" \ - "page-bluetooth" \ - "page-date" \ - "page-default-apps" \ - "page-display" \ - "page-input" \ - "page-legacy-applications" \ - "page-networking" \ - "page-power" \ - "page-region" \ - "page-sound" \ - "page-users" \ - "page-window-management" \ - "page-workspaces" + for service_manager in \ + "systemd" \ + "openrc" do - cargo check --no-default-features --features "${feature}" + cargo check --no-default-features --features "${service_manager}" + for feature in \ + "page-accessibility" \ + "page-about" \ + "page-bluetooth" \ + "page-date" \ + "page-default-apps" \ + "page-display" \ + "page-input" \ + "page-legacy-applications" \ + "page-networking" \ + "page-power" \ + "page-region" \ + "page-sound" \ + "page-users" \ + "page-window-management" \ + "page-workspaces" + do + cargo check --no-default-features --features "${feature},${service_manager}" + done done # Bump cargo version, create git commit, and create tag diff --git a/page/src/binder.rs b/page/src/binder.rs index b9aee2b..fe7f43e 100644 --- a/page/src/binder.rs +++ b/page/src/binder.rs @@ -3,15 +3,12 @@ use crate::section::{self, Section}; use crate::{Content, Info, Page}; -use cosmic::Element; -use cosmic::Task; use cosmic::app::ContextDrawer; +use cosmic::{Element, Task}; use regex::Regex; use slotmap::{SecondaryMap, SlotMap, SparseSecondaryMap}; -use std::{ - any::{Any, TypeId}, - collections::HashMap, -}; +use std::any::{Any, TypeId}; +use std::collections::HashMap; /// All settings pages are registered and managed by the [`Binder`]. pub struct Binder { diff --git a/page/src/lib.rs b/page/src/lib.rs index 23f894d..26335d5 100644 --- a/page/src/lib.rs +++ b/page/src/lib.rs @@ -5,7 +5,9 @@ mod binder; pub use binder::{AutoBind, Binder}; mod insert; -use cosmic::{Element, Task, app::ContextDrawer, iced::Subscription}; +use cosmic::app::ContextDrawer; +use cosmic::iced::Subscription; +use cosmic::{Element, Task}; use downcast_rs::{Downcast, impl_downcast}; pub use insert::Insert; diff --git a/pages/sound/Cargo.toml b/pages/sound/Cargo.toml new file mode 100644 index 0000000..29f6bb9 --- /dev/null +++ b/pages/sound/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cosmic-settings-sound" +version = "0.1.0" +edition = "2024" +rust-version.workspace = true + +[dependencies] +futures = "0.3.32" +intmap = "3.1.3" +tokio = { workspace = true, features = ["time"] } +tracing = "0.1.44" + +[dependencies.cosmic-settings-audio-client] +git = "https://github.com/pop-os/cosmic-settings-daemon" +features = ["codec"] diff --git a/pages/sound/src/lib.rs b/pages/sound/src/lib.rs new file mode 100644 index 0000000..575ef4c --- /dev/null +++ b/pages/sound/src/lib.rs @@ -0,0 +1,58 @@ +// Copyright 2026 System76 +// SPDX-License-Identifier: GPL-3.0-only + +pub mod model; +use std::sync::Arc; + +pub use cosmic_settings_audio_client as audio_client; +use futures::{SinkExt, StreamExt}; + +pub async fn subscribe( + mut emitter: futures::channel::mpsc::Sender, + apply_fn: fn(Message) -> T, +) { + loop { + let mut client = match audio_client::connect().await { + Ok(client) => client, + Err(why) => { + if let audio_client::zlink::Error::Io(ref why) = why + && why.kind() == std::io::ErrorKind::NotFound + { + tracing::error!("cosmic-settings-daemon varlink service not found."); + } else { + tracing::error!( + ?why, + "failed to connect to cosmic-settings's varlink service" + ); + } + + tokio::time::sleep(std::time::Duration::from_secs(3)).await; + continue; + } + }; + + if let Ok(Ok(mut stream)) = client.recv_events().await { + _ = emitter + .send(apply_fn(Message::Client(Arc::new(client)))) + .await; + while let Some(message) = stream.next().await { + match message { + Ok(event) => { + _ = emitter.send(apply_fn(Message::Subscription(event))).await; + } + Err(why) => { + tracing::error!(?why, "event error"); + } + } + } + } + } +} + +#[derive(Clone, Debug)] +pub enum Message { + /// Connection to `com.system76.CosmicSettings`. + Client(Arc), + /// Messages from the varlink audio client, + Subscription(audio_client::Event), +} diff --git a/pages/sound/src/model.rs b/pages/sound/src/model.rs new file mode 100644 index 0000000..87c6509 --- /dev/null +++ b/pages/sound/src/model.rs @@ -0,0 +1,480 @@ +// Copyright 2026 System76 +// SPDX-License-Identifier: GPL-3.0-only + +use std::sync::Arc; + +use cosmic_settings_audio_client::{self as audio_client, Availability, ProfileInfo, RouteInfo}; +use intmap::IntMap; + +pub type DeviceId = u32; +pub type NodeId = u32; + +#[derive(Debug, Default)] +pub struct Model { + #[allow(clippy::type_complexity)] + pub device_profile_dropdowns: Vec<(DeviceId, String, Option, Vec, Vec)>, + pub device_names: IntMap, + pub device_profiles: IntMap>, + pub device_profiles_active: IntMap, + pub device_routes: IntMap>, + pub node_devices: IntMap>, + pub sinks: Nodes, + pub sources: Nodes, + pub active_sink: ActiveNode, + pub active_source: ActiveNode, + pub default_sink: Option, + pub default_source: Option, + pub text: Text, +} + +#[derive(Debug, Default)] +pub struct Text { + pub hd_audio: String, + pub usb_audio: String, +} + +#[derive(Debug, Default)] +pub struct Nodes { + active: Option, + pub sorted_display: Vec>, + pub sorted_index: Vec, + pub balance: Vec>, + pub card_profile_device: Vec>, + pub description: Vec, + pub devices: Vec>, + pub display: Vec>, + pub mute: Vec, + pub name: Vec, + pub id: Vec, + pub volume: Vec, +} + +impl Nodes { + pub fn active(&self) -> Option { + self.active.and_then(|active| { + self.sorted_index + .iter() + .position(|idx| *idx as usize == active) + }) + } + + pub fn dropdown_sort(&mut self) { + let mut enumerated_displays = self + .display + .clone() + .into_iter() + .enumerate() + .map(|(index, display)| (index as u16, display)) + .collect::>(); + enumerated_displays.sort_by_key(|v| v.1.clone()); + let (indexes, displays): (Vec<_>, Vec<_>) = enumerated_displays.into_iter().unzip(); + self.sorted_display = displays; + self.sorted_index = indexes; + } + + pub fn remove(&mut self, node_id: u32) -> bool { + let Some(pos) = self.id.iter().position(|id| node_id == *id) else { + return false; + }; + self.balance.remove(pos); + self.card_profile_device.remove(pos); + self.description.remove(pos); + self.devices.remove(pos); + self.display.remove(pos); + self.mute.remove(pos); + self.name.remove(pos); + self.id.remove(pos); + self.volume.remove(pos); + self.dropdown_sort(); + if self.active == Some(pos) { + self.active = None; + } + true + } +} + +#[derive(Debug, Default)] +pub struct ActiveNode { + pub volume_text: String, + pub volume: u32, + pub balance: Option, + pub mute: bool, +} + +impl Model { + pub fn update(&mut self, event: audio_client::Event) { + tracing::info!(target: "sound", ?event, "update"); + match event { + audio_client::Event::NodeMute(node_id, mute) => { + if let Some(pos) = self.sinks.id.iter().position(|id| node_id == *id) { + self.sinks.mute[pos] = mute; + if self.sinks.active == Some(pos) { + self.active_sink.mute = mute; + } + } else if let Some(pos) = self.sources.id.iter().position(|id| node_id == *id) { + self.sources.mute[pos] = mute; + if self.sources.active == Some(pos) { + self.active_source.mute = mute; + } + } + } + + audio_client::Event::NodeVolume(node_id, volume, balance) => { + if let Some(pos) = self.sinks.id.iter().position(|id| node_id == *id) { + self.sinks.volume[pos] = volume; + self.sinks.balance[pos] = balance; + if self.default_sink.as_ref().is_some_and(|&id| id == node_id) + && let Some(pos) = self.sinks.active + { + self.active_sink.mute = self.sinks.mute[pos]; + self.active_sink.balance = balance; + self.active_sink.volume = self.sinks.volume[pos]; + self.active_sink.volume_text = self.active_sink.volume.to_string(); + } + } else if let Some(pos) = self.sources.id.iter().position(|id| node_id == *id) { + self.sources.volume[pos] = volume; + self.sources.balance[pos] = balance; + if self + .default_source + .as_ref() + .is_some_and(|&id| id == node_id) + && let Some(pos) = self.sources.active + { + self.active_source.mute = self.sources.mute[pos]; + self.active_source.volume = self.sources.volume[pos]; + self.active_source.volume_text = self.active_source.volume.to_string(); + } + } + } + + audio_client::Event::DefaultSink(node_id) => { + self.default_sink = Some(node_id); + if let Some(pos) = self.sinks.id.iter().position(|&id| id == node_id) { + self.sinks.active = Some(pos); + self.active_sink.mute = self.sinks.mute[pos]; + self.active_sink.volume = self.sinks.volume[pos]; + self.active_sink.volume_text = self.active_sink.volume.to_string(); + } + } + + audio_client::Event::DefaultSource(node_id) => { + self.default_source = Some(node_id); + if let Some(pos) = self.sources.id.iter().position(|&id| id == node_id) { + self.sources.active = Some(pos); + self.active_source.mute = self.sources.mute[pos]; + self.active_source.volume = self.sources.volume[pos]; + self.active_source.volume_text = self.active_source.volume.to_string(); + } + } + + audio_client::Event::Device(device_id, device) => { + self.device_names + .insert(device_id, self.translate(&device.description)); + } + + audio_client::Event::Node(node_id, node) => { + self.node_devices.insert(node_id, node.device_id); + if node.is_sink { + let pos = if let Some(pos) = self.sinks.id.iter().position(|&id| id == node_id) + { + self.sinks.description[pos] = self.translate(&node.description); + self.sinks.name[pos] = node.name; + self.sinks.card_profile_device[pos] = node.card_profile_device; + pos + } else { + self.sinks.display.push(Arc::default()); + self.sinks + .description + .push(self.translate(&node.description)); + self.sinks.id.push(node_id); + self.sinks.volume.push(0); + self.sinks.balance.push(None); + self.sinks.mute.push(false); + self.sinks.name.push(node.name); + self.sinks.devices.push(node.device_id); + self.sinks + .card_profile_device + .push(node.card_profile_device); + self.sinks.id.len() - 1 + }; + + self.sinks.display[pos] = node + .device_id + .zip(node.card_profile_device) + .and_then(|(device_id, node_card_profile_device)| { + let routes = self.device_routes.get(device_id)?; + for route in routes { + if matches!(route.availability, Availability::No) || !route.is_sink + { + continue; + } + + if route.devices.contains(&node_card_profile_device) { + return Some(node_name( + &self.translate(&route.description), + &self.sinks.description[pos], + )); + } + } + + None + }) + .unwrap_or_else(|| { + node_name( + &node.device_profile_description, + &self.sinks.description[pos], + ) + }); + + self.sinks.dropdown_sort(); + + if let Some(default_node_id) = self.default_sink + && default_node_id == node_id + { + self.sinks.active = Some(pos); + self.active_sink.mute = self.sinks.mute[pos]; + self.active_sink.volume = self.sinks.volume[pos]; + self.active_sink.volume_text = self.active_sink.volume.to_string(); + } + } else { + let pos = + if let Some(pos) = self.sources.id.iter().position(|&id| id == node_id) { + self.sources.description[pos] = self.translate(&node.description); + self.sources.name[pos] = node.name; + self.sources.card_profile_device[pos] = node.card_profile_device; + pos + } else { + self.sources + .description + .push(self.translate(&node.description)); + self.sources.display.push(Arc::default()); + self.sources.id.push(node_id); + self.sources.volume.push(0); + self.sources.balance.push(None); + self.sources.mute.push(false); + self.sources.name.push(node.name); + self.sources.devices.push(node.device_id); + self.sources + .card_profile_device + .push(node.card_profile_device); + self.sources.id.len() - 1 + }; + + if let Some(name) = node.device_id.zip(node.card_profile_device).map_or_else( + || { + Some(node_name( + &node.device_profile_description, + &self.sources.description[pos], + )) + }, + |(device_id, node_card_profile_device)| { + let routes = self.device_routes.get(device_id)?; + for route in routes { + if route.is_sink || matches!(route.availability, Availability::No) { + continue; + } + + if route.devices.contains(&node_card_profile_device) { + return Some(node_name( + &self.translate(&route.description), + &self.sources.description[pos], + )); + } + } + + None + }, + ) { + self.sources.display[pos] = name; + self.sources.dropdown_sort(); + } else { + // Remove sources that are unplugged. + self.sources.remove(node_id); + return; + } + + if let Some(default_node_id) = self.default_source + && default_node_id == node_id + { + self.sources.active = Some(pos); + self.active_source.mute = self.sources.mute[pos]; + self.active_source.volume = self.sources.volume[pos]; + self.active_source.volume_text = self.active_source.volume.to_string(); + } + } + } + + audio_client::Event::ActiveRoute(device_id, _index, route) => { + self.update_device_names(device_id, &route); + } + + audio_client::Event::Route(device_id, index, route) => { + let routes = self.device_routes.entry(device_id).or_default(); + if routes.len() < index as usize + 1 { + let additional = (index as usize + 1) - routes.capacity(); + routes.reserve_exact(additional); + routes.extend(std::iter::repeat_n(RouteInfo::default(), additional)); + } + routes[index as usize] = route.clone(); + // self.update_device_names(device_id, &route); + } + + audio_client::Event::ActiveProfile(device_id, profile) => { + self.device_profiles_active.insert(device_id, profile); + self.update_device_profile_dropdowns(); + } + + audio_client::Event::Profile(device_id, index, profile) => { + let profiles = self.device_profiles.entry(device_id).or_default(); + if profiles.len() < index as usize + 1 { + let additional = (index as usize + 1) - profiles.capacity(); + profiles.reserve_exact(additional); + profiles.extend(std::iter::repeat_n(ProfileInfo::default(), additional)); + } + + profiles[index as usize] = profile; + self.update_device_profile_dropdowns(); + } + + audio_client::Event::RemoveNode(node_id) => { + self.node_devices.remove(node_id); + + if !self.sinks.remove(node_id) { + self.sources.remove(node_id); + } + } + + audio_client::Event::RemoveDevice(device_id) => { + self.device_names.remove(device_id); + self.device_profiles.remove(device_id); + self.device_profiles_active.remove(device_id); + self.device_routes.remove(device_id); + self.update_device_profile_dropdowns(); + } + + _ => (), + } + } + + pub fn translate(&self, description: &str) -> String { + description + .replace("High Definition", "HD") + .replace("DisplayPort", "DP") + .replace("Controller", "") + .replace("HD Audio", &self.text.hd_audio) + .replace("USB Audio", &self.text.usb_audio) + } + + fn update_device_names(&mut self, device_id: DeviceId, route: &RouteInfo) { + if matches!(route.availability, Availability::No) { + return; + } + + let compatible_nodes = self.node_devices.iter().filter_map(|(node, &dev_id)| { + if dev_id? == device_id { + Some(node) + } else { + None + } + }); + + if route.is_sink { + for n_id in compatible_nodes { + let Some(pos) = self.sinks.id.iter().position(|&node| node == n_id) else { + continue; + }; + + let Some(card_profile_device) = self.sinks.card_profile_device[pos] else { + continue; + }; + + if route.devices.contains(&card_profile_device) { + self.sinks.display[pos] = + node_name(&route.description, &self.sinks.description[pos]); + self.sinks.dropdown_sort(); + break; + } + } + } else { + for n_id in compatible_nodes { + let Some(pos) = self.sources.id.iter().position(|&node| node == n_id) else { + continue; + }; + + let Some(card_profile_device) = self.sources.card_profile_device[pos] else { + continue; + }; + + if route.devices.contains(&card_profile_device) { + self.sources.display[pos] = + node_name(&route.description, &self.sources.description[pos]); + self.sources.dropdown_sort(); + break; + } + } + } + } + + fn update_device_profile_dropdowns(&mut self) { + self.device_profile_dropdowns = self + .device_profiles + .iter() + .filter_map(|(device_id, profiles)| { + let name = self.device_names.get(device_id)?.as_str(); + let (active_profile, indexes, descriptions) = self + .device_profiles_active + .get(device_id) + .map(|profile| { + let (indexes, descriptions): (Vec<_>, Vec<_>) = profiles + .iter() + .filter(|p| { + p.index == profile.index + || !matches!(p.availability, audio_client::Availability::No) + }) + .map(|p| (p.index, p.description.clone())) + .collect(); + + let pos = profiles + .iter() + .filter(|p| { + p.index == profile.index + || !matches!(p.availability, audio_client::Availability::No) + }) + .enumerate() + .find(|(_, p)| p.index == profile.index) + .map(|(pos, _)| pos); + + (pos, indexes, descriptions) + }) + .unwrap_or_else(|| { + let (indexes, descriptions): (Vec<_>, Vec<_>) = profiles + .iter() + .filter(|p| !matches!(p.availability, audio_client::Availability::No)) + .map(|p| (p.index, p.description.clone())) + .collect(); + + (None, indexes, descriptions) + }); + + Some(( + device_id, + name.to_owned(), + active_profile, + indexes, + descriptions, + )) + }) + .collect::>(); + + self.device_profile_dropdowns.sort_by(|a, b| a.1.cmp(&b.1)); + } +} + +fn node_name(route: &str, node: &str) -> Arc { + if route.is_empty() { + node.to_owned() + } else { + [route, " - ", node].concat() + } + .into() +} diff --git a/pages/wallpapers/Cargo.toml b/pages/wallpapers/Cargo.toml index b148edb..3a67d87 100644 --- a/pages/wallpapers/Cargo.toml +++ b/pages/wallpapers/Cargo.toml @@ -4,8 +4,6 @@ version = "1.0.7" edition = "2024" rust-version.workspace = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] cosmic-bg-config = { workspace = true } cosmic-randr-shell = { workspace = true } @@ -16,7 +14,7 @@ fast_image_resize = { version = "6", features = [ ] } futures-lite = "2.6.1" futures-util = "0.3.32" -image = "0.25.9" +image.workspace = true infer = "0.19.0" jxl-oxide = { version = "0.12.5", features = ["image"] } tokio = { workspace = true, features = ["sync"] } diff --git a/pages/wallpapers/src/lib.rs b/pages/wallpapers/src/lib.rs index 498b424..a0b309b 100644 --- a/pages/wallpapers/src/lib.rs +++ b/pages/wallpapers/src/lib.rs @@ -6,16 +6,15 @@ use futures_util::StreamExt; use image::imageops::FilterType; use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage}; use jxl_oxide::integration::JxlDecoder; +use std::borrow::Cow; +use std::collections::HashMap; +use std::collections::hash_map::DefaultHasher; use std::fs::File; +use std::hash::{Hash, Hasher}; +use std::io::Read; use std::os::unix::ffi::OsStrExt; -use std::{ - borrow::Cow, - collections::{HashMap, hash_map::DefaultHasher}, - hash::{Hash, Hasher}, - io::Read, - path::{Path, PathBuf}, - pin::Pin, -}; +use std::path::{Path, PathBuf}; +use std::pin::Pin; use walkdir::WalkDir; pub const DEFAULT_COLORS: &[Color] = &[ @@ -104,6 +103,7 @@ pub async fn load_each_from_path( ) -> Pin>> { let candidate_paths: Vec<_> = WalkDir::new(path) .max_depth(3) + .follow_links(true) .into_iter() .filter_map(Result::ok) .filter(|entry| entry.file_type().is_file()) diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/accent b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/accent new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/accent @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/active_hint b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/active_hint new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/active_hint @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/alpha_map b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/alpha_map new file mode 100644 index 0000000..06f3e6a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/alpha_map @@ -0,0 +1,16 @@ +( + extremely_low: 0.9, + extremely_low_2: 0.87692, + very_low: 0.85385, + very_low_2: 0.83076, + low: 0.80769, + low_2: 0.78461, + medium: 0.76154, + medium_2: 0.73846, + high: 0.71538, + high_2: 0.69231, + very_high: 0.66023, + very_high_2: 0.64615, + extremely_high: 0.62308, + extremely_high_2: 0.6, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/bg_color b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/bg_color new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/bg_color @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/corner_radii b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/corner_radii new file mode 100644 index 0000000..7d52139 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/corner_radii @@ -0,0 +1,8 @@ +( + radius_0: (0.0, 0.0, 0.0, 0.0), + radius_xs: (4.0, 4.0, 4.0, 4.0), + radius_s: (8.0, 8.0, 8.0, 8.0), + radius_m: (16.0, 16.0, 16.0, 16.0), + radius_l: (32.0, 32.0, 32.0, 32.0), + radius_xl: (160.0, 160.0, 160.0, 160.0), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/destructive b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/destructive new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/destructive @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted new file mode 100644 index 0000000..55b60b7 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted @@ -0,0 +1 @@ +Medium \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_applets b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_applets new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_applets @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_panel b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_panel new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_panel @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_system_interface b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_system_interface new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_system_interface @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_windows b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_windows new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/frosted_windows @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/gaps b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/gaps new file mode 100644 index 0000000..6fe974b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/gaps @@ -0,0 +1 @@ +(0, 8) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/neutral_tint b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/neutral_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/neutral_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/palette b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/palette new file mode 100644 index 0000000..16e8c50 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/palette @@ -0,0 +1,35 @@ +( + name: "cosmic-dark", + bright_red: "#FFA09AFF", + bright_green: "#5EDB8CFF", + bright_orange: "#FFA37DFF", + gray_1: "#1B1B1BFF", + gray_2: "#262626FF", + neutral_0: "#000000FF", + neutral_1: "#030303FF", + neutral_2: "#161616FF", + neutral_3: "#2E2E2EFF", + neutral_4: "#484848FF", + neutral_5: "#636363FF", + neutral_6: "#808080FF", + neutral_7: "#9E9E9EFF", + neutral_8: "#BEBEBEFF", + neutral_9: "#DEDEDEFF", + neutral_10: "#FFFFFFFF", + accent_blue: "#63D0DFFF", + accent_indigo: "#A1C0EBFF", + accent_purple: "#E79CFEFF", + accent_pink: "#FF9CB1FF", + accent_red: "#FDA1A0FF", + accent_orange: "#FFAD00FF", + accent_yellow: "#F7E062FF", + accent_green: "#92CF9CFF", + accent_warm_grey: "#CABAB4FF", + ext_warm_grey: "#9B8E8AFF", + ext_orange: "#FFAD00FF", + ext_yellow: "#FEDB40FF", + ext_blue: "#48B9C7FF", + ext_purple: "#CF7DFFFF", + ext_pink: "#F93A83FF", + ext_indigo: "#3E88FFFF", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/primary_container_bg b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/primary_container_bg new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/primary_container_bg @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/secondary_container_bg b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/secondary_container_bg new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/secondary_container_bg @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/spacing b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/spacing new file mode 100644 index 0000000..464b264 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/spacing @@ -0,0 +1,12 @@ +( + space_none: 0, + space_xxxs: 4, + space_xxs: 8, + space_xs: 12, + space_s: 16, + space_m: 24, + space_l: 32, + space_xl: 48, + space_xxl: 64, + space_xxxl: 128, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/success b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/success new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/success @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/text_tint b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/text_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/text_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/warning b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/warning new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/warning @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/window_hint b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/window_hint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark.Builder/v2/window_hint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v1/list_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v1/list_button new file mode 100644 index 0000000..7ed0fdb --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v1/list_button @@ -0,0 +1,74 @@ +( + base: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + hover: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + pressed: ( + red: 0.08610422, + green: 0.08610421, + blue: 0.08610421, + alpha: 0.5, + ), + selected: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + selected_text: ( + red: 0.3882353, + green: 0.8156863, + blue: 0.8745098, + alpha: 1.0, + ), + focus: ( + red: 0.3882353, + green: 0.8156863, + blue: 0.8745098, + alpha: 1.0, + ), + divider: ( + red: 0.7532969, + green: 0.7532969, + blue: 0.75329685, + alpha: 0.2, + ), + on: ( + red: 0.7532969, + green: 0.7532969, + blue: 0.75329685, + alpha: 1.0, + ), + disabled: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + on_disabled: ( + red: 0.7532969, + green: 0.7532969, + blue: 0.75329685, + alpha: 0.65, + ), + border: ( + red: 0.743206, + green: 0.74320585, + blue: 0.74320585, + alpha: 1.0, + ), + disabled_border: ( + red: 0.743206, + green: 0.74320585, + blue: 0.74320585, + alpha: 0.5, + ), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent new file mode 100644 index 0000000..5519c3b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent @@ -0,0 +1,14 @@ +( + base: "#63D0DFFF", + hover: "#63BAC6FF", + pressed: "#3C737AFF", + selected: "#63BAC6FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#000000FF", + on: "#000000FF", + disabled: "#63D0DFFF", + on_disabled: "#326870FF", + border: "#63D0DFFF", + disabled_border: "#63D0DF80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_button new file mode 100644 index 0000000..0e79e51 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_button @@ -0,0 +1,14 @@ +( + base: "#63D0DFFF", + hover: "#63BAC6FF", + pressed: "#3C737AFF", + selected: "#63BAC6FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#030303FF", + on: "#000000FF", + disabled: "#63D0DFFF", + on_disabled: "#00000080", + border: "#63D0DFFF", + disabled_border: "#63D0DF80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_text b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_text new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/accent_text @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/active_hint b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/active_hint new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/active_hint @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/alpha_map b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/alpha_map new file mode 100644 index 0000000..06f3e6a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/alpha_map @@ -0,0 +1,16 @@ +( + extremely_low: 0.9, + extremely_low_2: 0.87692, + very_low: 0.85385, + very_low_2: 0.83076, + low: 0.80769, + low_2: 0.78461, + medium: 0.76154, + medium_2: 0.73846, + high: 0.71538, + high_2: 0.69231, + very_high: 0.66023, + very_high_2: 0.64615, + extremely_high: 0.62308, + extremely_high_2: 0.6, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/background b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/background new file mode 100644 index 0000000..8568268 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/background @@ -0,0 +1,20 @@ +( + base: "#1B1B1BFF", + component: ( + base: "#2E2E2EFF", + hover: "#434343FF", + pressed: "#585858FF", + selected: "#434343FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#C0C0C033", + on: "#C0C0C0FF", + disabled: "#2E2E2E80", + on_disabled: "#C0C0C0A6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#444444FF", + on: "#E7E7E7FF", + small_widget: "#27272740", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/button new file mode 100644 index 0000000..ea09e2d --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/button @@ -0,0 +1,14 @@ +( + base: "#9E9E9E40", + hover: "#63636366", + pressed: "#2B2B2B9F", + selected: "#63636366", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#C0C0C033", + on: "#C0C0C0FF", + disabled: "#9E9E9E20", + on_disabled: "#C0C0C0A6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/control_tint b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/control_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/control_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/corner_radii b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/corner_radii new file mode 100644 index 0000000..7d52139 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/corner_radii @@ -0,0 +1,8 @@ +( + radius_0: (0.0, 0.0, 0.0, 0.0), + radius_xs: (4.0, 4.0, 4.0, 4.0), + radius_s: (8.0, 8.0, 8.0, 8.0), + radius_m: (16.0, 16.0, 16.0, 16.0), + radius_l: (32.0, 32.0, 32.0, 32.0), + radius_xl: (160.0, 160.0, 160.0, 160.0), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive new file mode 100644 index 0000000..428c1d1 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive @@ -0,0 +1,14 @@ +( + base: "#FFA09AFF", + hover: "#E0948FFF", + pressed: "#8A5B58FF", + selected: "#E0948FFF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#000000FF", + on: "#000000FF", + disabled: "#FFA09AFF", + on_disabled: "#80504DFF", + border: "#FFA09AFF", + disabled_border: "#FFA09A80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive_button new file mode 100644 index 0000000..fc8066f --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/destructive_button @@ -0,0 +1,14 @@ +( + base: "#FFA09AFF", + hover: "#E0948FFF", + pressed: "#8A5B58FF", + selected: "#E0948FFF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#030303FF", + on: "#000000FF", + disabled: "#FFA09AFF", + on_disabled: "#00000080", + border: "#FFA09AFF", + disabled_border: "#FFA09A80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted new file mode 100644 index 0000000..55b60b7 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted @@ -0,0 +1 @@ +Medium \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_applets b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_applets new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_applets @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_panel b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_panel new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_panel @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_system_interface b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_system_interface new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_system_interface @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_windows b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_windows new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/frosted_windows @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/gaps b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/gaps new file mode 100644 index 0000000..6fe974b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/gaps @@ -0,0 +1 @@ +(0, 8) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/icon_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/icon_button new file mode 100644 index 0000000..cb5fa87 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/icon_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#63636333", + pressed: "#16161680", + selected: "#63636333", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#BEBEBE33", + on: "#BEBEBEFF", + disabled: "#00000000", + on_disabled: "#BEBEBEA6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_dark b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_dark new file mode 100644 index 0000000..f32a580 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_dark @@ -0,0 +1 @@ +true \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_high_contrast b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_high_contrast new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/is_high_contrast @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/link_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/link_button new file mode 100644 index 0000000..eec0dff --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/link_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#00000000", + pressed: "#00000000", + selected: "#00000000", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#63D0DF33", + on: "#63D0DFFF", + disabled: "#00000000", + on_disabled: "#32687080", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/name b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/name new file mode 100644 index 0000000..7147ddb --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/name @@ -0,0 +1 @@ +"cosmic-dark" \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/palette b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/palette new file mode 100644 index 0000000..16e8c50 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/palette @@ -0,0 +1,35 @@ +( + name: "cosmic-dark", + bright_red: "#FFA09AFF", + bright_green: "#5EDB8CFF", + bright_orange: "#FFA37DFF", + gray_1: "#1B1B1BFF", + gray_2: "#262626FF", + neutral_0: "#000000FF", + neutral_1: "#030303FF", + neutral_2: "#161616FF", + neutral_3: "#2E2E2EFF", + neutral_4: "#484848FF", + neutral_5: "#636363FF", + neutral_6: "#808080FF", + neutral_7: "#9E9E9EFF", + neutral_8: "#BEBEBEFF", + neutral_9: "#DEDEDEFF", + neutral_10: "#FFFFFFFF", + accent_blue: "#63D0DFFF", + accent_indigo: "#A1C0EBFF", + accent_purple: "#E79CFEFF", + accent_pink: "#FF9CB1FF", + accent_red: "#FDA1A0FF", + accent_orange: "#FFAD00FF", + accent_yellow: "#F7E062FF", + accent_green: "#92CF9CFF", + accent_warm_grey: "#CABAB4FF", + ext_warm_grey: "#9B8E8AFF", + ext_orange: "#FFAD00FF", + ext_yellow: "#FEDB40FF", + ext_blue: "#48B9C7FF", + ext_purple: "#CF7DFFFF", + ext_pink: "#F93A83FF", + ext_indigo: "#3E88FFFF", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/primary b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/primary new file mode 100644 index 0000000..c779f21 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/primary @@ -0,0 +1,20 @@ +( + base: "#272727FF", + component: ( + base: "#363636FF", + hover: "#4A4A4AFF", + pressed: "#5E5E5EFF", + selected: "#4A4A4AFF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#CACACA33", + on: "#CACACAFF", + disabled: "#36363680", + on_disabled: "#CACACAA6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#515151FF", + on: "#F8F8F8FF", + small_widget: "#34343440", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/secondary b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/secondary new file mode 100644 index 0000000..069a373 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/secondary @@ -0,0 +1,20 @@ +( + base: "#343434FF", + component: ( + base: "#3B3B3BFF", + hover: "#4F4F4FFF", + pressed: "#626262FF", + selected: "#4F4F4FFF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#D0D0D033", + on: "#D0D0D0FF", + disabled: "#3B3B3B80", + on_disabled: "#D0D0D0A6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#515151FF", + on: "#C7C7C7FF", + small_widget: "#41414140", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/shade b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/shade new file mode 100644 index 0000000..1afc7ab --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/shade @@ -0,0 +1 @@ +"#00000052" \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/spacing b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/spacing new file mode 100644 index 0000000..464b264 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/spacing @@ -0,0 +1,12 @@ +( + space_none: 0, + space_xxxs: 4, + space_xxs: 8, + space_xs: 12, + space_s: 16, + space_m: 24, + space_l: 32, + space_xl: 48, + space_xxl: 64, + space_xxxl: 128, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success new file mode 100644 index 0000000..8bdbb8b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success @@ -0,0 +1,14 @@ +( + base: "#5EDB8CFF", + hover: "#5FC384FF", + pressed: "#3A7851FF", + selected: "#5FC384FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#000000FF", + on: "#000000FF", + disabled: "#5EDB8CFF", + on_disabled: "#2F6E46FF", + border: "#5EDB8CFF", + disabled_border: "#5EDB8C80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success_button new file mode 100644 index 0000000..972c4f3 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/success_button @@ -0,0 +1,14 @@ +( + base: "#5EDB8CFF", + hover: "#5FC384FF", + pressed: "#3A7851FF", + selected: "#5FC384FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#030303FF", + on: "#000000FF", + disabled: "#5EDB8CFF", + on_disabled: "#00000080", + border: "#5EDB8CFF", + disabled_border: "#5EDB8C80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_button new file mode 100644 index 0000000..cd17f71 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#63636333", + pressed: "#16161680", + selected: "#63636333", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#63D0DF33", + on: "#63D0DFFF", + disabled: "#00000000", + on_disabled: "#63D0DFA6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_tint b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/text_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_background b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_background new file mode 100644 index 0000000..8981793 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_background @@ -0,0 +1,20 @@ +( + base: "#1B1B1B99", + component: ( + base: "#2E2E2E99", + hover: "#2E2E2E99", + pressed: "#2E2E2E99", + selected: "#2E2E2E99", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#C0C0C033", + on: "#C0C0C099", + disabled: "#2E2E2E4C", + on_disabled: "#C0C0C0A6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#414141AD", + on: "#E7E7E799", + small_widget: "#27272740", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_primary b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_primary new file mode 100644 index 0000000..3f25243 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_primary @@ -0,0 +1,20 @@ +( + base: "#272727E6", + component: ( + base: "#363636E6", + hover: "#363636E6", + pressed: "#363636E6", + selected: "#363636E6", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#CACACA33", + on: "#CACACAE6", + disabled: "#36363673", + on_disabled: "#CACACAA6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#505050EB", + on: "#F8F8F8E6", + small_widget: "#34343440", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_secondary b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_secondary new file mode 100644 index 0000000..b2a0ac2 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/transparent_secondary @@ -0,0 +1,20 @@ +( + base: "#343434FF", + component: ( + base: "#3B3B3BFF", + hover: "#3B3B3BFF", + pressed: "#3B3B3BFF", + selected: "#3B3B3BFF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#D0D0D033", + on: "#D0D0D0FF", + disabled: "#3B3B3B80", + on_disabled: "#D0D0D0A6", + border: "#BEBEBEFF", + disabled_border: "#BEBEBE80", + ), + divider: "#515151FF", + on: "#C7C7C7FF", + small_widget: "#41414140", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning new file mode 100644 index 0000000..944161b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning @@ -0,0 +1,14 @@ +( + base: "#FFA37DFF", + hover: "#E09678FF", + pressed: "#8A5C49FF", + selected: "#E09678FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#000000FF", + on: "#000000FF", + disabled: "#FFA37DFF", + on_disabled: "#80523FFF", + border: "#FFA37DFF", + disabled_border: "#FFA37D80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning_button b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning_button new file mode 100644 index 0000000..e184d57 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/warning_button @@ -0,0 +1,14 @@ +( + base: "#FFA37DFF", + hover: "#E09678FF", + pressed: "#8A5C49FF", + selected: "#E09678FF", + selected_text: "#63D0DFFF", + focus: "#63D0DFFF", + divider: "#FFFFFFFF", + on: "#000000FF", + disabled: "#FFA37DFF", + on_disabled: "#00000080", + border: "#FFA37DFF", + disabled_border: "#FFA37D80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Dark/v2/window_hint b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/window_hint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Dark/v2/window_hint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/accent b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/accent new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/accent @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/active_hint b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/active_hint new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/active_hint @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/alpha_map b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/alpha_map new file mode 100644 index 0000000..06f3e6a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/alpha_map @@ -0,0 +1,16 @@ +( + extremely_low: 0.9, + extremely_low_2: 0.87692, + very_low: 0.85385, + very_low_2: 0.83076, + low: 0.80769, + low_2: 0.78461, + medium: 0.76154, + medium_2: 0.73846, + high: 0.71538, + high_2: 0.69231, + very_high: 0.66023, + very_high_2: 0.64615, + extremely_high: 0.62308, + extremely_high_2: 0.6, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/bg_color b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/bg_color new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/bg_color @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/corner_radii b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/corner_radii new file mode 100644 index 0000000..7d52139 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/corner_radii @@ -0,0 +1,8 @@ +( + radius_0: (0.0, 0.0, 0.0, 0.0), + radius_xs: (4.0, 4.0, 4.0, 4.0), + radius_s: (8.0, 8.0, 8.0, 8.0), + radius_m: (16.0, 16.0, 16.0, 16.0), + radius_l: (32.0, 32.0, 32.0, 32.0), + radius_xl: (160.0, 160.0, 160.0, 160.0), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/destructive b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/destructive new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/destructive @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted new file mode 100644 index 0000000..55b60b7 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted @@ -0,0 +1 @@ +Medium \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_applets b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_applets new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_applets @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_panel b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_panel new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_panel @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_system_interface b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_system_interface new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_system_interface @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_windows b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_windows new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/frosted_windows @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/gaps b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/gaps new file mode 100644 index 0000000..6fe974b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/gaps @@ -0,0 +1 @@ +(0, 8) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/neutral_tint b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/neutral_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/neutral_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/palette b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/palette new file mode 100644 index 0000000..71b3c7d --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/palette @@ -0,0 +1,35 @@ +Light(( + name: "cosmic-light", + bright_red: "#890418FF", + bright_green: "#00572CFF", + bright_orange: "#792C00FF", + gray_1: "#D7D7D7FF", + gray_2: "#E4E4E4FF", + neutral_0: "#FFFFFFFF", + neutral_1: "#DEDEDEFF", + neutral_2: "#BEBEBEFF", + neutral_3: "#9E9E9EFF", + neutral_4: "#808080FF", + neutral_5: "#636363FF", + neutral_6: "#484848FF", + neutral_7: "#2E2E2EFF", + neutral_8: "#161616FF", + neutral_9: "#030303FF", + neutral_10: "#000000FF", + accent_blue: "#00525AFF", + accent_indigo: "#2E496DFF", + accent_purple: "#68217CFF", + accent_pink: "#86043AFF", + accent_red: "#78292EFF", + accent_orange: "#624000FF", + accent_yellow: "#534800FF", + accent_green: "#185529FF", + accent_warm_grey: "#554742FF", + ext_warm_grey: "#9B8E8AFF", + ext_orange: "#FBB86CFF", + ext_yellow: "#F7E062FF", + ext_blue: "#6ACAD8FF", + ext_purple: "#D58CFFFF", + ext_pink: "#FF9CDDFF", + ext_indigo: "#95C4FCFF", +)) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/primary_container_bg b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/primary_container_bg new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/primary_container_bg @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/secondary_container_bg b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/secondary_container_bg new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/secondary_container_bg @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/spacing b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/spacing new file mode 100644 index 0000000..464b264 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/spacing @@ -0,0 +1,12 @@ +( + space_none: 0, + space_xxxs: 4, + space_xxs: 8, + space_xs: 12, + space_s: 16, + space_m: 24, + space_l: 32, + space_xl: 48, + space_xxl: 64, + space_xxxl: 128, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/success b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/success new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/success @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/text_tint b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/text_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/text_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/warning b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/warning new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/warning @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/window_hint b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/window_hint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light.Builder/v2/window_hint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v1/list_button b/resources/default_schema/com.system76.CosmicTheme.Light/v1/list_button new file mode 100644 index 0000000..2a63b93 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v1/list_button @@ -0,0 +1,74 @@ +( + base: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + hover: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + pressed: ( + red: 0.74320567, + green: 0.743206, + blue: 0.74320585, + alpha: 0.5, + ), + selected: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + selected_text: ( + red: 0.0, + green: 0.32156864, + blue: 0.3529412, + alpha: 1.0, + ), + focus: ( + red: 0.0, + green: 0.32156864, + blue: 0.3529412, + alpha: 1.0, + ), + divider: ( + red: 0.15292808, + green: 0.15292814, + blue: 0.15292796, + alpha: 0.2, + ), + on: ( + red: 0.15292808, + green: 0.15292814, + blue: 0.15292796, + alpha: 1.0, + ), + disabled: ( + red: 0.0, + green: 0.0, + blue: 0.0, + alpha: 0.0, + ), + on_disabled: ( + red: 0.15292808, + green: 0.15292814, + blue: 0.15292796, + alpha: 0.65, + ), + border: ( + red: 0.08610404, + green: 0.08610427, + blue: 0.08610421, + alpha: 1.0, + ), + disabled_border: ( + red: 0.08610404, + green: 0.08610427, + blue: 0.08610421, + alpha: 0.5, + ), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent new file mode 100644 index 0000000..adea896 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent @@ -0,0 +1,14 @@ +( + base: "#00525AFF", + hover: "#14555CFF", + pressed: "#5F888CFF", + selected: "#14555CFF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#FFFFFFFF", + on: "#FFFFFFFF", + disabled: "#00525AFF", + on_disabled: "#7FA8ACFF", + border: "#00525AFF", + disabled_border: "#00525A80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_button new file mode 100644 index 0000000..b9eb27a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_button @@ -0,0 +1,14 @@ +( + base: "#00525AFF", + hover: "#14555CFF", + pressed: "#5F888CFF", + selected: "#14555CFF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#DEDEDEFF", + on: "#FFFFFFFF", + disabled: "#00525AFF", + on_disabled: "#FFFFFF80", + border: "#00525AFF", + disabled_border: "#00525A80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_text b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_text new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/accent_text @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/active_hint b/resources/default_schema/com.system76.CosmicTheme.Light/v2/active_hint new file mode 100644 index 0000000..e440e5c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/active_hint @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/alpha_map b/resources/default_schema/com.system76.CosmicTheme.Light/v2/alpha_map new file mode 100644 index 0000000..06f3e6a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/alpha_map @@ -0,0 +1,16 @@ +( + extremely_low: 0.9, + extremely_low_2: 0.87692, + very_low: 0.85385, + very_low_2: 0.83076, + low: 0.80769, + low_2: 0.78461, + medium: 0.76154, + medium_2: 0.73846, + high: 0.71538, + high_2: 0.69231, + very_high: 0.66023, + very_high_2: 0.64615, + extremely_high: 0.62308, + extremely_high_2: 0.6, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/background b/resources/default_schema/com.system76.CosmicTheme.Light/v2/background new file mode 100644 index 0000000..70dc626 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/background @@ -0,0 +1,20 @@ +( + base: "#D7D7D7FF", + component: ( + base: "#F5F5F5FF", + hover: "#F6F6F6FF", + pressed: "#F7F7F7FF", + selected: "#F6F6F6FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#27272733", + on: "#272727FF", + disabled: "#F5F5F580", + on_disabled: "#272727A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#B0B0B0FF", + on: "#121212FF", + small_widget: "#CACACA40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/button new file mode 100644 index 0000000..5b5826a --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/button @@ -0,0 +1,14 @@ +( + base: "#2E2E2E40", + hover: "#2B2B2B66", + pressed: "#6868689F", + selected: "#2B2B2B66", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#27272733", + on: "#272727FF", + disabled: "#2E2E2E20", + on_disabled: "#272727A6", + border: "#161616FF", + disabled_border: "#16161680", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/control_tint b/resources/default_schema/com.system76.CosmicTheme.Light/v2/control_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/control_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/corner_radii b/resources/default_schema/com.system76.CosmicTheme.Light/v2/corner_radii new file mode 100644 index 0000000..7d52139 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/corner_radii @@ -0,0 +1,8 @@ +( + radius_0: (0.0, 0.0, 0.0, 0.0), + radius_xs: (4.0, 4.0, 4.0, 4.0), + radius_s: (8.0, 8.0, 8.0, 8.0), + radius_m: (16.0, 16.0, 16.0, 16.0), + radius_l: (32.0, 32.0, 32.0, 32.0), + radius_xl: (160.0, 160.0, 160.0, 160.0), +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive b/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive new file mode 100644 index 0000000..a13c718 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive @@ -0,0 +1,14 @@ +( + base: "#890418FF", + hover: "#811727FF", + pressed: "#A3616BFF", + selected: "#811727FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#FFFFFFFF", + on: "#FFFFFFFF", + disabled: "#890418FF", + on_disabled: "#C4828CFF", + border: "#890418FF", + disabled_border: "#89041880", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive_button new file mode 100644 index 0000000..bb2de29 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/destructive_button @@ -0,0 +1,14 @@ +( + base: "#890418FF", + hover: "#811727FF", + pressed: "#A3616BFF", + selected: "#811727FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#DEDEDEFF", + on: "#FFFFFFFF", + disabled: "#890418FF", + on_disabled: "#FFFFFF80", + border: "#890418FF", + disabled_border: "#89041880", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted new file mode 100644 index 0000000..55b60b7 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted @@ -0,0 +1 @@ +Medium \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_applets b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_applets new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_applets @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_panel b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_panel new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_panel @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_system_interface b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_system_interface new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_system_interface @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_windows b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_windows new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/frosted_windows @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/gaps b/resources/default_schema/com.system76.CosmicTheme.Light/v2/gaps new file mode 100644 index 0000000..6fe974b --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/gaps @@ -0,0 +1 @@ +(0, 8) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/icon_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/icon_button new file mode 100644 index 0000000..52138d5 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/icon_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#63636333", + pressed: "#BEBEBE80", + selected: "#63636333", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#16161633", + on: "#161616FF", + disabled: "#00000000", + on_disabled: "#161616A6", + border: "#161616FF", + disabled_border: "#16161680", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_dark b/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_dark new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_dark @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_high_contrast b/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_high_contrast new file mode 100644 index 0000000..02e4a84 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/is_high_contrast @@ -0,0 +1 @@ +false \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/link_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/link_button new file mode 100644 index 0000000..826da6e --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/link_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#00000000", + pressed: "#00000000", + selected: "#00000000", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#00525A33", + on: "#00525AFF", + disabled: "#00000000", + on_disabled: "#00292D80", + border: "#161616FF", + disabled_border: "#16161680", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/name b/resources/default_schema/com.system76.CosmicTheme.Light/v2/name new file mode 100644 index 0000000..9dce5c6 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/name @@ -0,0 +1 @@ +"cosmic-light" \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/palette b/resources/default_schema/com.system76.CosmicTheme.Light/v2/palette new file mode 100644 index 0000000..3b9eda9 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/palette @@ -0,0 +1,35 @@ +( + name: "cosmic-light", + bright_red: "#890418FF", + bright_green: "#00572CFF", + bright_orange: "#792C00FF", + gray_1: "#D7D7D7FF", + gray_2: "#E4E4E4FF", + neutral_0: "#FFFFFFFF", + neutral_1: "#DEDEDEFF", + neutral_2: "#BEBEBEFF", + neutral_3: "#9E9E9EFF", + neutral_4: "#808080FF", + neutral_5: "#636363FF", + neutral_6: "#484848FF", + neutral_7: "#2E2E2EFF", + neutral_8: "#161616FF", + neutral_9: "#030303FF", + neutral_10: "#000000FF", + accent_blue: "#00525AFF", + accent_indigo: "#2E496DFF", + accent_purple: "#68217CFF", + accent_pink: "#86043AFF", + accent_red: "#78292EFF", + accent_orange: "#624000FF", + accent_yellow: "#534800FF", + accent_green: "#185529FF", + accent_warm_grey: "#554742FF", + ext_warm_grey: "#9B8E8AFF", + ext_orange: "#FBB86CFF", + ext_yellow: "#F7E062FF", + ext_blue: "#6ACAD8FF", + ext_purple: "#D58CFFFF", + ext_pink: "#FF9CDDFF", + ext_indigo: "#95C4FCFF", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/primary b/resources/default_schema/com.system76.CosmicTheme.Light/v2/primary new file mode 100644 index 0000000..8610d9c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/primary @@ -0,0 +1,20 @@ +( + base: "#EBEBEBFF", + component: ( + base: "#DADADAFF", + hover: "#DEDEDEFF", + pressed: "#E2E2E2FF", + selected: "#DEDEDEFF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#14141433", + on: "#141414FF", + disabled: "#DADADA80", + on_disabled: "#141414A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#C2C2C2FF", + on: "#202020FF", + small_widget: "#DDDDDD40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/secondary b/resources/default_schema/com.system76.CosmicTheme.Light/v2/secondary new file mode 100644 index 0000000..cb87ef0 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/secondary @@ -0,0 +1,20 @@ +( + base: "#FCFCFCFF", + component: ( + base: "#F5F5F5FF", + hover: "#F6F6F6FF", + pressed: "#F7F7F7FF", + selected: "#F6F6F6FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#27272733", + on: "#272727FF", + disabled: "#F5F5F580", + on_disabled: "#272727A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#D2D2D2FF", + on: "#2C2C2CFF", + small_widget: "#EEEEEE40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/shade b/resources/default_schema/com.system76.CosmicTheme.Light/v2/shade new file mode 100644 index 0000000..8714b7f --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/shade @@ -0,0 +1 @@ +"#00000014" \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/spacing b/resources/default_schema/com.system76.CosmicTheme.Light/v2/spacing new file mode 100644 index 0000000..464b264 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/spacing @@ -0,0 +1,12 @@ +( + space_none: 0, + space_xxxs: 4, + space_xxs: 8, + space_xs: 12, + space_s: 16, + space_m: 24, + space_l: 32, + space_xl: 48, + space_xxl: 64, + space_xxxl: 128, +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/success b/resources/default_schema/com.system76.CosmicTheme.Light/v2/success new file mode 100644 index 0000000..0b24f8c --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/success @@ -0,0 +1,14 @@ +( + base: "#00572CFF", + hover: "#145937FF", + pressed: "#5F8A75FF", + selected: "#145937FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#FFFFFFFF", + on: "#FFFFFFFF", + disabled: "#00572CFF", + on_disabled: "#7FAB96FF", + border: "#00572CFF", + disabled_border: "#00572C80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/success_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/success_button new file mode 100644 index 0000000..8e69154 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/success_button @@ -0,0 +1,14 @@ +( + base: "#00572CFF", + hover: "#145937FF", + pressed: "#5F8A75FF", + selected: "#145937FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#DEDEDEFF", + on: "#FFFFFFFF", + disabled: "#00572CFF", + on_disabled: "#FFFFFF80", + border: "#00572CFF", + disabled_border: "#00572C80", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_button new file mode 100644 index 0000000..b95c9c0 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_button @@ -0,0 +1,14 @@ +( + base: "#00000000", + hover: "#63636333", + pressed: "#BEBEBE80", + selected: "#63636333", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#00525A33", + on: "#00525AFF", + disabled: "#00000000", + on_disabled: "#00525AA6", + border: "#161616FF", + disabled_border: "#16161680", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_tint b/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_tint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/text_tint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_background b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_background new file mode 100644 index 0000000..8f9a00d --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_background @@ -0,0 +1,20 @@ +( + base: "#D7D7D799", + component: ( + base: "#F5F5F599", + hover: "#F5F5F599", + pressed: "#F5F5F599", + selected: "#F5F5F599", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#27272733", + on: "#27272799", + disabled: "#F5F5F54C", + on_disabled: "#272727A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#9B9B9BAD", + on: "#12121299", + small_widget: "#CACACA40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_primary b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_primary new file mode 100644 index 0000000..d1f0b03 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_primary @@ -0,0 +1,20 @@ +( + base: "#EBEBEBD9", + component: ( + base: "#DADADAD9", + hover: "#DADADAD9", + pressed: "#DADADAD9", + selected: "#DADADAD9", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#14141433", + on: "#141414D9", + disabled: "#DADADA6C", + on_disabled: "#141414A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#BCBCBCE0", + on: "#202020D9", + small_widget: "#DDDDDD40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_secondary b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_secondary new file mode 100644 index 0000000..b8753f1 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/transparent_secondary @@ -0,0 +1,20 @@ +( + base: "#FCFCFCFF", + component: ( + base: "#F5F5F5FF", + hover: "#F5F5F5FF", + pressed: "#F5F5F5FF", + selected: "#F5F5F5FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#27272733", + on: "#272727FF", + disabled: "#F5F5F580", + on_disabled: "#272727A6", + border: "#161616FF", + disabled_border: "#16161680", + ), + divider: "#D2D2D2FF", + on: "#2C2C2CFF", + small_widget: "#EEEEEE40", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning b/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning new file mode 100644 index 0000000..b84809e --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning @@ -0,0 +1,14 @@ +( + base: "#792C00FF", + hover: "#753714FF", + pressed: "#9B755FFF", + selected: "#753714FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#FFFFFFFF", + on: "#FFFFFFFF", + disabled: "#792C00FF", + on_disabled: "#BC967FFF", + border: "#792C00FF", + disabled_border: "#792C0080", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning_button b/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning_button new file mode 100644 index 0000000..695ca71 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/warning_button @@ -0,0 +1,14 @@ +( + base: "#792C00FF", + hover: "#753714FF", + pressed: "#9B755FFF", + selected: "#753714FF", + selected_text: "#00525AFF", + focus: "#00525AFF", + divider: "#000000FF", + on: "#FFFFFFFF", + disabled: "#792C00FF", + on_disabled: "#FFFFFF80", + border: "#792C00FF", + disabled_border: "#792C0080", +) \ No newline at end of file diff --git a/resources/default_schema/com.system76.CosmicTheme.Light/v2/window_hint b/resources/default_schema/com.system76.CosmicTheme.Light/v2/window_hint new file mode 100644 index 0000000..4af1832 --- /dev/null +++ b/resources/default_schema/com.system76.CosmicTheme.Light/v2/window_hint @@ -0,0 +1 @@ +None \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index f35f369..fb5449a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.90.0" +channel = "1.93.0" components = ["clippy", "rustfmt"] diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..c1578aa --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +imports_granularity = "Module" diff --git a/subscriptions/a11y-manager/src/lib.rs b/subscriptions/a11y-manager/src/lib.rs index 0bcd849..ba9b8e4 100644 --- a/subscriptions/a11y-manager/src/lib.rs +++ b/subscriptions/a11y-manager/src/lib.rs @@ -1,17 +1,11 @@ use cosmic_protocols::a11y::v1::client::cosmic_a11y_manager_v1::{self, ActiveState}; use num_derive::{FromPrimitive, ToPrimitive}; -use sctk::{ - reexports::{ - calloop::{self, LoopSignal, channel}, - calloop_wayland_source::WaylandSource, - client::{ - ConnectError, Connection, Dispatch, Proxy, WEnum, - globals::{GlobalListContents, registry_queue_init}, - protocol::wl_registry, - }, - }, - registry::RegistryState, -}; +use sctk::reexports::calloop::{self, LoopSignal, channel}; +use sctk::reexports::calloop_wayland_source::WaylandSource; +use sctk::reexports::client::globals::{GlobalListContents, registry_queue_init}; +use sctk::reexports::client::protocol::wl_registry; +use sctk::reexports::client::{ConnectError, Connection, Dispatch, Proxy, WEnum}; +use sctk::registry::RegistryState; use tokio::sync::mpsc; #[derive(Debug, Clone, Copy)] diff --git a/subscriptions/airplane-mode/src/lib.rs b/subscriptions/airplane-mode/src/lib.rs index 1e326e7..48f4c8e 100644 --- a/subscriptions/airplane-mode/src/lib.rs +++ b/subscriptions/airplane-mode/src/lib.rs @@ -42,8 +42,9 @@ fn is_airplane_mode(rfkill_state: &HashMap) -> bool { mod rfkill { use futures::stream::Stream; + use std::collections::HashMap; use std::os::unix::fs::OpenOptionsExt; - use std::{collections::HashMap, fs, io, mem, slice}; + use std::{fs, io, mem, slice}; use tokio::io::unix::AsyncFd; // /usr/include/linux/rfkill.h diff --git a/subscriptions/bluetooth/src/adapter.rs b/subscriptions/bluetooth/src/adapter.rs index eb5de34..756f893 100644 --- a/subscriptions/bluetooth/src/adapter.rs +++ b/subscriptions/bluetooth/src/adapter.rs @@ -2,13 +2,11 @@ // SPDX-License-Identifier: MPL-2.0 use crate::{Active, Event}; -use std::{ - collections::HashMap, - convert::Infallible, - hash::{Hash, Hasher}, - path::PathBuf, - time::Duration, -}; +use std::collections::HashMap; +use std::convert::Infallible; +use std::hash::{Hash, Hasher}; +use std::path::PathBuf; +use std::time::Duration; use zbus::zvariant::OwnedObjectPath; #[derive(Default, Debug, Clone)] diff --git a/subscriptions/bluetooth/src/agent.rs b/subscriptions/bluetooth/src/agent.rs index cb7e7db..99fcaae 100644 --- a/subscriptions/bluetooth/src/agent.rs +++ b/subscriptions/bluetooth/src/agent.rs @@ -40,7 +40,7 @@ pub async fn watch( bluez .register_agent( &agent_path, - <&'static str>::from(bluez_zbus::agent1::Capability::DisplayYesNo), + <&'static str>::from(bluez_zbus::agent1::Capability::KeyboardDisplay), ) .await?; diff --git a/subscriptions/bluetooth/src/device.rs b/subscriptions/bluetooth/src/device.rs index aec4a72..2ba1854 100644 --- a/subscriptions/bluetooth/src/device.rs +++ b/subscriptions/bluetooth/src/device.rs @@ -3,11 +3,9 @@ use crate::{Active, Event}; use futures::join; -use std::{ - collections::HashMap, - hash::{Hash, Hasher}, - time::Duration, -}; +use std::collections::HashMap; +use std::hash::{Hash, Hasher}; +use std::time::Duration; use zbus::zvariant::OwnedObjectPath; const DEFAILT_DEVICE_ICON: &str = "bluetooth-symbolic"; diff --git a/subscriptions/bluetooth/src/subscription.rs b/subscriptions/bluetooth/src/subscription.rs index c88b98f..b92b262 100644 --- a/subscriptions/bluetooth/src/subscription.rs +++ b/subscriptions/bluetooth/src/subscription.rs @@ -5,9 +5,11 @@ use crate::{AdapterUpdate, Device, DeviceUpdate, Event}; use std::pin::Pin; use bluez_zbus::BluetoothDevice; -use futures::{channel::mpsc, stream::FusedStream}; +use futures::channel::mpsc; +use futures::stream::FusedStream; use iced_futures::futures::{SinkExt, StreamExt}; -use zbus::{fdo, zvariant::OwnedObjectPath}; +use zbus::fdo; +use zbus::zvariant::OwnedObjectPath; enum DevicePropertyWatcherTask { Add(OwnedObjectPath), diff --git a/subscriptions/network-manager/Cargo.toml b/subscriptions/network-manager/Cargo.toml deleted file mode 100644 index e40a2a8..0000000 --- a/subscriptions/network-manager/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "cosmic-settings-network-manager-subscription" -version = "1.0.7" -edition = "2024" -license = "MPL-2.0" -rust-version.workspace = true -publish = true - -[dependencies] -cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings" } -secret-service = { version = "5.1.0", features = ["rt-tokio-crypto-rust"] } -nm-secret-agent-manager = { git = "https://github.com/pop-os/dbus-settings-bindings" } -futures = "0.3.32" -iced_futures = { git = "https://github.com/pop-os/libcosmic" } -itertools = "0.14.0" -secure-string = "0.3.0" -thiserror = "2.0.18" -tokio = "1.49.0" -tracing = "0.1.44" -zbus = { version = "5.13.2", features = ["tokio"] } -bitflags = "2.11.0" diff --git a/subscriptions/network-manager/LICENSE.md b/subscriptions/network-manager/LICENSE.md deleted file mode 100644 index 8dc5b15..0000000 --- a/subscriptions/network-manager/LICENSE.md +++ /dev/null @@ -1,359 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -## 1. Definitions - -### 1.1. "Contributor" -means each individual or legal entity that creates, contributes to -the creation of, or owns Covered Software. - -### 1.2. "Contributor Version" -means the combination of the Contributions of others (if any) used -by a Contributor and that particular Contributor's Contribution. - -### 1.3. "Contribution" -means Covered Software of a particular Contributor. - -### 1.4. "Covered Software" -means Source Code Form to which the initial Contributor has attached -the notice in Exhibit A, the Executable Form of such Source Code -Form, and Modifications of such Source Code Form, in each case -including portions thereof. - -### 1.5. "Incompatible With Secondary Licenses" -means - -+ (a) that the initial Contributor has attached the notice described -in Exhibit B to the Covered Software; or - -+ (b) that the Covered Software was made available under the terms of -version 1.1 or earlier of the License, but not also under the -terms of a Secondary License. - -### 1.6. "Executable Form" -means any form of the work other than Source Code Form. - -### 1.7. "Larger Work" -means a work that combines Covered Software with other material, in -a separate file or files, that is not Covered Software. - -### 1.8. "License" -means this document. - -### 1.9. "Licensable" -means having the right to grant, to the maximum extent possible, -whether at the time of the initial grant or subsequently, any and -all of the rights conveyed by this License. - -### 1.10. "Modifications" -means any of the following: - -+ (a) any file in Source Code Form that results from an addition to, -deletion from, or modification of the contents of Covered -Software; or - -+ (b) any new file in Source Code Form that contains any Covered -Software. - -### 1.11. "Patent Claims" of a Contributor -means any patent claim(s), including without limitation, method, -process, and apparatus claims, in any patent Licensable by such -Contributor that would be infringed, but for the grant of the -License, by the making, using, selling, offering for sale, having -made, import, or transfer of either its Contributions or its -Contributor Version. - -### 1.12. "Secondary License" -means either the GNU General Public License, Version 2.0, the GNU -Lesser General Public License, Version 2.1, the GNU Affero General -Public License, Version 3.0, or any later versions of those -licenses. - -### 1.13. "Source Code Form" -means the form of the work preferred for making modifications. - -### 1.14. "You" (or "Your") -means an individual or a legal entity exercising rights under this -License. For legal entities, "You" includes any entity that -controls, is controlled by, or is under common control with You. For -purposes of this definition, "control" means (a) the power, direct -or indirect, to cause the direction or management of such entity, -whether by contract or otherwise, or (b) ownership of more than -fifty percent (50%) of the outstanding shares or beneficial -ownership of such entity. - -## 2. License Grants and Conditions - -### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -+ (a) under intellectual property rights (other than patent or trademark) -Licensable by such Contributor to use, reproduce, make available, -modify, display, perform, distribute, and otherwise exploit its -Contributions, either on an unmodified basis, with Modifications, or -as part of a Larger Work; and - -+ (b) under Patent Claims of such Contributor to make, use, sell, offer -for sale, have made, import, and otherwise transfer either its -Contributions or its Contributor Version. - -### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -+ (a) for any code that a Contributor has removed from Covered Software; -or - -+ (b) for infringements caused by: (i) Your and any other third party's -modifications of Covered Software, or (ii) the combination of its -Contributions with other software (except as part of its Contributor -Version); or - -+ (c) under Patent Claims infringed by Covered Software in the absence of -its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -## 3. Responsibilities - -### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -+ (a) such Covered Software must also be made available in Source Code -Form, as described in Section 3.1, and You must inform recipients of -the Executable Form how they can obtain a copy of such Source Code -Form by reasonable means in a timely manner, at a charge no more -than the cost of distribution to the recipient; and - -+ (b) You may distribute such Executable Form under the terms of this -License, or sublicense it under different terms, provided that the -license for the Executable Form does not attempt to limit or alter -the recipients' rights in the Source Code Form under this License. - -### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -## 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -## 5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -## 6. Disclaimer of Warranty - -**Covered Software is provided under this License on an "as is" -basis, without warranty of any kind, either expressed, implied, or -statutory, including, without limitation, warranties that the -Covered Software is free of defects, merchantable, fit for a -particular purpose or non-infringing. The entire risk as to the -quality and performance of the Covered Software is with You. -Should any Covered Software prove defective in any respect, You -(not any Contributor) assume the cost of any necessary servicing, -repair, or correction. This disclaimer of warranty constitutes an -essential part of this License. No use of any Covered Software is -authorized under this License except under this disclaimer.** - - -#7. Limitation of Liability - -**Under no circumstances and under no legal theory, whether tort -(including negligence), contract, or otherwise, shall any -Contributor, or anyone who distributes Covered Software as -permitted above, be liable to You for any direct, indirect, -special, incidental, or consequential damages of any character -including, without limitation, damages for lost profits, loss of -goodwill, work stoppage, computer failure or malfunction, or any -and all other commercial damages or losses, even if such party -shall have been informed of the possibility of such damages. This -limitation of liability shall not apply to liability for death or -personal injury resulting from such party's negligence to the -extent applicable law prohibits such limitation. Some -jurisdictions do not allow the exclusion or limitation of -incidental or consequential damages, so this exclusion and -limitation may not apply to You.** - - -## 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -## 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -## 10. Versions of the License - -### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -### 10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - "Incompatible With Secondary Licenses" Notice - - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - diff --git a/subscriptions/network-manager/src/active_conns.rs b/subscriptions/network-manager/src/active_conns.rs deleted file mode 100644 index e902b2a..0000000 --- a/subscriptions/network-manager/src/active_conns.rs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use crate::Wrapper; - -use super::Event; -use cosmic_dbus_networkmanager::nm::NetworkManager; -use futures::{SinkExt, StreamExt}; -use iced_futures::{Subscription, stream}; -use std::{fmt::Debug, hash::Hash}; -use zbus::Connection; - -#[derive(Debug, Clone)] -pub enum State { - Continue(Connection), - Error, -} - -pub fn active_conns_subscription( - id: I, - conn: Connection, -) -> iced_futures::Subscription { - Subscription::run_with(Wrapper { id, conn: conn }, |Wrapper { id: _id, conn }| { - let conn = conn.clone(); - stream::channel(50, move |output| async move { - watch(conn, output).await; - futures::future::pending().await - }) - }) -} - -pub async fn watch(conn: zbus::Connection, mut output: futures::channel::mpsc::Sender) { - let mut state = State::Continue(conn); - - loop { - state = start_listening(state, &mut output).await; - } -} - -async fn start_listening( - state: State, - output: &mut futures::channel::mpsc::Sender, -) -> State { - let conn = match state { - State::Continue(conn) => conn, - State::Error => futures::future::pending().await, - }; - let network_manager = match NetworkManager::new(&conn).await { - Ok(n) => n, - Err(why) => { - tracing::error!(why = why.to_string(), "Failed to connect to NetworkManager"); - return State::Error; - } - }; - - let mut active_conns_changed = network_manager.receive_active_connections_changed().await; - active_conns_changed.next().await; - - while let (Some(_change), _) = futures::future::join( - active_conns_changed.next(), - tokio::time::sleep(tokio::time::Duration::from_secs(1)), - ) - .await - { - _ = output.send(Event::ActiveConns).await; - } - - State::Continue(conn) -} diff --git a/subscriptions/network-manager/src/available_wifi.rs b/subscriptions/network-manager/src/available_wifi.rs deleted file mode 100644 index f467092..0000000 --- a/subscriptions/network-manager/src/available_wifi.rs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use cosmic_dbus_networkmanager::{ - device::wireless::WirelessDevice, - interface::enums::{ApFlags, ApSecurityFlags, DeviceState}, -}; - -use futures::StreamExt; -use itertools::Itertools; -use std::{collections::HashMap, sync::Arc}; -use zbus::zvariant::ObjectPath; - -use super::hw_address::HwAddress; - -pub async fn handle_wireless_device( - device: WirelessDevice<'_>, - hw_address: Option, -) -> zbus::Result> { - device.request_scan(HashMap::new()).await?; - - let mut scan_changed = device.receive_last_scan_changed().await; - - if let Some(t) = scan_changed.next().await - && let Ok(-1) = t.get().await - { - tracing::error!("wireless device scan errored"); - return Ok(Default::default()); - } - - let access_points = device.get_access_points().await?; - - let state: DeviceState = device - .upcast() - .await - .and_then(|dev| dev.cached_state()) - .unwrap_or_default() - .map(|s| s.into()) - .unwrap_or_else(|| DeviceState::Unknown); - - // Sort by strength and remove duplicates - let mut aps = HashMap::::new(); - for ap in access_points { - let (ssid_res, strength_res) = futures::join!(ap.ssid(), ap.strength()); - - if let Some((ssid, strength)) = ssid_res.ok().zip(strength_res.ok()) { - let ssid = String::from_utf8_lossy(&ssid.clone()).into_owned(); - if let Some(access_point) = aps.get(&ssid) - && access_point.strength > strength - { - continue; - } - - let Ok(flags) = ap.rsn_flags().await else { - continue; - }; - let network_type = if flags.intersects(ApSecurityFlags::KEY_MGMT_802_1X) { - NetworkType::EAP - } else if flags.intersects(ApSecurityFlags::KEY_MGMTPSK | ApSecurityFlags::KEY_MGMT_SAE) - { - NetworkType::PskOrSae - } else if flags.intersects(ApSecurityFlags::KEY_MGMT_OWE) || flags.is_empty() { - NetworkType::Open - } else { - continue; - }; - - aps.insert( - ssid.clone(), - AccessPoint { - ssid: Arc::from(ssid), - strength, - state, - working: false, - path: ap.inner().path().to_owned(), - secured: !ap.wpa_flags().await?.is_empty(), - wps_push: ap.flags().await?.contains(ApFlags::WPS_PBC), - network_type, - hw_address: hw_address - .as_ref() - .and_then(|str_addr| HwAddress::from_str(str_addr)) - .unwrap_or_default(), - }, - ); - } - } - - let aps = aps - .into_values() - .sorted_by(|a, b| b.strength.cmp(&a.strength)) - .collect(); - - Ok(aps) -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct AccessPoint { - pub ssid: Arc, - pub strength: u8, - pub state: DeviceState, - pub working: bool, - pub path: ObjectPath<'static>, - pub hw_address: HwAddress, - pub secured: bool, - pub wps_push: bool, - pub network_type: NetworkType, -} - -// TODO do we want to support eap methods other than peap in the applet? -// Then we'd need a dropdown for the eap method, -// and tls requires a cert instead of a password -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum NetworkType { - Open, - PskOrSae, - EAP, -} diff --git a/subscriptions/network-manager/src/current_networks.rs b/subscriptions/network-manager/src/current_networks.rs deleted file mode 100644 index 2fc6b9b..0000000 --- a/subscriptions/network-manager/src/current_networks.rs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use cosmic_dbus_networkmanager::{ - active_connection::ActiveConnection, device::SpecificDevice, - interface::enums::ActiveConnectionState, -}; -use std::net::Ipv4Addr; - -pub async fn active_connections( - active_connections: Vec>, -) -> zbus::Result> { - let mut info = Vec::::with_capacity(active_connections.len()); - for connection in active_connections { - let ipv4 = connection - .ip4_config() - .await? - .address_data() - .await - .unwrap_or_default(); - let addresses: Vec<_> = ipv4.iter().map(|d| d.address).collect(); - let state = connection - .state() - .await - .unwrap_or(ActiveConnectionState::Unknown); - - if connection.vpn().await.unwrap_or_default() { - info.push(ActiveConnectionInfo::Vpn { - name: connection.id().await?, - ip_addresses: addresses.clone(), - }); - continue; - } - for device in connection.devices().await.unwrap_or_default() { - match device - .downcast_to_device() - .await - .ok() - .and_then(|inner| inner) - { - Some(SpecificDevice::Wired(wired_device)) => { - info.push(ActiveConnectionInfo::Wired { - name: connection.id().await?, - hw_address: wired_device.hw_address().await?, - speed: wired_device.speed().await?, - ip_addresses: addresses.clone(), - }); - } - Some(SpecificDevice::Wireless(wireless_device)) => { - if let Ok(access_point) = wireless_device.active_access_point().await { - info.push(ActiveConnectionInfo::WiFi { - name: String::from_utf8_lossy(&access_point.ssid().await?).into_owned(), - ip_addresses: addresses.clone(), - hw_address: wireless_device.hw_address().await?, - state, - strength: access_point.strength().await.unwrap_or_default(), - }); - } - } - Some(SpecificDevice::WireGuard(_)) => { - info.push(ActiveConnectionInfo::Vpn { - name: connection.id().await?, - ip_addresses: addresses.clone(), - }); - } - _ => {} - } - } - } - - info.sort_by(|a, b| { - let helper = |conn: &ActiveConnectionInfo| match conn { - ActiveConnectionInfo::Vpn { name, .. } => format!("0{name}"), - ActiveConnectionInfo::Wired { name, .. } => format!("1{name}"), - ActiveConnectionInfo::WiFi { name, .. } => format!("2{name}"), - }; - helper(a).cmp(&helper(b)) - }); - - Ok(info) -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum ActiveConnectionInfo { - Wired { - name: String, - hw_address: String, - speed: u32, - ip_addresses: Vec, - }, - WiFi { - name: String, - ip_addresses: Vec, - hw_address: String, - state: ActiveConnectionState, - strength: u8, - }, - Vpn { - name: String, - ip_addresses: Vec, - }, -} - -impl ActiveConnectionInfo { - pub fn name(&self) -> String { - match &self { - Self::Wired { name, .. } => name.clone(), - Self::WiFi { name, .. } => name.clone(), - Self::Vpn { name, .. } => name.clone(), - } - } -} diff --git a/subscriptions/network-manager/src/devices.rs b/subscriptions/network-manager/src/devices.rs deleted file mode 100644 index 235b0b5..0000000 --- a/subscriptions/network-manager/src/devices.rs +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use super::Event; -pub use cosmic_dbus_networkmanager::interface::enums::{ - ActiveConnectionState, DeviceState, DeviceType, -}; - -use core::hash; -use cosmic_dbus_networkmanager::nm::NetworkManager; -use futures::{SinkExt, StreamExt}; -use iced_futures::{self, Subscription, stream}; -use std::{fmt::Debug, hash::Hash, sync::Arc}; -use zbus::{Connection, zvariant::ObjectPath}; - -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct DeviceInfo { - pub path: ObjectPath<'static>, - pub device_type: DeviceType, - pub interface: String, - pub state: DeviceState, - pub active_connection: Option<(DeviceConnection, ActiveConnectionState)>, - pub available_connections: Vec, - pub known_connections: Vec, -} - -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct DeviceConnection { - pub path: ObjectPath<'static>, - pub id: String, - pub uuid: Arc, -} - -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct KnownDeviceConnection { - pub id: String, - pub uuid: Arc, -} - -pub async fn list( - conn: &zbus::Connection, - device_type_filter: fn(DeviceType) -> bool, -) -> zbus::Result> { - let nm = NetworkManager::new(conn).await?; - - let (devices, nm_settings) = futures::try_join!(nm.devices(), nm.settings())?; - - let connection_settings: &Vec<_> = &futures::stream::FuturesOrdered::from_iter( - nm_settings - .list_connections() - .await? - .into_iter() - .map(|connection| async move { connection.get_settings().await }), - ) - .filter_map(|res| async move { res.ok() }) - .collect() - .await; - - let device_iter = devices.into_iter().map(|device| async move { - let (interface, hw_address, device_type, state, available_connections) = - futures::try_join!( - device.interface(), - device.hw_address(), - device.device_type(), - device.state(), - device.available_connections() - ) - .ok()?; - - if !device_type_filter(device_type) { - return None; - } - - if hw_address.is_empty() { - return None; - } - - let (active_connection, available_connections) = futures::join!( - async { - let connection = device.active_connection().await?; - - let (id, uuid, state) = - futures::try_join!(connection.id(), connection.uuid(), connection.state())?; - - Ok::<_, zbus::Error>(( - DeviceConnection { - id, - uuid: Arc::from(uuid), - path: connection.inner().path().to_owned(), - }, - state, - )) - }, - futures::stream::FuturesOrdered::from_iter(available_connections.into_iter().map( - |conn| async move { - let path = conn.inner().path().to_owned(); - - let settings = conn.get_settings().await.ok()?; - - let id = settings - .get("connection")? - .get("id")? - .downcast_ref::() - .ok()?; - - let uuid = settings["connection"] - .get("uuid")? - .downcast_ref::() - .ok()?; - - Some(DeviceConnection { - id, - uuid: Arc::from(uuid), - path, - }) - } - ),) - .filter_map(|res| async move { res }) - .collect::>() - ); - - let known_connections = connection_settings - .iter() - .flat_map(|conn_settings| { - let connection = conn_settings.get("connection")?; - - let interface_name = connection - .get("interface-name")? - .downcast_ref::() - .ok()?; - - if interface_name != interface { - return None; - } - - let id = connection.get("id")?.downcast_ref::().ok()?; - let uuid = connection.get("uuid")?.downcast_ref::().ok()?; - - Some(KnownDeviceConnection { - uuid: Arc::from(uuid), - id, - }) - }) - .collect(); - - Some(DeviceInfo { - path: device.inner().path().to_owned(), - device_type, - interface, - state, - active_connection: active_connection.ok(), - known_connections, - available_connections, - }) - }); - - let devices_info = futures::stream::FuturesOrdered::from_iter(device_iter) - .filter_map(|res| async move { res }) - .collect::>() - .await; - - Ok(devices_info) -} - -pub fn subscription( - id: I, - has_popup: bool, - conn: Connection, -) -> iced_futures::Subscription { - struct Wrapper { - id: I, - has_popup: bool, - conn: Connection, - } - impl Hash for Wrapper { - fn hash(&self, state: &mut H) { - self.id.hash(state); - self.has_popup.hash(state); - } - } - Subscription::run_with( - Wrapper { - id, - has_popup, - conn, - }, - |Wrapper { - id, - has_popup, - conn, - }| { - let conn = conn.clone(); - let has_popup = *has_popup; - stream::channel(50, move |output| async move { - watch(conn, has_popup, output).await; - futures::future::pending().await - }) - }, - ) -} - -pub async fn watch( - conn: zbus::Connection, - has_popup: bool, - mut output: futures::channel::mpsc::Sender, -) { - let mut state = State::Continue(conn); - - loop { - state = start_listening(state, has_popup, &mut output).await; - } -} - -#[derive(Debug, Clone)] -pub enum State { - Continue(Connection), - Error, -} - -async fn start_listening( - state: State, - has_popup: bool, - output: &mut futures::channel::mpsc::Sender, -) -> State { - let conn = match state { - State::Continue(conn) => conn, - State::Error => futures::future::pending().await, - }; - let network_manager = match NetworkManager::new(&conn).await { - Ok(n) => n, - Err(why) => { - tracing::error!( - why = why.to_string(), - "failed to connect to network_manager" - ); - return State::Error; - } - }; - - let mut devices_changed = network_manager.receive_devices_changed().await; - - let secs = if has_popup { 4 } else { 60 }; - - while let (Some(_change), _) = futures::future::join( - devices_changed.next(), - tokio::time::sleep(tokio::time::Duration::from_secs(secs)), - ) - .await - { - _ = output.send(Event::Devices).await; - } - - State::Continue(conn) -} diff --git a/subscriptions/network-manager/src/hw_address.rs b/subscriptions/network-manager/src/hw_address.rs deleted file mode 100644 index db29158..0000000 --- a/subscriptions/network-manager/src/hw_address.rs +++ /dev/null @@ -1,38 +0,0 @@ -#[derive(Copy, Clone, PartialEq, Eq, Default, Debug, PartialOrd, Ord)] -pub struct HwAddress { - address: u64, -} - -impl HwAddress { - pub fn from_str(arg: &str) -> Option { - let columnless_vec = arg.split(":").collect::>(); - if columnless_vec.len() * 3 - 1 != arg.len() { - return None; - } - for byte in &columnless_vec { - if byte.len() != 2 { - return None; - } - } - u64::from_str_radix(columnless_vec.join("").as_str(), 16) - .ok() - .map(|address| HwAddress { address }) - } - pub fn from_string(arg: &str) -> Option { - HwAddress::from_str(arg) - } -} - -impl std::fmt::Display for HwAddress { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let hex = format!("{:#x}", self.address) - .trim_start_matches("0x") - .chars() - .collect::>() - .chunks(2) - .map(|chunk| chunk.iter().cloned().collect::()) - .collect::>() - .join(":"); - write!(f, "{}", hex) - } -} diff --git a/subscriptions/network-manager/src/lib.rs b/subscriptions/network-manager/src/lib.rs deleted file mode 100644 index 631eda9..0000000 --- a/subscriptions/network-manager/src/lib.rs +++ /dev/null @@ -1,1170 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -pub mod active_conns; -pub mod available_wifi; -pub mod current_networks; -pub mod devices; -pub mod hw_address; -pub mod nm_secret_agent; -pub mod wireless_enabled; - -use std::{collections::HashMap, fmt::Debug, hash::Hash, sync::Arc, time::Duration}; - -use available_wifi::NetworkType; -pub use cosmic_dbus_networkmanager as dbus; -pub use dbus::settings::connection::Settings; - -use cosmic_dbus_networkmanager::{ - device::SpecificDevice, - interface::{ - enums::{self, ActiveConnectionState, DeviceType, NmConnectivityState}, - settings::connection::ConnectionSettingsProxy, - }, - nm::NetworkManager, - settings::{NetworkManagerSettings, connection::Connection}, -}; -use futures::{ - FutureExt, SinkExt, StreamExt, - channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded}, -}; -use iced_futures::{Subscription, stream}; -use secure_string::SecureString; -use tokio::process::Command; -use zbus::zvariant::{self, ObjectPath, Value}; - -use self::{ - available_wifi::{AccessPoint, handle_wireless_device}, - current_networks::{ActiveConnectionInfo, active_connections}, -}; - -pub type SSID = Arc; -pub type UUID = Arc; - -pub(crate) struct Wrapper { - id: I, - conn: zbus::Connection, -} - -impl Hash for Wrapper { - fn hash(&self, state: &mut H) { - self.id.hash(state); - } -} - -#[derive(thiserror::Error, Debug)] -pub enum Error { - #[error("failed to list bluetooth devices with rfkill")] - BluetoothRfkillList(std::io::Error), - #[error("failed to activate connection")] - ConnectionActivate, - #[error("no wifi devices found")] - NoWiFiDevices, - #[error("zbus error")] - Zbus(#[from] zbus::Error), - #[error("missing connection field")] - MissingField(&'static str), -} - -#[derive(Debug)] -pub enum State { - Ready(zbus::Connection), - Waiting(zbus::Connection, UnboundedReceiver), - Finished, -} - -/// Reloads state on available connection changes. -pub async fn watch_connections_changed( - conn: zbus::Connection, - mut output: futures::channel::mpsc::Sender, -) { - let Ok(nm) = NetworkManager::new(&conn).await else { - return; - }; - - let mut device_stream = nm.receive_devices_changed().await; - - loop { - // Emits updates when available connections changes. - let connections_changed = std::pin::pin!(async { - let devices = nm.devices().await.unwrap_or_default(); - - let mut connection_streams = - futures::stream::FuturesUnordered::from_iter(devices.into_iter().map( - |device| async move { device.receive_available_connections_changed().await }, - )) - .collect::>() - .await; - - let mut available_connections = futures::stream::FuturesUnordered::from_iter( - connection_streams - .iter_mut() - .map(|stream| async { stream.next().await }), - ); - - loop { - _ = futures::join!( - available_connections.next(), - tokio::time::sleep(Duration::from_secs(3)) - ); - - // TODO: although it should consume the stream, the stream is never empty. - // while available_connections.next().now_or_never().is_some() {} - - let state = NetworkManagerState::new(&conn).await.unwrap_or_default(); - - _ = output - .send(Event::RequestResponse { - req: Request::Reload, - state, - success: true, - }) - .await; - } - }); - - // Reload the connection streams whenever devices change. - futures::future::select(connections_changed, device_stream.next()).await; - } -} - -pub fn subscription( - id: I, - conn: zbus::Connection, -) -> iced_futures::Subscription { - struct Wrapper { - id: I, - conn: zbus::Connection, - } - impl Hash for Wrapper { - fn hash(&self, state: &mut H) { - self.id.hash(state); - } - } - Subscription::run_with(Wrapper { id, conn }, |Wrapper { id, conn }| { - let conn = conn.clone(); - stream::channel( - 50, - |output: futures::channel::mpsc::Sender| async move { - watch(conn, output).await; - futures::future::pending().await - }, - ) - }) -} - -pub async fn watch(conn: zbus::Connection, mut output: futures::channel::mpsc::Sender) { - let mut state = State::Ready(conn); - - loop { - state = start_listening(state, &mut output).await; - } -} - -async fn start_listening( - state: State, - output: &mut futures::channel::mpsc::Sender, -) -> State { - match state { - State::Ready(conn) => { - let (tx, rx) = unbounded(); - - if output - .send(Event::Init { - conn: conn.clone(), - sender: tx, - state: NetworkManagerState::new(&conn).await.unwrap_or_default(), - }) - .await - .is_ok() - { - State::Waiting(conn, rx) - } else { - State::Finished - } - } - State::Waiting(conn, mut rx) => { - let network_manager = match NetworkManager::new(&conn).await { - Ok(n) => n, - Err(_) => return State::Finished, - }; - - match rx.next().await { - Some(Request::Deactivate(uuid)) => { - let mut success = false; - for c in network_manager - .active_connections() - .await - .unwrap_or_default() - { - if c.uuid().await.unwrap_or_default().as_str() == uuid.as_ref() - && network_manager.deactivate_connection(&c).await.is_ok() - { - success = true; - if let Ok(ActiveConnectionState::Deactivated) = c.state().await { - break; - } else { - let mut changed = c.receive_state_changed().await; - _ = tokio::time::timeout(Duration::from_secs(5), async move { - loop { - if let Some(next) = changed.next().await - && let Ok(ActiveConnectionState::Deactivated) = - next.get().await.map(ActiveConnectionState::from) - { - break; - } - } - }) - .await; - } - break; - } - } - - _ = request_response(&conn, Request::Deactivate(uuid.clone()), success) - .then(|event| output.send(event)) - .await; - } - - Some(Request::Disconnect(ssid)) => { - let mut success = false; - for c in network_manager - .active_connections() - .await - .unwrap_or_default() - { - if c.id().await.unwrap_or_default().as_str() == ssid.as_ref() - && network_manager.deactivate_connection(&c).await.is_ok() - { - success = true; - if let Ok(ActiveConnectionState::Deactivated) = c.state().await { - break; - } else { - let mut changed = c.receive_state_changed().await; - _ = tokio::time::timeout(Duration::from_secs(5), async move { - loop { - if let Some(next) = changed.next().await - && let Ok(ActiveConnectionState::Deactivated) = - next.get().await.map(ActiveConnectionState::from) - { - break; - } - } - }) - .await; - } - break; - } - } - - _ = request_response(&conn, Request::Disconnect(ssid.clone()), success) - .then(|event| output.send(event)) - .await; - } - - Some(Request::SetAirplaneMode(airplane_mode)) => { - // wifi - let mut success = network_manager - .set_wireless_enabled(!airplane_mode) - .await - .is_ok(); - // bluetooth - success = success - && Command::new("rfkill") - .arg(if airplane_mode { "block" } else { "unblock" }) - .arg("bluetooth") - .output() - .await - .is_ok(); - - let mut state = NetworkManagerState::new(&conn).await.unwrap_or_default(); - state.airplane_mode = if success { - airplane_mode - } else { - !airplane_mode - }; - if state.airplane_mode { - state.wifi_enabled = false; - } - - _ = output - .send(Event::RequestResponse { - req: Request::SetAirplaneMode(airplane_mode), - success, - state, - }) - .await; - } - - Some(Request::SetWiFi(enabled)) => { - let success = network_manager.set_wireless_enabled(enabled).await.is_ok(); - - let mut state = NetworkManagerState::new(&conn).await.unwrap_or_default(); - - state.wifi_enabled = if success { enabled } else { !enabled }; - - if state.wifi_enabled { - tokio::time::sleep(Duration::from_secs(3)).await; - } - - _ = request_response(&conn, Request::SetWiFi(enabled), success) - .then(|event| output.send(event)) - .await; - } - - Some(Request::Authenticate { - ssid, - identity, - password, - secret_tx, - interface, - }) => { - let nm_state = NetworkManagerState::new(&conn).await.unwrap_or_default(); - - let success = nm_state - .connect_wifi( - &conn, - &ssid, - identity.as_deref(), - Some(password.unsecure()), - secret_tx.clone(), - if identity.is_some() { - NetworkType::EAP - } else { - NetworkType::PskOrSae - }, - interface.clone(), - ) - .await - .is_ok(); - - _ = output - .send(Event::RequestResponse { - req: Request::Authenticate { - ssid: ssid.clone(), - identity: identity.clone(), - password: password.clone(), - secret_tx: secret_tx.clone(), - interface, - }, - success, - state: NetworkManagerState::new(&conn).await.unwrap_or_default(), - }) - .await; - } - - Some(Request::SelectAccessPoint(ssid, network_type, secret_tx, interface)) => { - if matches!(network_type, NetworkType::Open) { - attempt_wifi_connection(&conn, ssid, network_type, output, None, interface) - .await; - } else { - // For secured networks, check if we have saved credentials - let has_saved = has_saved_wifi_credentials(&conn, &ssid).await; - - if !has_saved { - return State::Waiting(conn, rx); - } - - // We have saved credentials, attempt connection - attempt_wifi_connection( - &conn, - ssid, - network_type, - output, - secret_tx, - interface, - ) - .await; - } - } - - Some(Request::Activate(device_path, connection_path)) => { - let mut success = true; - - if let Err(why) = network_manager - .activate_connection_by_paths(&connection_path, &device_path) - .await - { - tracing::error!( - ?why, - "failed to activate connection on {device_path:?} to {connection_path}" - ); - success = false; - }; - - _ = request_response( - &conn, - Request::Activate(device_path, connection_path), - success, - ) - .then(|event| output.send(event)) - .await; - } - - Some(Request::Reload) => { - _ = output - .send(request_response(&conn, Request::Reload, true).await) - .await; - } - - Some(Request::Remove(uuid)) => { - let s = match NetworkManagerSettings::new(&conn).await { - Ok(s) => s, - Err(why) => { - tracing::error!(?why, "error getting network manager settings"); - _ = output - .send(Event::RequestResponse { - req: Request::Forget(uuid.clone()), - success: false, - state: NetworkManagerState::new(&conn) - .await - .unwrap_or_default(), - }) - .await; - - return State::Waiting(conn, rx); - } - }; - - let known_conns = s.list_connections().await.unwrap_or_default(); - let mut success = false; - for c in known_conns { - let settings = c.get_settings().await.ok().unwrap_or_default(); - - let c_uuid = settings - .get("connection") - .and_then(|conn| conn.get("uuid")) - .and_then(|uuid| uuid.downcast_ref::().ok()) - .unwrap_or_default(); - - if uuid.as_ref() == c_uuid.as_str() { - _ = c.delete().await; - success = true; - } - } - - _ = request_response(&conn, Request::Remove(uuid.clone()), success) - .then(|event| output.send(event)) - .await; - } - - Some(Request::Forget(ssid)) => { - let s = match NetworkManagerSettings::new(&conn).await { - Ok(s) => s, - Err(why) => { - tracing::error!(?why, "error getting network manager settings"); - _ = output - .send(Event::RequestResponse { - req: Request::Forget(ssid.clone()), - success: false, - state: NetworkManagerState::new(&conn) - .await - .unwrap_or_default(), - }) - .await; - - return State::Waiting(conn, rx); - } - }; - - let known_conns = s.list_connections().await.unwrap_or_default(); - let mut success = false; - for c in known_conns { - let settings = c.get_settings().await.ok().unwrap_or_default(); - let s = Settings::new(settings); - if s.wifi - .clone() - .and_then(|w| w.ssid) - .and_then(|ssid| String::from_utf8(ssid).ok()) - .is_some_and(|s| s == ssid.as_ref()) - { - _ = c.delete().await; - success = true; - break; - } - } - - _ = request_response(&conn, Request::Forget(ssid.clone()), success) - .then(|event| output.send(event)) - .await; - } - - Some(Request::GetWiFiCredentials(ssid, uuid, security_type, secret_tx)) => { - let s = match NetworkManagerSettings::new(&conn).await { - Ok(s) => s, - Err(why) => { - tracing::error!(?why, "error getting network manager settings"); - return State::Waiting(conn, rx); - } - }; - - match security_type { - NetworkType::Open => { - _ = output - .send(Event::WiFiCredentials { - ssid: ssid.clone(), - password: None, - security_type, - }) - .await; - } - t => { - let (tx, rx) = tokio::sync::oneshot::channel(); - let setting_name = if matches!(t, NetworkType::PskOrSae) { - "802-11-wireless-security" - } else { - "802-1x" - }; - let pw_key = if matches!(t, NetworkType::PskOrSae) { - "psk" - } else { - "password" - }; - if let Some(secret_tx) = secret_tx { - let _ = secret_tx - .send(nm_secret_agent::Request::GetSecrets { - setting_name: setting_name.to_string(), - uuid: uuid.to_string(), - resp_tx: tx, - }) - .await; - let _ = tokio::time::timeout(Duration::from_secs(10), async move { - if let Some(password) = - rx.await.ok().and_then(|mut secrets| secrets.remove(pw_key)) - { - _ = output - .send(Event::WiFiCredentials { - ssid: ssid.clone(), - password: Some(password), - security_type, - }) - .await; - } else { - _ = output - .send(Event::WiFiCredentials { - ssid: ssid.clone(), - password: None, - security_type, - }) - .await; - } - }) - .await; - } else { - let known_conns = s.list_connections().await.unwrap_or_default(); - for c in known_conns { - let settings = c.get_settings().await.ok().unwrap_or_default(); - let settings_parsed = Settings::new(settings.clone()); - - if let Some(saved_ssid) = settings_parsed - .wifi - .clone() - .and_then(|w| w.ssid) - .and_then(|s| String::from_utf8(s).ok()) - && saved_ssid == ssid.as_ref() - { - let password = c - .get_secrets("802-11-wireless-security") - .await - .ok() - .and_then(|secrets| { - // Look for PSK password - secrets - .get("802-11-wireless-security") - .and_then(|sec| sec.get("psk")) - .and_then(|v| { - v.downcast_ref::().ok() - }) - .map(|s| s.to_string()) - .or_else(|| { - // Fallback to WEP key - secrets - .get("802-11-wireless-security") - .and_then(|sec| sec.get("wep-key0")) - .and_then(|v| { - v.downcast_ref::().ok() - }) - .map(|s| s.to_string()) - }) - }); - - _ = output - .send(Event::WiFiCredentials { - ssid: ssid.clone(), - password: password.map(SecureString::from), - security_type, - }) - .await; - break; - } - } - } - } - } - } - - None => { - return State::Finished; - } - }; - - State::Waiting(conn, rx) - } - State::Finished => futures::future::pending().await, - } -} - -async fn request_response(conn: &zbus::Connection, req: Request, success: bool) -> Event { - Event::RequestResponse { - req, - success, - state: NetworkManagerState::new(conn).await.unwrap_or_default(), - } -} - -async fn has_saved_wifi_credentials(conn: &zbus::Connection, ssid: &str) -> bool { - let Ok(nm_settings) = NetworkManagerSettings::new(conn).await else { - return false; - }; - - let known_conns = nm_settings.list_connections().await.unwrap_or_default(); - - for connection in known_conns { - if let Ok(settings) = connection.get_settings().await { - let settings = Settings::new(settings); - if let Some(saved_ssid) = settings - .wifi - .and_then(|w| w.ssid) - .and_then(|ssid| String::from_utf8(ssid).ok()) - && saved_ssid == ssid - { - return true; - } - } - } - - false -} - -async fn attempt_wifi_connection( - conn: &zbus::Connection, - ssid: SSID, - network_type: NetworkType, - output: &mut futures::channel::mpsc::Sender, - secret_tx: Option>, - interface: Option, -) { - let state = NetworkManagerState::new(conn).await.unwrap_or_default(); - let success = if let Err(err) = state - .connect_wifi( - conn, - ssid.as_ref(), - None, - None, - secret_tx, - network_type, - interface.clone(), - ) - .await - { - tracing::error!("Failed to connect to access point: {:?}", err); - false - } else { - true - }; - - _ = request_response( - conn, - Request::SelectAccessPoint(ssid, network_type, None, interface), - success, - ) - .then(|event| output.send(event)) - .await; -} - -#[derive(Debug, Clone)] -pub enum Request { - /// Activate a device's connection profile - Activate(ObjectPath<'static>, ObjectPath<'static>), - /// Deactivate a connection - Deactivate(UUID), - /// Disconnect from an access point. - Disconnect(SSID), - /// Forget a known access point. - Forget(SSID), - /// Create a connection to a new access point. - Authenticate { - ssid: String, - identity: Option, - password: SecureString, - secret_tx: Option>, - interface: Option, - }, - /// Get WiFi credentials for a known access point. - GetWiFiCredentials( - SSID, - UUID, - NetworkType, - Option>, - ), - /// Signal to reload the service. - Reload, - /// Remove a connection profile. - Remove(UUID), - /// Connect to a known access point. - SelectAccessPoint( - SSID, - NetworkType, - Option>, - Option, - ), - /// Toggle airplaine mode. - SetAirplaneMode(bool), - /// Toggle WiFi enablement. - SetWiFi(bool), -} - -#[derive(Debug, Clone)] -pub enum Event { - RequestResponse { - req: Request, - state: NetworkManagerState, - success: bool, - }, - Init { - conn: zbus::Connection, - sender: UnboundedSender, - state: NetworkManagerState, - }, - Devices, - WiFiEnabled(bool), - WirelessAccessPoints, - ActiveConns, - WiFiCredentials { - ssid: SSID, - password: Option, - security_type: NetworkType, - }, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct NetworkManagerState { - pub wireless_access_points: Vec, - pub active_conns: Vec, - pub known_access_points: Vec, - pub wifi_enabled: bool, - pub airplane_mode: bool, - pub connectivity: NmConnectivityState, -} - -impl Default for NetworkManagerState { - fn default() -> Self { - Self { - wireless_access_points: Vec::new(), - active_conns: Vec::new(), - known_access_points: Vec::new(), - wifi_enabled: false, - airplane_mode: false, - connectivity: NmConnectivityState::Unknown, - } - } -} - -impl NetworkManagerState { - pub async fn new(conn: &zbus::Connection) -> Result { - let network_manager = NetworkManager::new(conn).await?; - let mut this = Self::default(); - - this.refresh_wifi_state(conn, &network_manager).await?; - - Ok(this) - } - - pub async fn refresh_wifi_state( - &mut self, - conn: &zbus::Connection, - network_manager: &NetworkManager<'_>, - ) -> Result<(), Error> { - let (airplane_mode, wireless_enabled, settings_res) = futures::join!( - Command::new("rfkill") - .arg("list") - .arg("bluetooth") - .output() - .then(|res| async move { - let Ok(output) = res else { - return false; - }; - - std::str::from_utf8(&output.stdout) - .ok() - .is_some_and(|stdout| stdout.contains("Soft blocked: yes")) - }), - network_manager - .wireless_enabled() - .then(|res| async move { res.unwrap_or_default() }), - NetworkManagerSettings::new(conn) - ); - - self.wifi_enabled = wireless_enabled; - self.airplane_mode = airplane_mode && !self.wifi_enabled; - - let settings = settings_res?; - - _ = settings.load_connections(&[]).await; - - let (known_conns, active_conns, devices, connectivity) = futures::join!( - settings.list_connections(), - network_manager.active_connections(), - network_manager.devices(), - network_manager.connectivity(), - ); - - let devices = devices.unwrap_or_default(); - let known_conns = known_conns.unwrap_or_default(); - - let (active_conns, wireless_access_points) = futures::join!( - // Retrieve active connections. - async move { - let mut active_conns = active_connections(active_conns.unwrap_or_default()) - .await - .unwrap_or_default(); - - active_conns.sort_by(|a, b| { - let helper = |conn: &ActiveConnectionInfo| match conn { - ActiveConnectionInfo::Vpn { name, .. } => format!("0{name}"), - ActiveConnectionInfo::Wired { name, .. } => format!("1{name}"), - ActiveConnectionInfo::WiFi { name, .. } => format!("2{name}"), - }; - helper(a).cmp(&helper(b)) - }); - - active_conns - }, - // Retrieve all access points, and sort by strength. - async move { - let mut wireless_access_points = futures::stream::FuturesUnordered::from_iter( - devices.iter().map(|device| async move { - if let Ok(Some(SpecificDevice::Wireless(wireless_device))) = - device.downcast_to_device().await - { - handle_wireless_device(wireless_device, device.hw_address().await.ok()) - .await - .unwrap_or_default() - } else { - Vec::new() - } - }), - ) - .fold( - Vec::with_capacity(devices.len()), - |mut access_points, mut f| async move { - access_points.append(&mut f); - access_points - }, - ) - .await; - - wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength)); - wireless_access_points - } - ); - - // Concurrently get - let known_ssid: Vec> = futures::stream::FuturesOrdered::from_iter( - known_conns.into_iter().map(|c| async move { - let s = c.get_settings().await.ok()?; - let s = Settings::new(s); - let curr_ssid = s - .wifi - .clone() - .and_then(|w| w.ssid) - .and_then(|ssid| String::from_utf8(ssid).ok())?; - - Some(Arc::from(curr_ssid)) - }), - ) - .filter_map(|c| async move { c }) - .collect() - .await; - - self.known_access_points = wireless_access_points - .iter() - .filter(|a| { - known_ssid.contains(&a.ssid) - && !active_conns.iter().any(|ac| ac.name() == a.ssid.as_ref()) - }) - .cloned() - .collect(); - - self.wireless_access_points = wireless_access_points; - self.active_conns = active_conns; - self.connectivity = connectivity?; - - Ok(()) - } - - #[allow(dead_code)] - pub fn clear(&mut self) { - self.active_conns = Vec::new(); - self.known_access_points = Vec::new(); - self.wireless_access_points = Vec::new(); - } - - async fn connect_wifi( - &self, - conn: &zbus::Connection, - ssid: &str, - identity: Option<&str>, - password: Option<&str>, - mut secret_tx: Option>, - network_type: NetworkType, - interface: Option, - ) -> Result<(), Error> { - secret_tx = secret_tx.filter(|tx| !tx.is_closed()); - let nm = NetworkManager::new(conn).await?; - - for c in nm.active_connections().await.unwrap_or_default() { - if self - .wireless_access_points - .iter() - .any(|w| Ok(Some(w.ssid.as_ref())) == c.cached_id().as_ref().map(|v| v.as_deref())) - { - _ = nm.deactivate_connection(&c).await; - break; - } - } - - let mut conn_settings: HashMap<&str, HashMap<&str, zvariant::Value>> = HashMap::from([ - ( - "802-11-wireless", - HashMap::from([("ssid", Value::Array(ssid.as_bytes().into()))]), - ), - ( - "connection", - HashMap::from([ - ("id", Value::Str(ssid.into())), - ("type", Value::Str("802-11-wireless".into())), - ]), - ), - ]); - - if let Some(identity) = identity { - conn_settings.insert( - "802-1x", - HashMap::from([ - ("identity", Value::Str(identity.into())), - // most common default - ("eap", Value::Array(vec!["peap"].into())), - // most common default - ("phase2-auth", Value::Str("mschapv2".into())), - ]), - ); - if secret_tx.is_none() { - conn_settings - .get_mut("802-1x") - .unwrap() - .insert("password", Value::Str(password.unwrap_or("").into())); - } - let wireless = conn_settings.get_mut("802-11-wireless").unwrap(); - wireless.insert("security", Value::Str("802-11-wireless-security".into())); - wireless.insert("mode", Value::Str("infrastructure".into())); - conn_settings.insert( - "802-11-wireless-security", - HashMap::from([("key-mgmt", Value::Str("wpa-eap".into()))]), - ); - } else if let Some(pass) = password { - let entry = conn_settings.entry("802-11-wireless-security").or_default(); - _ = entry.insert("key-mgmt", Value::Str("wpa-psk".into())); - if secret_tx.is_none() { - _ = entry.insert("psk", Value::Str(pass.into())); - } - } - - let devices = nm.devices().await?; - for device in devices { - if !matches!( - device.device_type().await.unwrap_or(DeviceType::Other), - DeviceType::Wifi - ) || (interface.is_some() && interface != device.interface().await.ok()) - { - continue; - } - - let s = NetworkManagerSettings::new(conn).await?; - let known_conns = s.list_connections().await.unwrap_or_default(); - let mut known_conn = None; - for c in known_conns { - let settings = c.get_settings().await.ok().unwrap_or_default(); - - let s = Settings::new(settings); - if let Some(cur_ssid) = s - .wifi - .clone() - .and_then(|w| w.ssid) - .and_then(|ssid| String::from_utf8(ssid).ok()) - && cur_ssid == ssid - { - known_conn = Some(c); - break; - } - } - - let known_conn = if let Some(known_conn) = known_conn { - if (secret_tx.is_none() && password.is_some()) || identity.is_some() { - known_conn.update(conn_settings).await.unwrap(); - } - known_conn - } else { - let settings = nm.settings().await?; - let object_path = settings.add_connection(conn_settings).await?; - let known_connection = Connection::from( - ConnectionSettingsProxy::builder(settings.inner().connection()) - .path(object_path)? - .build() - .await?, - ); - let settings = known_connection.get_settings().await?; - let uuid = String::try_from( - settings - .get("connection") - .ok_or_else(|| Error::MissingField("connection"))? - .get("uuid") - .ok_or_else(|| Error::MissingField("uuid"))? - .clone(), - ) - .map_err(zbus::Error::Variant)?; - - if let Some((pass, secret_tx)) = password.zip(secret_tx.as_ref()) { - let pass = SecureString::from(pass); - let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); - - let _ = secret_tx - .send(nm_secret_agent::Request::SetSecrets { - setting_name: if identity.is_some() { - "802-1x".into() - } else { - "802-11-wireless-security".into() - }, - uuid, - secrets: if identity.is_some() { - HashMap::from([("password".to_string(), pass)]) - } else { - HashMap::from([("psk".to_string(), pass)]) - }, - applied_tx, - }) - .await; - if let Err(err) = applied_rx.await { - tracing::error!("Failed to set secret. {err:?}"); - } - } - - known_connection - }; - - if let Some(pass) = password { - let pass = SecureString::from(pass); - if let Some(secret_tx) = secret_tx.as_ref() { - let settings = known_conn.get_settings().await?; - let uuid = String::try_from( - settings - .get("connection") - .ok_or_else(|| Error::MissingField("connection"))? - .get("uuid") - .ok_or_else(|| Error::MissingField("uuid"))? - .clone(), - ) - .map_err(zbus::Error::Variant)?; - let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); - let setting_name: String = if identity.is_some() { - "802-1x".into() - } else { - "802-11-wireless-security".into() - }; - let _ = secret_tx - .send(nm_secret_agent::Request::SetSecrets { - setting_name, - uuid, - secrets: if identity.is_some() { - HashMap::from([("password".to_string(), pass)]) - } else { - HashMap::from([("psk".to_string(), pass)]) - }, - applied_tx, - }) - .await; - if let Err(err) = applied_rx.await { - tracing::error!("Failed to set secret. {err:?}"); - } - } - } - - let active_conn = nm.activate_connection(&known_conn, &device).await?; - let mut changes = active_conn.receive_state_changed().await; - _ = tokio::time::sleep(tokio::time::Duration::from_millis(500)).await; - let mut count = 5; - loop { - let state = active_conn.state().await; - if let Ok(enums::ActiveConnectionState::Activated) = state { - return Ok(()); - } else if let Ok(enums::ActiveConnectionState::Deactivated) = state { - break; - } - - if let Ok(Some(s)) = - tokio::time::timeout(Duration::from_secs(20), changes.next()).await - { - let state = s.get().await.unwrap_or_default().into(); - if matches!(state, enums::ActiveConnectionState::Activated) { - return Ok(()); - } - }; - - count -= 1; - if count <= 0 { - break; - } - } - if let Some(secret_tx) = secret_tx - && !matches!(network_type, NetworkType::Open) - { - let settings = known_conn.get_settings().await?; - let uuid = String::try_from( - settings - .get("connection") - .ok_or_else(|| Error::MissingField("connection"))? - .get("uuid") - .ok_or_else(|| Error::MissingField("uuid"))? - .clone(), - ) - .map_err(zbus::Error::Variant)?; - let (applied_tx, applied_rx) = tokio::sync::oneshot::channel(); - let setting_name: String = if identity.is_some() { - "802-1x".into() - } else { - "802-11-wireless-security".into() - }; - if let Err(err) = secret_tx - .send(nm_secret_agent::Request::SetSecrets { - setting_name, - uuid, - secrets: Default::default(), - applied_tx, - }) - .await - { - tracing::error!( - "Failed to reset access point secrets after failed activation: {err:?}" - ); - } else if let Err(err) = applied_rx.await { - tracing::error!( - "Failed to reset access point secrets after failed activation: {err:?}" - ); - } - } - return Err(Error::ConnectionActivate); - } - - Err(Error::NoWiFiDevices) - } -} diff --git a/subscriptions/network-manager/src/nm_secret_agent.rs b/subscriptions/network-manager/src/nm_secret_agent.rs deleted file mode 100644 index fa697c9..0000000 --- a/subscriptions/network-manager/src/nm_secret_agent.rs +++ /dev/null @@ -1,742 +0,0 @@ -use std::{ - collections::{HashMap, HashSet}, - fmt::Debug, - sync::Arc, -}; - -use bitflags::bitflags; -use cosmic_dbus_networkmanager::interface::settings::connection::ConnectionSettingsProxy; -use futures::{SinkExt, Stream}; -use secure_string::SecureString; -use tokio::sync::oneshot; -use zbus::{ - ObjectServer, fdo, - zvariant::{OwnedValue, Str}, -}; - -pub type SecretSender = Arc>>>; - -pub const SECRET_ID: &str = "com.system76.CosmicSettings.NetworkManager"; -pub const DBUS_PATH: &str = "/org/freedesktop/NetworkManager/SecretAgent"; - -bitflags! { - #[derive(Debug, Clone, Copy, PartialEq, Eq)] - pub struct GetSecretsFlags: u32 { - /// No special behavior. - /// By default no user interaction is allowed and secrets must come - /// from persistent storage, otherwise an error is returned. - const NONE = 0x0; - - /// Allows interaction with the user (eg. prompt via UI). - const ALLOW_INTERACTION = 0x1; - - /// Explicitly request new secrets from the user. - /// Implies ALLOW_INTERACTION. - const REQUEST_NEW = 0x2; - - /// Request was initiated by a user action (via D-Bus). - const USER_REQUESTED = 0x4; - - /// Internal flag, not part of the public D-Bus API. - const ONLY_SYSTEM = 0x8000_0000; - - /// Internal flag, not part of the public D-Bus API. - const NO_ERRORS = 0x4000_0000; - } -} - -#[derive(thiserror::Error, Clone, Debug)] -pub enum Error { - #[error("zbus error")] - Zbus(#[from] zbus::Error), - #[error("listening for secret agent closed")] - RecvError(#[from] oneshot::error::RecvError), - #[error("secret service error")] - SecretService(#[from] Arc), - #[error("no password found for identifier: {0}")] - NoPasswordForIdentifier(String), - #[error("utf8 error")] - Utf8Error(#[from] std::string::FromUtf8Error), -} - -#[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub enum PasswordFlag { - /// The system is responsible for providing and storing this secret. - None = 0, - /// A user-session secret agent is responsible for providing and storing - /// this secret; when it is required, agents will be asked to provide it. - AgentOwned = 1, - /// This secret should not be saved but should be requested from the user - /// each time it is required. This flag should be used for One-Time-Pad - /// secrets, PIN codes from hardware tokens, or if the user simply does not - /// want to save the secret. - NotSaved = 2, - /// in some situations it cannot be automatically determined that a secret is required or not. This flag hints that the secret is not required and should not be requested from the user. - NotRequired = 4, -} - -#[derive(Debug, Clone)] -pub struct SecretHint { - pub key: String, - pub message: Option, -} - -fn parse_hints(hints: Vec) -> Vec { - hints - .into_iter() - // fold message hints into previous hints - .fold(Vec::new(), |mut acc, hint| { - if let Some((key, msg)) = hint.split_once(':') { - if let Some(last) = acc.last_mut() { - last.message = Some(format!("{}: {}", key, msg)); - } - } else { - acc.push(SecretHint { - key: hint, - message: None, - }); - } - acc - }) -} - -#[derive(Debug, Clone)] -pub enum Event { - RequestSecret { - uuid: String, - name: String, - description: Option, - previous: SecureString, - tx: SecretSender, - }, - CancelGetSecrets { - uuid: String, - name: String, - }, - Failed(Error), -} - -#[derive(Debug)] -pub enum Request { - SetSecrets { - setting_name: String, - uuid: String, - secrets: HashMap, - applied_tx: oneshot::Sender<()>, - }, - GetSecrets { - setting_name: String, - uuid: String, - resp_tx: oneshot::Sender>, - }, -} - -pub fn secret_agent_stream( - identifier: impl AsRef, - rx: tokio::sync::mpsc::Receiver, -) -> impl Stream { - iced_futures::stream::channel( - 4, - move |mut msg_tx: futures::channel::mpsc::Sender| async move { - if let Err(e) = secret_agent_stream_impl(identifier.as_ref(), msg_tx.clone(), rx).await - { - let _ = msg_tx.send(Event::Failed(e)).await; - } - }, - ) -} - -async fn secret_agent_stream_impl( - identifier: &str, - msg_tx: futures::channel::mpsc::Sender, - mut rx: tokio::sync::mpsc::Receiver, -) -> Result<(), Error> { - // fail early if we can't connect, closing the channel - { - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - if collection.is_locked().await.map_err(Arc::new)? { - collection.unlock().await.map_err(Arc::new)?; - } - } - // register the secret agent with NetworkManager - let proxy = - nm_secret_agent_manager::AgentManagerProxy::builder(&zbus::Connection::system().await?) - .path("/org/freedesktop/NetworkManager/AgentManager")? - .build() - .await?; - - let _ = ObjectServer::at( - proxy.inner().connection().object_server(), - DBUS_PATH, - SettingsSecretAgent { tx: msg_tx }, - ) - .await?; - - proxy.register_with_capabilities(identifier, 1).await?; - - while let Some(request) = rx.recv().await { - match request { - Request::SetSecrets { - setting_name, - uuid, - secrets, - applied_tx, - } => { - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - - if secrets.is_empty() { - let mut attributes = std::collections::HashMap::new(); - attributes.insert("application", SECRET_ID); - attributes.insert("uuid", &uuid); - let search_items = collection - .search_items(attributes) - .await - .map_err(Arc::new)?; - - for item in &search_items { - item.delete().await.map_err(Arc::new)?; - } - let _ = applied_tx.send(()); - - continue; - } - - for (name, secret) in &secrets { - let mut attributes = std::collections::HashMap::new(); - attributes.insert("application", SECRET_ID); - attributes.insert("uuid", &uuid); - attributes.insert("setting_name", &setting_name); - attributes.insert("name", name); - let _item = collection - .create_item( - "NetworkManager Secret", - attributes, - secret.unsecure().as_bytes(), - true, - "text/plain", - ) - .await - .map_err(Arc::new)?; - } - let _ = applied_tx.send(()); - } - Request::GetSecrets { - setting_name, - uuid, - resp_tx, - } => { - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - - let mut attributes = std::collections::HashMap::new(); - attributes.insert("application", SECRET_ID); - attributes.insert("uuid", &uuid); - attributes.insert("setting_name", &setting_name); - - let search_items = collection - .search_items(attributes) - .await - .map_err(Arc::new)?; - - let mut secrets = HashMap::new(); - for item in &search_items { - let name = item - .get_attributes() - .await - .map_err(Arc::new)? - .get("name") - .cloned() - .unwrap_or_else(|| "unknown".to_string()); - let secret = item.get_secret().await.map_err(Arc::new)?; - let secret: String = String::from_utf8(secret)?; - secrets.insert(name, SecureString::from(secret)); - } - let _ = resp_tx.send(secrets); - } - } - } - Ok(()) -} - -fn parse_secret_flag(value: &str) -> PasswordFlag { - match value { - "0" => PasswordFlag::None, - "1" => PasswordFlag::AgentOwned, - "2" => PasswordFlag::NotSaved, - "4" => PasswordFlag::NotRequired, - _ => PasswordFlag::AgentOwned, - } -} - -fn setting_has_always_ask(setting: zbus::zvariant::Dict) -> bool { - for (key, value) in setting.iter() { - let Ok(key) = key.downcast_ref::() else { - continue; - }; - let Ok(value) = value.downcast_ref::() else { - continue; - }; - // we only care about "-flags" - if !key.ends_with("-flags") { - continue; - } - - if parse_secret_flag(value.as_str()) == PasswordFlag::NotSaved { - return true; - } - } - - false -} - -fn has_always_ask(setting: Option) -> bool { - setting.map(setting_has_always_ask).unwrap_or(false) -} - -fn is_connection_always_ask(connection: &HashMap>) -> bool { - let conn_setting = match connection.get("connection") { - Some(s) => s, - None => return false, - }; - - let conn_type = match conn_setting - .get("type") - .and_then(|v| v.downcast_ref::().ok()) - { - Some(t) => t, - None => return false, - }; - - // Primary setting (vpn, wifi, ethernet, etc) - if has_always_ask( - connection - .get(&conn_type) - .and_then(|d| d.get("data")) - .and_then(|data| data.downcast_ref::().ok()), - ) { - return true; - } - - match conn_type.as_str() { - "802-11-wireless" => { - if has_always_ask( - connection - .get("802-11-wireless-security") - .and_then(|d| d.get("data")) - .and_then(|data| data.downcast_ref::().ok()), - ) { - return true; - } - if has_always_ask( - connection - .get("802-1x") - .and_then(|d| d.get("data")) - .and_then(|data| data.downcast_ref::().ok()), - ) { - return true; - } - } - - "802-3-ethernet" => { - if has_always_ask( - connection - .get("pppoe") - .and_then(|d| d.get("data")) - .and_then(|data| data.downcast_ref::().ok()), - ) { - return true; - } - if has_always_ask( - connection - .get("802-1x") - .and_then(|d| d.get("data")) - .and_then(|data| data.downcast_ref::().ok()), - ) { - return true; - } - } - - _ => {} - } - - false -} - -#[derive(Debug)] -pub struct SettingsSecretAgent { - tx: futures::channel::mpsc::Sender, -} - -#[zbus::interface(name = "org.freedesktop.NetworkManager.SecretAgent")] -impl SettingsSecretAgent { - /// CancelGetSecrets method - async fn cancel_get_secrets( - &mut self, - connection_path: zbus::zvariant::ObjectPath<'_>, - setting_name: String, - ) -> fdo::Result<()> { - let conn = ConnectionSettingsProxy::builder( - &zbus::Connection::system() - .await - .map_err(|_| fdo::Error::Failed("failed to get uuid".to_string()))?, - ) - .path(connection_path)? - .build() - .await - .map_err(|e| fdo::Error::Failed(e.to_string()))?; - - let uuid = conn - .get_settings() - .await - .map_err(|e| fdo::Error::Failed(e.to_string()))? - .get("connection") - .and_then(|m| m.get("uuid")) - .and_then(|v| v.downcast_ref::().ok()) - .ok_or_else(|| fdo::Error::Failed("failed to get uuid".to_string()))? - .to_string(); - if let Err(e) = self - .tx - .clone() - .send(Event::CancelGetSecrets { - uuid, - name: setting_name, - }) - .await - && e.is_disconnected() - { - return Err(fdo::Error::Failed( - "failed to send cancel message".to_string(), - )); - } - - Ok(()) - } - - /// DeleteSecrets method - async fn delete_secrets( - &self, - connection: HashMap>, - connection_path: zbus::zvariant::ObjectPath<'_>, - ) -> fdo::Result<()> { - match self.delete_secrets_inner(connection, connection_path).await { - Ok(_) => Ok(()), - Err(err) => Err(fdo::Error::Failed(err.to_string())), - } - } - - /// GetSecrets method - async fn get_secrets( - &mut self, - connection: HashMap>, - connection_path: zbus::zvariant::ObjectPath<'_>, - setting_name: String, - hints: Vec, - flags: u32, - ) -> HashMap> { - self.get_secrets_inner(connection, connection_path, setting_name, hints, flags) - .await - .unwrap_or_default() - } - - /// SaveSecrets method - async fn save_secrets( - &self, - connection: HashMap>, - _connection_path: zbus::zvariant::ObjectPath<'_>, - ) -> fdo::Result<()> { - match self.save_secrets_inner(connection).await { - Ok(_) => Ok(()), - Err(err) => Err(fdo::Error::Failed(err.to_string())), - } - } -} - -impl SettingsSecretAgent { - pub async fn get_secrets_inner( - &mut self, - connection: HashMap>, - connection_path: zbus::zvariant::ObjectPath<'_>, - setting_name: String, - hints: Vec, - flags: u32, - ) -> Result>, Error> { - let flags = GetSecretsFlags::from_bits_truncate(flags); - - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - - let conn_uuid = connection - .get("connection") - .and_then(|m| m.get("uuid")) - .and_then(|v| v.downcast_ref::().ok()) - .ok_or_else(|| Error::NoPasswordForIdentifier(setting_name.clone()))? - .to_string(); - - let conn = - ConnectionSettingsProxy::builder(&zbus::Connection::system().await.map_err(|_| { - Error::Zbus(fdo::Error::Failed("failed to get uuid".to_string()).into()) - })?) - .path(connection_path)? - .build() - .await - .map_err(|e| Error::Zbus(fdo::Error::Failed(e.to_string()).into()))?; - let settings = conn.get_settings().await?; - let is_vpn = settings - .get("connection") - .and_then(|m| m.get("type")) - .and_then(|v| v.downcast_ref::().ok()) - .is_some_and(|t| t == "vpn"); - let is_always_ask = is_connection_always_ask(&settings); - - let mut setting_attributes = std::collections::HashMap::new(); - setting_attributes.insert("application", SECRET_ID); - setting_attributes.insert("uuid", &conn_uuid); - setting_attributes.insert("setting_name", &setting_name); - - let search_items = collection - .search_items(setting_attributes.clone()) - .await - .map_err(Arc::new)?; - let mut result = HashMap::new(); - let mut setting = HashMap::new(); - - if hints.is_empty() { - for item in &search_items { - let name = item - .get_attributes() - .await - .map_err(Arc::new)? - .get("name") - .cloned() - .unwrap_or_else(|| "unknown".to_string()); - let secret = item.get_secret().await.map_err(Arc::new)?; - let secret: String = String::from_utf8(secret)?; - setting.insert(name, zbus::zvariant::OwnedValue::from(Str::from(secret))); - } - result.insert(setting_name, setting); - Ok(result) - } else { - let hints = parse_hints(hints); - let mut requested = HashSet::new(); - - for SecretHint { key, message } in &hints { - if requested.contains(key) { - continue; - } - requested.insert(key); - if flags.contains(GetSecretsFlags::REQUEST_NEW) - && flags.contains(GetSecretsFlags::ALLOW_INTERACTION) - || is_always_ask - { - // request the secret via the message channel - let (resp_tx, resp_rx) = oneshot::channel(); - // msg begins after ":" - let actual_hint = message.as_ref().map(|m| { - m.split_once(":") - .map(|(_, msg)| msg.trim().to_string()) - .unwrap_or(m.clone()) - }); - if let Err(e) = self - .tx - .clone() - .send(Event::RequestSecret { - uuid: conn_uuid.clone(), - name: setting_name.clone(), - description: actual_hint.clone(), - previous: String::new().into(), - tx: Arc::new(tokio::sync::Mutex::new(Some(resp_tx))), - }) - .await - && e.is_disconnected() - { - continue; - } else if let Ok(secret) = resp_rx.await { - let mut named_attribute = setting_attributes.clone(); - named_attribute.insert("name", key); - let _item = collection - .create_item( - "NetworkManager Secret", - named_attribute, - secret.unsecure().as_bytes(), - true, - "text/plain", - ) - .await - .map_err(Arc::new)?; - - setting.insert( - key.clone(), - zbus::zvariant::OwnedValue::from(Str::from(secret.unsecure())), - ); - } - } else if !is_always_ask { - let mut pos = None; - let mut pos_with_message = None; - for item in &search_items { - let attributes = item.get_attributes().await.map_err(Arc::new)?; - if let Some(value) = attributes.get("name") - && value == key - { - if let Some(saved_message) = attributes.get("message") { - if message.as_ref().is_some_and(|msg| msg == saved_message) { - pos_with_message = Some(item); - } - break; - } else { - pos = Some(item); - } - } - } - - if let Some(item) = pos_with_message.or(pos) { - let secret = item.get_secret().await.map_err(Arc::new)?; - let secret: String = String::from_utf8(secret)?; - if is_vpn { - // ask anyway, but offer the previous one as a hint - let (resp_tx, resp_rx) = oneshot::channel(); - let actual_hint = message.as_ref().map(|m| { - m.split_once(":") - .map(|(_, msg)| msg.trim().to_string()) - .unwrap_or(m.clone()) - }); - if let Err(e) = self - .tx - .clone() - .send(Event::RequestSecret { - uuid: conn_uuid.clone(), - name: setting_name.clone(), - description: actual_hint.clone(), - previous: SecureString::from(secret.clone()), - tx: Arc::new(tokio::sync::Mutex::new(Some(resp_tx))), - }) - .await - && e.is_disconnected() - { - continue; - } else if let Ok(secret) = resp_rx.await { - let mut named_attribute = setting_attributes.clone(); - named_attribute.insert("name", key); - let _item = collection - .create_item( - "NetworkManager Secret", - named_attribute, - secret.unsecure().as_bytes(), - true, - "text/plain", - ) - .await - .map_err(Arc::new)?; - - setting.insert( - key.clone(), - zbus::zvariant::OwnedValue::from(Str::from(secret.unsecure())), - ); - } - } else { - setting.insert( - key.clone(), - zbus::zvariant::OwnedValue::from(Str::from(secret)), - ); - } - } - } else { - // can't find the secret, and we can't request it, so we just skip it - continue; - } - } - result.insert(setting_name, setting); - Ok(result) - } - } - - pub async fn delete_secrets_inner( - &self, - connection: HashMap>, - _connection_path: zbus::zvariant::ObjectPath<'_>, - ) -> Result<(), Error> { - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - - let conn_uuid = connection - .get("connection") - .and_then(|m| m.get("uuid")) - .and_then(|v| v.downcast_ref::().ok()) - .ok_or_else(|| Error::NoPasswordForIdentifier("unknown".to_string()))? - .to_string(); - - let mut attributes = std::collections::HashMap::new(); - attributes.insert("application", SECRET_ID); - attributes.insert("uuid", &conn_uuid); - - let search_items = collection - .search_items(attributes) - .await - .map_err(Arc::new)?; - - for item in &search_items { - item.delete().await.map_err(Arc::new)?; - } - Ok(()) - } - - pub async fn save_secrets_inner( - &self, - connection: HashMap>, - ) -> Result<(), Error> { - let ss = secret_service::SecretService::connect(secret_service::EncryptionType::Dh) - .await - .map_err(Arc::new)?; - let collection = ss.get_default_collection().await.map_err(Arc::new)?; - let conn_uuid = connection - .get("connection") - .and_then(|m| m.get("uuid")) - .and_then(|v| v.downcast_ref::().ok()) - .ok_or_else(|| Error::NoPasswordForIdentifier("unknown".to_string()))? - .to_string(); - - let secret: Option<(String, String)> = connection - .get("802-11-wireless-security") - .and_then(|m| m.get("psk")) - .and_then(|v| v.downcast_ref::().ok()) - .map(|password| ("psk".to_string(), password.clone())) - .or_else(|| { - connection - .get("802-1x") - .and_then(|s| s.get("password")) - .and_then(|v| v.downcast_ref::().ok()) - .map(|password| ("802-1x-password".to_string(), password.clone())) - }); - if let Some((name, secret)) = secret { - let mut attributes = std::collections::HashMap::new(); - attributes.insert("application", SECRET_ID); - attributes.insert("uuid", &conn_uuid); - attributes.insert("setting_name", &name); - let _item = collection - .create_item( - "NetworkManager Secret", - attributes, - secret.as_bytes(), - true, - "text/plain", - ) - .await - .map_err(Arc::new)?; - Ok(()) - } else { - Err(Error::NoPasswordForIdentifier("unknown".to_string())) - } - } -} diff --git a/subscriptions/network-manager/src/wireless_enabled.rs b/subscriptions/network-manager/src/wireless_enabled.rs deleted file mode 100644 index 5ad940d..0000000 --- a/subscriptions/network-manager/src/wireless_enabled.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use crate::Wrapper; - -use super::Event; -use cosmic_dbus_networkmanager::nm::NetworkManager; -use futures::{SinkExt, StreamExt}; -use iced_futures::{Subscription, stream}; -use std::{fmt::Debug, hash::Hash}; -use zbus::Connection; - -#[derive(Debug, Clone)] -pub enum State { - Continue(Connection), - Error, -} - -pub fn wireless_enabled_subscription( - id: I, - conn: Connection, -) -> iced_futures::Subscription { - Subscription::run_with(Wrapper { id, conn: conn }, |Wrapper { id: _id, conn }| { - let conn = conn.clone(); - stream::channel(50, move |output| async move { - watch(conn, output).await; - futures::future::pending().await - }) - }) -} - -pub async fn watch(conn: zbus::Connection, mut output: futures::channel::mpsc::Sender) { - let mut state = State::Continue(conn); - - loop { - state = start_listening(state, &mut output).await; - } -} - -async fn start_listening( - state: State, - output: &mut futures::channel::mpsc::Sender, -) -> State { - let conn = match state { - State::Continue(conn) => conn, - State::Error => futures::future::pending().await, - }; - - let network_manager = match NetworkManager::new(&conn).await { - Ok(n) => n, - Err(why) => { - tracing::error!(why = why.to_string(), "Failed to connect to NetworkManager"); - return State::Error; - } - }; - - let mut wireless_enabled_changed = network_manager.receive_wireless_enabled_changed().await; - - while let Some(change) = wireless_enabled_changed.next().await { - if let Ok(enable) = change.get().await { - _ = output.send(Event::WiFiEnabled(enable)).await; - } - } - State::Continue(conn) -} diff --git a/subscriptions/pulse/Cargo.toml b/subscriptions/pulse/Cargo.toml deleted file mode 100644 index cc4760b..0000000 --- a/subscriptions/pulse/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "cosmic-settings-pulse-subscription" -version = "0.1.0" -edition = "2024" -rust-version.workspace = true - -[dependencies] -libpulse-binding = { version = "2.30.1" } -rustix = { version = "1.1.3", features = ["pipe"] } -iced_futures = { git = "https://github.com/pop-os/libcosmic" } -futures = "0.3.32" -log = "0.4.27" diff --git a/subscriptions/pulse/src/lib.rs b/subscriptions/pulse/src/lib.rs deleted file mode 100644 index 4220765..0000000 --- a/subscriptions/pulse/src/lib.rs +++ /dev/null @@ -1,751 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -// Make sure not to fail if pulse not found, and reconnect? -// change to device shouldn't send osd? - -use futures::{SinkExt, executor::block_on}; -use iced_futures::{Subscription, stream}; -use libpulse_binding::{ - callbacks::ListResult, - channelmap::Map, - context::{ - Context, FlagSet, State, - introspect::{CardInfo, CardProfileInfo, Introspector, ServerInfo, SinkInfo, SourceInfo}, - subscribe::{Facility, InterestMaskSet, Operation}, - }, - def::{PortAvailable, Retval}, - mainloop::{ - api::MainloopApi, - events::io::IoEventInternal, - standard::{IterateResult, Mainloop}, - }, - volume::{ChannelVolumes, Volume}, -}; -use std::{ - borrow::Cow, - cell::{Cell, RefCell}, - convert::Infallible, - io::{Read, Write}, - os::{ - fd::{FromRawFd, IntoRawFd, RawFd}, - raw::c_void, - }, - rc::Rc, - str::FromStr, - sync::mpsc, -}; - -pub fn subscription() -> iced_futures::Subscription { - Subscription::run_with("pulse", |_| { - stream::channel(20, |sender| async { - std::thread::spawn(move || thread(sender)); - futures::future::pending().await - }) - }) -} - -pub fn thread(sender: futures::channel::mpsc::Sender) { - let Some(mut main_loop) = Mainloop::new() else { - log::error!("Failed to create PA main loop"); - return; - }; - - let Some(mut context) = Context::new(&main_loop, "cosmic-osd") else { - log::error!("Failed to create PA context"); - return; - }; - - let data = Rc::new(Data { - main_loop: RefCell::new(Mainloop { - _inner: Rc::clone(&main_loop._inner), - }), - introspector: context.introspect(), - sink_volume: Cell::new(None), - sink_mute: Cell::new(None), - source_volume: Cell::new(None), - source_mute: Cell::new(None), - default_sink_name: RefCell::new(None), - default_source_name: RefCell::new(None), - sender: RefCell::new(sender.clone()), - }); - - let data_clone = data.clone(); - context.set_subscribe_callback(Some(Box::new(move |facility, operation, index| { - data_clone.subscribe_cb(facility.unwrap(), operation, index); - }))); - - let _ = context.connect(None, FlagSet::NOFAIL, None); - - loop { - if sender.is_closed() { - return; - } - - match main_loop.iterate(false) { - IterateResult::Success(_) => {} - IterateResult::Err(_e) => { - return; - } - IterateResult::Quit(_e) => { - return; - } - } - - if context.get_state() == State::Ready { - break; - } - } - - // Inspect all available cards on startup - data.introspector.get_card_info_list({ - let data_weak = Rc::downgrade(&data); - move |card_info_res| { - if let Some(data) = data_weak.upgrade() { - data.card_info_cb(card_info_res) - } - } - }); - - data.get_server_info(); - context.subscribe( - InterestMaskSet::SERVER | InterestMaskSet::SINK | InterestMaskSet::SOURCE, - |_| {}, - ); - - if let Err((err, retval)) = main_loop.run() { - log::error!("PA main loop returned {:?}, error {}", retval, err); - } -} - -#[derive(Clone, Debug)] -pub enum Event { - Balance(Option), - CardInfo(Card), - DefaultSink(String), - DefaultSource(String), - SinkVolume(u32), - Channels(PulseChannels), - SinkMute(bool), - SourceVolume(u32), - SourceMute(bool), -} - -enum Request { - Volume(u32, f32), - Balance(u32, f32), - Quit, -} - -#[derive(Debug)] -pub struct PulseChannels { - tx: mpsc::Sender, - pipe_tx: std::fs::File, - index: u32, -} - -impl Clone for PulseChannels { - fn clone(&self) -> Self { - Self { - tx: self.tx.clone(), - pipe_tx: self - .pipe_tx - .try_clone() - .expect("failed to clone PulseChannels pipe writer"), - index: self.index, - } - } -} - -/// Data used by the [`handle_balance_io_new`] callback. -struct HandleBalanceData( - Context, - ChannelVolumes, - Map, - std::sync::mpsc::Receiver, -); - -/// Callback for creating an IO event source [`MainloopApi::io_new`]. -extern "C" fn handle_balance_io_new( - api: *const MainloopApi, - event: *mut IoEventInternal, - reader_fd: RawFd, - _flags: libpulse_binding::mainloop::events::io::FlagSet, - data: *mut c_void, -) { - // Take ownership of the data and borrow its contents. - let mut data = unsafe { Box::::from_raw(data as _) }; - let HandleBalanceData(ctx, volumes, map, rx) = data.as_mut(); - - // Return early if the context is not ready, and give the data back. - if ctx.get_state() != State::Ready { - let _ = Box::leak(data); - return; - } - - // If the first byte cannot be read, destroy this event source with its reader and data. - let mut buf = [0u8; 1]; - let mut reader = unsafe { std::fs::File::from_raw_fd(reader_fd) }; - if reader.read_exact(&mut buf).is_err() { - (unsafe { &*api }) - .io_free - .as_ref() - .expect("io_free function is missing")(event); - return; - } - - // Give ownership of the reader back. - _ = reader.into_raw_fd(); - - while let Ok(req) = rx.try_recv() { - match req { - Request::Volume(index, volume_scale) => { - let mut intro = ctx.introspect(); - - let new_scale = Volume((volume_scale * Volume::NORMAL.0 as f32).round() as u32); - - if let Some(v) = volumes.scale(new_scale) { - _ = intro.set_sink_volume_by_index( - index, - v, - Some(Box::new(|success| { - if !success { - log::error!("Failed to set sink balance"); - } - })), - ); - } - } - Request::Balance(index, new_balance) => { - if map.can_balance() { - if let Some(v) = volumes.set_balance(&map, new_balance) { - let mut intro = ctx.introspect(); - - _ = intro.set_sink_volume_by_index( - index, - v, - Some(Box::new(|success| { - if !success { - log::error!("Failed to set sink balance"); - } - })), - ); - } - } - } - Request::Quit => unsafe { &*api } - .quit - .as_ref() - .expect("quit function missing")(api, 0), - } - } - - let _ = Box::leak(data); -} - -impl PulseChannels { - fn new( - volumes: ChannelVolumes, - map: Map, - api: &MainloopApi, - index: u32, - ctx: Context, - ) -> PulseChannels { - let (reader, writer) = rustix::pipe::pipe_with(rustix::pipe::PipeFlags::CLOEXEC) - .expect("failed to crate pipe"); - - let (tx, rx) = mpsc::channel::(); - - // Create IO event source object for handling speaker balance. - let event_source = api.io_new.as_ref().unwrap()( - api as *const _, - reader.into_raw_fd(), - libpulse_binding::mainloop::events::io::FlagSet::INPUT, - Some(handle_balance_io_new), - Box::into_raw(Box::new(HandleBalanceData(ctx, volumes, map, rx))) as *mut c_void, - ); - - if let Some(enable) = api.io_enable.as_ref() { - enable( - event_source, - libpulse_binding::mainloop::events::io::FlagSet::INPUT, - ); - } - - Self { - tx, - pipe_tx: std::fs::File::from(writer), - index, - } - } - - /// Change the active index. - #[inline] - pub fn set_index(&mut self, index: u32) { - self.index = index; - } - - /// Set the speaker balance of the active sink. - pub fn set_balance(&mut self, balance: f32) { - if let Err(err) = self.tx.send(Request::Balance(self.index, balance)) { - log::error!("Failed to send new balance to channel"); - } else { - self.pipe_tx - .write_all(&[1]) - .expect("PulseChannels pipe write failed"); - } - } - - /// Set the volume of the active sink. - pub fn set_volume(&mut self, volume: f32) { - if let Err(err) = self.tx.send(Request::Volume(self.index, volume)) { - log::error!("Failed to send new volume to channel"); - } else { - self.pipe_tx - .write_all(&[1]) - .expect("PulseChannels pipe write failed"); - } - } - - /// Request the pulse thread to quit. - pub fn quit(mut self) { - _ = self.tx.send(Request::Quit); - _ = self.pipe_tx.write_all(&[1]); - } -} - -#[derive(Clone, Debug, Hash, Eq, PartialEq)] -pub struct Card { - pub object_id: u32, - pub name: String, - pub product_name: String, - pub variant: DeviceVariant, - pub ports: Vec, - pub profiles: Vec, - pub active_profile: Option, -} - -#[derive(Clone, Debug, Hash, Eq, PartialEq)] -pub struct CardPort { - pub name: String, - pub description: String, - pub direction: Direction, - pub port_type: PortType, - pub profile_port: u32, - pub priority: u32, - pub profiles: Vec, - pub availability: Availability, -} - -#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] -pub enum Availability { - Unknown, - No, - Yes, -} - -impl From for Availability { - fn from(pa: PortAvailable) -> Self { - match pa { - PortAvailable::Unknown => Availability::Unknown, - PortAvailable::No => Availability::No, - PortAvailable::Yes => Availability::Yes, - } - } -} - -#[derive(Clone, Debug, Hash, Eq, PartialEq)] -pub struct CardProfile { - pub name: String, - pub description: String, - pub available: bool, - pub n_sinks: u32, - pub n_sources: u32, - pub priority: u32, -} - -#[derive(Clone, Debug, Hash, Eq, PartialEq)] -pub enum DeviceVariant { - Alsa { alsa_card: u32 }, - Bluez5 { address: String }, -} - -#[derive(Clone, Debug, Hash, Eq, PartialEq)] -pub enum Direction { - Input, - Output, - Both, -} - -#[derive(Default, Clone, Debug, Hash, Eq, PartialEq)] -pub enum PortType { - Mic, - Speaker, - Headphones, - Headset, - Digital, - #[default] - Unknown, -} - -impl FromStr for PortType { - type Err = Infallible; - - fn from_str(s: &str) -> Result { - match s { - "mic" => Ok(PortType::Mic), - "speaker" => Ok(PortType::Speaker), - "headphones" => Ok(PortType::Headphones), - "headset" => Ok(PortType::Headset), - "digital" => Ok(PortType::Digital), - _ => Ok(PortType::Unknown), - } - } -} - -struct Data { - main_loop: RefCell, - default_sink_name: RefCell>, - default_source_name: RefCell>, - sink_volume: Cell>, - sink_mute: Cell>, - source_volume: Cell>, - source_mute: Cell>, - introspector: Introspector, - sender: RefCell>, -} - -impl Data { - fn card_info_cb(self: &Rc, card_info: ListResult<&CardInfo>) { - if let ListResult::Item(card_info) = card_info { - let Some(object_id) = card_info - .proplist - .get_str("object.id") - .and_then(|v| v.parse::().ok()) - else { - return; - }; - - let variant = if let Some(alsa_card) = card_info - .proplist - .get_str("alsa.card") - .and_then(|v| v.parse::().ok()) - { - DeviceVariant::Alsa { alsa_card } - } else if let Some(address) = card_info.proplist.get_str("api.bluez5.address") { - DeviceVariant::Bluez5 { address } - } else { - return; - }; - - let card = Card { - name: card_info - .name - .as_ref() - .map(Cow::to_string) - .unwrap_or_default(), - product_name: card_info - .proplist - .get_str("device.product.name") - .unwrap_or_default(), - object_id, - variant, - ports: card_info - .ports - .iter() - .map(|port| CardPort { - name: port.name.as_ref().map(Cow::to_string).unwrap_or_default(), - description: port - .description - .as_ref() - .map(Cow::to_string) - .unwrap_or_default(), - direction: match port.direction.bits() { - x if x == libpulse_binding::direction::FlagSet::INPUT.bits() => { - Direction::Input - } - x if x == libpulse_binding::direction::FlagSet::OUTPUT.bits() => { - Direction::Output - } - _ => Direction::Both, - }, - port_type: port - .proplist - .get_str("port.type") - .as_deref() - .map(|s| PortType::from_str(s).unwrap()) - .unwrap_or_default(), - profile_port: port - .proplist - .get_str("card.profile.port") - .and_then(|v| v.parse::().ok()) - .unwrap_or(0), - priority: port.priority, - profiles: collect_profiles(&port.profiles), - availability: port.available.into(), - }) - .collect(), - profiles: collect_profiles(&card_info.profiles), - active_profile: card_info.active_profile.as_deref().map(CardProfile::from), - }; - - if block_on(self.sender.borrow_mut().send(Event::CardInfo(card))).is_err() { - self.main_loop.borrow_mut().quit(Retval(0)); - } - } - } - - fn server_info_cb(self: &Rc, server_info: &ServerInfo) { - let new_default_sink_name = server_info - .default_sink_name - .as_ref() - .map(|x| x.clone().into_owned()); - let mut default_sink_name = self.default_sink_name.borrow_mut(); - if new_default_sink_name != *default_sink_name { - if let Some(name) = &new_default_sink_name { - _ = block_on( - self.sender - .borrow_mut() - .send(Event::DefaultSink(name.clone())), - ); - self.get_sink_info_by_name(name); - } - *default_sink_name = new_default_sink_name; - } - - let new_default_source_name = server_info - .default_source_name - .as_ref() - .map(|x| x.clone().into_owned()); - let mut default_source_name = self.default_source_name.borrow_mut(); - if new_default_source_name != *default_source_name { - if let Some(name) = &new_default_source_name { - _ = block_on( - self.sender - .borrow_mut() - .send(Event::DefaultSource(name.clone())), - ); - self.get_source_info_by_name(name); - } - *default_source_name = new_default_source_name; - } - } - - fn get_server_info(self: &Rc) { - let data = self.clone(); - self.introspector - .get_server_info(move |server_info| data.server_info_cb(server_info)); - } - - fn sink_info_cb(&self, sink_info_res: ListResult<&SinkInfo>) { - if let ListResult::Item(sink_info) = sink_info_res { - if sink_info.name.as_deref() != self.default_sink_name.borrow().as_deref() { - return; - } - let balance = (sink_info.channel_map.can_balance() - && sink_info.base_volume.is_normal()) - .then(|| sink_info.volume.get_balance(&sink_info.channel_map)); - - let volume = sink_info.volume.max().0 / (Volume::NORMAL.0 / 100); - if self.sink_mute.get() != Some(sink_info.mute) { - self.sink_mute.set(Some(sink_info.mute)); - if block_on( - self.sender - .borrow_mut() - .send(Event::SinkMute(sink_info.mute)), - ) - .is_err() - { - self.main_loop.borrow_mut().quit(Retval(0)); - } - } - if self.sink_volume.get() != Some(volume) { - self.sink_volume.set(Some(volume)); - if block_on(self.sender.borrow_mut().send(Event::SinkVolume(volume))).is_err() { - self.main_loop.borrow_mut().quit(Retval(0)); - } - } - if block_on(self.sender.borrow_mut().send(Event::Balance(balance))).is_err() { - self.main_loop.borrow_mut().quit(Retval(0)); - } - let mut main_loop = self.main_loop.borrow_mut(); - let api = main_loop.get_api(); - if let Some(mut ctx) = Context::new(&*main_loop, "balance") { - let _ = ctx.connect(None, FlagSet::NOFAIL, None); - - let channels = PulseChannels::new( - sink_info.volume, - sink_info.channel_map, - api, - sink_info.index, - ctx, - ); - - if block_on(self.sender.borrow_mut().send(Event::Channels(channels))).is_err() { - main_loop.quit(Retval(0)); - } - } - } - } - - fn source_info_cb(&self, source_info_res: ListResult<&SourceInfo>) { - if let ListResult::Item(source_info) = source_info_res { - if source_info.name.as_deref() != self.default_source_name.borrow().as_deref() { - return; - } - let volume = source_info.volume.max().0 / (Volume::NORMAL.0 / 100); - if self.source_mute.get() != Some(source_info.mute) { - self.source_mute.set(Some(source_info.mute)); - if block_on( - self.sender - .borrow_mut() - .send(Event::SourceMute(source_info.mute)), - ) - .is_err() - { - self.main_loop.borrow_mut().quit(Retval(0)); - } - } - if self.source_volume.get() != Some(volume) { - self.source_volume.set(Some(volume)); - if block_on(self.sender.borrow_mut().send(Event::SourceVolume(volume))).is_err() { - self.main_loop.borrow_mut().quit(Retval(0)); - } - } - } - } - - fn get_card_info_by_index(self: &Rc, index: u32) { - let data = self.clone(); - self.introspector - .get_card_info_by_index(index, move |card_info_res| { - data.card_info_cb(card_info_res); - }); - } - - fn get_sink_info_by_index(self: &Rc, index: u32) { - let data = self.clone(); - self.introspector.get_sink_info_by_index( - index, - move |sink_info_res: ListResult<&SinkInfo<'_>>| { - if let ListResult::Item(ref info) = sink_info_res { - if let Some(card_index) = info.card { - let data_clone = data.clone(); - data.introspector.get_card_info_by_index( - card_index, - move |card_info_res| { - data_clone.card_info_cb(card_info_res); - }, - ); - } - } - data.sink_info_cb(sink_info_res); - }, - ); - } - - fn get_sink_info_by_name(self: &Rc, name: &str) { - let data = self.clone(); - self.introspector - .get_sink_info_by_name(name, move |sink_info_res| { - if let ListResult::Item(ref info) = sink_info_res { - if let Some(card_index) = info.card { - let data_clone = data.clone(); - data.introspector.get_card_info_by_index( - card_index, - move |card_info_res| { - data_clone.card_info_cb(card_info_res); - }, - ); - } - } - data.sink_info_cb(sink_info_res); - }); - } - - fn get_source_info_by_index(self: &Rc, index: u32) { - let data = self.clone(); - self.introspector - .get_source_info_by_index(index, move |source_info_res| { - if let ListResult::Item(ref info) = source_info_res { - if let Some(card_index) = info.card { - let data_clone = data.clone(); - data.introspector.get_card_info_by_index( - card_index, - move |card_info_res| { - data_clone.card_info_cb(card_info_res); - }, - ); - } - } - data.source_info_cb(source_info_res); - }); - } - - fn get_source_info_by_name(self: &Rc, name: &str) { - let data = self.clone(); - self.introspector - .get_source_info_by_name(name, move |source_info_res| { - if let ListResult::Item(ref info) = source_info_res { - if let Some(card_index) = info.card { - let data_clone = data.clone(); - data.introspector.get_card_info_by_index( - card_index, - move |card_info_res| { - data_clone.card_info_cb(card_info_res); - }, - ); - } - } - data.source_info_cb(source_info_res); - }); - } - - fn subscribe_cb( - self: &Rc, - facility: Facility, - _operation: Option, - index: u32, - ) { - match facility { - Facility::Server => { - self.get_server_info(); - } - Facility::Sink => { - self.get_sink_info_by_index(index); - } - Facility::Source => { - self.get_source_info_by_index(index); - } - Facility::Card => { - self.get_card_info_by_index(index); - } - _ => {} - } - } -} - -fn collect_profiles(profiles: &[CardProfileInfo]) -> Vec { - profiles.iter().map(CardProfile::from).collect() -} - -impl From<&CardProfileInfo<'_>> for CardProfile { - fn from(profile: &CardProfileInfo) -> Self { - CardProfile { - name: profile - .name - .as_ref() - .map(Cow::to_string) - .unwrap_or_default(), - description: profile - .description - .as_ref() - .map(Cow::to_string) - .unwrap_or_default(), - available: profile.available, - n_sinks: profile.n_sinks, - n_sources: profile.n_sources, - priority: profile.priority, - } - } -} diff --git a/subscriptions/settings-daemon/src/lib.rs b/subscriptions/settings-daemon/src/lib.rs index 313bfb6..db02cc6 100644 --- a/subscriptions/settings-daemon/src/lib.rs +++ b/subscriptions/settings-daemon/src/lib.rs @@ -1,8 +1,6 @@ // Copyright 2024 System76 // SPDX-License-Identifier: MPL-2.0 -// XXX error handling? - use std::hash::Hash; use futures::{FutureExt, StreamExt}; @@ -21,6 +19,29 @@ impl Hash for Wrapper { } } +const DAEMON_NAME: &str = "com.system76.CosmicSettingsDaemon"; + +async fn wait_for_daemon(conn: &zbus::Connection) { + let Ok(dbus) = zbus::fdo::DBusProxy::new(conn).await else { + return; + }; + let name: zbus::names::BusName = DAEMON_NAME.try_into().unwrap(); + if dbus.name_has_owner(name.clone()).await.unwrap_or(false) { + return; + } + log::info!("Waiting for {DAEMON_NAME} to appear on D-Bus..."); + if let Ok(mut stream) = dbus.receive_name_owner_changed().await { + while let Some(signal) = stream.next().await { + if let Ok(args) = signal.args() + && args.name == name + && args.new_owner.as_ref().is_some_and(|n| !n.is_empty()) + { + break; + } + } + } +} + pub fn subscription(connection: zbus::Connection) -> iced_futures::Subscription { Subscription::run_with( Wrapper { @@ -33,11 +54,13 @@ pub fn subscription(connection: zbus::Connection) -> iced_futures::Subscription< }| { let connection = connection.clone(); async move { + wait_for_daemon(&connection).await; + let settings_daemon = match CosmicSettingsDaemonProxy::new(&connection).await { Ok(value) => value, Err(err) => { log::error!("Error connecting to settings daemon: {}", err); - futures::future::pending().await + return futures::future::pending().await; } }; @@ -48,9 +71,15 @@ pub fn subscription(connection: zbus::Connection) -> iced_futures::Subscription< .await; let brightness_stream = settings_daemon.receive_display_brightness_changed().await; - let initial = futures::stream::iter([Event::Sender(tx)]); + let mut initial = vec![Event::Sender(tx)]; + if let Ok(max) = settings_daemon.max_display_brightness().await { + initial.push(Event::MaxDisplayBrightness(max)); + } + if let Ok(brightness) = settings_daemon.display_brightness().await { + initial.push(Event::DisplayBrightness(brightness)); + } - initial.chain(futures::stream_select!( + futures::stream::iter(initial).chain(futures::stream_select!( Box::pin(UnboundedReceiverStream::new(rx).filter_map(move |request| { let settings_daemon = settings_daemon.clone(); async move { @@ -58,9 +87,17 @@ pub fn subscription(connection: zbus::Connection) -> iced_futures::Subscription< Request::SetDisplayBrightness(brightness) => { let _ = settings_daemon.set_display_brightness(brightness).await; + None + } + Request::GetDisplayBrightness => { + let b = settings_daemon.display_brightness().await; + Some(Event::DisplayBrightness(b.ok()?)) + } + Request::GetMaxDisplayBrightness => { + let m = settings_daemon.max_display_brightness().await; + Some(Event::MaxDisplayBrightness(m.ok()?)) } } - None:: } })), Box::pin(max_brightness_stream.filter_map(|evt| async move { @@ -102,4 +139,6 @@ trait CosmicSettingsDaemon { #[derive(Debug, Clone)] pub enum Request { SetDisplayBrightness(i32), + GetDisplayBrightness, + GetMaxDisplayBrightness, } diff --git a/subscriptions/sound/Cargo.toml b/subscriptions/sound/Cargo.toml deleted file mode 100644 index adf5891..0000000 --- a/subscriptions/sound/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "cosmic-settings-sound-subscription" -version = "1.0.7" -edition = "2024" -rust-version.workspace = true -license = "MPL-2.0" -publish = true - -[dependencies] -cosmic-pipewire = { path = "../../crates/cosmic-pipewire" } -futures = "0.3.32" -intmap = "3.1.3" -libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false } -numtoa = "1.0.0-alpha1" -rustix = "1.1.3" -tokio = { version = "1.49.0", features = ["process", "rt", "time"] } -tracing = { version = "0.1.44", default-features = false } - -[features] -# Set profile on first load -auto-profile-init = [] diff --git a/subscriptions/sound/LICENSE.md b/subscriptions/sound/LICENSE.md deleted file mode 100644 index 8dc5b15..0000000 --- a/subscriptions/sound/LICENSE.md +++ /dev/null @@ -1,359 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -## 1. Definitions - -### 1.1. "Contributor" -means each individual or legal entity that creates, contributes to -the creation of, or owns Covered Software. - -### 1.2. "Contributor Version" -means the combination of the Contributions of others (if any) used -by a Contributor and that particular Contributor's Contribution. - -### 1.3. "Contribution" -means Covered Software of a particular Contributor. - -### 1.4. "Covered Software" -means Source Code Form to which the initial Contributor has attached -the notice in Exhibit A, the Executable Form of such Source Code -Form, and Modifications of such Source Code Form, in each case -including portions thereof. - -### 1.5. "Incompatible With Secondary Licenses" -means - -+ (a) that the initial Contributor has attached the notice described -in Exhibit B to the Covered Software; or - -+ (b) that the Covered Software was made available under the terms of -version 1.1 or earlier of the License, but not also under the -terms of a Secondary License. - -### 1.6. "Executable Form" -means any form of the work other than Source Code Form. - -### 1.7. "Larger Work" -means a work that combines Covered Software with other material, in -a separate file or files, that is not Covered Software. - -### 1.8. "License" -means this document. - -### 1.9. "Licensable" -means having the right to grant, to the maximum extent possible, -whether at the time of the initial grant or subsequently, any and -all of the rights conveyed by this License. - -### 1.10. "Modifications" -means any of the following: - -+ (a) any file in Source Code Form that results from an addition to, -deletion from, or modification of the contents of Covered -Software; or - -+ (b) any new file in Source Code Form that contains any Covered -Software. - -### 1.11. "Patent Claims" of a Contributor -means any patent claim(s), including without limitation, method, -process, and apparatus claims, in any patent Licensable by such -Contributor that would be infringed, but for the grant of the -License, by the making, using, selling, offering for sale, having -made, import, or transfer of either its Contributions or its -Contributor Version. - -### 1.12. "Secondary License" -means either the GNU General Public License, Version 2.0, the GNU -Lesser General Public License, Version 2.1, the GNU Affero General -Public License, Version 3.0, or any later versions of those -licenses. - -### 1.13. "Source Code Form" -means the form of the work preferred for making modifications. - -### 1.14. "You" (or "Your") -means an individual or a legal entity exercising rights under this -License. For legal entities, "You" includes any entity that -controls, is controlled by, or is under common control with You. For -purposes of this definition, "control" means (a) the power, direct -or indirect, to cause the direction or management of such entity, -whether by contract or otherwise, or (b) ownership of more than -fifty percent (50%) of the outstanding shares or beneficial -ownership of such entity. - -## 2. License Grants and Conditions - -### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -+ (a) under intellectual property rights (other than patent or trademark) -Licensable by such Contributor to use, reproduce, make available, -modify, display, perform, distribute, and otherwise exploit its -Contributions, either on an unmodified basis, with Modifications, or -as part of a Larger Work; and - -+ (b) under Patent Claims of such Contributor to make, use, sell, offer -for sale, have made, import, and otherwise transfer either its -Contributions or its Contributor Version. - -### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -+ (a) for any code that a Contributor has removed from Covered Software; -or - -+ (b) for infringements caused by: (i) Your and any other third party's -modifications of Covered Software, or (ii) the combination of its -Contributions with other software (except as part of its Contributor -Version); or - -+ (c) under Patent Claims infringed by Covered Software in the absence of -its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -## 3. Responsibilities - -### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -+ (a) such Covered Software must also be made available in Source Code -Form, as described in Section 3.1, and You must inform recipients of -the Executable Form how they can obtain a copy of such Source Code -Form by reasonable means in a timely manner, at a charge no more -than the cost of distribution to the recipient; and - -+ (b) You may distribute such Executable Form under the terms of this -License, or sublicense it under different terms, provided that the -license for the Executable Form does not attempt to limit or alter -the recipients' rights in the Source Code Form under this License. - -### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -## 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -## 5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -## 6. Disclaimer of Warranty - -**Covered Software is provided under this License on an "as is" -basis, without warranty of any kind, either expressed, implied, or -statutory, including, without limitation, warranties that the -Covered Software is free of defects, merchantable, fit for a -particular purpose or non-infringing. The entire risk as to the -quality and performance of the Covered Software is with You. -Should any Covered Software prove defective in any respect, You -(not any Contributor) assume the cost of any necessary servicing, -repair, or correction. This disclaimer of warranty constitutes an -essential part of this License. No use of any Covered Software is -authorized under this License except under this disclaimer.** - - -#7. Limitation of Liability - -**Under no circumstances and under no legal theory, whether tort -(including negligence), contract, or otherwise, shall any -Contributor, or anyone who distributes Covered Software as -permitted above, be liable to You for any direct, indirect, -special, incidental, or consequential damages of any character -including, without limitation, damages for lost profits, loss of -goodwill, work stoppage, computer failure or malfunction, or any -and all other commercial damages or losses, even if such party -shall have been informed of the possibility of such damages. This -limitation of liability shall not apply to liability for death or -personal injury resulting from such party's negligence to the -extent applicable law prohibits such limitation. Some -jurisdictions do not allow the exclusion or limitation of -incidental or consequential damages, so this exclusion and -limitation may not apply to You.** - - -## 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -## 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -## 10. Versions of the License - -### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -### 10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - "Incompatible With Secondary Licenses" Notice - - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - diff --git a/subscriptions/sound/src/lib.rs b/subscriptions/sound/src/lib.rs deleted file mode 100644 index adac229..0000000 --- a/subscriptions/sound/src/lib.rs +++ /dev/null @@ -1,958 +0,0 @@ -// Copyright 2024 System76 -// SPDX-License-Identifier: MPL-2.0 - -use cosmic::Task; -use cosmic::iced::stream; -use cosmic_pipewire as pipewire; -use futures::{SinkExt, Stream}; -use intmap::IntMap; -use pipewire::Availability; -use std::{ - process::Stdio, - sync::{Arc, Mutex}, - time::Duration, -}; - -pub type DeviceId = u32; -pub type NodeId = u32; -pub type ProfileId = i32; -pub type RouteId = u32; - -pub fn watch() -> impl Stream + Send + 'static { - stream::channel( - 1, - |mut emitter: futures::channel::mpsc::Sender| async move { - loop { - let (cancel_tx, cancel_rx) = futures::channel::oneshot::channel::<()>(); - let sender = Arc::new((Mutex::new(Vec::new()), tokio::sync::Notify::const_new())); - let receiver = sender.clone(); - - _ = emitter - .send(Message::SubHandle(Arc::new(SubscriptionHandle { - cancel_tx, - pipewire: pipewire::run(move |event| { - sender.0.lock().unwrap().push(event); - sender.1.notify_one(); - }), - }))) - .await; - - let forwarder = Box::pin(async { - loop { - _ = receiver.1.notified().await; - let events = std::mem::take(&mut *receiver.0.lock().unwrap()); - if !events.is_empty() { - _ = emitter.send(Message::Server(Arc::from(events))).await; - tokio::time::sleep(Duration::from_millis(64)).await; - } - } - }); - - futures::future::select(cancel_rx, forwarder).await; - } - }, - ) -} - -#[derive(Default)] -pub struct Model { - subscription_handle: Option, - - pub device_profile_dropdowns: Vec<(DeviceId, String, Option, Vec, Vec)>, - - // Translated text - pub unplugged_text: String, - pub hd_audio_text: String, - pub usb_audio_text: String, - - device_ids: IntMap, - node_names: IntMap, - card_profile_devices: IntMap, - node_route_indexes: IntMap, - - device_names: IntMap, - device_profiles: IntMap>, - active_profiles: IntMap, - device_routes: IntMap>, - - /** Sink devices */ - - /// Description of a sink device and its port - sinks: Vec, - /// Node IDs for sinks - sink_node_ids: Vec, - /// Index of active sink device. - active_sink: Option, - /// Node ID of active sink device. - active_sink_node: Option, - /// Device ID of active sink device. - active_sink_device: Option, - /// Device identifier of the default sink. - active_sink_node_name: String, - - /** Source devices */ - - /// Product names for source devices. - sources: Vec, - /// Node IDs for sources - source_node_ids: Vec, - /// Index of active source device. - active_source: Option, - /// Node ID of active source device. - active_source_node: Option, - /// Device ID of active source device. - active_source_device: Option, - /// Node identifier of the default source. - active_source_node_name: String, - - changing_sink_device: Option, - changing_source_device: Option, - - pub sink_volume_text: String, - pub source_volume_text: String, - pub sink_balance: Option, - - pub sink_volume: u32, - pub source_volume: u32, - - pub sink_mute: bool, - sink_volume_debounce: bool, - pub source_mute: bool, - source_volume_debounce: bool, -} - -impl Model { - pub fn active_sink(&self) -> Option { - self.active_sink - } - - pub fn active_source(&self) -> Option { - self.active_source - } - - pub fn sinks(&self) -> &[String] { - &self.sinks - } - - pub fn sources(&self) -> &[String] { - &self.sources - } - - pub fn clear(&mut self) { - if let Some(handle) = self.subscription_handle.take() { - _ = handle.cancel_tx.send(()); - _ = handle.pipewire.send(pipewire::Request::Quit); - } - } - - /// Send a message to the pipewire-rs thread. - pub fn pipewire_send(&self, request: pipewire::Request) { - if let Some(handle) = self.subscription_handle.as_ref() { - _ = handle.pipewire.send(request); - } - } - - /// Sets and applies a profile to a device with wpctl. - /// - /// Requires using the device ID rather than a node ID. - pub fn set_profile(&mut self, device_id: DeviceId, index: u32, save: bool) { - if save { - self.changing_sink_device = self - .device_ids - .iter() - .find(|(node_id, _device)| self.active_sink_node == Some(*node_id)) - .and_then(|(_node_id, &device)| { - if device == device_id { - Some(device_id) - } else { - None - } - }); - - self.changing_source_device = self - .device_ids - .iter() - .find(|(node_id, _device)| self.active_source_node == Some(*node_id)) - .and_then(|(_node_id, &device)| { - if device == device_id { - Some(device_id) - } else { - None - } - }); - } - - let mut update = false; - - if let Some(profiles) = self.device_profiles.get(device_id) { - for profile in profiles { - if profile.index as u32 == index { - self.active_profiles.insert(device_id, profile.clone()); - self.pipewire_send(pipewire::Request::SetProfile(device_id, index, save)); - update = true; - } - } - - if update { - self.update_ui_profiles(); - } - - // Use pw-cli as a fallback in case it wasn't set correctly. - tokio::spawn(async move { - set_profile(device_id, index, save).await; - }); - } - } - - /// Change the balance of channel volumes on the sink device. - pub fn set_sink_balance(&mut self, balance: u32) -> Task { - self.sink_balance = (balance != 100).then(|| balance as f32 / 100.); - if self.sink_volume_debounce { - return Task::none(); - } - - if let Some(id) = self.active_sink_node { - self.sink_volume_debounce = true; - return cosmic::Task::future(async move { - tokio::time::sleep(Duration::from_millis(128)).await; - Message::SinkVolumeApply(id) - }); - } - - Task::none() - } - - /// Change the default sink device - pub fn set_default_sink(&mut self, pos: usize) -> Task { - if let Some(&node_id) = self.sink_node_ids.get(pos) { - self.set_default_sink_node_id(node_id); - } - - Task::none() - } - - pub fn set_default_sink_node_id(&mut self, node_id: NodeId) { - tracing::debug!(target: "sound", "set default sink node {node_id}"); - self.set_default_sink_id(node_id); - - // Use pactl if the node is not a device node. - let virtual_sink_name: Option = - if let Some(device) = self.device_ids.get(node_id).cloned() { - // Get route index of the selected node and apply it to the device. - if let Some((card_profile_device, route_index)) = self - .card_profile_devices - .get(node_id) - .cloned() - .zip(self.node_route_indexes.get(node_id).cloned()) - { - self.pipewire_send(pipewire::Request::SetRoute( - device, - card_profile_device, - route_index as u32, - )); - } - - None - } else { - self.node_names.get(node_id).cloned() - }; - - tokio::task::spawn(async move { - if let Some(node_name) = virtual_sink_name { - pactl_set_default_sink(&node_name).await - } else { - set_default(node_id).await - } - }); - } - - /// Toggle the mute property of the sink device. - pub fn toggle_sink_mute(&mut self) { - self.sink_mute = !self.sink_mute; - if let Some(node_id) = self.active_sink_node { - let mute = self.sink_mute; - if let Some(handle) = self.subscription_handle.as_mut() { - _ = handle - .pipewire - .send(pipewire::Request::SetNodeMute(node_id, mute)); - } - } - } - - /// Change the sink device's volume. - pub fn set_sink_volume(&mut self, volume: u32) -> Task { - self.sink_volume = volume; - self.sink_volume_text = numtoa::BaseN::<10>::u32(volume).as_str().to_owned(); - if self.sink_volume_debounce { - return Task::none(); - } - - // Wait for the debounce duration before applying the volume change. - if let Some(node_id) = self.active_sink_node { - self.sink_volume_debounce = true; - return cosmic::Task::future(async move { - tokio::time::sleep(Duration::from_millis(128)).await; - Message::SinkVolumeApply(node_id) - }); - } - - Task::none() - } - - /// Change the default source device. - pub fn set_default_source(&mut self, pos: usize) -> Task { - if let Some(&node_id) = self.source_node_ids.get(pos) { - self.set_default_source_node_id(node_id); - } - - Task::none() - } - - pub fn set_default_source_node_id(&mut self, node_id: NodeId) { - tracing::debug!(target: "sound", "set default source node {node_id}"); - self.set_default_source_id(node_id); - - // Use pactl if the node is not a device node. - let virtual_source_name: Option = - if let Some(device) = self.device_ids.get(node_id).cloned() { - // Get route index of the selected node and apply it to the device. - if let Some((card_profile_device, route_index)) = self - .card_profile_devices - .get(node_id) - .cloned() - .zip(self.node_route_indexes.get(node_id).cloned()) - { - self.pipewire_send(pipewire::Request::SetRoute( - device, - card_profile_device, - route_index as u32, - )); - } - - None - } else { - self.node_names.get(node_id).cloned() - }; - - tokio::task::spawn(async move { - if let Some(node_name) = virtual_source_name { - pactl_set_default_source(&node_name).await - } else { - set_default(node_id).await - } - }); - } - - /// Toggle the mute property of the source device. - pub fn toggle_source_mute(&mut self) { - self.source_mute = !self.source_mute; - if let Some(node_id) = self.active_source_node { - let mute = self.source_mute; - if let Some(handle) = self.subscription_handle.as_mut() { - _ = handle - .pipewire - .send(pipewire::Request::SetNodeMute(node_id, mute)); - } - } - } - - /// Change the source device's volume. - pub fn set_source_volume(&mut self, volume: u32) -> Task { - self.source_volume = volume; - self.source_volume_text = numtoa::BaseN::<10>::u32(volume).as_str().to_owned(); - if self.source_volume_debounce { - return Task::none(); - } - - // Wait for the debounce duration before applying the volume change. - if let Some(node_id) = self.active_source_node { - self.source_volume_debounce = true; - return cosmic::Task::future(async move { - tokio::time::sleep(Duration::from_millis(128)).await; - Message::SourceVolumeApply(node_id) - }); - } - - Task::none() - } - - pub fn update(&mut self, message: Message) -> Task { - match message { - Message::Server(events) => { - Arc::into_inner(events) - .into_iter() - .flatten() - .for_each(|event| self.pipewire_update(event)); - } - - Message::SinkVolumeApply(node_id) => { - self.sink_volume_debounce = false; - self.pipewire_send(pipewire::Request::SetNodeVolume( - node_id, - self.sink_volume as f32 / 100.0, - self.sink_balance, - )); - } - - Message::SourceVolumeApply(node_id) => { - self.source_volume_debounce = false; - self.pipewire_send(pipewire::Request::SetNodeVolume( - node_id, - self.source_volume as f32 / 100.0, - None, - )); - } - - Message::SubHandle(handle) => { - if let Some(handle) = Arc::into_inner(handle) { - self.subscription_handle = Some(handle); - } - } - } - - Task::none() - } - - fn pipewire_update(&mut self, event: pipewire::Event) { - match event { - pipewire::Event::NodeProperties(id, props) => { - if self.active_sink_node == Some(id) { - if self.sink_volume_debounce { - return; - } - - if let Some(mute) = props.mute { - self.sink_mute = mute; - } - - if let Some(channel_volumes) = props.channel_volumes { - let (volume, balance) = - pipewire::volume::from_channel_volumes(&channel_volumes); - - self.sink_balance = balance; - self.sink_volume = (volume * 100.0) as u32; - self.sink_volume_text = numtoa::BaseN::<10>::u32(self.sink_volume) - .as_str() - .to_owned(); - } - } else if self.active_source_node == Some(id) { - if self.source_volume_debounce { - return; - } - - if let Some(mute) = props.mute { - self.source_mute = mute; - } - - if let Some(channel_volumes) = props.channel_volumes { - let (volume, _balance) = - pipewire::volume::from_channel_volumes(&channel_volumes); - self.source_volume = (volume * 100.0) as u32; - self.source_volume_text = numtoa::BaseN::<10>::u32(self.source_volume) - .as_str() - .to_owned(); - } - } - } - - pipewire::Event::ActiveProfile(id, profile) => { - tracing::debug!( - target: "sound", - "Device {id} active profile changed to {}: {}", - profile.index, - profile.description - ); - - let prev = self.active_profiles.insert(id, profile.clone()); - self.update_ui_profiles(); - if let Some(prev) = prev { - if prev.index == profile.index { - return; - } - - tracing::debug!( - target: "sound", - "Device {id} profile changed from {} to {}: {}", - prev.index, profile.index, profile.description - ); - } else { - #[cfg(feature = "auto-profile-init")] - if profile.index != 0 { - // Use pw-cli to re-set the profile in case wireplumber has invalid state. - // Profiles set by us do not need to use this. Only sets if profile is not `Off`. - tracing::debug!( - target: "sound", - "Device {id} initialized with profile {}: {}", profile.index, profile.description - ); - - self.set_profile(id, profile.index as u32, false); - } - } - } - - pipewire::Event::ActiveRoute(id, _index, route) => { - tracing::debug!( - target: "sound", - "Device {id} active route changed to {}: {}", - route.index, - route.description - ); - - self.update_device_route_name(&route, id); - - let (active_device, node_ids, set_default_node): ( - Option, - &[NodeId], - fn(&mut Self, NodeId), - ) = match route.direction { - pipewire::Direction::Output => ( - self.active_sink_device, - &self.sink_node_ids, - Self::set_default_sink_id, - ), - pipewire::Direction::Input => ( - self.active_source_device, - &self.source_node_ids, - Self::set_default_source_id, - ), - }; - - if active_device == Some(id) { - for (node_id, &device) in &self.device_ids { - if device == id && node_ids.contains(&node_id) { - set_default_node(self, node_id); - break; - } - } - } - } - - pipewire::Event::AddProfile(id, index, profile) => { - if let Some(p) = self.active_profiles.get_mut(id) - && p.index == profile.index - { - *p = profile.clone(); - } - - let profiles = self.device_profiles.entry(id).or_default(); - if profiles.len() < index as usize + 1 { - let additional = (index as usize + 1) - profiles.capacity(); - profiles.reserve_exact(additional); - profiles.extend(std::iter::repeat_n( - pipewire::Profile::default(), - additional, - )); - } - - profiles[index as usize] = profile; - - self.update_ui_profiles(); - } - - pipewire::Event::AddRoute(id, index, route) => self.add_route(id, index, route), - - pipewire::Event::AddDevice(device) => { - tracing::debug!(target: "sound", "Device {} added: {}", device.id, device.name); - self.device_names - .insert(device.id, self.translate_device_name(&device.name)); - } - - pipewire::Event::AddNode(node) => { - tracing::debug!(target: "sound", "Node {} added: {}", node.object_id, node.node_name); - // Device nodes will have device and card profile device IDs. - // Virtual sinks/sources do not have these. - if let Some(device_id) = node.device_id { - self.device_ids.insert(node.object_id, device_id); - - // This is the device number of the route. This is used with the - // device ID to set properties for a route. - if let Some(card_profile_device) = node.card_profile_device { - self.card_profile_devices - .insert(node.object_id, card_profile_device); - } - } - - let description = self.translate_device_name(&node.description); - - // The default sink/source is defined by a node's name. We use this when setting - // virtual sink/source nodes with pactl; and when pipewire notifies us of a new - // default sink/source. - if self - .node_names - .insert(node.object_id, node.node_name.clone()) - .is_none() - { - // Use the device.profile.description as the route name by default for the UI. - let name = if node.device_profile_description.is_empty() { - description - } else { - [&node.device_profile_description, " - ", &description].concat() - }; - - // Check if the node is a sink or a source, and append it to the relevant collections. - match node.media_class { - pipewire::MediaClass::Sink => { - self.sinks.push(name); - self.sink_node_ids.push(node.object_id); - - // Set the sink as the default if it matches the server. - if self.active_sink_node_name == node.node_name { - tracing::debug!( - target: "sound", - "Node {} ({}) was the default sink", - node.object_id, - node.node_name - ); - self.set_default_sink_node_id(node.object_id); - } else if let Some(device_id) = self.changing_sink_device { - for (node_id, &device) in &self.device_ids { - if device == device_id && self.sink_node_ids.contains(&node_id) - { - self.changing_sink_device = None; - self.set_default_sink_node_id(node_id); - return; - } - } - } - } - - pipewire::MediaClass::Source => { - self.sources.push(name); - self.source_node_ids.push(node.object_id); - - // Set the source as the default if it matches the server. - if self.active_source_node_name == node.node_name { - tracing::debug!( - target: "sound", - "Node {} ({}) was the default source", - node.object_id, - node.node_name - ); - self.set_default_source_node_id(node.object_id); - } else if let Some(device_id) = self.changing_source_device { - for (node_id, &device) in &self.device_ids { - if device == device_id - && self.source_node_ids.contains(&node_id) - { - self.changing_source_device = None; - self.set_default_source_node_id(node_id); - return; - } - } - } - } - } - } - } - - pipewire::Event::DefaultSink(node_name) => { - tracing::debug!(target: "sound", "default sink node changed to {node_name}"); - if self.active_sink_node_name == node_name { - return; - } - - if let Some(id) = self.node_id_from_name(&node_name) { - self.set_default_sink_id(id); - } - - self.active_sink_node_name = node_name; - } - - pipewire::Event::DefaultSource(node_name) => { - tracing::debug!(target: "sound", "default source node changed to {node_name}"); - if self.active_source_node_name == node_name { - return; - } - - if let Some(id) = self.node_id_from_name(&node_name) { - self.set_default_source_id(id); - } - - self.active_source_node_name = node_name; - } - - pipewire::Event::RemoveDevice(id) => self.remove_device(id), - pipewire::Event::RemoveNode(id) => self.remove_node(id), - } - } - - fn add_route(&mut self, id: DeviceId, index: u32, route: pipewire::Route) { - self.update_device_route_name(&route, id); - - tracing::debug!(target: "sound", - "Device {} added route {} ({:?}); {:?}", - id, - route.name, - route.direction, - route.available - ); - - let routes = self.device_routes.entry(id).or_default(); - if routes.len() < index as usize + 1 { - let additional = (index as usize + 1) - routes.capacity(); - routes.reserve_exact(additional); - routes.extend(std::iter::repeat_n(pipewire::Route::default(), additional)); - } - - routes[index as usize] = route; - } - - fn node_id_from_name(&self, name: &str) -> Option { - self.node_names - .iter() - .find(|&(_, n)| *n == name) - .map(|(id, _)| id) - } - - fn remove_device(&mut self, id: DeviceId) { - tracing::debug!(target: "sound", "Device {id} removed"); - _ = self.device_names.remove(id); - _ = self.device_profiles.remove(id); - _ = self.active_profiles.remove(id); - _ = self.device_routes.remove(id); - } - - fn remove_node(&mut self, id: NodeId) { - tracing::debug!(target: "sound", "Node {id} removed"); - if let Some(pos) = self.sink_node_ids.iter().position(|&node_id| node_id == id) { - self.sink_node_ids.remove(pos); - self.sinks.remove(pos); - if let Some(node_id) = self.active_sink_node - && id == node_id - { - self.active_sink = None; - self.active_sink_node = None; - self.active_sink_node_name.clear(); - } - } else if let Some(pos) = self - .source_node_ids - .iter() - .position(|&node_id| node_id == id) - { - self.source_node_ids.remove(pos); - self.sources.remove(pos); - if let Some(node_id) = self.active_source_node - && id == node_id - { - self.active_source = None; - self.active_source_node = None; - self.active_source_node_name.clear(); - } - } - - _ = self.device_ids.remove(id); - _ = self.node_names.remove(id); - _ = self.card_profile_devices.remove(id); - } - - /// Set the default sink device by its the node ID. - fn set_default_sink_id(&mut self, node_id: NodeId) { - self.active_sink = self.sink_node_ids.iter().position(|&id| id == node_id); - self.active_sink_node = Some(node_id); - self.active_sink_node_name = self.node_names.get(node_id).cloned().unwrap_or_default(); - self.active_sink_device = self - .device_ids - .iter() - .find_map(|(nid, did)| if nid == node_id { Some(*did) } else { None }); - } - - /// Set the default source device by its the node ID. - fn set_default_source_id(&mut self, node_id: NodeId) { - self.active_source = self.source_node_ids.iter().position(|&id| id == node_id); - self.active_source_node = Some(node_id); - self.active_source_node_name = self.node_names.get(node_id).cloned().unwrap_or_default(); - self.active_source_device = self - .device_ids - .iter() - .find_map(|(nid, did)| if nid == node_id { Some(*did) } else { None }); - } - - fn update_device_route_name(&mut self, route: &pipewire::Route, id: DeviceId) { - if matches!(route.available, Availability::No) { - return; - } - - let (devices, node_ids) = match route.direction { - pipewire::Direction::Output => (&mut self.sinks, &self.sink_node_ids), - pipewire::Direction::Input => (&mut self.sources, &self.source_node_ids), - }; - - for (pos, &node) in node_ids.iter().enumerate() { - let Some(&device) = self.device_ids.get(node) else { - continue; - }; - - if device != id { - continue; - } - - let Some(profile) = self.active_profiles.get(id) else { - continue; - }; - - if !profile.name.starts_with("pro-audio") { - let Some(&card_profile_device) = self.card_profile_devices.get(node) else { - continue; - }; - - if !route.devices.contains(&(card_profile_device as i32)) { - continue; - } - } - - let Some(device_name) = self.device_names.get(id) else { - continue; - }; - - tracing::debug!(target: "sound", "matched route {} on {}: {}", route.index, id, route.description); - devices[pos] = [&route.description, " - ", device_name].concat(); - self.node_route_indexes.insert(node, route.index); - - break; - } - } - - // Update the cached profiles for the UI. - fn update_ui_profiles(&mut self) { - self.device_profile_dropdowns = self - .device_profiles - .iter() - .filter_map(|(device_id, profiles)| { - let name = self.device_names.get(device_id)?.as_str(); - let (active_profile, indexes, descriptions) = self - .active_profiles - .get(device_id) - .map(|profile| { - let (indexes, descriptions): (Vec<_>, Vec<_>) = profiles - .iter() - .filter(|p| { - p.index == profile.index - || !matches!(p.available, pipewire::Availability::No) - }) - .map(|p| (p.index as u32, p.description.clone())) - .collect(); - - let pos = profiles - .iter() - .filter(|p| { - p.index == profile.index - || !matches!(p.available, pipewire::Availability::No) - }) - .enumerate() - .find(|(_, p)| p.index == profile.index) - .map(|(pos, _)| pos); - - (pos, indexes, descriptions) - }) - .unwrap_or_else(|| { - let (indexes, descriptions): (Vec<_>, Vec<_>) = profiles - .iter() - .filter(|p| !matches!(p.available, pipewire::Availability::No)) - .map(|p| (p.index as u32, p.description.clone())) - .collect(); - - (None, indexes, descriptions) - }); - - Some(( - device_id, - name.to_owned(), - active_profile, - indexes, - descriptions, - )) - }) - .collect::>(); - - self.device_profile_dropdowns.sort_by(|a, b| a.1.cmp(&b.1)); - } - - fn translate_device_name(&self, input: &str) -> String { - input - .replacen(" Controller", "", 1) - .replacen("High Definition Audio", &self.hd_audio_text, 1) - .replacen("HD Audio", &self.hd_audio_text, 1) - .replacen("USB Audio Device", &self.usb_audio_text, 1) - } -} - -#[derive(Clone, Debug)] -pub enum Message { - /// Handle messages from the sound server. - Server(Arc>), - /// Change the output volume. - SinkVolumeApply(NodeId), - /// Change the input volume. - SourceVolumeApply(NodeId), - /// On init of the subscription, channels for closing background threads are given to the app. - SubHandle(Arc), -} - -pub struct SubscriptionHandle { - cancel_tx: futures::channel::oneshot::Sender<()>, - pipewire: pipewire::Sender, -} - -impl std::fmt::Debug for SubscriptionHandle { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str("SubscriptionHandle") - } -} - -// TODO: Use pipewire library -pub async fn set_default(id: u32) { - tracing::debug!(target: "sound", "setting default node {id}"); - let id = numtoa::BaseN::<10>::u32(id); - _ = tokio::process::Command::new("wpctl") - .args(["set-default", id.as_str()]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .await; -} - -/// Use this to set a virtual sink as a default. -/// TODO: We should be able to set this with pipewire-rs somehow. -pub async fn pactl_set_default_sink(node_name: &str) { - tracing::debug!(target: "sound", "setting default virtual node {node_name}"); - _ = tokio::process::Command::new("pactl") - .args(["set-default-sink", node_name]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .await; -} - -/// Use this to set a virtual sink as a default. -/// TODO: We should be able to set this with pipewire-rs somehow. -pub async fn pactl_set_default_source(node_name: &str) { - _ = tokio::process::Command::new("pactl") - .args(["set-default-source", node_name]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .await; -} - -// TODO: Use pipewire library -pub async fn set_profile(id: u32, index: u32, save: bool) { - let id = numtoa::BaseN::<10>::u32(id); - let index = numtoa::BaseN::<10>::u32(index); - let value = [ - "{ index: ", - index.as_str(), - if save { - ", save: true }" - } else { - ", save: false }" - }, - ] - .concat(); - - _ = tokio::process::Command::new("pw-cli") - .args(["s", id.as_str(), "Profile", &value]) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status() - .await; -} diff --git a/subscriptions/upower/src/lib.rs b/subscriptions/upower/src/lib.rs index e594774..6e210f3 100644 --- a/subscriptions/upower/src/lib.rs +++ b/subscriptions/upower/src/lib.rs @@ -4,7 +4,8 @@ pub mod device { use futures::{FutureExt, Stream, StreamExt}; use iced_futures::Subscription; - use std::{fmt::Debug, hash::Hash}; + use std::fmt::Debug; + use std::hash::Hash; use upower_dbus::{BatteryType, DeviceProxy, UPowerProxy}; pub fn device_subscription( @@ -31,7 +32,7 @@ pub mod device { Ok((upower, device_path)) } - async fn events() -> zbus::Result> { + async fn events() -> zbus::Result + Unpin + Send>> { let (upower, device) = display_device().await?; let devices = upower.enumerate_devices().await?; let mut has_battery = false; @@ -50,11 +51,11 @@ pub mod device { } } - let initial = futures::stream::iter(if has_battery { - None - } else { - Some(DeviceDbusEvent::NoBattery) - }); + if !has_battery { + return Ok(Box::new(futures::stream::iter(Some( + DeviceDbusEvent::NoBattery, + )))); + }; let stream = futures::stream_select!( upower.receive_on_battery_changed().await.map(|_| ()), @@ -62,7 +63,7 @@ pub mod device { device.receive_time_to_empty_changed().await.map(|_| ()), ); - Ok(initial.chain(stream.map(move |_| { + Ok(Box::new(stream.map(move |_| { DeviceDbusEvent::Update { on_battery: upower .cached_on_battery() @@ -97,7 +98,8 @@ pub mod kbdbacklight { use futures::{FutureExt, Stream, StreamExt}; use iced_futures::Subscription; - use std::{fmt::Debug, hash::Hash}; + use std::fmt::Debug; + use std::hash::Hash; use tokio::sync::mpsc::{UnboundedSender, unbounded_channel}; use tokio_stream::wrappers::UnboundedReceiverStream; use upower_dbus::{BrightnessChanged, KbdBacklightProxy};