diff --git a/Cargo.lock b/Cargo.lock index 6556559b..b14b5830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -171,7 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.7.0", + "bitflags 2.8.0", "cc", "cesu8", "jni", @@ -342,8 +342,6 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd884d7c72877a94102c3715f3b1cd09ff4fac28221add3e57cfbe25c236d093" dependencies = [ - "async-fs", - "async-net", "enumflags2", "futures-channel", "futures-util", @@ -492,17 +490,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-net" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" -dependencies = [ - "async-io 2.4.0", - "blocking", - "futures-lite 2.6.0", -] - [[package]] name = "async-process" version = "1.8.1" @@ -743,9 +730,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" dependencies = [ "serde", ] @@ -886,7 +873,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "log", "polling 3.7.4", "rustix 0.38.43", @@ -908,9 +895,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -1198,7 +1185,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1217,7 +1204,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "quote", "syn 1.0.109", @@ -1243,7 +1230,7 @@ dependencies = [ "icu_collator", "icu_provider", "ignore", - "image 0.25.5", + "image", "libc", "libcosmic", "liblzma", @@ -1302,7 +1289,7 @@ name = "cosmic-protocols" version = "0.1.0" source = "git+https://github.com/pop-os/cosmic-protocols?rev=d218c76#d218c76b58c7a3b20dd5e7943f93fc306a1b81b8" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -1316,7 +1303,7 @@ name = "cosmic-text" version = "0.12.1" source = "git+https://github.com/pop-os/cosmic-text.git#166b59f560c551dab391a864f7c1f503c1e18446" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "fontdb 0.16.2", "log", "rangemap", @@ -1336,7 +1323,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "almost", "cosmic-config", @@ -1467,7 +1454,7 @@ version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "libloading", "winapi", ] @@ -1679,7 +1666,7 @@ name = "dnd" version = "0.1.0" source = "git+https://github.com/pop-os/window_clipboard.git?tag=pop-0.13-2#6b9faab87bea9cebec6ae036906fd67fed254f5f" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "mime 0.1.0", "raw-window-handle", "smithay-client-toolkit", @@ -1712,7 +1699,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytemuck", "drm-ffi", "drm-fourcc", @@ -1759,9 +1746,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" dependencies = [ "enumflags2_derive", "serde", @@ -1769,9 +1756,9 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" dependencies = [ "proc-macro2", "quote", @@ -2393,7 +2380,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f969edf089188d821a30cde713b6f9eb08b20c63fc2e584aba2892a7984a8cc0" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "futures-channel", "futures-core", "futures-executor", @@ -2488,7 +2475,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "gpu-alloc-types", ] @@ -2498,7 +2485,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -2520,7 +2507,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf29e94d6d243368b7a56caa16bc213e4f9f8ed38c4d9557069527b5d5281ca" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "gpu-descriptor-types", "hashbrown 0.15.2", ] @@ -2531,7 +2518,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -2581,7 +2568,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "com", "libc", "libloading", @@ -2737,7 +2724,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "dnd", "iced_accessibility", @@ -2746,7 +2733,7 @@ dependencies = [ "iced_renderer", "iced_widget", "iced_winit", - "image 0.24.9", + "image", "mime 0.1.0", "thiserror 1.0.69", "window_clipboard", @@ -2755,7 +2742,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "accesskit", "accesskit_winit", @@ -2764,9 +2751,9 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "cosmic-client-toolkit", "dnd", @@ -2788,7 +2775,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "futures", "iced_core", @@ -2814,15 +2801,15 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytemuck", "cosmic-text", "half", "iced_core", "iced_futures", - "image 0.24.9", + "image", "kamadak-exif", "log", "lyon_path", @@ -2836,7 +2823,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2848,7 +2835,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "bytes", "cosmic-client-toolkit", @@ -2863,7 +2850,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "bytemuck", "cosmic-text", @@ -2879,10 +2866,10 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "as-raw-xcb-connection", - "bitflags 2.7.0", + "bitflags 2.8.0", "bytemuck", "cosmic-client-toolkit", "futures", @@ -2910,7 +2897,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -2928,7 +2915,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0-dev" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "cosmic-client-toolkit", "dnd", @@ -3140,24 +3127,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "image" -version = "0.24.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "exr", - "gif", - "jpeg-decoder", - "num-traits", - "png", - "qoi", - "tiff", -] - [[package]] name = "image" version = "0.25.5" @@ -3401,9 +3370,6 @@ name = "jpeg-decoder" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" @@ -3524,7 +3490,7 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#bd8347f7fcb8acad3bfd90cb0bc0891330db12e6" +source = "git+https://github.com/jpttrssn/libcosmic?branch=launch-app-in-term#55ad8f98a091808b168347bcaa1925c310916d2a" dependencies = [ "apply", "ashpd 0.9.2", @@ -3536,6 +3502,7 @@ dependencies = [ "css-color", "derive_setters", "freedesktop-desktop-entry", + "freedesktop_entry_parser", "iced", "iced_core", "iced_futures", @@ -3545,9 +3512,13 @@ dependencies = [ "iced_wgpu", "iced_widget", "iced_winit", + "icu_collator", + "image", "lazy_static", "libc", "mime 0.3.17", + "mime_guess", + "once_cell", "palette", "rfd", "rustix 0.38.43", @@ -3560,6 +3531,7 @@ dependencies = [ "tracing", "unicode-segmentation", "url", + "xdg", "zbus 4.4.0", ] @@ -3615,7 +3587,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "libc", "redox_syscall 0.5.8", ] @@ -3851,7 +3823,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block", "core-graphics-types", "foreign-types", @@ -3937,7 +3909,7 @@ checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" dependencies = [ "arrayvec 0.7.6", "bit-set", - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", @@ -3956,7 +3928,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "jni-sys", "log", "ndk-sys 0.6.0+11769913", @@ -4013,7 +3985,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if", "cfg_aliases 0.2.1", "libc", @@ -4053,7 +4025,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -4242,7 +4214,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "libc", "objc2", @@ -4258,7 +4230,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-core-location", @@ -4282,7 +4254,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -4324,7 +4296,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "dispatch", "libc", @@ -4349,7 +4321,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -4361,7 +4333,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -4384,7 +4356,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-cloud-kit", @@ -4416,7 +4388,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-core-location", @@ -4962,9 +4934,9 @@ dependencies = [ [[package]] name = "range-alloc" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" +checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde" [[package]] name = "rangemap" @@ -5098,7 +5070,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -5217,7 +5189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.7.0", + "bitflags 2.8.0", "serde", "serde_derive", ] @@ -5300,7 +5272,7 @@ version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys 0.4.15", @@ -5319,7 +5291,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytemuck", "libm", "smallvec", @@ -5407,9 +5379,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "336a0c23cf42a38d9eaa7cd22c7040d04e1228a19a933890805ffd00a16437d2" dependencies = [ "indexmap", "itoa", @@ -5554,7 +5526,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bytemuck", "calloop", "calloop-wayland-source", @@ -5652,7 +5624,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.7.0", + "bitflags 2.8.0", ] [[package]] @@ -5859,9 +5831,9 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dffced63c2b5c7be278154d76b479f9f9920ed34e7574201407f0b14e2bbb93" +checksum = "e7f46083d221181166e5b6f6b1e5f1d499f3a76888826e6cb1d057554157cd0f" dependencies = [ "env_logger", "test-log-macros", @@ -5870,9 +5842,9 @@ dependencies = [ [[package]] name = "test-log-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" +checksum = "888d0c3c6db53c0fdab160d2ed5e12ba745383d3e85813f2ea0f2b1475ab553f" dependencies = [ "proc-macro2", "quote", @@ -6460,9 +6432,9 @@ dependencies = [ [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vergen" @@ -6616,7 +6588,7 @@ version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "rustix 0.38.43", "wayland-backend", "wayland-scanner", @@ -6628,7 +6600,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cursor-icon", "wayland-backend", ] @@ -6650,7 +6622,7 @@ version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -6663,7 +6635,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6676,7 +6648,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6701,7 +6673,7 @@ version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c89532cc712a2adb119eb4d09694b402576052254d0bb284f82ac1c47fb786ad" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "downcast-rs", "io-lifetimes 2.0.4", "rustix 0.38.43", @@ -6780,7 +6752,7 @@ checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" dependencies = [ "arrayvec 0.7.6", "bit-vec", - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg_aliases 0.1.1", "document-features", "indexmap", @@ -6807,7 +6779,7 @@ dependencies = [ "arrayvec 0.7.6", "ash", "bit-set", - "bitflags 2.7.0", + "bitflags 2.8.0", "block", "cfg_aliases 0.1.1", "core-graphics-types", @@ -6848,7 +6820,7 @@ version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "js-sys", "web-sys", ] @@ -7316,7 +7288,7 @@ dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.7.0", + "bitflags 2.8.0", "block2", "bytemuck", "calloop", @@ -7484,7 +7456,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "dlib", "log", "once_cell", @@ -7591,15 +7563,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" dependencies = [ "async-broadcast 0.7.2", - "async-executor", - "async-fs", - "async-io 2.4.0", - "async-lock 3.4.0", "async-process 2.3.0", "async-recursion", - "async-task", "async-trait", - "blocking", "enumflags2", "event-listener 5.4.0", "futures-core", diff --git a/Cargo.toml b/Cargo.toml index 52b6721e..12cf19b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,8 +98,9 @@ filetime = { git = "https://github.com/jackpot51/filetime" } # [patch.'https://github.com/pop-os/cosmic-text'] # cosmic-text = { path = "../cosmic-text" } -# [patch.'https://github.com/pop-os/libcosmic'] +[patch.'https://github.com/pop-os/libcosmic'] # libcosmic = { path = "../libcosmic" } +libcosmic = { git = "https://github.com/jpttrssn/libcosmic", branch = "launch-app-in-term"} # cosmic-config = { path = "../libcosmic/cosmic-config" } # cosmic-theme = { path = "../libcosmic/cosmic-theme" } diff --git a/src/app.rs b/src/app.rs index c5c2a5e0..b269dd56 100644 --- a/src/app.rs +++ b/src/app.rs @@ -27,7 +27,7 @@ use cosmic::{ Alignment, Event, Length, Point, Rectangle, Size, Subscription, }, iced_runtime::clipboard, - style, theme, + mime_app, style, theme, widget::{ self, dnd_destination::DragId, @@ -65,7 +65,7 @@ use crate::{ fl, home_dir, key_bind::key_binds, localize::LANGUAGE_SORTER, - menu, mime_app, mime_icon, + menu, mime_icon, mounter::{MounterAuth, MounterItem, MounterItems, MounterKey, MounterMessage, MOUNTERS}, operation::{Controller, Operation, OperationSelection, ReplaceResult}, spawn_detached::spawn_detached, @@ -1601,6 +1601,8 @@ impl Application for App { tab_drag_id: DragId::new(), }; + mime_app::reload(Some(&LANGUAGE_SORTER)); + let mut commands = vec![app.update_config()]; for location in flags.locations { diff --git a/src/lib.rs b/src/lib.rs index c6ca3456..2570c028 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,6 @@ pub mod dialog; mod key_bind; mod localize; mod menu; -mod mime_app; pub mod mime_icon; mod mounter; mod mouse_area; diff --git a/src/mime_app.rs b/src/mime_app.rs deleted file mode 100644 index 9e110113..00000000 --- a/src/mime_app.rs +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright 2023 System76 -// SPDX-License-Identifier: GPL-3.0-only - -#[cfg(feature = "desktop")] -use cosmic::desktop; -use cosmic::widget; -pub use mime_guess::Mime; -use once_cell::sync::Lazy; -use std::{ - cmp::Ordering, collections::HashMap, env, ffi::OsString, path::PathBuf, process, sync::Mutex, - time::Instant, -}; - -pub fn exec_to_command(exec: &str, path_opt: Option) -> Option { - let args_vec: Vec = shlex::split(exec)?; - let mut args = args_vec.iter(); - let mut command = process::Command::new(args.next()?); - for arg in args { - if arg.starts_with('%') { - match arg.as_str() { - "%f" | "%F" | "%u" | "%U" => { - if let Some(path) = &path_opt { - command.arg(path); - } - } - _ => { - log::warn!("unsupported Exec code {:?} in {:?}", arg, exec); - return None; - } - } - } else { - command.arg(arg); - } - } - Some(command) -} - -#[derive(Clone, Debug)] -pub struct MimeApp { - pub id: String, - pub path: Option, - pub name: String, - pub exec: Option, - pub icon: widget::icon::Handle, - pub is_default: bool, -} - -impl MimeApp { - //TODO: move to libcosmic, support multiple files - pub fn command(&self, path_opt: Option) -> Option { - exec_to_command(self.exec.as_deref()?, path_opt) - } -} - -#[cfg(feature = "desktop")] -impl From<&desktop::DesktopEntryData> for MimeApp { - fn from(app: &desktop::DesktopEntryData) -> Self { - Self { - id: app.id.clone(), - path: app.path.clone(), - name: app.name.clone(), - exec: app.exec.clone(), - icon: match &app.icon { - desktop::IconSource::Name(name) => { - widget::icon::from_name(name.as_str()).size(32).handle() - } - desktop::IconSource::Path(path) => widget::icon::from_path(path.clone()), - }, - is_default: false, - } - } -} - -#[cfg(feature = "desktop")] -fn filename_eq(path_opt: &Option, filename: &str) -> bool { - path_opt - .as_ref() - .and_then(|path| path.file_name()) - .map(|x| x == filename) - .unwrap_or(false) -} - -pub struct MimeAppCache { - cache: HashMap>, - terminals: Vec, -} - -impl MimeAppCache { - pub fn new() -> Self { - let mut mime_app_cache = Self { - cache: HashMap::new(), - terminals: Vec::new(), - }; - mime_app_cache.reload(); - mime_app_cache - } - - #[cfg(not(feature = "desktop"))] - pub fn reload(&mut self) {} - - // Only available when using desktop feature of libcosmic, which only works on Unix-likes - #[cfg(feature = "desktop")] - pub fn reload(&mut self) { - use crate::localize::LANGUAGE_SORTER; - - let start = Instant::now(); - - self.cache.clear(); - self.terminals.clear(); - - //TODO: get proper locale? - let locale = None; - - // Load desktop applications by supported mime types - //TODO: hashmap for all apps by id? - let all_apps = desktop::load_applications(locale, false); - for app in all_apps.iter() { - for mime in app.mime_types.iter() { - let apps = self - .cache - .entry(mime.clone()) - .or_insert_with(|| Vec::with_capacity(1)); - if apps.iter().find(|x| x.id == app.id).is_none() { - apps.push(MimeApp::from(app)); - } - } - for category in app.categories.iter() { - if category == "TerminalEmulator" { - self.terminals.push(MimeApp::from(app)); - break; - } - } - } - - let desktops: Vec = env::var("XDG_CURRENT_DESKTOP") - .unwrap_or_default() - .split(':') - .map(|x| x.to_ascii_lowercase()) - .collect(); - - // Load mimeapps.list files - // https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html - //TODO: ensure correct lookup order - let mut mimeapps_paths = Vec::new(); - match xdg::BaseDirectories::new() { - Ok(xdg_dirs) => { - for path in xdg_dirs.find_data_files("applications/mimeapps.list") { - mimeapps_paths.push(path); - } - for desktop in desktops.iter().rev() { - for path in - xdg_dirs.find_data_files(format!("applications/{desktop}-mimeapps.list")) - { - mimeapps_paths.push(path); - } - } - for path in xdg_dirs.find_config_files("mimeapps.list") { - mimeapps_paths.push(path); - } - for desktop in desktops.iter().rev() { - for path in xdg_dirs.find_config_files(format!("{desktop}-mimeapps.list")) { - mimeapps_paths.push(path); - } - } - } - Err(err) => { - log::warn!("failed to get xdg base directories: {}", err); - } - } - - //TODO: handle directory specific behavior - for path in mimeapps_paths { - let entry = match freedesktop_entry_parser::parse_entry(&path) { - Ok(ok) => ok, - Err(err) => { - log::warn!("failed to parse {:?}: {}", path, err); - continue; - } - }; - - for attr in entry - .section("Added Associations") - .attrs() - .chain(entry.section("Default Applications").attrs()) - { - if let Ok(mime) = attr.name.parse::() { - if let Some(filenames) = attr.value { - for filename in filenames.split_terminator(';') { - log::trace!("add {}={}", mime, filename); - let apps = self - .cache - .entry(mime.clone()) - .or_insert_with(|| Vec::with_capacity(1)); - if apps - .iter() - .find(|x| filename_eq(&x.path, filename)) - .is_none() - { - if let Some(app) = - all_apps.iter().find(|x| filename_eq(&x.path, filename)) - { - apps.push(MimeApp::from(app)); - } else { - log::debug!("failed to add association for {:?}: application {:?} not found", mime, filename); - } - } - } - } - } - } - - for attr in entry.section("Removed Associations").attrs() { - if let Ok(mime) = attr.name.parse::() { - if let Some(filenames) = attr.value { - for filename in filenames.split_terminator(';') { - log::trace!("remove {}={}", mime, filename); - if let Some(apps) = self.cache.get_mut(&mime) { - apps.retain(|x| !filename_eq(&x.path, filename)); - } - } - } - } - } - - for attr in entry.section("Default Applications").attrs() { - if let Ok(mime) = attr.name.parse::() { - if let Some(filenames) = attr.value { - for filename in filenames.split_terminator(';') { - log::trace!("default {}={}", mime, filename); - if let Some(apps) = self.cache.get_mut(&mime) { - let mut found = false; - for app in apps.iter_mut() { - if filename_eq(&app.path, filename) { - app.is_default = true; - found = true; - } else { - app.is_default = false; - } - } - if found { - break; - } else { - log::debug!("failed to set default for {:?}: application {:?} not found", mime, filename); - } - } - } - } - } - } - } - - // Sort apps by name - for apps in self.cache.values_mut() { - apps.sort_by(|a, b| match (a.is_default, b.is_default) { - (true, false) => Ordering::Less, - (false, true) => Ordering::Greater, - _ => LANGUAGE_SORTER.compare(&a.name, &b.name), - }); - } - - let elapsed = start.elapsed(); - log::info!("loaded mime app cache in {:?}", elapsed); - } - - pub fn get(&self, key: &Mime) -> Vec { - self.cache - .get(&key) - .map_or_else(|| Vec::new(), |x| x.clone()) - } -} - -static MIME_APP_CACHE: Lazy> = Lazy::new(|| Mutex::new(MimeAppCache::new())); - -pub fn mime_apps(mime: &Mime) -> Vec { - let mime_app_cache = MIME_APP_CACHE.lock().unwrap(); - mime_app_cache.get(mime) -} - -pub fn terminal() -> Option { - let mime_app_cache = MIME_APP_CACHE.lock().unwrap(); - - //TODO: consider rules in https://github.com/Vladimir-csp/xdg-terminal-exec - - // Look for and return preferred terminals - //TODO: fallback order beyond cosmic-term? - for id in &["com.system76.CosmicTerm"] { - for terminal in mime_app_cache.terminals.iter() { - if &terminal.id == id { - return Some(terminal.clone()); - } - } - } - - // Return whatever was the first terminal found - mime_app_cache.terminals.first().map(|x| x.clone()) -} diff --git a/src/tab.rs b/src/tab.rs index 125c8cec..89bc9ab0 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -8,8 +8,7 @@ use cosmic::{ alignment::{Horizontal, Vertical}, clipboard::dnd::DndAction, event, - futures, - futures::SinkExt, + futures::{self, SinkExt}, keyboard::Modifiers, stream, //TODO: export in cosmic::widget @@ -28,6 +27,7 @@ use cosmic::{ Subscription, }, iced_core::{mouse::ScrollDelta, widget::tree}, + mime_app::{mime_apps, MimeApp}, theme, widget::{ self, @@ -65,7 +65,6 @@ use crate::{ fl, localize::{LANGUAGE_CHRONO, LANGUAGE_SORTER}, menu, - mime_app::{mime_apps, MimeApp}, mime_icon::{mime_for_path, mime_icon}, mounter::MOUNTERS, mouse_area,