diff --git a/Cargo.lock b/Cargo.lock index 367af6f2..61b84a17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,6 +149,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5f312b0a56c5cdf967c0aeb67f6289603354951683bc97ddc595ab974ba9aa" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -272,11 +278,11 @@ dependencies = [ "futures-lite 2.0.1", "parking", "polling 3.3.0", - "rustix 0.38.21", + "rustix 0.38.24", "slab", "tracing", "waker-fn", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -312,8 +318,8 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.21", - "windows-sys 0.48.0", + "rustix 0.38.24", + "windows-sys", ] [[package]] @@ -339,10 +345,10 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 0.38.21", + "rustix 0.38.24", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -374,9 +380,9 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4d45f362125ed144544e57b0ec6de8fd6a296d41a6252fc4a20c0cf12e9ed3a" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.24", "tempfile", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -587,7 +593,7 @@ dependencies = [ "bitflags 2.4.1", "log", "polling 3.3.0", - "rustix 0.38.21", + "rustix 0.38.24", "slab", "thiserror", ] @@ -599,16 +605,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ "calloop", - "rustix 0.38.21", + "rustix 0.38.24", "wayland-backend 0.3.2", "wayland-client 0.31.1", ] [[package]] name = "cc" -version = "1.0.84" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8e7c90afad890484a21653d08b6e209ae34770fb5ee298f9c699fcc1e5c856" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "libc", ] @@ -651,16 +657,16 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c" dependencies = [ "bitflags 1.3.2", "block", "cocoa-foundation", "core-foundation", "core-graphics", - "foreign-types", + "foreign-types 0.5.0", "libc", "objc", ] @@ -728,14 +734,14 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core-graphics" -version = "0.22.3" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" dependencies = [ "bitflags 1.3.2", "core-foundation", "core-graphics-types", - "foreign-types", + "foreign-types 0.5.0", "libc", ] @@ -763,7 +769,7 @@ dependencies = [ "futures-util", "i18n-embed 0.13.9", "i18n-embed-fl 0.6.7", - "itertools 0.11.0", + "itertools 0.12.0", "libcosmic", "log", "nix 0.26.4", @@ -947,6 +953,7 @@ name = "cosmic-applet-time" version = "0.1.0" dependencies = [ "chrono", + "cosmic-client-toolkit", "i18n-embed 0.13.9", "i18n-embed-fl 0.6.7", "icon-loader", @@ -954,6 +961,9 @@ dependencies = [ "nix 0.26.4", "once_cell", "rust-embed 6.8.1", + "shlex", + "tokio", + "tracing", ] [[package]] @@ -988,7 +998,6 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1002,7 +1011,6 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "quote", "syn 1.0.109", @@ -1102,7 +1110,6 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "almost", "cosmic-config", @@ -1216,6 +1223,16 @@ dependencies = [ "serde", ] +[[package]] +name = "ctor" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583" +dependencies = [ + "quote", + "syn 2.0.39", +] + [[package]] name = "cursor-icon" version = "1.1.0" @@ -1495,7 +1512,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1530,6 +1547,41 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "drm" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb1b703ffbc7ebd216eba7900008049a56ace55580ecb2ee7fa801e8d8be87" +dependencies = [ + "bitflags 2.4.1", + "bytemuck", + "drm-ffi", + "drm-fourcc", + "nix 0.27.1", +] + +[[package]] +name = "drm-ffi" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba7d1c19c4b6270e89d59fb27dc6d02a317c658a8a54e54781e1db9b5947595d" +dependencies = [ + "drm-sys", + "nix 0.27.1", +] + +[[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.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f1c0468062a56cd5705f1e3b5409eb286d5596a2028ec8e947595d7e715ae" + [[package]] name = "either" version = "1.9.0" @@ -1602,12 +1654,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1721,7 +1773,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1850,7 +1902,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", ] [[package]] @@ -1859,6 +1932,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.0" @@ -2040,9 +2119,9 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +checksum = "bb65d4ba3173c56a500b555b532f72c42e8d1fe64962b518897f8959fae2c177" dependencies = [ "libc", "winapi", @@ -2483,7 +2562,6 @@ dependencies = [ [[package]] name = "iced" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "iced_accessibility", "iced_core", @@ -2498,7 +2576,6 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "accesskit", "accesskit_unix", @@ -2507,7 +2584,6 @@ dependencies = [ [[package]] name = "iced_core" version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "bitflags 1.3.2", "iced_accessibility", @@ -2522,7 +2598,6 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.7.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "futures", "iced_core", @@ -2535,7 +2610,6 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2553,7 +2627,6 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2566,7 +2639,6 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.1.1" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "iced_accessibility", "iced_core", @@ -2578,7 +2650,6 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "enum-repr", "float-cmp", @@ -2602,7 +2673,6 @@ dependencies = [ [[package]] name = "iced_style" version = "0.9.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "iced_core", "once_cell", @@ -2612,7 +2682,6 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "bytemuck", "cosmic-text", @@ -2630,7 +2699,6 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.11.1" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2652,7 +2720,6 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.1.3" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "iced_renderer", "iced_runtime", @@ -2792,7 +2859,7 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.3", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -2808,8 +2875,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.21", - "windows-sys 0.48.0", + "rustix 0.38.24", + "windows-sys", ] [[package]] @@ -2823,9 +2890,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] @@ -2924,10 +2991,10 @@ checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#405aaf134d00a6aef223aef3799b3904b1050b0c" dependencies = [ "apply", "ashpd", + "cosmic-client-toolkit", "cosmic-config", "cosmic-panel-config", "cosmic-theme", @@ -2945,16 +3012,17 @@ dependencies = [ "iced_tiny_skia", "iced_widget", "lazy_static", + "nix 0.26.4", "palette", "ron", "slotmap", - "smithay-client-toolkit 0.18.0", "taffy", "thiserror", "tokio", "tracing", "unicode-segmentation", "url", + "zbus", ] [[package]] @@ -2983,7 +3051,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3258,7 +3326,7 @@ dependencies = [ "bitflags 1.3.2", "block", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -3288,7 +3356,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3352,28 +3420,26 @@ dependencies = [ [[package]] name = "nix" -version = "0.25.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ - "autocfg", "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", + "memoffset 0.7.1", + "pin-utils", ] [[package]] name = "nix" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "libc", - "memoffset 0.7.1", - "pin-utils", ] [[package]] @@ -3402,7 +3468,7 @@ dependencies = [ "log", "mio", "walkdir", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3830,7 +3896,7 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3842,9 +3908,9 @@ dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.21", + "rustix 0.38.24", "tracing", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3941,7 +4007,7 @@ dependencies = [ "hex", "lazy_static", "procfs-core", - "rustix 0.38.21", + "rustix 0.38.24", ] [[package]] @@ -4297,20 +4363,20 @@ dependencies = [ "io-lifetimes 1.0.11", "libc", "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys 0.4.11", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -4578,7 +4644,7 @@ dependencies = [ "log", "memmap2 0.9.0", "pkg-config", - "rustix 0.38.21", + "rustix 0.38.24", "thiserror", "wayland-backend 0.3.2", "wayland-client 0.31.1", @@ -4618,33 +4684,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "softbuffer" -version = "0.2.0" -source = "git+https://github.com/pop-os/softbuffer?tag=cosmic-2.0-old#ece901a9f60dc89ca740dc3bd11f3c909e801723" +version = "0.3.3" +source = "git+https://github.com/pop-os/softbuffer?tag=v0.3-cosmic#6f0371ccece51d124c6c5d37082189df0dc5f9ba" dependencies = [ + "as-raw-xcb-connection", "bytemuck", "cfg_aliases", "cocoa", "core-graphics", - "fastrand 1.9.0", - "foreign-types", + "drm", + "fastrand 2.0.1", + "foreign-types 0.5.0", + "js-sys", "log", - "nix 0.26.4", + "memmap2 0.9.0", "objc", "raw-window-handle", - "redox_syscall 0.3.5", - "thiserror", + "redox_syscall 0.4.1", + "rustix 0.38.24", + "tiny-xlib", "wasm-bindgen", - "wayland-backend 0.1.2", - "wayland-client 0.30.2", - "wayland-sys 0.30.1", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-sys 0.31.1", "web-sys", - "windows-sys 0.42.0", - "x11-dl", + "windows-sys", "x11rb", ] @@ -4824,15 +4893,15 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.21", - "windows-sys 0.48.0", + "rustix 0.38.24", + "windows-sys", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -4932,6 +5001,18 @@ dependencies = [ "strict-num", ] +[[package]] +name = "tiny-xlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" +dependencies = [ + "as-raw-xcb-connection", + "ctor", + "libloading 0.8.1", + "tracing", +] + [[package]] name = "tinystr" version = "0.7.4" @@ -4973,7 +5054,7 @@ dependencies = [ "socket2 0.5.5", "tokio-macros", "tracing", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -5097,9 +5178,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", @@ -5108,9 +5189,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "sharded-slab", @@ -5695,7 +5776,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96b2a02ac608e07132978689a6f9bf4214949c85998c247abadd4f4129b1aa06" dependencies = [ "dlib", - "lazy_static", "log", "pkg-config", ] @@ -5708,6 +5788,7 @@ checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", "log", + "once_cell", "pkg-config", ] @@ -5788,7 +5869,7 @@ dependencies = [ "block", "core-graphics-types", "d3d12", - "foreign-types", + "foreign-types 0.3.2", "glow", "gpu-alloc", "gpu-allocator", @@ -5891,21 +5972,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6038,27 +6104,17 @@ dependencies = [ "memchr", ] -[[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.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +checksum = "b1641b26d4dec61337c35a1b1aaf9e3cba8f46f0b43636c609ab0291a648040a" dependencies = [ + "as-raw-xcb-connection", "gethostname", "libc", "libloading 0.7.4", - "nix 0.25.1", + "nix 0.26.4", "once_cell", "winapi", "winapi-wsapoll", @@ -6067,11 +6123,11 @@ dependencies = [ [[package]] name = "x11rb-protocol" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" +checksum = "82d6c3f9a0fb6701fab8f6cea9b0c0bd5d6876f1f89f7fada07e558077c344bc" dependencies = [ - "nix 0.25.1", + "nix 0.26.4", ] [[package]] @@ -6227,18 +6283,18 @@ checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" [[package]] name = "zerocopy" -version = "0.7.25" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.25" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index a2b9bb0f..6906506d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ lto = "thin" # [patch."https://github.com/pop-os/cosmic-time"] # cosmic-time = { path = "../cosmic-time" } -# [patch."https://github.com/pop-os/libcosmic"] +[patch."https://github.com/pop-os/libcosmic"] # libcosmic = { path = "../libcosmic" } # cosmic-config = { path = "../libcosmic/cosmic-config" } [patch."https://github.com/Smithay/client-toolkit"] diff --git a/cosmic-applet-time/Cargo.toml b/cosmic-applet-time/Cargo.toml index f20e3339..fc4df234 100644 --- a/cosmic-applet-time/Cargo.toml +++ b/cosmic-applet-time/Cargo.toml @@ -5,12 +5,23 @@ edition = "2021" license = "GPL-3.0-or-later" [dependencies] +cctk.workspace = true icon-loader = { version = "0.3.6", features = ["gtk"] } -libcosmic.workspace = true +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = [ + "applet", + "tokio", + "wayland", + "applet-token", + "process" +], branch = "single-instance" } nix = "0.26.2" chrono = { version = "0.4.23", features = ["clock"] } once_cell = "1" +shlex = "1.1.0" +tracing = "0.1" +tokio = { version = "1.17.0", features = ["process"] } + # Application i18n i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] } i18n-embed-fl = "0.6.4" -rust-embed = "6.3.0" \ No newline at end of file +rust-embed = "6.3.0" diff --git a/cosmic-applet-time/data/com.system76.CosmicAppletTime.desktop b/cosmic-applet-time/data/com.system76.CosmicAppletTime.desktop index a0f1a4ce..8a4a8287 100644 --- a/cosmic-applet-time/data/com.system76.CosmicAppletTime.desktop +++ b/cosmic-applet-time/data/com.system76.CosmicAppletTime.desktop @@ -9,3 +9,5 @@ Keywords=Cosmic;Iced; Icon=com.system76.CosmicAppletTime NoDisplay=true X-CosmicApplet=true +X-HostWaylandDisplay=true + diff --git a/cosmic-applet-time/src/window.rs b/cosmic-applet-time/src/window.rs index edff6b1a..c05e16ca 100644 --- a/cosmic-applet-time/src/window.rs +++ b/cosmic-applet-time/src/window.rs @@ -1,3 +1,4 @@ +use cctk::sctk::reexports::calloop; use cosmic::applet::{menu_button, padded_control}; use cosmic::iced::wayland::popup::{destroy_popup, get_popup}; use cosmic::iced::{ @@ -19,6 +20,9 @@ use std::time::Duration; use crate::fl; use crate::time::get_calender_first; +use cosmic::applet::token::subscription::{ + activation_token_subscription, TokenRequest, TokenUpdate, +}; #[derive(Debug, Clone)] #[allow(dead_code)] @@ -35,6 +39,7 @@ pub struct Window { now: DateTime, rectangle_tracker: Option>, rectangle: Rectangle, + wayland_tx: Option>, } #[derive(Debug, Clone)] @@ -47,6 +52,7 @@ pub enum Message { PreviousMonth, NextMonth, OpenDateTimeSettings, + Wayland(TokenUpdate), } impl cosmic::Application for Window { @@ -68,6 +74,7 @@ impl cosmic::Application for Window { now: Local::now(), rectangle_tracker: None, rectangle: Rectangle::default(), + wayland_tx: None, }, Command::none(), ) @@ -106,6 +113,7 @@ impl cosmic::Application for Window { wait.try_into().unwrap_or(FALLBACK_DELAY), )) .map(|_| Message::Tick), + activation_token_subscription(0).map(Message::Wayland), ]) } @@ -179,6 +187,47 @@ impl cosmic::Application for Window { } Message::OpenDateTimeSettings => { // TODO + let exec = "cosmic-settings time".to_string(); + if let Some(tx) = self.wayland_tx.as_ref() { + let _ = tx.send(TokenRequest { + app_id: Self::APP_ID.to_string(), + exec, + }); + } else { + tracing::error!("Wayland tx is None"); + }; + Command::none() + } + Message::Wayland(u) => { + match u { + TokenUpdate::Init(tx) => { + self.wayland_tx = Some(tx); + } + TokenUpdate::Finished => { + self.wayland_tx = None; + } + TokenUpdate::ActivationToken { token, exec } => { + let mut exec = shlex::Shlex::new(&exec); + let mut cmd = match exec.next() { + Some(cmd) if !cmd.contains('=') => std::process::Command::new(cmd), + _ => return Command::none(), + }; + for arg in exec { + // TODO handle "%" args here if necessary? + if !arg.starts_with('%') { + cmd.arg(arg); + } + } + eprintln!("token: {:?}", token); + if let Some(token) = token { + cmd.env("XDG_ACTIVATION_TOKEN", &token); + cmd.env("DESKTOP_STARTUP_ID", &token); + } + tokio::task::spawn_blocking(|| { + cosmic::process::spawn(cmd); + }); + } + } Command::none() } }