├── .github └── dependabot.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md └── src └── main.rs /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "cargo" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | target-branch: "main" 11 | schedule: 12 | interval: "monthly" 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.8.11" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 10 | dependencies = [ 11 | "cfg-if", 12 | "once_cell", 13 | "serde", 14 | "version_check", 15 | "zerocopy", 16 | ] 17 | 18 | [[package]] 19 | name = "aho-corasick" 20 | version = "1.0.2" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" 23 | dependencies = [ 24 | "memchr", 25 | ] 26 | 27 | [[package]] 28 | name = "android-tzdata" 29 | version = "0.1.1" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 32 | 33 | [[package]] 34 | name = "android_system_properties" 35 | version = "0.1.5" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 38 | dependencies = [ 39 | "libc", 40 | ] 41 | 42 | [[package]] 43 | name = "autocfg" 44 | version = "1.1.0" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 47 | 48 | [[package]] 49 | name = "bumpalo" 50 | version = "3.15.0" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" 53 | 54 | [[package]] 55 | name = "bytes" 56 | version = "1.4.0" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 59 | 60 | [[package]] 61 | name = "cc" 62 | version = "1.0.83" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 65 | dependencies = [ 66 | "libc", 67 | ] 68 | 69 | [[package]] 70 | name = "cfg-if" 71 | version = "1.0.0" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 74 | 75 | [[package]] 76 | name = "chrono" 77 | version = "0.4.34" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" 80 | dependencies = [ 81 | "android-tzdata", 82 | "iana-time-zone", 83 | "num-traits", 84 | "windows-targets 0.52.0", 85 | ] 86 | 87 | [[package]] 88 | name = "core-foundation-sys" 89 | version = "0.8.6" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 92 | 93 | [[package]] 94 | name = "derive_more" 95 | version = "0.99.17" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 98 | dependencies = [ 99 | "proc-macro2", 100 | "quote", 101 | "syn 1.0.109", 102 | ] 103 | 104 | [[package]] 105 | name = "flexi_logger" 106 | version = "0.29.6" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "d26948e37cfcb1f2c2cd38e0602d3a8ab6b9472c0c6eff4516fc8def9a3124d7" 109 | dependencies = [ 110 | "chrono", 111 | "log", 112 | "nu-ansi-term", 113 | "regex", 114 | "thiserror", 115 | ] 116 | 117 | [[package]] 118 | name = "hyprland" 119 | version = "0.4.0-alpha.3" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "2de3f836e02af5a12f374d3a986867c1dc487a63a6d19477d66c7de50f715895" 122 | dependencies = [ 123 | "ahash", 124 | "derive_more", 125 | "hyprland-macros", 126 | "num-traits", 127 | "once_cell", 128 | "paste", 129 | "regex", 130 | "serde", 131 | "serde_json", 132 | "serde_repr", 133 | "tokio", 134 | ] 135 | 136 | [[package]] 137 | name = "hyprland-macros" 138 | version = "0.4.0-alpha.1" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "5dd8ce4c182ce77e485918f49262425ee51a2746fe97f14084869aeff2fbc38e" 141 | dependencies = [ 142 | "quote", 143 | "syn 2.0.86", 144 | ] 145 | 146 | [[package]] 147 | name = "hyprland-workspaces" 148 | version = "2.0.4" 149 | dependencies = [ 150 | "flexi_logger", 151 | "hyprland", 152 | "log", 153 | "serde", 154 | "serde_json", 155 | ] 156 | 157 | [[package]] 158 | name = "iana-time-zone" 159 | version = "0.1.60" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 162 | dependencies = [ 163 | "android_system_properties", 164 | "core-foundation-sys", 165 | "iana-time-zone-haiku", 166 | "js-sys", 167 | "wasm-bindgen", 168 | "windows-core", 169 | ] 170 | 171 | [[package]] 172 | name = "iana-time-zone-haiku" 173 | version = "0.1.2" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 176 | dependencies = [ 177 | "cc", 178 | ] 179 | 180 | [[package]] 181 | name = "itoa" 182 | version = "1.0.6" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 185 | 186 | [[package]] 187 | name = "js-sys" 188 | version = "0.3.68" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" 191 | dependencies = [ 192 | "wasm-bindgen", 193 | ] 194 | 195 | [[package]] 196 | name = "libc" 197 | version = "0.2.140" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" 200 | 201 | [[package]] 202 | name = "log" 203 | version = "0.4.22" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 206 | 207 | [[package]] 208 | name = "memchr" 209 | version = "2.7.1" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 212 | 213 | [[package]] 214 | name = "mio" 215 | version = "0.8.6" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 218 | dependencies = [ 219 | "libc", 220 | "log", 221 | "wasi", 222 | "windows-sys 0.45.0", 223 | ] 224 | 225 | [[package]] 226 | name = "nu-ansi-term" 227 | version = "0.50.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "dd2800e1520bdc966782168a627aa5d1ad92e33b984bf7c7615d31280c83ff14" 230 | dependencies = [ 231 | "windows-sys 0.48.0", 232 | ] 233 | 234 | [[package]] 235 | name = "num-traits" 236 | version = "0.2.19" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 239 | dependencies = [ 240 | "autocfg", 241 | ] 242 | 243 | [[package]] 244 | name = "once_cell" 245 | version = "1.19.0" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 248 | 249 | [[package]] 250 | name = "paste" 251 | version = "1.0.15" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" 254 | 255 | [[package]] 256 | name = "pin-project-lite" 257 | version = "0.2.9" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 260 | 261 | [[package]] 262 | name = "proc-macro2" 263 | version = "1.0.89" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" 266 | dependencies = [ 267 | "unicode-ident", 268 | ] 269 | 270 | [[package]] 271 | name = "quote" 272 | version = "1.0.35" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 275 | dependencies = [ 276 | "proc-macro2", 277 | ] 278 | 279 | [[package]] 280 | name = "regex" 281 | version = "1.10.3" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" 284 | dependencies = [ 285 | "aho-corasick", 286 | "memchr", 287 | "regex-automata", 288 | "regex-syntax", 289 | ] 290 | 291 | [[package]] 292 | name = "regex-automata" 293 | version = "0.4.5" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" 296 | dependencies = [ 297 | "aho-corasick", 298 | "memchr", 299 | "regex-syntax", 300 | ] 301 | 302 | [[package]] 303 | name = "regex-syntax" 304 | version = "0.8.2" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 307 | 308 | [[package]] 309 | name = "ryu" 310 | version = "1.0.13" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 313 | 314 | [[package]] 315 | name = "serde" 316 | version = "1.0.215" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" 319 | dependencies = [ 320 | "serde_derive", 321 | ] 322 | 323 | [[package]] 324 | name = "serde_derive" 325 | version = "1.0.215" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" 328 | dependencies = [ 329 | "proc-macro2", 330 | "quote", 331 | "syn 2.0.86", 332 | ] 333 | 334 | [[package]] 335 | name = "serde_json" 336 | version = "1.0.133" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" 339 | dependencies = [ 340 | "itoa", 341 | "memchr", 342 | "ryu", 343 | "serde", 344 | ] 345 | 346 | [[package]] 347 | name = "serde_repr" 348 | version = "0.1.11" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "395627de918015623b32e7669714206363a7fc00382bf477e72c1f7533e8eafc" 351 | dependencies = [ 352 | "proc-macro2", 353 | "quote", 354 | "syn 1.0.109", 355 | ] 356 | 357 | [[package]] 358 | name = "socket2" 359 | version = "0.4.9" 360 | source = "registry+https://github.com/rust-lang/crates.io-index" 361 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 362 | dependencies = [ 363 | "libc", 364 | "winapi", 365 | ] 366 | 367 | [[package]] 368 | name = "syn" 369 | version = "1.0.109" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 372 | dependencies = [ 373 | "proc-macro2", 374 | "quote", 375 | "unicode-ident", 376 | ] 377 | 378 | [[package]] 379 | name = "syn" 380 | version = "2.0.86" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" 383 | dependencies = [ 384 | "proc-macro2", 385 | "quote", 386 | "unicode-ident", 387 | ] 388 | 389 | [[package]] 390 | name = "thiserror" 391 | version = "1.0.40" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 394 | dependencies = [ 395 | "thiserror-impl", 396 | ] 397 | 398 | [[package]] 399 | name = "thiserror-impl" 400 | version = "1.0.40" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" 403 | dependencies = [ 404 | "proc-macro2", 405 | "quote", 406 | "syn 2.0.86", 407 | ] 408 | 409 | [[package]] 410 | name = "tokio" 411 | version = "1.26.0" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" 414 | dependencies = [ 415 | "autocfg", 416 | "bytes", 417 | "libc", 418 | "memchr", 419 | "mio", 420 | "pin-project-lite", 421 | "socket2", 422 | "tokio-macros", 423 | "windows-sys 0.45.0", 424 | ] 425 | 426 | [[package]] 427 | name = "tokio-macros" 428 | version = "1.8.2" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" 431 | dependencies = [ 432 | "proc-macro2", 433 | "quote", 434 | "syn 1.0.109", 435 | ] 436 | 437 | [[package]] 438 | name = "unicode-ident" 439 | version = "1.0.8" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 442 | 443 | [[package]] 444 | name = "version_check" 445 | version = "0.9.4" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 448 | 449 | [[package]] 450 | name = "wasi" 451 | version = "0.11.0+wasi-snapshot-preview1" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 454 | 455 | [[package]] 456 | name = "wasm-bindgen" 457 | version = "0.2.91" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" 460 | dependencies = [ 461 | "cfg-if", 462 | "wasm-bindgen-macro", 463 | ] 464 | 465 | [[package]] 466 | name = "wasm-bindgen-backend" 467 | version = "0.2.91" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" 470 | dependencies = [ 471 | "bumpalo", 472 | "log", 473 | "once_cell", 474 | "proc-macro2", 475 | "quote", 476 | "syn 2.0.86", 477 | "wasm-bindgen-shared", 478 | ] 479 | 480 | [[package]] 481 | name = "wasm-bindgen-macro" 482 | version = "0.2.91" 483 | source = "registry+https://github.com/rust-lang/crates.io-index" 484 | checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" 485 | dependencies = [ 486 | "quote", 487 | "wasm-bindgen-macro-support", 488 | ] 489 | 490 | [[package]] 491 | name = "wasm-bindgen-macro-support" 492 | version = "0.2.91" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" 495 | dependencies = [ 496 | "proc-macro2", 497 | "quote", 498 | "syn 2.0.86", 499 | "wasm-bindgen-backend", 500 | "wasm-bindgen-shared", 501 | ] 502 | 503 | [[package]] 504 | name = "wasm-bindgen-shared" 505 | version = "0.2.91" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" 508 | 509 | [[package]] 510 | name = "winapi" 511 | version = "0.3.9" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 514 | dependencies = [ 515 | "winapi-i686-pc-windows-gnu", 516 | "winapi-x86_64-pc-windows-gnu", 517 | ] 518 | 519 | [[package]] 520 | name = "winapi-i686-pc-windows-gnu" 521 | version = "0.4.0" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 524 | 525 | [[package]] 526 | name = "winapi-x86_64-pc-windows-gnu" 527 | version = "0.4.0" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 530 | 531 | [[package]] 532 | name = "windows-core" 533 | version = "0.52.0" 534 | source = "registry+https://github.com/rust-lang/crates.io-index" 535 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 536 | dependencies = [ 537 | "windows-targets 0.52.0", 538 | ] 539 | 540 | [[package]] 541 | name = "windows-sys" 542 | version = "0.45.0" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 545 | dependencies = [ 546 | "windows-targets 0.42.2", 547 | ] 548 | 549 | [[package]] 550 | name = "windows-sys" 551 | version = "0.48.0" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 554 | dependencies = [ 555 | "windows-targets 0.48.5", 556 | ] 557 | 558 | [[package]] 559 | name = "windows-targets" 560 | version = "0.42.2" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 563 | dependencies = [ 564 | "windows_aarch64_gnullvm 0.42.2", 565 | "windows_aarch64_msvc 0.42.2", 566 | "windows_i686_gnu 0.42.2", 567 | "windows_i686_msvc 0.42.2", 568 | "windows_x86_64_gnu 0.42.2", 569 | "windows_x86_64_gnullvm 0.42.2", 570 | "windows_x86_64_msvc 0.42.2", 571 | ] 572 | 573 | [[package]] 574 | name = "windows-targets" 575 | version = "0.48.5" 576 | source = "registry+https://github.com/rust-lang/crates.io-index" 577 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 578 | dependencies = [ 579 | "windows_aarch64_gnullvm 0.48.5", 580 | "windows_aarch64_msvc 0.48.5", 581 | "windows_i686_gnu 0.48.5", 582 | "windows_i686_msvc 0.48.5", 583 | "windows_x86_64_gnu 0.48.5", 584 | "windows_x86_64_gnullvm 0.48.5", 585 | "windows_x86_64_msvc 0.48.5", 586 | ] 587 | 588 | [[package]] 589 | name = "windows-targets" 590 | version = "0.52.0" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 593 | dependencies = [ 594 | "windows_aarch64_gnullvm 0.52.0", 595 | "windows_aarch64_msvc 0.52.0", 596 | "windows_i686_gnu 0.52.0", 597 | "windows_i686_msvc 0.52.0", 598 | "windows_x86_64_gnu 0.52.0", 599 | "windows_x86_64_gnullvm 0.52.0", 600 | "windows_x86_64_msvc 0.52.0", 601 | ] 602 | 603 | [[package]] 604 | name = "windows_aarch64_gnullvm" 605 | version = "0.42.2" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 608 | 609 | [[package]] 610 | name = "windows_aarch64_gnullvm" 611 | version = "0.48.5" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 614 | 615 | [[package]] 616 | name = "windows_aarch64_gnullvm" 617 | version = "0.52.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 620 | 621 | [[package]] 622 | name = "windows_aarch64_msvc" 623 | version = "0.42.2" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 626 | 627 | [[package]] 628 | name = "windows_aarch64_msvc" 629 | version = "0.48.5" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 632 | 633 | [[package]] 634 | name = "windows_aarch64_msvc" 635 | version = "0.52.0" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 638 | 639 | [[package]] 640 | name = "windows_i686_gnu" 641 | version = "0.42.2" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 644 | 645 | [[package]] 646 | name = "windows_i686_gnu" 647 | version = "0.48.5" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 650 | 651 | [[package]] 652 | name = "windows_i686_gnu" 653 | version = "0.52.0" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 656 | 657 | [[package]] 658 | name = "windows_i686_msvc" 659 | version = "0.42.2" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 662 | 663 | [[package]] 664 | name = "windows_i686_msvc" 665 | version = "0.48.5" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 668 | 669 | [[package]] 670 | name = "windows_i686_msvc" 671 | version = "0.52.0" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 674 | 675 | [[package]] 676 | name = "windows_x86_64_gnu" 677 | version = "0.42.2" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 680 | 681 | [[package]] 682 | name = "windows_x86_64_gnu" 683 | version = "0.48.5" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 686 | 687 | [[package]] 688 | name = "windows_x86_64_gnu" 689 | version = "0.52.0" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 692 | 693 | [[package]] 694 | name = "windows_x86_64_gnullvm" 695 | version = "0.42.2" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 698 | 699 | [[package]] 700 | name = "windows_x86_64_gnullvm" 701 | version = "0.48.5" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 704 | 705 | [[package]] 706 | name = "windows_x86_64_gnullvm" 707 | version = "0.52.0" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 710 | 711 | [[package]] 712 | name = "windows_x86_64_msvc" 713 | version = "0.42.2" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 716 | 717 | [[package]] 718 | name = "windows_x86_64_msvc" 719 | version = "0.48.5" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 722 | 723 | [[package]] 724 | name = "windows_x86_64_msvc" 725 | version = "0.52.0" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 728 | 729 | [[package]] 730 | name = "zerocopy" 731 | version = "0.7.34" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 734 | dependencies = [ 735 | "zerocopy-derive", 736 | ] 737 | 738 | [[package]] 739 | name = "zerocopy-derive" 740 | version = "0.7.34" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 743 | dependencies = [ 744 | "proc-macro2", 745 | "quote", 746 | "syn 2.0.86", 747 | ] 748 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hyprland-workspaces" 3 | description = "A multi-monitor aware Hyprland workspace widget" 4 | homepage = "https://github.com/FieldofClay/hyprland-workspaces" 5 | repository = "https://github.com/FieldofClay/hyprland-workspaces" 6 | readme = "README.md" 7 | keywords = ["hyprland", "eww"] 8 | categories = ["command-line-utilities"] 9 | version = "2.0.4" 10 | edition = "2021" 11 | license = "MIT" 12 | 13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 14 | 15 | [dependencies] 16 | hyprland = { version = "0.4.0-alpha.3", features = ['silent'] } 17 | serde_json = "1.0" 18 | serde = "1.0" 19 | flexi_logger = "0.29" 20 | log = "0.4" 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 FieldofClay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hyprland-workspaces 2 | A multi-monitor aware Hyprland workspace widget. Follows the specified monitor and outputs the currently open workspaces. Designed to be used with [Eww](https://github.com/elkowar/eww), but may function with other bars. Compatible with [hyprland-autoname-workspaces](https://github.com/cyrinux/hyprland-autoname-workspaces). 3 | 4 | ## Installation Instructions 5 | ### Dependencies 6 | [Hyprland](https://github.com/hyprwm/Hyprland) 7 | ### Arch Linux 8 | Arch users can install from AUR using your favourite package manager. 9 | ``` 10 | pikaur -S hyprland-workspaces 11 | ``` 12 | 13 | ### NixOS 14 | 15 | NixOS users can use the [unstable channel](https://nixos.wiki/wiki/Nix_channels) to try or install the package. 16 | 17 | ``` 18 | nix-shell -p hyprland-workspaces 19 | ``` 20 | 21 | ### Crates.io 22 | It can be installed directly from [crates.io](https://crates.io) with cargo. 23 | ``` 24 | cargo install hyprland-workspaces 25 | ``` 26 | ### Building from source 27 | ``` 28 | git clone https://github.com/FieldofClay/hyprland-workspaces.git 29 | cd hyprland-workspaces 30 | cargo build --release 31 | ``` 32 | 33 | ## Usage 34 | ### Basic Usage 35 | Pass the name of the monitor to follow as the only argument. 36 | ``` 37 | ./hyprland-workspaces eDP-1 38 | ``` 39 | If you wish to get all workspaces across all monitors, pass the special argument "ALL". 40 | ``` 41 | ./hyprland-workspaces ALL 42 | ``` 43 | It will then follow that monitor(s) and output the workspaces details in JSON to stdout. 44 | ```json 45 | [{"active":false,"class":"workspace-button w1","id":1,"name":"1: "},{"active":false,"class":"workspace-button w2","id":2,"name":"2: "},{"active":true,"class":"workspace-button w4 workspace-active wa4","id":4,"name":"4: "}] 46 | ``` 47 | You can get the names of your monitors by running: 48 | ``` 49 | hyprctl monitors -j 50 | ``` 51 | 52 | It can be used as a workspaces widget in Eww with config similar to below. 53 | ```yuck 54 | (deflisten workspace0 "hyprland-workspaces `hyprctl monitors -j | jq -r \".[0].name\"`") 55 | (deflisten workspace1 "hyprland-workspaces `hyprctl monitors -j | jq -r \".[1].name\"`") 56 | 57 | (defwidget workspaces0 [] 58 | (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" 59 | (box :class "workspaces" 60 | (for i in workspace0 61 | (button 62 | :onclick "hyprctl dispatch workspace ${i.id}" 63 | :class "${i.class}" 64 | "${i.name}"))))) 65 | (defwidget workspaces1 [] 66 | (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" 67 | (box :class "workspaces" 68 | (for i in workspace1 69 | (button 70 | :onclick "hyprctl dispatch workspace ${i.id}" 71 | :class "${i.class}" 72 | "${i.name}"))))) 73 | 74 | (defwindow bar0 [] 75 | :monitor 0 76 | (box 77 | (workspaces0) 78 | (other_widget))) 79 | (defwindow bar1 [] 80 | :monitor 1 81 | (box 82 | (workspaces1) 83 | (other_widget))) 84 | ``` 85 | ### Advanced Usage 86 | Passing the special argument '_' will output all workspaces, wrapped in an array of monitors. This allows only running a single instance of hyprland-workspaces and simplified eww configuration. 87 | ``` 88 | ./hyprland-workspaces _ 89 | ``` 90 | Each monitor will have a sub array, workspaces, which will be the same information output as `hyprland-workspaces MONITORNAME`. 91 | ```json 92 | [ 93 | { 94 | "name": "eDP-1", 95 | "workspaces": [ 96 | {"active": false,"class": "workspace-button w6 workspace-on-screen","id": 6,"name": "6 []"} 97 | ] 98 | }, 99 | { 100 | "name": "DP-3", 101 | "workspaces": [ 102 | {"active": false,"class": "workspace-button w1","id": 1,"name": "1 "}, 103 | {"active": true,"class": "workspace-button w3 workspace-active wa3 workspace-on-screen","id": 3,"name": "3 "} 104 | ] 105 | }, 106 | { 107 | "name": "DP-4", 108 | "workspaces": [ 109 | {"active": false,"class": "workspace-button w2","id": 2,"name": "2 "}, 110 | {"active": false,"class": "workspace-button w5 workspace-on-screen","id": 5,"name": "5 "} 111 | ] 112 | } 113 | ] 114 | ``` 115 | This helps avoid repetition within your eww configuration, by using something similar to below. 116 | ```yuck 117 | (deflisten workspaces "hyprland-workspaces _") 118 | 119 | (defwidget workspaceWidget [monitor] 120 | (eventbox :onscroll "hyprctl dispatch workspace `echo {} | sed 's/up/+/\' | sed 's/down/-/'`1" 121 | (box :class "workspaces" 122 | (for i in {workspaces[monitor].workspaces} 123 | (button 124 | :onclick "hyprctl dispatch workspace ${i.id}" 125 | :class "${i.class}" 126 | "${i.name}"))))) 127 | 128 | (defwidget bar0 [] 129 | (box 130 | (workspaceWidget :monitor 0) 131 | ) 132 | ) 133 | 134 | (defwidget bar1 [] 135 | (box 136 | (workspaceWidget :monitor 1) 137 | ) 138 | ) 139 | ``` 140 | ### Classes 141 | The following classes are output, to provide multiple options for theming your workspaces widget. 142 | * `workspace-button`: all workspaces will have this class 143 | * `workspace-active`: only the active workspace will have this class. Will not be present if workspace is active, but focus is on another monitor. 144 | * `w`: Each workspace will have this class to allow for unique CSS per workspace. 145 | * `wa`: The active workspace will have this to allow for unique CSS per workspace, when it is active. Like `workspace-active`, this does not appear when the focus is on another monitor. 146 | * `workspace-on-screen`: a workspace will have this class if it's currently displayed on a monitor. 147 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use flexi_logger::{FileSpec, Logger}; 2 | use hyprland::data::{Monitors, Workspace, Workspaces}; 3 | use hyprland::event_listener::EventListener; 4 | use hyprland::shared::{HyprData, HyprDataActive, HyprError}; 5 | use hyprland::Result; 6 | use log; 7 | use serde::Serialize; 8 | use serde_json::json; 9 | use std::env; 10 | use std::sync::Arc; 11 | 12 | const HELP: &str = "\ 13 | hyprland-workspaces: a multi monitor aware hyprland workspaces json widget generator for eww. 14 | 15 | USAGE: 16 | hyprland-workspaces MONITOR 17 | 18 | FLAGS: 19 | -h, --help Prints help information 20 | 21 | ARGS: 22 | Monitor to track windows/workspaces on 23 | Use the special keywords ALL to track all monitors or _ to track all monitors and output monitor name information as well 24 | "; 25 | 26 | #[derive(Serialize)] 27 | struct WorkspaceCustom { 28 | pub name: String, 29 | pub id: i32, 30 | pub active: bool, 31 | pub on_screen: bool, 32 | pub class: String, 33 | } 34 | 35 | #[derive(Serialize)] 36 | struct MonitorCustom { 37 | pub name: String, 38 | pub workspaces: Vec, 39 | } 40 | 41 | fn get_workspace_windows(monitor: &str) -> Result> { 42 | // get all workspaces 43 | let mut workspaces: Vec<_> = Workspaces::get()?.into_iter().collect(); 44 | workspaces.sort_by_key(|w| w.id); 45 | 46 | //get active workspace 47 | let active_workspace_id: i32; 48 | if monitor == "ALL" { 49 | active_workspace_id = Workspace::get_active()?.id; 50 | } else { 51 | active_workspace_id = Monitors::get()? 52 | .into_iter() 53 | .find(|m| m.name == monitor) 54 | .ok_or_else(|| { 55 | log::error!("No monitor found with name: {}", monitor); 56 | HyprError::NotOkDispatch("No monitor found".to_string()) 57 | })? 58 | .active_workspace 59 | .id; 60 | } 61 | //active monitor name 62 | let active_monitor_name = Monitors::get()? 63 | .into_iter() 64 | .find(|m| m.focused == true) 65 | .ok_or_else(|| { 66 | log::error!("No active monitor found."); 67 | HyprError::NotOkDispatch("No active monitor found".to_string()) 68 | })? 69 | .name; 70 | let on_screen_workspaces: Vec = Monitors::get()? 71 | .into_iter() 72 | .map(|m| m.active_workspace.id).collect(); 73 | let mut out_workspaces: Vec = Vec::new(); 74 | 75 | for workspace in workspaces 76 | .iter() 77 | .filter(|m| m.monitor == monitor || monitor == "ALL" || monitor == "_") 78 | { 79 | let mut active = false; 80 | let on_screen = on_screen_workspaces.contains(&workspace.id); 81 | let mut class = format!("workspace-button w{}{}", workspace.id, if on_screen {" workspace-on-screen"} else {""}); 82 | if (active_workspace_id == workspace.id) 83 | && (active_monitor_name == monitor || monitor == "ALL") 84 | { 85 | class = format!("{} workspace-active wa{}", class, workspace.id); 86 | active = true; 87 | } 88 | 89 | let ws: WorkspaceCustom = WorkspaceCustom { 90 | name: workspace.name.clone(), 91 | id: workspace.id, 92 | active, 93 | on_screen, 94 | class, 95 | }; 96 | out_workspaces.push(ws); 97 | } 98 | return Ok(out_workspaces); 99 | } 100 | 101 | fn get_all_advanced() -> Result> { 102 | let monitors = Monitors::get()?; 103 | let mut out_monitors: Vec = Vec::new(); 104 | for m in monitors { 105 | let workspaces = get_workspace_windows(&m.name)?; 106 | let mc: MonitorCustom = MonitorCustom { 107 | name: m.name, 108 | workspaces: workspaces, 109 | }; 110 | out_monitors.push(mc); 111 | } 112 | Ok(out_monitors) 113 | } 114 | 115 | fn output(monitor: &str) { 116 | if monitor == "_" { 117 | println!( 118 | "{}", 119 | json!(get_all_advanced().unwrap_or_else(|err| { 120 | log::error!("Advanced get failed: {}", err); 121 | Vec::new() 122 | })) 123 | .to_string() 124 | ); 125 | } else { 126 | println!( 127 | "{}", 128 | json!(get_workspace_windows(monitor).unwrap_or_else(|err| { 129 | log::error!("Basic get failed: {}", err); 130 | Vec::new() 131 | })) 132 | .to_string() 133 | ); 134 | } 135 | } 136 | 137 | fn main() -> Result<()> { 138 | let args: Vec = env::args().collect(); 139 | //check args 140 | if args.len() != 2 || args[1].eq("-h") || args[1].eq("--help") { 141 | println!("{HELP}"); 142 | std::process::exit(0); 143 | } 144 | let _logger = match Logger::try_with_str("info") { 145 | Ok(logger) => { 146 | match logger 147 | .log_to_file( 148 | FileSpec::default() 149 | .directory("/tmp") 150 | .basename("hyprland-workspaces"), 151 | ) 152 | .start() 153 | { 154 | Ok(logger) => logger, 155 | Err(e) => { 156 | println!("Unable to start logger: {}", e); 157 | std::process::exit(1) 158 | } 159 | }; 160 | } 161 | Err(e) => { 162 | println!("Unable to initialise logger: {}", e); 163 | std::process::exit(1) 164 | } 165 | }; 166 | let mon = Arc::new(String::from(args[1].to_string())); 167 | if let None = Monitors::get() 168 | .unwrap_or_else(|err| { 169 | log::error!("Unable to get monitors: {}", err); 170 | std::process::exit(1) 171 | }) 172 | .into_iter() 173 | .find(|m| m.name == mon.to_string() || mon.to_string() == "ALL" || mon.to_string() == "_") 174 | { 175 | log::error!("Unable to find monitor {mon}"); 176 | std::process::exit(0); 177 | } 178 | 179 | log::info!("Started with arg {}", mon); 180 | output(&mon); 181 | // Create a event listener 182 | let mut event_listener = EventListener::new(); 183 | let mon_clone = Arc::clone(&mon); 184 | event_listener.add_workspace_change_handler(move |_| { 185 | output(&mon_clone); 186 | }); 187 | let mon_clone = Arc::clone(&mon); 188 | event_listener.add_workspace_added_handler(move |_| { 189 | output(&mon_clone); 190 | }); 191 | let mon_clone = Arc::clone(&mon); 192 | event_listener.add_workspace_destroy_handler(move |_| { 193 | output(&mon_clone); 194 | }); 195 | let mon_clone = Arc::clone(&mon); 196 | event_listener.add_workspace_moved_handler(move |_| { 197 | output(&mon_clone); 198 | }); 199 | let mon_clone = Arc::clone(&mon); 200 | event_listener.add_monitor_added_handler(move |_| { 201 | output(&mon_clone); 202 | }); 203 | let mon_clone = Arc::clone(&mon); 204 | event_listener.add_monitor_removed_handler(move |_| { 205 | output(&mon_clone); 206 | }); 207 | let mon_clone = Arc::clone(&mon); 208 | event_listener.add_window_close_handler(move |_| { 209 | output(&mon_clone); 210 | }); 211 | let mon_clone = Arc::clone(&mon); 212 | event_listener.add_window_open_handler(move |_| { 213 | output(&mon_clone); 214 | }); 215 | let mon_clone = Arc::clone(&mon); 216 | event_listener.add_active_monitor_change_handler(move |_| { 217 | output(&mon_clone); 218 | }); 219 | let mon_clone = Arc::clone(&mon); 220 | event_listener.add_active_window_change_handler(move |_| { 221 | output(&mon_clone); 222 | }); 223 | let mon_clone = Arc::clone(&mon); 224 | event_listener.add_window_close_handler(move |_| { 225 | output(&mon_clone); 226 | }); 227 | let mon_clone = Arc::clone(&mon); 228 | event_listener.add_fullscreen_state_change_handler(move |_| { 229 | output(&mon_clone); 230 | }); 231 | let mon_clone = Arc::clone(&mon); 232 | event_listener.add_window_moved_handler(move |_| { 233 | output(&mon_clone); 234 | }); 235 | let mon_clone = Arc::clone(&mon); 236 | event_listener.add_layer_open_handler(move |_| { 237 | output(&mon_clone); 238 | }); 239 | let mon_clone = Arc::clone(&mon); 240 | event_listener.add_layer_closed_handler(move |_| { 241 | output(&mon_clone); 242 | }); 243 | let mon_clone = Arc::clone(&mon); 244 | event_listener.add_urgent_state_handler(move |_| { 245 | output(&mon_clone); 246 | }); 247 | let mon_clone = Arc::clone(&mon); 248 | event_listener.add_window_title_change_handler(move |_| { 249 | output(&mon_clone); 250 | }); 251 | 252 | event_listener.start_listener() 253 | } 254 | --------------------------------------------------------------------------------