← luna

Commit 82f8442

8
files
+911
added
-3
deleted
@@ -26,6 +26,149 @@ version = "0.7.8"
26 26 source = "registry+https://github.com/rust-lang/crates.io-index"
27 27 checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
28 28
29 +[[package]]
30 +name = "async-broadcast"
31 +version = "0.7.2"
32 +source = "registry+https://github.com/rust-lang/crates.io-index"
33 +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
34 +dependencies = [
35 + "event-listener",
36 + "event-listener-strategy",
37 + "futures-core",
38 + "pin-project-lite",
39 +]
40 +
41 +[[package]]
42 +name = "async-channel"
43 +version = "2.5.0"
44 +source = "registry+https://github.com/rust-lang/crates.io-index"
45 +checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
46 +dependencies = [
47 + "concurrent-queue",
48 + "event-listener-strategy",
49 + "futures-core",
50 + "pin-project-lite",
51 +]
52 +
53 +[[package]]
54 +name = "async-executor"
55 +version = "1.14.0"
56 +source = "registry+https://github.com/rust-lang/crates.io-index"
57 +checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
58 +dependencies = [
59 + "async-task",
60 + "concurrent-queue",
61 + "fastrand",
62 + "futures-lite",
63 + "pin-project-lite",
64 + "slab",
65 +]
66 +
67 +[[package]]
68 +name = "async-io"
69 +version = "2.6.0"
70 +source = "registry+https://github.com/rust-lang/crates.io-index"
71 +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
72 +dependencies = [
73 + "autocfg",
74 + "cfg-if",
75 + "concurrent-queue",
76 + "futures-io",
77 + "futures-lite",
78 + "parking",
79 + "polling",
80 + "rustix 1.1.5",
81 + "slab",
82 + "windows-sys 0.61.2",
83 +]
84 +
85 +[[package]]
86 +name = "async-lock"
87 +version = "3.4.2"
88 +source = "registry+https://github.com/rust-lang/crates.io-index"
89 +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
90 +dependencies = [
91 + "event-listener",
92 + "event-listener-strategy",
93 + "pin-project-lite",
94 +]
95 +
96 +[[package]]
97 +name = "async-process"
98 +version = "2.5.0"
99 +source = "registry+https://github.com/rust-lang/crates.io-index"
100 +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
101 +dependencies = [
102 + "async-channel",
103 + "async-io",
104 + "async-lock",
105 + "async-signal",
106 + "async-task",
107 + "blocking",
108 + "cfg-if",
109 + "event-listener",
110 + "futures-lite",
111 + "rustix 1.1.5",
112 +]
113 +
114 +[[package]]
115 +name = "async-recursion"
116 +version = "1.2.0"
117 +source = "registry+https://github.com/rust-lang/crates.io-index"
118 +checksum = "4f8abc12baad266b1c8cec146854c195b5864b4221d4b2ca7296a7ae82d9e451"
119 +dependencies = [
120 + "proc-macro2",
121 + "quote",
122 + "syn 3.0.7",
123 +]
124 +
125 +[[package]]
126 +name = "async-signal"
127 +version = "0.2.14"
128 +source = "registry+https://github.com/rust-lang/crates.io-index"
129 +checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
130 +dependencies = [
131 + "async-io",
132 + "async-lock",
133 + "atomic-waker",
134 + "cfg-if",
135 + "futures-core",
136 + "futures-io",
137 + "rustix 1.1.5",
138 + "signal-hook-registry",
139 + "slab",
140 + "windows-sys 0.61.2",
141 +]
142 +
143 +[[package]]
144 +name = "async-task"
145 +version = "4.7.1"
146 +source = "registry+https://github.com/rust-lang/crates.io-index"
147 +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
148 +
149 +[[package]]
150 +name = "async-trait"
151 +version = "0.1.92"
152 +source = "registry+https://github.com/rust-lang/crates.io-index"
153 +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
154 +dependencies = [
155 + "proc-macro2",
156 + "quote",
157 + "syn 3.0.7",
158 +]
159 +
160 +[[package]]
161 +name = "atomic-waker"
162 +version = "1.1.2"
163 +source = "registry+https://github.com/rust-lang/crates.io-index"
164 +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
165 +
166 +[[package]]
167 +name = "autocfg"
168 +version = "1.5.1"
169 +source = "registry+https://github.com/rust-lang/crates.io-index"
170 +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
171 +
29 172 [[package]]
30 173 name = "bitflags"
31 174 version = "1.3.2"
@@ -38,6 +181,25 @@ version = "2.13.2"
38 181 source = "registry+https://github.com/rust-lang/crates.io-index"
39 182 checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
40 183
184 +[[package]]
185 +name = "blocking"
186 +version = "1.7.0"
187 +source = "registry+https://github.com/rust-lang/crates.io-index"
188 +checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
189 +dependencies = [
190 + "async-channel",
191 + "async-task",
192 + "futures-io",
193 + "futures-lite",
194 + "piper",
195 +]
196 +
197 +[[package]]
198 +name = "bumpalo"
199 +version = "3.20.3"
200 +source = "registry+https://github.com/rust-lang/crates.io-index"
201 +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
202 +
41 203 [[package]]
42 204 name = "bytemuck"
43 205 version = "1.25.2"
@@ -145,6 +307,33 @@ version = "1.2.1"
145 307 source = "registry+https://github.com/rust-lang/crates.io-index"
146 308 checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
147 309
310 +[[package]]
311 +name = "endi"
312 +version = "1.1.1"
313 +source = "registry+https://github.com/rust-lang/crates.io-index"
314 +checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
315 +
316 +[[package]]
317 +name = "enumflags2"
318 +version = "0.7.12"
319 +source = "registry+https://github.com/rust-lang/crates.io-index"
320 +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
321 +dependencies = [
322 + "enumflags2_derive",
323 + "serde",
324 +]
325 +
326 +[[package]]
327 +name = "enumflags2_derive"
328 +version = "0.7.12"
329 +source = "registry+https://github.com/rust-lang/crates.io-index"
330 +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
331 +dependencies = [
332 + "proc-macro2",
333 + "quote",
334 + "syn 2.0.119",
335 +]
336 +
148 337 [[package]]
149 338 name = "equivalent"
150 339 version = "1.0.2"
@@ -161,6 +350,32 @@ dependencies = [
161 350 "windows-sys 0.61.2",
162 351 ]
163 352
353 +[[package]]
354 +name = "event-listener"
355 +version = "5.4.2"
356 +source = "registry+https://github.com/rust-lang/crates.io-index"
357 +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
358 +dependencies = [
359 + "parking",
360 + "pin-project-lite",
361 +]
362 +
363 +[[package]]
364 +name = "event-listener-strategy"
365 +version = "0.5.4"
366 +source = "registry+https://github.com/rust-lang/crates.io-index"
367 +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
368 +dependencies = [
369 + "event-listener",
370 + "pin-project-lite",
371 +]
372 +
373 +[[package]]
374 +name = "fastrand"
375 +version = "2.5.0"
376 +source = "registry+https://github.com/rust-lang/crates.io-index"
377 +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
378 +
164 379 [[package]]
165 380 name = "fdeflate"
166 381 version = "0.3.7"
@@ -199,10 +414,64 @@ version = "0.9.4"
199 414 source = "registry+https://github.com/rust-lang/crates.io-index"
200 415 checksum = "7894823fa221401399e2598f8b63f81ac77ff5c63248b7656779bff1632d7d3d"
201 416 dependencies = [
202 - "hashbrown",
417 + "hashbrown 0.15.5",
203 418 "ttf-parser",
204 419 ]
205 420
421 +[[package]]
422 +name = "futures-core"
423 +version = "0.3.34"
424 +source = "registry+https://github.com/rust-lang/crates.io-index"
425 +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
426 +
427 +[[package]]
428 +name = "futures-io"
429 +version = "0.3.34"
430 +source = "registry+https://github.com/rust-lang/crates.io-index"
431 +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
432 +
433 +[[package]]
434 +name = "futures-lite"
435 +version = "2.6.1"
436 +source = "registry+https://github.com/rust-lang/crates.io-index"
437 +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
438 +dependencies = [
439 + "fastrand",
440 + "futures-core",
441 + "futures-io",
442 + "parking",
443 + "pin-project-lite",
444 +]
445 +
446 +[[package]]
447 +name = "futures-task"
448 +version = "0.3.34"
449 +source = "registry+https://github.com/rust-lang/crates.io-index"
450 +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
451 +
452 +[[package]]
453 +name = "futures-util"
454 +version = "0.3.34"
455 +source = "registry+https://github.com/rust-lang/crates.io-index"
456 +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
457 +dependencies = [
458 + "futures-core",
459 + "futures-task",
460 + "pin-project-lite",
461 + "slab",
462 +]
463 +
464 +[[package]]
465 +name = "getrandom"
466 +version = "0.4.3"
467 +source = "registry+https://github.com/rust-lang/crates.io-index"
468 +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
469 +dependencies = [
470 + "cfg-if",
471 + "libc",
472 + "r-efi",
473 +]
474 +
206 475 [[package]]
207 476 name = "hashbrown"
208 477 version = "0.15.5"
@@ -214,12 +483,45 @@ dependencies = [
214 483 "foldhash",
215 484 ]
216 485
486 +[[package]]
487 +name = "hashbrown"
488 +version = "0.17.1"
489 +source = "registry+https://github.com/rust-lang/crates.io-index"
490 +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
491 +
217 492 [[package]]
218 493 name = "hermit-abi"
219 494 version = "0.5.3"
220 495 source = "registry+https://github.com/rust-lang/crates.io-index"
221 496 checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
222 497
498 +[[package]]
499 +name = "hex"
500 +version = "0.4.3"
501 +source = "registry+https://github.com/rust-lang/crates.io-index"
502 +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
503 +
504 +[[package]]
505 +name = "indexmap"
506 +version = "2.14.2"
507 +source = "registry+https://github.com/rust-lang/crates.io-index"
508 +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
509 +dependencies = [
510 + "equivalent",
511 + "hashbrown 0.17.1",
512 +]
513 +
514 +[[package]]
515 +name = "js-sys"
516 +version = "0.3.106"
517 +source = "registry+https://github.com/rust-lang/crates.io-index"
518 +checksum = "7883d941dae510fb2d978fc3fe018c71c9e2892fd38854de3e8b92c2e5ad9cc5"
519 +dependencies = [
520 + "cfg-if",
521 + "futures-util",
522 + "wasm-bindgen",
523 +]
524 +
223 525 [[package]]
224 526 name = "libc"
225 527 version = "0.2.190"
@@ -249,6 +551,7 @@ version = "0.0.1"
249 551 name = "libluna-platform"
250 552 version = "0.0.1"
251 553 dependencies = [
554 + "calloop",
252 555 "libluna-core",
253 556 "libluna-render",
254 557 "smithay-client-toolkit",
@@ -307,6 +610,7 @@ dependencies = [
307 610 "libluna-widgets",
308 611 "wayland-client",
309 612 "wayland-protocols-wlr",
613 + "zbus",
310 614 ]
311 615
312 616 [[package]]
@@ -345,6 +649,15 @@ dependencies = [
345 649 "libc",
346 650 ]
347 651
652 +[[package]]
653 +name = "memoffset"
654 +version = "0.9.1"
655 +source = "registry+https://github.com/rust-lang/crates.io-index"
656 +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
657 +dependencies = [
658 + "autocfg",
659 +]
660 +
348 661 [[package]]
349 662 name = "miniz_oxide"
350 663 version = "0.8.9"
@@ -365,12 +678,45 @@ dependencies = [
365 678 "simd-adler32",
366 679 ]
367 680
681 +[[package]]
682 +name = "once_cell"
683 +version = "1.21.4"
684 +source = "registry+https://github.com/rust-lang/crates.io-index"
685 +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
686 +
687 +[[package]]
688 +name = "ordered-stream"
689 +version = "0.2.0"
690 +source = "registry+https://github.com/rust-lang/crates.io-index"
691 +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
692 +dependencies = [
693 + "futures-core",
694 + "pin-project-lite",
695 +]
696 +
697 +[[package]]
698 +name = "parking"
699 +version = "2.2.1"
700 +source = "registry+https://github.com/rust-lang/crates.io-index"
701 +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
702 +
368 703 [[package]]
369 704 name = "pin-project-lite"
370 705 version = "0.2.17"
371 706 source = "registry+https://github.com/rust-lang/crates.io-index"
372 707 checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
373 708
709 +[[package]]
710 +name = "piper"
711 +version = "0.2.5"
712 +source = "registry+https://github.com/rust-lang/crates.io-index"
713 +checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
714 +dependencies = [
715 + "atomic-waker",
716 + "fastrand",
717 + "futures-io",
718 +]
719 +
374 720 [[package]]
375 721 name = "pkg-config"
376 722 version = "0.3.34"
@@ -404,6 +750,15 @@ dependencies = [
404 750 "windows-sys 0.61.2",
405 751 ]
406 752
753 +[[package]]
754 +name = "proc-macro-crate"
755 +version = "3.5.0"
756 +source = "registry+https://github.com/rust-lang/crates.io-index"
757 +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f"
758 +dependencies = [
759 + "toml_edit",
760 +]
761 +
407 762 [[package]]
408 763 name = "proc-macro2"
409 764 version = "1.0.107"
@@ -431,6 +786,12 @@ dependencies = [
431 786 "proc-macro2",
432 787 ]
433 788
789 +[[package]]
790 +name = "r-efi"
791 +version = "6.0.0"
792 +source = "registry+https://github.com/rust-lang/crates.io-index"
793 +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
794 +
434 795 [[package]]
435 796 name = "rustix"
436 797 version = "0.38.44"
@@ -457,6 +818,12 @@ dependencies = [
457 818 "windows-sys 0.61.2",
458 819 ]
459 820
821 +[[package]]
822 +name = "rustversion"
823 +version = "1.0.23"
824 +source = "registry+https://github.com/rust-lang/crates.io-index"
825 +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
826 +
460 827 [[package]]
461 828 name = "selene"
462 829 version = "0.0.1"
@@ -471,12 +838,63 @@ dependencies = [
471 838 "wayland-server",
472 839 ]
473 840
841 +[[package]]
842 +name = "serde"
843 +version = "1.0.229"
844 +source = "registry+https://github.com/rust-lang/crates.io-index"
845 +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
846 +dependencies = [
847 + "serde_core",
848 + "serde_derive",
849 +]
850 +
851 +[[package]]
852 +name = "serde_core"
853 +version = "1.0.229"
854 +source = "registry+https://github.com/rust-lang/crates.io-index"
855 +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
856 +dependencies = [
857 + "serde_derive",
858 +]
859 +
860 +[[package]]
861 +name = "serde_derive"
862 +version = "1.0.229"
863 +source = "registry+https://github.com/rust-lang/crates.io-index"
864 +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
865 +dependencies = [
866 + "proc-macro2",
867 + "quote",
868 + "syn 3.0.7",
869 +]
870 +
871 +[[package]]
872 +name = "serde_repr"
873 +version = "0.1.21"
874 +source = "registry+https://github.com/rust-lang/crates.io-index"
875 +checksum = "8d3b1629de253c70a0508c3899572da79ca359fdab27c7920ff00406df418906"
876 +dependencies = [
877 + "proc-macro2",
878 + "quote",
879 + "syn 3.0.7",
880 +]
881 +
474 882 [[package]]
475 883 name = "shlex"
476 884 version = "2.0.1"
477 885 source = "registry+https://github.com/rust-lang/crates.io-index"
478 886 checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
479 887
888 +[[package]]
889 +name = "signal-hook-registry"
890 +version = "1.4.8"
891 +source = "registry+https://github.com/rust-lang/crates.io-index"
892 +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
893 +dependencies = [
894 + "errno",
895 + "libc",
896 +]
897 +
480 898 [[package]]
481 899 name = "simd-adler32"
482 900 version = "0.3.10"
@@ -551,6 +969,19 @@ dependencies = [
551 969 "unicode-ident",
552 970 ]
553 971
972 +[[package]]
973 +name = "tempfile"
974 +version = "3.27.0"
975 +source = "registry+https://github.com/rust-lang/crates.io-index"
976 +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
977 +dependencies = [
978 + "fastrand",
979 + "getrandom",
980 + "once_cell",
981 + "rustix 1.1.5",
982 + "windows-sys 0.61.2",
983 +]
984 +
554 985 [[package]]
555 986 name = "thiserror"
556 987 version = "1.0.69"
@@ -597,6 +1028,67 @@ dependencies = [
597 1028 "strict-num",
598 1029 ]
599 1030
1031 +[[package]]
1032 +name = "toml_datetime"
1033 +version = "1.1.2+spec-1.1.0"
1034 +source = "registry+https://github.com/rust-lang/crates.io-index"
1035 +checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
1036 +dependencies = [
1037 + "serde_core",
1038 +]
1039 +
1040 +[[package]]
1041 +name = "toml_edit"
1042 +version = "0.25.17+spec-1.1.0"
1043 +source = "registry+https://github.com/rust-lang/crates.io-index"
1044 +checksum = "e3641d5bbb5349a79e1020a242d251efbc546ad8048d133958323ce9c40a9c9c"
1045 +dependencies = [
1046 + "indexmap",
1047 + "toml_datetime",
1048 + "toml_parser",
1049 + "winnow",
1050 +]
1051 +
1052 +[[package]]
1053 +name = "toml_parser"
1054 +version = "1.1.5+spec-1.1.0"
1055 +source = "registry+https://github.com/rust-lang/crates.io-index"
1056 +checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
1057 +dependencies = [
1058 + "winnow",
1059 +]
1060 +
1061 +[[package]]
1062 +name = "tracing"
1063 +version = "0.1.44"
1064 +source = "registry+https://github.com/rust-lang/crates.io-index"
1065 +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
1066 +dependencies = [
1067 + "pin-project-lite",
1068 + "tracing-attributes",
1069 + "tracing-core",
1070 +]
1071 +
1072 +[[package]]
1073 +name = "tracing-attributes"
1074 +version = "0.1.31"
1075 +source = "registry+https://github.com/rust-lang/crates.io-index"
1076 +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
1077 +dependencies = [
1078 + "proc-macro2",
1079 + "quote",
1080 + "syn 2.0.119",
1081 +]
1082 +
1083 +[[package]]
1084 +name = "tracing-core"
1085 +version = "0.1.36"
1086 +source = "registry+https://github.com/rust-lang/crates.io-index"
1087 +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
1088 +dependencies = [
1089 + "once_cell",
1090 +]
1091 +
600 1092 [[package]]
601 1093 name = "ttf-parser"
602 1094 version = "0.25.1"
@@ -606,12 +1098,79 @@ dependencies = [
606 1098 "core_maths",
607 1099 ]
608 1100
1101 +[[package]]
1102 +name = "uds_windows"
1103 +version = "1.2.1"
1104 +source = "registry+https://github.com/rust-lang/crates.io-index"
1105 +checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
1106 +dependencies = [
1107 + "memoffset",
1108 + "tempfile",
1109 + "windows-sys 0.61.2",
1110 +]
1111 +
609 1112 [[package]]
610 1113 name = "unicode-ident"
611 1114 version = "1.0.26"
612 1115 source = "registry+https://github.com/rust-lang/crates.io-index"
613 1116 checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
614 1117
1118 +[[package]]
1119 +name = "uuid"
1120 +version = "1.28.0"
1121 +source = "registry+https://github.com/rust-lang/crates.io-index"
1122 +checksum = "7cc1186384beb7dd8eedea376413fd654937285ea6c9cfbb928dc3043ea4b606"
1123 +dependencies = [
1124 + "js-sys",
1125 + "serde_core",
1126 + "wasm-bindgen",
1127 +]
1128 +
1129 +[[package]]
1130 +name = "wasm-bindgen"
1131 +version = "0.2.129"
1132 +source = "registry+https://github.com/rust-lang/crates.io-index"
1133 +checksum = "9bb54f33acc68fd454578d9820b0bde1a1a3d17aa17bb7b6595806d02886d409"
1134 +dependencies = [
1135 + "cfg-if",
1136 + "once_cell",
1137 + "rustversion",
1138 + "wasm-bindgen-macro",
1139 + "wasm-bindgen-shared",
1140 +]
1141 +
1142 +[[package]]
1143 +name = "wasm-bindgen-macro"
1144 +version = "0.2.129"
1145 +source = "registry+https://github.com/rust-lang/crates.io-index"
1146 +checksum = "2e29d0c35b16e224a7eeb5cd2d25e3e1968fbd65604117b44d3b789d00ee8535"
1147 +dependencies = [
1148 + "quote",
1149 + "wasm-bindgen-macro-support",
1150 +]
1151 +
1152 +[[package]]
1153 +name = "wasm-bindgen-macro-support"
1154 +version = "0.2.129"
1155 +source = "registry+https://github.com/rust-lang/crates.io-index"
1156 +checksum = "6f501a8bc3719dba86ef8ae4728879c08001bea749eb1333ac5b91e040e2a6b7"
1157 +dependencies = [
1158 + "bumpalo",
1159 + "proc-macro2",
1160 + "quote",
1161 + "syn 3.0.7",
1162 + "wasm-bindgen-shared",
1163 +]
1164 +
1165 +[[package]]
1166 +name = "wasm-bindgen-shared"
1167 +version = "0.2.129"
1168 +source = "registry+https://github.com/rust-lang/crates.io-index"
1169 +checksum = "23f0c9c52aa7cd7d77769a4cfe2a9adb1b331f489a41d912ce14513d5ab995c6"
1170 +dependencies = [
1171 + "unicode-ident",
1172 +]
1173 +
615 1174 [[package]]
616 1175 name = "wayland-backend"
617 1176 version = "0.3.17"
@@ -807,6 +1366,15 @@ version = "0.52.6"
807 1366 source = "registry+https://github.com/rust-lang/crates.io-index"
808 1367 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
809 1368
1369 +[[package]]
1370 +name = "winnow"
1371 +version = "1.0.4"
1372 +source = "registry+https://github.com/rust-lang/crates.io-index"
1373 +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
1374 +dependencies = [
1375 + "memchr",
1376 +]
1377 +
810 1378 [[package]]
811 1379 name = "xcursor"
812 1380 version = "0.3.11"
@@ -833,8 +1401,119 @@ dependencies = [
833 1401 "bytemuck",
834 1402 ]
835 1403
1404 +[[package]]
1405 +name = "zbus"
1406 +version = "5.19.0"
1407 +source = "registry+https://github.com/rust-lang/crates.io-index"
1408 +checksum = "5db4be7c075cb421e4b7ee645541604239bd243ba7c357511f4ff3a74b555907"
1409 +dependencies = [
1410 + "async-broadcast",
1411 + "async-executor",
1412 + "async-io",
1413 + "async-lock",
1414 + "async-process",
1415 + "async-recursion",
1416 + "async-task",
1417 + "async-trait",
1418 + "blocking",
1419 + "enumflags2",
1420 + "event-listener",
1421 + "futures-core",
1422 + "futures-lite",
1423 + "hex",
1424 + "libc",
1425 + "ordered-stream",
1426 + "rustix 1.1.5",
1427 + "serde",
1428 + "serde_repr",
1429 + "tracing",
1430 + "uds_windows",
1431 + "uuid",
1432 + "windows-sys 0.61.2",
1433 + "winnow",
1434 + "zbus_macros",
1435 + "zbus_names",
1436 + "zvariant",
1437 +]
1438 +
1439 +[[package]]
1440 +name = "zbus_macros"
1441 +version = "5.19.0"
1442 +source = "registry+https://github.com/rust-lang/crates.io-index"
1443 +checksum = "2990635d09ade6df1868f72f8cac69a876a90981e8bd3c40b1be413f8dc88f40"
1444 +dependencies = [
1445 + "proc-macro-crate",
1446 + "proc-macro2",
1447 + "quote",
1448 + "syn 3.0.7",
1449 + "zbus_names",
1450 + "zvariant",
1451 + "zvariant_utils",
1452 +]
1453 +
1454 +[[package]]
1455 +name = "zbus_names"
1456 +version = "4.3.4"
1457 +source = "registry+https://github.com/rust-lang/crates.io-index"
1458 +checksum = "d8bf88b4a3ff53e883001e0e0115b297a9d53c31b9c1edd2bfdd853e3428624e"
1459 +dependencies = [
1460 + "serde",
1461 + "winnow",
1462 + "zvariant",
1463 +]
1464 +
1465 +[[package]]
1466 +name = "zcheapstr"
1467 +version = "1.1.0"
1468 +source = "registry+https://github.com/rust-lang/crates.io-index"
1469 +checksum = "d1afec51604565183aeb5c54c20aeab286120d4e4460f7f76e3e8bb8c0d99473"
1470 +dependencies = [
1471 + "serde",
1472 +]
1473 +
836 1474 [[package]]
837 1475 name = "zlib-rs"
838 1476 version = "0.6.8"
839 1477 source = "registry+https://github.com/rust-lang/crates.io-index"
840 1478 checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112"
1479 +
1480 +[[package]]
1481 +name = "zvariant"
1482 +version = "5.15.0"
1483 +source = "registry+https://github.com/rust-lang/crates.io-index"
1484 +checksum = "c1d34c27cc6cdd1f458427519dd6b8612f7b7e3f7b9a0b2355d041dda9869147"
1485 +dependencies = [
1486 + "endi",
1487 + "enumflags2",
1488 + "serde",
1489 + "winnow",
1490 + "zcheapstr",
1491 + "zvariant_derive",
1492 + "zvariant_utils",
1493 +]
1494 +
1495 +[[package]]
1496 +name = "zvariant_derive"
1497 +version = "5.15.0"
1498 +source = "registry+https://github.com/rust-lang/crates.io-index"
1499 +checksum = "864155e69b4352db0c7f374917bf45d1e0c8d17659c8b3dbf9795f3673f8c497"
1500 +dependencies = [
1501 + "proc-macro-crate",
1502 + "proc-macro2",
1503 + "quote",
1504 + "syn 3.0.7",
1505 + "zvariant_utils",
1506 +]
1507 +
1508 +[[package]]
1509 +name = "zvariant_utils"
1510 +version = "4.2.0"
1511 +source = "registry+https://github.com/rust-lang/crates.io-index"
1512 +checksum = "bad0294361a320b694a328460dc73add56c306150f5cb6bfafc44446120008a3"
1513 +dependencies = [
1514 + "proc-macro2",
1515 + "quote",
1516 + "serde",
1517 + "syn 3.0.7",
1518 + "winnow",
1519 +]
@@ -13,3 +13,4 @@ libluna-render.workspace = true
13 13
14 14 smithay-client-toolkit = "0.19"
15 15 wayland-client = "0.31"
16 +calloop = "0.13"
@@ -12,7 +12,7 @@
12 12
13 13 pub mod window;
14 14
15 -pub use window::{run, AppConfig, Frame, LayerConfig};
15 +pub use window::{run, AppConfig, Frame, LayerConfig, WakeHandle};
16 16
17 17 /// Warstwy powierzchni (`wlr-layer-shell`) — reeksport dla wygody odbiorców.
18 18 pub use smithay_client_toolkit::shell::wlr_layer::{Anchor, Layer};
@@ -56,6 +56,22 @@ use wayland_client::{
56 56 /// Domknięcie rysujące jedną klatkę (łącznie z obsługą zdarzeń).
57 57 type RenderFn = dyn for<'a> FnMut(&mut Frame<'a>);
58 58
59 +/// Uchwyt do wybudzania pętli zdarzeń z innego wątku.
60 +///
61 +/// Używany np. przez powłokę po odebraniu powiadomienia D-Bus: [`WakeHandle::wake`]
62 +/// sprawia, że okno zostanie przerysowane, mimo że nie było żadnego zdarzenia wejścia.
63 +#[derive(Clone)]
64 +pub struct WakeHandle {
65 + ping: calloop::ping::Ping,
66 +}
67 +
68 +impl WakeHandle {
69 + /// Budzi pętlę zdarzeń (bezpieczne z dowolnego wątku).
70 + pub fn wake(&self) {
71 + self.ping.ping();
72 + }
73 +}
74 +
59 75 /// Konfiguracja okna.
60 76 #[derive(Debug, Clone)]
61 77 pub struct AppConfig {
@@ -207,6 +223,8 @@ pub struct Frame<'a> {
207 223 actions: &'a mut WindowActions,
208 224 frame_requested: &'a mut bool,
209 225 system_dark: bool,
226 + /// Uchwyt do wybudzania pętli z innego wątku (np. po powiadomieniu D-Bus).
227 + waker: WakeHandle,
210 228 }
211 229
212 230 impl Frame<'_> {
@@ -282,6 +300,11 @@ impl Frame<'_> {
282 300 pub const fn system_dark(&self) -> bool {
283 301 self.system_dark
284 302 }
303 +
304 + /// Uchwyt do wybudzania pętli zdarzeń z innego wątku.
305 + pub fn waker(&self) -> WakeHandle {
306 + self.waker.clone()
307 + }
285 308 }
286 309
287 310 /// Otwiera okno i uruchamia pętlę zdarzeń, wołając `render` przy każdej potrzebie
@@ -306,6 +329,13 @@ where
306 329 let loop_handle = event_loop.handle();
307 330 WaylandSource::new(conn.clone(), event_queue).insert(loop_handle)?;
308 331
332 + // Wybudzanie pętli z innego wątku (np. powiadomienia z magistrali D‑Bus).
333 + let (ping, ping_source) = calloop::ping::make_ping()?;
334 + event_loop
335 + .handle()
336 + .insert_source(ping_source, |_, _, app: &mut App| app.needs_redraw = true)?;
337 + let wake = WakeHandle { ping };
338 +
309 339 let compositor = CompositorState::bind(&globals, &qh)
310 340 .map_err(|e| format!("wl_compositor unavailable: {e}"))?;
311 341 let shm = Shm::bind(&globals, &qh).map_err(|e| format!("wl_shm unavailable: {e}"))?;
@@ -390,6 +420,7 @@ where
390 420 frame_requested: false,
391 421 last_tick: Instant::now(),
392 422 maximized: false,
423 + wake,
393 424 };
394 425
395 426 while !app.exit {
@@ -441,6 +472,8 @@ struct App {
441 472 /// Znacznik czasu poprzedniej klatki (do liczenia `dt`).
442 473 last_tick: Instant,
443 474 maximized: bool,
475 + /// Uchwyt wybudzania pętli (np. z wątku D‑Bus).
476 + wake: WakeHandle,
444 477 }
445 478
446 479 /// Powierzchnia docelowa: zwykłe okno albo powierzchnia warstwowa (panel/dock).
@@ -542,6 +575,7 @@ impl App {
542 575 settings,
543 576 actions,
544 577 frame_requested,
578 + wake,
545 579 ..
546 580 } = self;
547 581 let mut frame = Frame {
@@ -556,6 +590,7 @@ impl App {
556 590 actions,
557 591 frame_requested,
558 592 system_dark,
593 + waker: wake.clone(),
559 594 };
560 595 render(&mut frame);
561 596 }
@@ -32,3 +32,4 @@ libluna-platform.workspace = true
32 32
33 33 wayland-client = "0.31"
34 34 wayland-protocols-wlr = { version = "0.3", features = ["client"] }
35 +zbus = { version = "5.12.0", features = ["blocking-api"] }
@@ -12,7 +12,8 @@ use std::time::{SystemTime, UNIX_EPOCH};
12 12 use libluna_core::{ButtonState, Event, PointerButton, Rect};
13 13 use libluna_platform::{run, AppConfig, Frame, LayerConfig};
14 14 use libluna_widgets::{IconName, PaintCtx};
15 -use luna::notifications::Notifications;
15 +use luna::dbus_notifications::{Incoming, NotificationsBus};
16 +use luna::notifications::{Notification, Notifications};
16 17 use luna::osd::Osd;
17 18 use luna::panel::{
18 19 self, App, Launcher, PanelState, Toggle, ToggleAction, LAUNCHER_H, LAUNCHER_W, THICKNESS,
@@ -48,6 +49,9 @@ fn main() -> Result<(), Box<dyn Error>> {
48 49 let mut power_open = false;
49 50 let mut osd = Osd::new(IconName::Volume, "Głośność", 0.0);
50 51 let mut notes = Notifications::new();
52 + // Daemon powiadomień D‑Bus (rejestrowany przy pierwszej klatce).
53 + let mut bus: Option<NotificationsBus> = None;
54 + let mut bus_tried = false;
51 55 // Lista okien z kompozytora (foreign-toplevel) — własne połączenie + wątek.
52 56 let toplevels = luna::toplevels::Toplevels::spawn();
53 57 // Realny stan systemu (użytkownik, dźwięk, Wi-Fi, bateria) — odpytywany w tle.
@@ -58,6 +62,18 @@ fn main() -> Result<(), Box<dyn Error>> {
58 62 run(cfg, move |frame: &mut Frame| {
59 63 let dt = frame.delta_time();
60 64
65 + // Rejestrujemy się jako daemon powiadomień raz, po pierwszej klatce
66 + // (potrzebny jest wtedy uchwyt do wybudzania pętli).
67 + if !bus_tried {
68 + bus_tried = true;
69 + bus = NotificationsBus::spawn(frame.waker());
70 + }
71 + if let Some(b) = &bus {
72 + for inc in b.drain() {
73 + notes.push(notification_from(inc));
74 + }
75 + }
76 +
61 77 let size = frame.size;
62 78 let theme = &frame.theme;
63 79 let text = frame.text;
@@ -261,6 +277,33 @@ fn main() -> Result<(), Box<dyn Error>> {
261 277 })
262 278 }
263 279
280 +/// Zamienia powiadomienie z magistrali D‑Bus na toast Luny.
281 +fn notification_from(inc: Incoming) -> Notification {
282 + let icon = icon_for(&inc.app_name);
283 + let timeout = inc.timeout_secs();
284 + let mut n = Notification::new(inc.app_name, inc.summary, inc.body).with_icon(icon);
285 + n.timeout = timeout;
286 + n
287 +}
288 +
289 +/// Dobiera ikonę pakietu do nazwy aplikacji wysyłającej powiadomienie.
290 +fn icon_for(app: &str) -> IconName {
291 + let a = app.to_lowercase();
292 + if a.contains("file") || a.contains("plik") {
293 + IconName::Files
294 + } else if a.contains("term") {
295 + IconName::Terminal
296 + } else if a.contains("music") || a.contains("muzy") || a.contains("audio") {
297 + IconName::Music
298 + } else if a.contains("setting") || a.contains("ustaw") {
299 + IconName::Settings
300 + } else if a.contains("browser") || a.contains("przegl") {
301 + IconName::Search
302 + } else {
303 + IconName::Info
304 + }
305 +}
306 +
264 307 /// Buduje przełączniki paska z realnego stanu systemu.
265 308 fn build_toggles(s: &luna::system::SystemStatus) -> Vec<Toggle> {
266 309 let mut v = Vec::new();
267 310 new file mode 100644
@@ -0,0 +1,148 @@
1 +//! Usługa powiadomień D‑Bus (`org.freedesktop.Notifications`).
2 +//!
3 +//! Powłoka rejestruje się na sesyjnej magistrali jako **daemon powiadomień**, więc
4 +//! aplikacje (np. `notify-send`, klienci bibliotek) trafiają wprost do toastów Luny.
5 +//! Serwer obsługuje magistralę we własnym wątku (zbus, API blokujące), a UI opróżnia
6 +//! kolejkę w [`NotificationsBus::drain`] i przerysowuje okno po wybudzeniu
7 +//! ([`WakeHandle`]) — powiadomienie pojawia się więc także, gdy powłoka śpi.
8 +//!
9 +//! Gdy nazwę `org.freedesktop.Notifications` trzyma już inny daemon (np. w sesji
10 +//! Xfce obok Luny), [`NotificationsBus::spawn`] zwraca `None` i nic nie przejmujemy.
11 +
12 +use std::collections::HashMap;
13 +use std::sync::{Arc, Mutex};
14 +
15 +use libluna_platform::WakeHandle;
16 +use zbus::zvariant::OwnedValue;
17 +
18 +/// Żądanie powiadomienia odebrane z magistrali.
19 +#[derive(Debug, Clone, Default)]
20 +pub struct Incoming {
21 + /// Nazwa aplikacji wysyłającej.
22 + pub app_name: String,
23 + /// Podsumowanie (tytuł toasta).
24 + pub summary: String,
25 + /// Treść.
26 + pub body: String,
27 + /// Czas życia w ms: `-1` = domyślny serwera, `0` = trwałe, `> 0` = jawny.
28 + pub expire_ms: i32,
29 +}
30 +
31 +impl Incoming {
32 + /// Czas życia w sekundach (dla [`crate::notifications::Notification`]).
33 + pub fn timeout_secs(&self) -> f64 {
34 + match self.expire_ms {
35 + 0 => 0.0,
36 + ms if ms > 0 => ms as f64 / 1000.0,
37 + _ => 5.0,
38 + }
39 + }
40 +}
41 +
42 +/// Kolejka odebranych powiadomień (współdzielona z wątkiem magistrali).
43 +type Queue = Arc<Mutex<Vec<Incoming>>>;
44 +
45 +/// Interfejs `org.freedesktop.Notifications` (serwer).
46 +struct Server {
47 + queue: Queue,
48 + waker: WakeHandle,
49 +}
50 +
51 +#[zbus::interface(name = "org.freedesktop.Notifications")]
52 +impl Server {
53 + fn get_capabilities(&self) -> Vec<String> {
54 + vec!["body".to_owned()]
55 + }
56 +
57 + #[allow(clippy::too_many_arguments)]
58 + fn notify(
59 + &self,
60 + app_name: String,
61 + _replaces_id: u32,
62 + _app_icon: String,
63 + summary: String,
64 + body: String,
65 + _actions: Vec<String>,
66 + _hints: HashMap<String, OwnedValue>,
67 + expire_ms: i32,
68 + ) -> u32 {
69 + let id = {
70 + let mut q = self.queue.lock().unwrap_or_else(|e| e.into_inner());
71 + q.push(Incoming {
72 + app_name,
73 + summary,
74 + body,
75 + expire_ms,
76 + });
77 + q.len() as u32
78 + };
79 + // Obudź pętlę powłoki, żeby nowy toast został narysowany.
80 + self.waker.wake();
81 + id
82 + }
83 +
84 + fn close_notification(&self, _id: u32) {}
85 +
86 + fn get_server_information(&self) -> (String, String, String, String) {
87 + (
88 + "Luna".to_owned(),
89 + "libLuna".to_owned(),
90 + env!("CARGO_PKG_VERSION").to_owned(),
91 + "1.2".to_owned(),
92 + )
93 + }
94 +}
95 +
96 +/// Uchwyt do usługi powiadomień (utrzymuje połączenie i kolejkę).
97 +pub struct NotificationsBus {
98 + queue: Queue,
99 + _conn: zbus::blocking::Connection,
100 +}
101 +
102 +impl NotificationsBus {
103 + /// Rejestruje powłokę jako daemon powiadomień na sesyjnej magistrali.
104 + ///
105 + /// `None`, gdy brak magistrali albo nazwę `org.freedesktop.Notifications` trzyma
106 + /// już inny daemon. `waker` budzi pętlę UI po każdym odebranym powiadomieniu.
107 + pub fn spawn(waker: WakeHandle) -> Option<Self> {
108 + let queue: Queue = Arc::new(Mutex::new(Vec::new()));
109 + let server = Server {
110 + queue: Arc::clone(&queue),
111 + waker,
112 + };
113 + let conn = zbus::blocking::connection::Builder::session()
114 + .ok()?
115 + .name("org.freedesktop.Notifications")
116 + .ok()?
117 + .serve_at("/org/freedesktop/Notifications", server)
118 + .ok()?
119 + .build()
120 + .ok()?;
121 + Some(Self { queue, _conn: conn })
122 + }
123 +
124 + /// Opróżnia kolejkę (UI woła raz na klatkę).
125 + pub fn drain(&self) -> Vec<Incoming> {
126 + let mut q = self.queue.lock().unwrap_or_else(|e| e.into_inner());
127 + std::mem::take(&mut *q)
128 + }
129 +}
130 +
131 +#[cfg(test)]
132 +mod tests {
133 + use super::*;
134 +
135 + #[test]
136 + fn timeout_maps_special_values() {
137 + let with = |ms| {
138 + Incoming {
139 + expire_ms: ms,
140 + ..Default::default()
141 + }
142 + .timeout_secs()
143 + };
144 + assert_eq!(with(-1), 5.0);
145 + assert_eq!(with(0), 0.0);
146 + assert_eq!(with(2500), 2.5);
147 + }
148 +}
@@ -7,6 +7,7 @@
7 7 //! podglądy headless (zrzuty do dokumentacji) i sesję na żywo.
8 8
9 9 pub mod apps;
10 +pub mod dbus_notifications;
10 11 pub mod notifications;
11 12 pub mod osd;
12 13 pub mod panel;