From 59e8e02f156474e9414b35f8d206b932b532d5cb Mon Sep 17 00:00:00 2001 From: Peter Crawley <49043380+Peter-Crawley@users.noreply.github.com> Date: Sat, 25 Feb 2023 09:25:55 +0000 Subject: [PATCH 01/14] Remove broken newline and mention zfs (#685) --- crates/eww/src/config/inbuilt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/eww/src/config/inbuilt.rs b/crates/eww/src/config/inbuilt.rs index 672b6d69..fba822d0 100644 --- a/crates/eww/src/config/inbuilt.rs +++ b/crates/eww/src/config/inbuilt.rs @@ -38,7 +38,7 @@ define_builtin_vars! { Duration::new(2, 0), // @prop { total_mem, free_mem, total_swap, free_swap, available_mem, used_mem, used_mem_perc } "EWW_RAM" => || Ok(DynVal::from(get_ram())), - // @desc EWW_DISK - Information on on all mounted partitions (Might report inaccurately on some filesystems, like btrfs)\nExample: `{EWW_DISK["/"]}` + // @desc EWW_DISK - Information on on all mounted partitions (Might report inaccurately on some filesystems, like btrfs and zfs) Example: `{EWW_DISK["/"]}` // @prop { : { name, total, free, used, used_perc } } "EWW_DISK" => || Ok(DynVal::from(get_disks())), From 6b576c02ace772b2c3d51a36ee2aaec2ae4beb95 Mon Sep 17 00:00:00 2001 From: Ezequiel Ramis Date: Sat, 25 Feb 2023 06:35:35 -0300 Subject: [PATCH 02/14] Vanilla CSS support (#467) Co-authored-by: ElKowar <5300871+elkowar@users.noreply.github.com> --- CHANGELOG.md | 1 + crates/eww/src/app.rs | 2 +- crates/eww/src/config/scss.rs | 31 ++++++++++++++++++++++--------- crates/eww/src/opts.rs | 2 +- crates/eww/src/paths.rs | 4 ---- crates/eww/src/server.rs | 4 ++-- docs/src/configuration.md | 4 ++-- docs/src/troubleshooting.md | 2 +- docs/src/working_with_gtk.md | 2 +- 9 files changed, 31 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2af69e0d..340fd981 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Allow floating-point numbers in percentages for window-geometry - Add support for safe access with index (`?.[n]`) (By: ModProg) - Made `and`, `or` and `?:` lazily evaluated in simplexpr (By: ModProg) +- Add Vanilla CSS support (By: Ezequiel Ramis) ## [0.4.0] (04.09.2022) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 48a25866..3b982a80 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -149,7 +149,7 @@ impl App { if let Err(e) = config_result.and_then(|new_config| self.load_config(new_config)) { errors.push(e) } - match crate::config::scss::parse_scss_from_file(&self.paths.get_eww_scss_path()) { + match crate::config::scss::parse_scss_from_config(&self.paths.get_config_dir()) { Ok((file_id, css)) => { if let Err(e) = self.load_css(file_id, &css) { errors.push(anyhow!(e)); diff --git a/crates/eww/src/config/scss.rs b/crates/eww/src/config/scss.rs index 4d08ee78..8561f709 100644 --- a/crates/eww/src/config/scss.rs +++ b/crates/eww/src/config/scss.rs @@ -4,18 +4,31 @@ use anyhow::{anyhow, Context}; use crate::{error_handling_ctx, util::replace_env_var_references}; -/// read an scss file, replace all environment variable references within it and +/// read an (s)css file, replace all environment variable references within it and /// then parse it into css. /// Also adds the CSS to the [`crate::file_database::FileDatabase`] -pub fn parse_scss_from_file(path: &Path) -> anyhow::Result<(usize, String)> { - let config_dir = path.parent().context("Given SCSS file has no parent directory?!")?; - let scss_file_content = - std::fs::read_to_string(path).with_context(|| format!("Given SCSS-file doesn't exist! {}", path.display()))?; - let file_content = replace_env_var_references(scss_file_content); - let grass_config = grass::Options::default().load_path(config_dir); - let css = grass::from_string(file_content, &grass_config).map_err(|err| anyhow!("SCSS parsing error: {}", err))?; +pub fn parse_scss_from_config(path: &Path) -> anyhow::Result<(usize, String)> { + let css_file = path.join("eww.css"); + let scss_file = path.join("eww.scss"); + if css_file.exists() && scss_file.exists() { + return Err(anyhow!("Encountered both an SCSS and CSS file. Only one of these may exist at a time")); + } + + let (s_css_path, css) = if css_file.exists() { + let css_file_content = std::fs::read_to_string(&css_file) + .with_context(|| format!("Given CSS file doesn't exist: {}", css_file.display()))?; + let css = replace_env_var_references(css_file_content); + (css_file, css) + } else { + let scss_file_content = + std::fs::read_to_string(&scss_file).with_context(|| format!("Given SCSS file doesn't exist! {}", path.display()))?; + let file_content = replace_env_var_references(scss_file_content); + let grass_config = grass::Options::default().load_path(path); + let css = grass::from_string(file_content, &grass_config).map_err(|err| anyhow!("SCSS parsing error: {}", err))?; + (scss_file, css) + }; let mut file_db = error_handling_ctx::FILE_DATABASE.write().unwrap(); - let file_id = file_db.insert_string(path.display().to_string(), css.clone())?; + let file_id = file_db.insert_string(s_css_path.display().to_string(), css.clone())?; Ok((file_id, css)) } diff --git a/crates/eww/src/opts.rs b/crates/eww/src/opts.rs index 31543ff9..fc1c4c3d 100644 --- a/crates/eww/src/opts.rs +++ b/crates/eww/src/opts.rs @@ -32,7 +32,7 @@ struct RawOpt { #[arg(long = "debug", global = true)] log_debug: bool, - /// override path to configuration directory (directory that contains eww.yuck and eww.scss) + /// override path to configuration directory (directory that contains eww.yuck and eww.(s)css) #[arg(short, long, global = true)] config: Option, diff --git a/crates/eww/src/paths.rs b/crates/eww/src/paths.rs index 376e9a65..498bd8e5 100644 --- a/crates/eww/src/paths.rs +++ b/crates/eww/src/paths.rs @@ -77,10 +77,6 @@ impl EwwPaths { pub fn get_yuck_path(&self) -> PathBuf { self.config_dir.join("eww.yuck") } - - pub fn get_eww_scss_path(&self) -> PathBuf { - self.config_dir.join("eww.scss") - } } impl std::fmt::Display for EwwPaths { diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 93a03bae..48adb0d8 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -83,7 +83,7 @@ pub fn initialize_server(paths: EwwPaths, action: Option, should_ gtk::StyleContext::add_provider_for_screen(&screen, &app.css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION); } - if let Ok((file_id, css)) = config::scss::parse_scss_from_file(&app.paths.get_eww_scss_path()) { + if let Ok((file_id, css)) = config::scss::parse_scss_from_config(&app.paths.get_config_dir()) { if let Err(e) = app.load_css(file_id, &css) { error_handling_ctx::print_error(e); } @@ -169,7 +169,7 @@ async fn run_filewatch>(config_dir: P, evt_send: UnboundedSender< Ok(notify::Event { kind: notify::EventKind::Modify(_), paths, .. }) => { let relevant_files_changed = paths.iter().any(|path| { let ext = path.extension().unwrap_or_default(); - ext == "yuck" || ext == "scss" + ext == "yuck" || ext == "scss" || ext == "css" }); if relevant_files_changed { if let Err(err) = tx.send(()) { diff --git a/docs/src/configuration.md b/docs/src/configuration.md index faa0567f..144d8a63 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -10,13 +10,13 @@ If you're using VSCode, you can get syntax highlighting and formatting from [yuc It is also recommended to use [parinfer](https://shaunlebron.github.io/parinfer/), which makes working with S-expressions delightfully easy! -Additionally, any styles are defined in SCSS (which is mostly just slightly improved CSS syntax). +Additionally, any styles are defined in CSS or SCSS (which is mostly just slightly improved CSS syntax). While eww supports a significant portion of the CSS you know from the web, not everything is supported, as eww relies on GTK's own CSS engine. Notably, some animation features are unsupported, as well as most layout-related CSS properties such as flexbox, `float`, absolute position or `width`/`height`. -To get started, you'll need to create two files: `eww.yuck` and `eww.scss`. +To get started, you'll need to create two files: `eww.yuck` and `eww.scss` (or `eww.css`, if you prefer). These files must be placed under `$XDG_CONFIG_HOME/eww` (this is most likely `~/.config/eww`). Now that those files are created, you can start writing your first widget! diff --git a/docs/src/troubleshooting.md b/docs/src/troubleshooting.md index a50253d0..d1db06bd 100644 --- a/docs/src/troubleshooting.md +++ b/docs/src/troubleshooting.md @@ -14,7 +14,7 @@ Here you will find help if something doesn't work. If the issue isn't listed her ## My configuration is not loaded correctly -1. Make sure the `eww.yuck` and `eww.scss` files are in the correct places. +1. Make sure the `eww.yuck` and `eww.(s)css` files are in the correct places. 2. Sometimes, eww might fail to load your configuration as a result of a configuration error. Make sure your configuration is valid. ## Something isn't styled correctly! diff --git a/docs/src/working_with_gtk.md b/docs/src/working_with_gtk.md index 51376bde..0debd368 100644 --- a/docs/src/working_with_gtk.md +++ b/docs/src/working_with_gtk.md @@ -3,7 +3,7 @@ ## Gtk-theming Eww is styled in GTK CSS. -To make theming even easier, it makes use of `SCSS` and then compiles that into CSS for you. +You can use `Vanilla CSS` or `SCSS` to make theming even easier. The latter is compiled into CSS for you. If you don't know any way to style something check out the [GTK CSS Overview wiki](https://docs.gtk.org/gtk3/css-overview.html), the [GTK CSS Properties Overview wiki ](https://docs.gtk.org/gtk3/css-properties.html), or use the [GTK-Debugger](#gtk-debugger). From 7290b9bb8df59e05fad7ec3d0bb3a12f637b4fe2 Mon Sep 17 00:00:00 2001 From: ElKowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 25 Feb 2023 16:27:32 +0100 Subject: [PATCH 03/14] Add jq function (#695) --- CHANGELOG.md | 1 + Cargo.lock | 229 ++++++++++++++++++++++++++- crates/eww_shared_util/src/span.rs | 10 ++ crates/simplexpr/Cargo.toml | 4 + crates/simplexpr/src/dynval.rs | 7 + crates/simplexpr/src/eval.rs | 69 +++++++- crates/yuck/src/format_diagnostic.rs | 23 ++- crates/yuck/src/lib.rs | 3 +- docs/src/expression_language.md | 2 +- 9 files changed, 332 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 340fd981..628c693b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add support for safe access with index (`?.[n]`) (By: ModProg) - Made `and`, `or` and `?:` lazily evaluated in simplexpr (By: ModProg) - Add Vanilla CSS support (By: Ezequiel Ramis) +- Add `jq` function, offering jq-style json processing ## [0.4.0] (04.09.2022) diff --git a/Cargo.lock b/Cargo.lock index d3de724e..4c133587 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +dependencies = [ + "const-random", +] + [[package]] name = "ahash" version = "0.7.6" @@ -37,6 +46,23 @@ dependencies = [ "term", ] +[[package]] +name = "async-trait" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + [[package]] name = "atk" version = "0.15.1" @@ -120,6 +146,44 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +[[package]] +name = "cached" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5877db5d1af7fae60d06b5db9430b68056a69b3582a0be8e3691e87654aeb6" +dependencies = [ + "async-trait", + "async_once", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "lazy_static", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ca87c81aaa3a949dbbe2b5e6c2c45dbc94ba4897e45ea31ff9ec5087be3dc" +dependencies = [ + "cached_proc_macro_types", + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + [[package]] name = "cairo-rs" version = "0.15.12" @@ -165,6 +229,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chumsky" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4" +dependencies = [ + "ahash 0.3.8", +] + [[package]] name = "clap" version = "4.0.27" @@ -231,6 +304,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -302,6 +397,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -342,6 +472,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "dyn-clone" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60" + [[package]] name = "either" version = "1.8.0" @@ -490,6 +626,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -499,6 +641,20 @@ dependencies = [ "libc", ] +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.25" @@ -506,6 +662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -562,6 +719,7 @@ checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-core", "futures-macro", + "futures-sink", "futures-task", "pin-project-lite", "pin-utils", @@ -867,7 +1025,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -876,6 +1034,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "heck" version = "0.4.0" @@ -909,6 +1073,12 @@ dependencies = [ "quick-error", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "indexmap" version = "1.9.1" @@ -952,6 +1122,15 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "io-lifetimes" version = "1.0.2" @@ -989,6 +1168,42 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +[[package]] +name = "jaq-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1452b4acc3a7f49bd8dd516e90ed0c4f688bada805857275f85957aca2c0e7eb" +dependencies = [ + "ahash 0.3.8", + "dyn-clone", + "indexmap", + "itertools", + "jaq-parse", + "log", + "once_cell", + "serde_json", +] + +[[package]] +name = "jaq-parse" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2130a59d64a5476f6feeb6b7e48cbe52ef05d8bc1b9174f50baa93e49052fd" +dependencies = [ + "chumsky", + "serde", +] + +[[package]] +name = "jaq-std" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ab73d2079279e784a52dbbf5f3a5e0d792c89b41fd2c857de87cf698a4e24a" +dependencies = [ + "bincode", + "jaq-parse", +] + [[package]] name = "kqueue" version = "1.0.7" @@ -1239,9 +1454,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "os_str_bytes" @@ -1480,9 +1695,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -1756,15 +1971,19 @@ dependencies = [ name = "simplexpr" version = "0.1.0" dependencies = [ + "cached", "eww_shared_util", "insta", "itertools", + "jaq-core", + "jaq-std", "lalrpop", "lalrpop-util", "once_cell", "regex", "serde", "serde_json", + "static_assertions", "strsim", "strum", "thiserror", diff --git a/crates/eww_shared_util/src/span.rs b/crates/eww_shared_util/src/span.rs index fcf6e692..9ee4b672 100644 --- a/crates/eww_shared_util/src/span.rs +++ b/crates/eww_shared_util/src/span.rs @@ -1,3 +1,7 @@ +/// A span is made up of +/// - the start location +/// - the end location +/// - the file id #[derive(Eq, PartialEq, Clone, Copy, serde::Serialize, serde::Deserialize)] pub struct Span(pub usize, pub usize, pub usize); @@ -39,6 +43,12 @@ impl Span { self } + pub fn new_relative(mut self, other_start: usize, other_end: usize) -> Self { + self.0 += other_start; + self.1 += other_end; + self + } + pub fn is_dummy(&self) -> bool { *self == Self::DUMMY } diff --git a/crates/simplexpr/Cargo.toml b/crates/simplexpr/Cargo.toml index 03748b13..edcb5ce4 100644 --- a/crates/simplexpr/Cargo.toml +++ b/crates/simplexpr/Cargo.toml @@ -21,6 +21,10 @@ once_cell = "1.8.0" serde = {version = "1.0", features = ["derive"]} serde_json = "1.0" strsim = "0.10" +jaq-core = "0.9.0" +jaq-std = {version = "0.9.0", features = ["bincode"]} +static_assertions = "1.1.0" +cached = "0.42.0" strum = { version = "0.24", features = ["derive"] } diff --git a/crates/simplexpr/src/dynval.rs b/crates/simplexpr/src/dynval.rs index e730d0a9..c35b9a91 100644 --- a/crates/simplexpr/src/dynval.rs +++ b/crates/simplexpr/src/dynval.rs @@ -132,6 +132,13 @@ impl DynVal { self } + pub fn at_if_dummy(mut self, span: Span) -> Self { + if self.1.is_dummy() { + self.1 = span; + } + self + } + pub fn from_string(s: String) -> Self { DynVal(s, Span::DUMMY) } diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index 3b75048b..d0b48115 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -1,3 +1,4 @@ +use cached::proc_macro::cached; use itertools::Itertools; use crate::{ @@ -8,8 +9,20 @@ use eww_shared_util::{Span, Spanned, VarName}; use std::{ collections::HashMap, convert::{TryFrom, TryInto}, + sync::Arc, }; +#[derive(Debug, thiserror::Error)] +pub struct JaqParseError(pub Option); +impl std::fmt::Display for JaqParseError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match &self.0 { + Some(x) => write!(f, "Error parsing jq filter: {x}"), + None => write!(f, "Error parsing jq filter"), + } + } +} + #[derive(Debug, thiserror::Error)] pub enum EvalError { #[error("Tried to reference variable `{0}`, but we cannot access variables here")] @@ -36,13 +49,24 @@ pub enum EvalError { #[error("Json operation failed: {0}")] SerdeError(#[from] serde_json::error::Error), + #[error("Error in jq function: {0}")] + JaqError(String), + + #[error(transparent)] + JaqParseError(JaqParseError), + #[error("{1}")] Spanned(Span, Box), } +static_assertions::assert_impl_all!(EvalError: Send, Sync); + impl EvalError { pub fn at(self, span: Span) -> Self { - Self::Spanned(span, Box::new(self)) + match self { + EvalError::Spanned(..) => self, + _ => EvalError::Spanned(span, Box::new(self)), + } } pub fn map_in_span(self, f: impl FnOnce(Self) -> Self) -> Self { @@ -113,8 +137,7 @@ impl SimplExpr { self.try_map_var_refs(|span, name| match variables.get(&name) { Some(value) => Ok(Literal(value.clone())), None => { - let similar_ish = - variables.keys().filter(|key| strsim::levenshtein(&key.0, &name.0) < 3).cloned().collect_vec(); + let similar_ish = variables.keys().filter(|key| strsim::levenshtein(&key.0, &name.0) < 3).cloned().collect_vec(); Err(EvalError::UnknownVariable(name.clone(), similar_ish).at(span)) } }) @@ -169,8 +192,7 @@ impl SimplExpr { Ok(DynVal(output, *span)) } SimplExpr::VarRef(span, ref name) => { - let similar_ish = - values.keys().filter(|keys| strsim::levenshtein(&keys.0, &name.0) < 3).cloned().collect_vec(); + let similar_ish = values.keys().filter(|keys| strsim::levenshtein(&keys.0, &name.0) < 3).cloned().collect_vec(); Ok(values .get(name) .cloned() @@ -349,11 +371,48 @@ fn call_expr_function(name: &str, args: Vec) -> Result Ok(DynVal::from(json.as_json_object()?.len() as i32)), _ => Err(EvalError::WrongArgCount(name.to_string())), }, + "jq" => match args.as_slice() { + [json, code] => run_jaq_function(json.as_json_value()?, code.as_string()?) + .map_err(|e| EvalError::Spanned(code.span(), Box::new(e))), + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, _ => Err(EvalError::UnknownFunction(name.to_string())), } } +#[cached(size = 10, result = true, sync_writes = true)] +fn prepare_jaq_filter(code: String) -> Result, EvalError> { + let (filter, mut errors) = jaq_core::parse::parse(&code, jaq_core::parse::main()); + let filter = match filter { + Some(x) => x, + None => return Err(EvalError::JaqParseError(JaqParseError(errors.pop()))), + }; + let mut defs = jaq_core::Definitions::core(); + for def in jaq_std::std() { + defs.insert(def, &mut errors); + } + + let filter = defs.finish(filter, Vec::new(), &mut errors); + + if let Some(error) = errors.pop() { + return Err(EvalError::JaqParseError(JaqParseError(Some(error)))); + } + Ok(Arc::new(filter)) +} + +fn run_jaq_function(json: serde_json::Value, code: String) -> Result { + let filter = prepare_jaq_filter(code)?; + let inputs = jaq_core::RcIter::new(std::iter::empty()); + let out = filter + .run(jaq_core::Ctx::new([], &inputs), jaq_core::Val::from(json)) + .map(|x| x.map(Into::::into)) + .map(|x| x.map(|x| DynVal::from_string(serde_json::to_string(&x).unwrap()))) + .collect::>() + .map_err(|e| EvalError::JaqError(e.to_string()))?; + Ok(out) +} + #[cfg(test)] mod tests { use crate::dynval::DynVal; diff --git a/crates/yuck/src/format_diagnostic.rs b/crates/yuck/src/format_diagnostic.rs index cdbac1dd..25cad797 100644 --- a/crates/yuck/src/format_diagnostic.rs +++ b/crates/yuck/src/format_diagnostic.rs @@ -187,10 +187,10 @@ impl ToDiagnostic for simplexpr::parser::lexer::LexicalError { impl ToDiagnostic for simplexpr::eval::EvalError { fn to_diagnostic(&self) -> Diagnostic { - use simplexpr::eval::EvalError::*; + use simplexpr::eval::EvalError; match self { - NoVariablesAllowed(name) => gen_diagnostic!(self), - UnknownVariable(name, similar) => { + EvalError::NoVariablesAllowed(name) => gen_diagnostic!(self), + EvalError::UnknownVariable(name, similar) => { let mut notes = Vec::new(); if similar.len() == 1 { notes.push(format!("Did you mean `{}`?", similar.first().unwrap())) @@ -202,7 +202,22 @@ impl ToDiagnostic for simplexpr::eval::EvalError { notes.push(format!("Hint: If you meant to use the literal value \"{}\", surround the value in quotes", name)); gen_diagnostic!(self).with_notes(notes) } - Spanned(span, error) => error.as_ref().to_diagnostic().with_label(span_to_primary_label(*span)), + EvalError::Spanned(span, box EvalError::JaqParseError(simplexpr::eval::JaqParseError(Some(err)))) => { + let span = span.new_relative(err.span().start, err.span().end).shifted(1); + let mut diag = gen_diagnostic!(self, span); + + if let Some(label) = err.label() { + diag = diag.with_label(span_to_secondary_label(span).with_message(label)); + } + + let expected: Vec<_> = err.expected().filter_map(|x| x.clone()).sorted().collect(); + if !expected.is_empty() { + let label = format!("Expected one of {} here", expected.join(", ")); + diag = diag.with_label(span_to_primary_label(span).with_message(label)); + } + diag + } + EvalError::Spanned(span, error) => error.as_ref().to_diagnostic().with_label(span_to_primary_label(*span)), _ => gen_diagnostic!(self, self.span()), } } diff --git a/crates/yuck/src/lib.rs b/crates/yuck/src/lib.rs index ff734912..0c6bf826 100644 --- a/crates/yuck/src/lib.rs +++ b/crates/yuck/src/lib.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] #![allow(unused)] -#![feature(try_blocks)] +#![allow(clippy::comparison_chain)] +#![feature(try_blocks, box_patterns)] pub mod ast_error; pub mod config; diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index f11c8ee0..3cb4b525 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -45,4 +45,4 @@ Supported currently are the following features: - `strlength(value)`: Gets the length of the string - `arraylength(value)`: Gets the length of the array - `objectlength(value)`: Gets the amount of entries in the object - + - `jq(value, jq_filter_string)`: run a [jq](https://stedolan.github.io/jq/manual/) style command on a json value. (Uses [jaq](https://crates.io/crates/jaq) internally). From d2c7bde29d26da38f19de3c4c7323025fff54876 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 25 Feb 2023 16:51:08 +0100 Subject: [PATCH 04/14] Fix outdated formatting config --- crates/eww/rustfmt.toml | 2 +- crates/simplexpr/rustfmt.toml | 2 +- crates/yuck/rustfmt.toml | 2 +- rustfmt.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/eww/rustfmt.toml b/crates/eww/rustfmt.toml index edce9c8d..824c0113 100644 --- a/crates/eww/rustfmt.toml +++ b/crates/eww/rustfmt.toml @@ -2,7 +2,7 @@ unstable_features = true fn_single_line = false max_width = 130 reorder_impl_items = true -merge_imports = true +imports_granularity = "Crate" normalize_comments = true use_field_init_shorthand = true #wrap_comments = true diff --git a/crates/simplexpr/rustfmt.toml b/crates/simplexpr/rustfmt.toml index edce9c8d..824c0113 100644 --- a/crates/simplexpr/rustfmt.toml +++ b/crates/simplexpr/rustfmt.toml @@ -2,7 +2,7 @@ unstable_features = true fn_single_line = false max_width = 130 reorder_impl_items = true -merge_imports = true +imports_granularity = "Crate" normalize_comments = true use_field_init_shorthand = true #wrap_comments = true diff --git a/crates/yuck/rustfmt.toml b/crates/yuck/rustfmt.toml index edce9c8d..824c0113 100644 --- a/crates/yuck/rustfmt.toml +++ b/crates/yuck/rustfmt.toml @@ -2,7 +2,7 @@ unstable_features = true fn_single_line = false max_width = 130 reorder_impl_items = true -merge_imports = true +imports_granularity = "Crate" normalize_comments = true use_field_init_shorthand = true #wrap_comments = true diff --git a/rustfmt.toml b/rustfmt.toml index edce9c8d..824c0113 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -2,7 +2,7 @@ unstable_features = true fn_single_line = false max_width = 130 reorder_impl_items = true -merge_imports = true +imports_granularity = "Crate" normalize_comments = true use_field_init_shorthand = true #wrap_comments = true From 8ff4142064afae76397ba11c9a7bafc10d2dc4d1 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 25 Feb 2023 17:04:15 +0100 Subject: [PATCH 05/14] Cleanup code, fix clippy lints --- crates/eww/src/app.rs | 2 +- crates/eww/src/error_handling_ctx.rs | 1 + crates/eww/src/script_var_handler.rs | 1 + crates/eww/src/server.rs | 2 +- crates/eww/src/util.rs | 1 - .../eww/src/widgets/circular_progressbar.rs | 6 +++ crates/eww/src/widgets/graph.rs | 6 +++ crates/eww/src/widgets/transform.rs | 6 +++ crates/eww/src/widgets/widget_definitions.rs | 4 +- crates/yuck/src/ast_error.rs | 9 +--- crates/yuck/src/config/attributes.rs | 17 ++---- .../yuck/src/config/backend_window_options.rs | 9 ++-- crates/yuck/src/config/file_provider.rs | 8 +-- crates/yuck/src/config/mod.rs | 4 +- .../yuck/src/config/script_var_definition.rs | 14 ++--- .../src/config/{config.rs => toplevel.rs} | 13 ++--- crates/yuck/src/config/validate.rs | 12 +---- crates/yuck/src/config/var_definition.rs | 12 ++--- crates/yuck/src/config/widget_definition.rs | 10 ++-- crates/yuck/src/config/widget_use.rs | 5 +- crates/yuck/src/config/window_definition.rs | 10 ++-- crates/yuck/src/config/window_geometry.rs | 18 ++----- crates/yuck/src/error.rs | 15 ++---- crates/yuck/src/format_diagnostic.rs | 19 +++---- crates/yuck/src/lib.rs | 2 - crates/yuck/src/parser/ast.rs | 13 ++--- crates/yuck/src/parser/ast_iterator.rs | 11 +--- crates/yuck/src/parser/from_ast.rs | 20 +++---- crates/yuck/src/parser/lexer.rs | 7 +-- crates/yuck/src/parser/mod.rs | 54 +++++++++---------- crates/yuck/src/parser/parse_error.rs | 2 +- crates/yuck/src/parser/parser.lalrpop | 1 - crates/yuck/src/value/mod.rs | 3 -- 33 files changed, 115 insertions(+), 202 deletions(-) rename crates/yuck/src/config/{config.rs => toplevel.rs} (91%) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 3b982a80..ac4e5131 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -149,7 +149,7 @@ impl App { if let Err(e) = config_result.and_then(|new_config| self.load_config(new_config)) { errors.push(e) } - match crate::config::scss::parse_scss_from_config(&self.paths.get_config_dir()) { + match crate::config::scss::parse_scss_from_config(self.paths.get_config_dir()) { Ok((file_id, css)) => { if let Err(e) = self.load_css(file_id, &css) { errors.push(anyhow!(e)); diff --git a/crates/eww/src/error_handling_ctx.rs b/crates/eww/src/error_handling_ctx.rs index 6900f88c..32732003 100644 --- a/crates/eww/src/error_handling_ctx.rs +++ b/crates/eww/src/error_handling_ctx.rs @@ -38,6 +38,7 @@ pub fn format_error(err: &anyhow::Error) -> String { } pub fn anyhow_err_to_diagnostic(err: &anyhow::Error) -> Option> { + #[allow(clippy::manual_map)] if let Some(err) = err.downcast_ref::() { Some(err.0.clone()) } else if let Some(err) = err.downcast_ref::() { diff --git a/crates/eww/src/script_var_handler.rs b/crates/eww/src/script_var_handler.rs index c289e372..0847b72b 100644 --- a/crates/eww/src/script_var_handler.rs +++ b/crates/eww/src/script_var_handler.rs @@ -100,6 +100,7 @@ impl ScriptVarHandlerHandle { /// Message enum used by the ScriptVarHandlerHandle to communicate to the ScriptVarHandler #[derive(Debug, Eq, PartialEq)] +#[allow(clippy::large_enum_variant)] enum ScriptVarHandlerMsg { AddVar(ScriptVarDefinition), Stop(VarName), diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 48adb0d8..2d32142e 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -83,7 +83,7 @@ pub fn initialize_server(paths: EwwPaths, action: Option, should_ gtk::StyleContext::add_provider_for_screen(&screen, &app.css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION); } - if let Ok((file_id, css)) = config::scss::parse_scss_from_config(&app.paths.get_config_dir()) { + if let Ok((file_id, css)) = config::scss::parse_scss_from_config(app.paths.get_config_dir()) { if let Err(e) = app.load_css(file_id, &css) { error_handling_ctx::print_error(e); } diff --git a/crates/eww/src/util.rs b/crates/eww/src/util.rs index 712a4110..fb5ae167 100644 --- a/crates/eww/src/util.rs +++ b/crates/eww/src/util.rs @@ -144,7 +144,6 @@ pub fn unindent(text: &str) -> String { #[cfg(test)] mod test { use super::{replace_env_var_references, unindent}; - use std; #[test] fn test_replace_env_var_references() { diff --git a/crates/eww/src/widgets/circular_progressbar.rs b/crates/eww/src/widgets/circular_progressbar.rs index b594333a..53974c72 100644 --- a/crates/eww/src/widgets/circular_progressbar.rs +++ b/crates/eww/src/widgets/circular_progressbar.rs @@ -104,6 +104,12 @@ impl ObjectSubclass for CircProgPriv { } } +impl Default for CircProg { + fn default() -> Self { + Self::new() + } +} + impl CircProg { pub fn new() -> Self { glib::Object::new::(&[]).expect("Failed to create CircularProgress Widget") diff --git a/crates/eww/src/widgets/graph.rs b/crates/eww/src/widgets/graph.rs index 5a8e2dd8..b3705ae4 100644 --- a/crates/eww/src/widgets/graph.rs +++ b/crates/eww/src/widgets/graph.rs @@ -175,6 +175,12 @@ impl ObjectSubclass for GraphPriv { } } +impl Default for Graph { + fn default() -> Self { + Self::new() + } +} + impl Graph { pub fn new() -> Self { glib::Object::new::(&[]).expect("Failed to create Graph Widget") diff --git a/crates/eww/src/widgets/transform.rs b/crates/eww/src/widgets/transform.rs index f3c8b172..328b7711 100644 --- a/crates/eww/src/widgets/transform.rs +++ b/crates/eww/src/widgets/transform.rs @@ -108,6 +108,12 @@ impl ObjectSubclass for TransformPriv { } } +impl Default for Transform { + fn default() -> Self { + Self::new() + } +} + impl Transform { pub fn new() -> Self { glib::Object::new::(&[]).expect("Failed to create Transform Widget") diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 6593b127..aa222fd2 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -905,7 +905,7 @@ fn build_gtk_calendar(bargs: &mut BuilderArgs) -> Result { def_widget!(bargs, _g, gtk_widget, { // @prop day - the selected day prop(day: as_f64) { - if day < 1f64 || day > 31f64 { + if !(1f64..=31f64).contains(&day) { log::warn!("Calendar day is not a number between 1 and 31"); } else { gtk_widget.set_day(day as i32) @@ -913,7 +913,7 @@ fn build_gtk_calendar(bargs: &mut BuilderArgs) -> Result { }, // @prop month - the selected month prop(month: as_f64) { - if month < 1f64 || month > 12f64 { + if !(1f64..=12f64).contains(&month) { log::warn!("Calendar month is not a number between 1 and 12"); } else { gtk_widget.set_month(month as i32 - 1) diff --git a/crates/yuck/src/ast_error.rs b/crates/yuck/src/ast_error.rs index e109bbd3..078660f3 100644 --- a/crates/yuck/src/ast_error.rs +++ b/crates/yuck/src/ast_error.rs @@ -1,11 +1,6 @@ use eww_shared_util::{AttrName, Span}; -use crate::{ - error::{DiagError, DiagResult}, - format_diagnostic::ToDiagnostic, - gen_diagnostic, - parser::ast::AstType, -}; +use crate::{format_diagnostic::ToDiagnostic, gen_diagnostic, parser::ast::AstType}; /// Error type representing errors that occur when trying to access parts of the AST specifically #[derive(Debug, thiserror::Error)] @@ -41,7 +36,7 @@ impl ToDiagnostic for AstError { note = format!("Expected: {expected}\n Got: {actual}"), }, AstError::DanglingKeyword(span, kw) => gen_diagnostic! { - msg = "{kw} is missing a value", + msg = format!("{kw} is missing a value"), label = span => "No value provided for this", }, AstError::EvalError(e) => e.to_diagnostic(), diff --git a/crates/yuck/src/config/attributes.rs b/crates/yuck/src/config/attributes.rs index 93dc92ba..9a10eb40 100644 --- a/crates/yuck/src/config/attributes.rs +++ b/crates/yuck/src/config/attributes.rs @@ -1,19 +1,12 @@ -use std::{ - collections::HashMap, - convert::{TryFrom, TryInto}, -}; +use std::collections::HashMap; -use simplexpr::{ - dynval::{DynVal, FromDynVal}, - eval::EvalError, - SimplExpr, -}; +use simplexpr::{dynval::FromDynVal, eval::EvalError, SimplExpr}; use crate::{ error::DiagError, parser::{ast::Ast, from_ast::FromAst}, }; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{AttrName, Span, Spanned}; #[derive(Debug, thiserror::Error)] pub enum AttrError { @@ -64,14 +57,14 @@ impl Attributes { pub fn ast_required(&mut self, key: &str) -> Result { let key = AttrName(key.to_string()); match self.attrs.remove(&key) { - Some(AttrEntry { key_span, value }) => T::from_ast(value), + Some(AttrEntry { value, .. }) => T::from_ast(value), None => Err(AttrError::MissingRequiredAttr(self.span, key.clone()).into()), } } pub fn ast_optional(&mut self, key: &str) -> Result, DiagError> { match self.attrs.remove(&AttrName(key.to_string())) { - Some(AttrEntry { key_span, value }) => T::from_ast(value).map(Some), + Some(AttrEntry { value, .. }) => T::from_ast(value).map(Some), None => Ok(None), } } diff --git a/crates/yuck/src/config/backend_window_options.rs b/crates/yuck/src/config/backend_window_options.rs index 37c3b66d..98b1709c 100644 --- a/crates/yuck/src/config/backend_window_options.rs +++ b/crates/yuck/src/config/backend_window_options.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use anyhow::{anyhow, Result}; +use anyhow::Result; use crate::{ enum_parse, @@ -16,10 +16,7 @@ pub use backend::*; #[cfg(feature = "x11")] mod backend { - use crate::{ - error::{DiagError, DiagResultExt}, - format_diagnostic::ToDiagnostic, - }; + use crate::error::{DiagError, DiagResultExt}; use super::*; @@ -103,7 +100,7 @@ mod backend { impl FromAstElementContent for StrutDefinition { const ELEMENT_NAME: &'static str = "struts"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let mut attrs = iter.expect_key_values()?; iter.expect_done().map_err(DiagError::from).note("Check if you are missing a colon in front of a key")?; Ok(StrutDefinition { side: attrs.primitive_required("side")?, dist: attrs.primitive_required("distance")? }) diff --git a/crates/yuck/src/config/file_provider.rs b/crates/yuck/src/config/file_provider.rs index c62e9858..f739159d 100644 --- a/crates/yuck/src/config/file_provider.rs +++ b/crates/yuck/src/config/file_provider.rs @@ -1,12 +1,6 @@ -use std::{collections::HashMap, path::PathBuf}; - -use codespan_reporting::files::{Files, SimpleFile, SimpleFiles}; use eww_shared_util::Span; -use crate::{ - error::{DiagError, DiagResult}, - parser::ast::Ast, -}; +use crate::{error::DiagError, parser::ast::Ast}; #[derive(thiserror::Error, Debug)] pub enum FilesError { diff --git a/crates/yuck/src/config/mod.rs b/crates/yuck/src/config/mod.rs index 5f5070b5..61fbef91 100644 --- a/crates/yuck/src/config/mod.rs +++ b/crates/yuck/src/config/mod.rs @@ -1,9 +1,9 @@ pub mod attributes; pub mod backend_window_options; -pub mod config; pub mod file_provider; pub mod monitor; pub mod script_var_definition; +pub mod toplevel; pub mod validate; pub mod var_definition; pub mod widget_definition; @@ -11,4 +11,4 @@ pub mod widget_use; pub mod window_definition; pub mod window_geometry; -pub use config::*; +pub use toplevel::*; diff --git a/crates/yuck/src/config/script_var_definition.rs b/crates/yuck/src/config/script_var_definition.rs index 4fa1c682..1c77dda8 100644 --- a/crates/yuck/src/config/script_var_definition.rs +++ b/crates/yuck/src/config/script_var_definition.rs @@ -1,17 +1,11 @@ -use std::collections::HashMap; - use simplexpr::{dynval::DynVal, SimplExpr}; use crate::{ error::{DiagError, DiagResult, DiagResultExt}, format_diagnostic::ToDiagnostic, - parser::{ - ast::Ast, - ast_iterator::AstIterator, - from_ast::{FromAst, FromAstElementContent}, - }, + parser::{ast::Ast, ast_iterator::AstIterator, from_ast::FromAstElementContent}, }; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{Span, VarName}; #[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)] pub enum ScriptVarDefinition { @@ -66,7 +60,7 @@ pub struct PollScriptVar { impl FromAstElementContent for PollScriptVar { const ELEMENT_NAME: &'static str = "defpoll"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let result: DiagResult<_> = try { let (name_span, name) = iter.expect_symbol()?; let mut attrs = iter.expect_key_values()?; @@ -103,7 +97,7 @@ pub struct ListenScriptVar { impl FromAstElementContent for ListenScriptVar { const ELEMENT_NAME: &'static str = "deflisten"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let result: DiagResult<_> = try { let (name_span, name) = iter.expect_symbol()?; let mut attrs = iter.expect_key_values()?; diff --git a/crates/yuck/src/config/config.rs b/crates/yuck/src/config/toplevel.rs similarity index 91% rename from crates/yuck/src/config/config.rs rename to crates/yuck/src/config/toplevel.rs index da27c60f..a1caeda2 100644 --- a/crates/yuck/src/config/config.rs +++ b/crates/yuck/src/config/toplevel.rs @@ -3,23 +3,18 @@ use std::{ path::{Path, PathBuf}, }; -use codespan_reporting::files::SimpleFiles; use itertools::Itertools; -use simplexpr::SimplExpr; use super::{ file_provider::{FilesError, YuckFileProvider}, script_var_definition::ScriptVarDefinition, - validate::ValidationError, var_definition::VarDefinition, widget_definition::WidgetDefinition, - widget_use::WidgetUse, window_definition::WindowDefinition, }; use crate::{ config::script_var_definition::{ListenScriptVar, PollScriptVar}, error::{DiagError, DiagResult}, - format_diagnostic::ToDiagnostic, gen_diagnostic, parser::{ ast::Ast, @@ -27,7 +22,7 @@ use crate::{ from_ast::{FromAst, FromAstElementContent}, }, }; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{Span, Spanned, VarName}; static TOP_LEVEL_DEFINITION_NAMES: &[&str] = &[ WidgetDefinition::ELEMENT_NAME, @@ -47,7 +42,7 @@ pub struct Include { impl FromAstElementContent for Include { const ELEMENT_NAME: &'static str = "include"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let (path_span, path) = iter.expect_literal()?; iter.expect_done()?; Ok(Include { path: path.to_string(), path_span }) @@ -127,7 +122,7 @@ impl Config { self.window_definitions.insert(x.name.clone(), x); } TopLevel::Include(include) => { - let (file_id, toplevels) = files.load_yuck_file(PathBuf::from(&include.path)).map_err(|err| match err { + let (_, toplevels) = files.load_yuck_file(PathBuf::from(&include.path)).map_err(|err| match err { FilesError::IoError(_) => DiagError(gen_diagnostic! { msg = format!("Included file `{}` not found", include.path), label = include.path_span => "Included here", @@ -156,7 +151,7 @@ impl Config { } pub fn generate_from_main_file(files: &mut impl YuckFileProvider, path: impl AsRef) -> DiagResult { - let (span, top_levels) = files.load_yuck_file(path.as_ref().to_path_buf()).map_err(|err| match err { + let (_span, top_levels) = files.load_yuck_file(path.as_ref().to_path_buf()).map_err(|err| match err { FilesError::IoError(err) => DiagError(gen_diagnostic!(err)), FilesError::DiagError(x) => x, })?; diff --git a/crates/yuck/src/config/validate.rs b/crates/yuck/src/config/validate.rs index 4876331d..5f9b035a 100644 --- a/crates/yuck/src/config/validate.rs +++ b/crates/yuck/src/config/validate.rs @@ -2,16 +2,7 @@ use std::collections::{HashMap, HashSet}; use simplexpr::SimplExpr; -use crate::{ - error::DiagResult, - parser::{ast::Ast, ast_iterator::AstIterator, from_ast::FromAst}, -}; - -use super::{ - widget_definition::WidgetDefinition, - widget_use::{BasicWidgetUse, WidgetUse}, - Config, -}; +use super::{widget_definition::WidgetDefinition, widget_use::WidgetUse, Config}; use eww_shared_util::{AttrName, Span, Spanned, VarName}; #[derive(Debug, thiserror::Error)] @@ -93,7 +84,6 @@ pub fn validate_variables_in_widget_use( } let values = widget.attrs.attrs.values(); let unknown_var = values.filter_map(|value| value.value.as_simplexpr().ok()).find_map(|expr: SimplExpr| { - let span = expr.span(); expr.var_refs_with_span() .iter() .cloned() diff --git a/crates/yuck/src/config/var_definition.rs b/crates/yuck/src/config/var_definition.rs index 232c807e..be4ab8d2 100644 --- a/crates/yuck/src/config/var_definition.rs +++ b/crates/yuck/src/config/var_definition.rs @@ -1,16 +1,10 @@ -use std::collections::HashMap; - -use simplexpr::{dynval::DynVal, SimplExpr}; +use simplexpr::dynval::DynVal; use crate::{ error::{DiagResult, DiagResultExt}, - parser::{ - ast::Ast, - ast_iterator::AstIterator, - from_ast::{FromAst, FromAstElementContent}, - }, + parser::{ast::Ast, ast_iterator::AstIterator, from_ast::FromAstElementContent}, }; -use eww_shared_util::{AttrName, Span, VarName}; +use eww_shared_util::{Span, VarName}; #[derive(Debug, PartialEq, Eq, Clone, serde::Serialize)] pub struct VarDefinition { diff --git a/crates/yuck/src/config/widget_definition.rs b/crates/yuck/src/config/widget_definition.rs index cb8f07a1..8a17233a 100644 --- a/crates/yuck/src/config/widget_definition.rs +++ b/crates/yuck/src/config/widget_definition.rs @@ -1,10 +1,6 @@ -use std::collections::HashMap; - -use simplexpr::SimplExpr; - use crate::{ error::{DiagError, DiagResult, DiagResultExt}, - format_diagnostic::{DiagnosticExt, ToDiagnostic}, + format_diagnostic::ToDiagnostic, gen_diagnostic, parser::{ ast::Ast, @@ -12,7 +8,7 @@ use crate::{ from_ast::{FromAst, FromAstElementContent}, }, }; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{AttrName, Span, Spanned}; use super::widget_use::WidgetUse; @@ -50,7 +46,7 @@ impl FromAstElementContent for WidgetDefinition { .expect_array() .map_err(|e| { DiagError(match e { - crate::ast_error::AstError::WrongExprType(span, expected, actual) => gen_diagnostic! { + crate::ast_error::AstError::WrongExprType(..) => gen_diagnostic! { msg = "Widget definition missing argument list", label = name_span.point_span_at_end() => "Insert the argument list (e.g.: `[]`) here", note = "This list needs to declare all the non-global variables / attributes used in this widget." diff --git a/crates/yuck/src/config/widget_use.rs b/crates/yuck/src/config/widget_use.rs index 4c7ff3d2..18b6d90e 100644 --- a/crates/yuck/src/config/widget_use.rs +++ b/crates/yuck/src/config/widget_use.rs @@ -1,11 +1,8 @@ -use std::collections::HashMap; - use simplexpr::SimplExpr; use crate::{ config::attributes::AttrEntry, error::{DiagError, DiagResult, DiagResultExt}, - format_diagnostic::{DiagnosticExt, ToDiagnostic}, gen_diagnostic, parser::{ ast::Ast, @@ -73,7 +70,7 @@ impl FromAstElementContent for LoopWidgetUse { const ELEMENT_NAME: &'static str = "for"; fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { - let (element_name_span, element_name) = iter.expect_symbol()?; + let (_element_name_span, element_name) = iter.expect_symbol()?; let (in_string_span, in_string) = iter.expect_symbol()?; if in_string != "in" { return Err(DiagError(gen_diagnostic! { diff --git a/crates/yuck/src/config/window_definition.rs b/crates/yuck/src/config/window_definition.rs index 1633b063..afe3fd52 100644 --- a/crates/yuck/src/config/window_definition.rs +++ b/crates/yuck/src/config/window_definition.rs @@ -1,19 +1,15 @@ -use std::{collections::HashMap, fmt::Display, str::FromStr}; - -use simplexpr::{dynval::DynVal, SimplExpr}; +use std::fmt::Display; use crate::{ config::monitor::MonitorIdentifier, error::{DiagError, DiagResult}, - format_diagnostic::ToDiagnostic, parser::{ ast::Ast, ast_iterator::AstIterator, from_ast::{FromAst, FromAstElementContent}, }, - value::NumWithUnit, }; -use eww_shared_util::{AttrName, Span, VarName}; +use eww_shared_util::Span; use super::{backend_window_options::BackendWindowOptions, widget_use::WidgetUse, window_geometry::WindowGeometry}; @@ -31,7 +27,7 @@ pub struct WindowDefinition { impl FromAstElementContent for WindowDefinition { const ELEMENT_NAME: &'static str = "defwindow"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let (_, name) = iter.expect_symbol()?; let mut attrs = iter.expect_key_values()?; let monitor = attrs.primitive_optional("monitor")?; diff --git a/crates/yuck/src/config/window_geometry.rs b/crates/yuck/src/config/window_geometry.rs index f86931ca..a96c256a 100644 --- a/crates/yuck/src/config/window_geometry.rs +++ b/crates/yuck/src/config/window_geometry.rs @@ -1,21 +1,13 @@ -use std::collections::HashMap; - -use simplexpr::{dynval::DynVal, SimplExpr}; - use crate::{ enum_parse, - error::{DiagError, DiagResult}, + error::DiagResult, format_diagnostic::ToDiagnostic, - parser::{ - ast::Ast, - ast_iterator::AstIterator, - from_ast::{FromAst, FromAstElementContent}, - }, + parser::{ast::Ast, ast_iterator::AstIterator, from_ast::FromAstElementContent}, value::Coords, }; -use super::{widget_use::WidgetUse, window_definition::EnumParseError}; -use eww_shared_util::{AttrName, Span, VarName}; +use super::window_definition::EnumParseError; +use eww_shared_util::Span; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, Eq, PartialEq, smart_default::SmartDefault, Serialize, Deserialize, strum::Display)] @@ -120,7 +112,7 @@ pub struct WindowGeometry { impl FromAstElementContent for WindowGeometry { const ELEMENT_NAME: &'static str = "geometry"; - fn from_tail>(span: Span, mut iter: AstIterator) -> DiagResult { + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { let mut attrs = iter.expect_key_values()?; iter.expect_done() .map_err(|e| e.to_diagnostic().with_notes(vec!["Check if you are missing a colon in front of a key".to_string()]))?; diff --git a/crates/yuck/src/error.rs b/crates/yuck/src/error.rs index 8dc8a121..9660503f 100644 --- a/crates/yuck/src/error.rs +++ b/crates/yuck/src/error.rs @@ -1,14 +1,9 @@ use crate::{ - config::{attributes::AttrError, config::Include, validate::ValidationError}, format_diagnostic::{lalrpop_error_to_diagnostic, DiagnosticExt, ToDiagnostic}, - gen_diagnostic, - parser::{ - ast::{Ast, AstType}, - lexer, parse_error, - }, + parser::{lexer, parse_error}, }; -use codespan_reporting::{diagnostic, files}; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use codespan_reporting::diagnostic; +use eww_shared_util::{Span, Spanned}; use simplexpr::dynval; use thiserror::Error; @@ -45,8 +40,8 @@ pub fn get_parse_error_span(file_id: usize, err: &lalrpop_util::P use lalrpop_util::ParseError::*; match err { InvalidToken { location } => Span(*location, *location, file_id), - UnrecognizedEOF { location, expected } => Span(*location, *location, file_id), - UnrecognizedToken { token, expected } => Span(token.0, token.2, file_id), + UnrecognizedEOF { location, .. } => Span(*location, *location, file_id), + UnrecognizedToken { token, .. } => Span(token.0, token.2, file_id), ExtraToken { token } => Span(token.0, token.2, file_id), User { error } => error.span(), } diff --git a/crates/yuck/src/format_diagnostic.rs b/crates/yuck/src/format_diagnostic.rs index 25cad797..1fdbc680 100644 --- a/crates/yuck/src/format_diagnostic.rs +++ b/crates/yuck/src/format_diagnostic.rs @@ -1,16 +1,13 @@ -use codespan_reporting::{diagnostic, files}; +use codespan_reporting::diagnostic; use itertools::Itertools; use simplexpr::dynval; use diagnostic::*; -use crate::{ - config::{attributes::AttrError, config, validate::ValidationError}, - error::{get_parse_error_span, DiagError}, -}; +use crate::config::{attributes::AttrError, validate::ValidationError}; use super::parser::parse_error; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{Span, Spanned}; pub fn span_to_primary_label(span: Span) -> Label { Label::primary(span.2, span.0..span.1) @@ -103,7 +100,7 @@ impl ToDiagnostic for AttrError { AttrError::MissingRequiredAttr(span, attr_name) => { gen_diagnostic!(format!("Missing attribute `{}`", attr_name), span) } - AttrError::EvaluationError(span, source) => source.to_diagnostic(), + AttrError::EvaluationError(_span, source) => source.to_diagnostic(), AttrError::Other(span, source) => gen_diagnostic!(source, span), } } @@ -145,7 +142,7 @@ impl ToDiagnostic for ValidationError { diag.with_notes(extra_notes) } - ValidationError::AccidentalBuiltinOverride(span, widget_name) => gen_diagnostic! { + ValidationError::AccidentalBuiltinOverride(span, _widget_name) => gen_diagnostic! { msg = self, label = span => "Defined here", note = "Hint: Give your widget a different name. You could call it \"John\" for example. That's a cool name." @@ -166,11 +163,11 @@ pub fn lalrpop_error_to_diagnostic gen_diagnostic!("Invalid token", Span::point(*location, file_id)), - UnrecognizedEOF { location, expected } => gen_diagnostic! { + UnrecognizedEOF { location, expected: _ } => gen_diagnostic! { msg = "Input ended unexpectedly. Check if you have any unclosed delimiters", label = Span::point(*location, file_id), }, - UnrecognizedToken { token, expected } => gen_diagnostic! { + UnrecognizedToken { token, expected: _ } => gen_diagnostic! { msg = format!("Unexpected token `{}` encountered", token.1), label = Span(token.0, token.2, file_id) => "Token unexpected", }, @@ -189,7 +186,7 @@ impl ToDiagnostic for simplexpr::eval::EvalError { fn to_diagnostic(&self) -> Diagnostic { use simplexpr::eval::EvalError; match self { - EvalError::NoVariablesAllowed(name) => gen_diagnostic!(self), + EvalError::NoVariablesAllowed(_name) => gen_diagnostic!(self), EvalError::UnknownVariable(name, similar) => { let mut notes = Vec::new(); if similar.len() == 1 { diff --git a/crates/yuck/src/lib.rs b/crates/yuck/src/lib.rs index 0c6bf826..1fda2371 100644 --- a/crates/yuck/src/lib.rs +++ b/crates/yuck/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(unused_imports)] -#![allow(unused)] #![allow(clippy::comparison_chain)] #![feature(try_blocks, box_patterns)] diff --git a/crates/yuck/src/parser/ast.rs b/crates/yuck/src/parser/ast.rs index 468f949e..d80d208f 100644 --- a/crates/yuck/src/parser/ast.rs +++ b/crates/yuck/src/parser/ast.rs @@ -1,16 +1,11 @@ use itertools::Itertools; -use simplexpr::{ast::SimplExpr, dynval::DynVal}; -use std::collections::HashMap; +use simplexpr::ast::SimplExpr; use eww_shared_util::{Span, Spanned, VarName}; use std::fmt::Display; -use super::{ast_iterator::AstIterator, from_ast::FromAst}; -use crate::{ - ast_error::AstError, - config::attributes::{AttrEntry, Attributes}, - error::{DiagError, DiagResult}, -}; +use super::ast_iterator::AstIterator; +use crate::ast_error::AstError; #[derive(Debug, PartialEq, Eq, Copy, Clone)] pub enum AstType { @@ -92,7 +87,7 @@ impl Ast { // TODO do I do this? // Ast::Array(span, elements) => todo!() Ast::Symbol(span, x) => Ok(SimplExpr::VarRef(*span, VarName(x.clone()))), - Ast::SimplExpr(span, x) => Ok(x.clone()), + Ast::SimplExpr(_span, x) => Ok(x.clone()), _ => Err(AstError::WrongExprType(self.span(), AstType::IntoPrimitive, self.expr_type())), } } diff --git a/crates/yuck/src/parser/ast_iterator.rs b/crates/yuck/src/parser/ast_iterator.rs index b3b8afa1..603fdcae 100644 --- a/crates/yuck/src/parser/ast_iterator.rs +++ b/crates/yuck/src/parser/ast_iterator.rs @@ -1,19 +1,10 @@ -use itertools::Itertools; use simplexpr::{ast::SimplExpr, dynval::DynVal}; use std::collections::HashMap; -use std::fmt::Display; - -use super::{ - ast::{Ast, AstType}, - from_ast::FromAst, -}; +use super::ast::{Ast, AstType}; use crate::{ ast_error::AstError, config::attributes::{AttrEntry, Attributes}, - error::{DiagError, DiagResult}, - format_diagnostic::ToDiagnostic, - gen_diagnostic, }; use eww_shared_util::{AttrName, Span, Spanned, VarName}; diff --git a/crates/yuck/src/parser/from_ast.rs b/crates/yuck/src/parser/from_ast.rs index d61c5a9e..e65d1006 100644 --- a/crates/yuck/src/parser/from_ast.rs +++ b/crates/yuck/src/parser/from_ast.rs @@ -1,16 +1,8 @@ -use super::{ - ast::{Ast, AstType}, - ast_iterator::AstIterator, -}; -use crate::{error::*, format_diagnostic::ToDiagnostic, gen_diagnostic, parser}; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; -use itertools::Itertools; -use simplexpr::{ast::SimplExpr, dynval::DynVal}; -use std::{ - collections::{HashMap, LinkedList}, - iter::FromIterator, - str::FromStr, -}; +use super::{ast::Ast, ast_iterator::AstIterator}; +use crate::{error::*, format_diagnostic::ToDiagnostic, gen_diagnostic}; +use eww_shared_util::{Span, Spanned}; + +use simplexpr::ast::SimplExpr; pub trait FromAst: Sized { fn from_ast(e: Ast) -> DiagResult; @@ -55,7 +47,7 @@ impl FromAst for SimplExpr { fn from_ast(e: Ast) -> DiagResult { match e { Ast::Symbol(span, x) => Ok(SimplExpr::var_ref(span, x)), - Ast::SimplExpr(span, x) => Ok(x), + Ast::SimplExpr(_span, x) => Ok(x), _ => Err(DiagError(gen_diagnostic! { msg = format!("Expected value, but got `{}`", e.expr_type()), label = e.span() => "Expected some value here", diff --git a/crates/yuck/src/parser/lexer.rs b/crates/yuck/src/parser/lexer.rs index ec9bfa0e..eb3bf72c 100644 --- a/crates/yuck/src/parser/lexer.rs +++ b/crates/yuck/src/parser/lexer.rs @@ -1,9 +1,8 @@ use once_cell::sync::Lazy; use regex::{Regex, RegexSet}; -use simplexpr::parser::lexer::{STR_INTERPOLATION_END, STR_INTERPOLATION_START}; use super::parse_error; -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{Span, Spanned}; #[derive(Debug, PartialEq, Eq, Clone)] pub enum Token { @@ -54,8 +53,6 @@ macro_rules! regex_rules { } } -static ESCAPE_REPLACE_REGEX: Lazy = Lazy::new(|| Regex::new(r"\\(.)").unwrap()); - regex_rules! { r"\(" => |_| Token::LPren, r"\)" => |_| Token::RPren, @@ -100,7 +97,7 @@ impl Lexer { self.pos += 1; let mut simplexpr_lexer = simplexpr_lexer::Lexer::new(self.file_id, self.pos, &self.source[self.pos..]); let mut toks: Vec<(usize, _, usize)> = Vec::new(); - let mut end = self.pos; + let mut end; let mut curly_nesting = 0; loop { match simplexpr_lexer.next_token()? { diff --git a/crates/yuck/src/parser/mod.rs b/crates/yuck/src/parser/mod.rs index edb44c4a..faebf106 100644 --- a/crates/yuck/src/parser/mod.rs +++ b/crates/yuck/src/parser/mod.rs @@ -6,10 +6,6 @@ use crate::gen_diagnostic; use super::error::{DiagError, DiagResult}; use ast::Ast; -use std::{fmt::Display, ops::Deref}; - -use itertools::Itertools; - pub mod ast; pub mod ast_iterator; pub mod from_ast; @@ -43,7 +39,7 @@ pub fn require_single_toplevel(span: Span, mut asts: Vec) -> DiagResult Err(DiagError(gen_diagnostic! { + _n => Err(DiagError(gen_diagnostic! { msg = "Expected exactly one element, but but got {n}", label = asts.get(1).unwrap().span().to(asts.last().unwrap().span()) => "these elements must not be here", note = "Consider wrapping the elements in some container element", @@ -51,7 +47,10 @@ pub fn require_single_toplevel(span: Span, mut asts: Vec) -> DiagResult {{ let p = parser::AstParser::new(); use lexer::Lexer; @@ -64,26 +63,27 @@ macro_rules! test_parser { }} } -#[test] -fn test() { - test_parser!( - "1", - "(12)", - "1.2", - "-1.2", - "(1 2)", - "(1 :foo 1)", - "(:foo 1)", - "(:foo->: 1)", - "(foo 1)", - "(lol😄 1)", - r#"(test "hi")"#, - r#"(test "h\"i")"#, - r#"(test " hi ")"#, - "(+ (1 2 (* 2 5)))", - r#"foo ; test"#, - r#"(f arg ; test + #[test] + fn test() { + test_parser!( + "1", + "(12)", + "1.2", + "-1.2", + "(1 2)", + "(1 :foo 1)", + "(:foo 1)", + "(:foo->: 1)", + "(foo 1)", + "(lol😄 1)", + r#"(test "hi")"#, + r#"(test "h\"i")"#, + r#"(test " hi ")"#, + "(+ (1 2 (* 2 5)))", + r#"foo ; test"#, + r#"(f arg ; test arg2)"#, - "\"h\\\"i\"" - ); + "\"h\\\"i\"" + ); + } } diff --git a/crates/yuck/src/parser/parse_error.rs b/crates/yuck/src/parser/parse_error.rs index 022bd594..b8fa94b9 100644 --- a/crates/yuck/src/parser/parse_error.rs +++ b/crates/yuck/src/parser/parse_error.rs @@ -1,4 +1,4 @@ -use eww_shared_util::{AttrName, Span, Spanned, VarName}; +use eww_shared_util::{Span, Spanned}; #[derive(Debug, thiserror::Error)] pub enum ParseError { diff --git a/crates/yuck/src/parser/parser.lalrpop b/crates/yuck/src/parser/parser.lalrpop index 25d3aa4d..22c47605 100644 --- a/crates/yuck/src/parser/parser.lalrpop +++ b/crates/yuck/src/parser/parser.lalrpop @@ -1,4 +1,3 @@ -use std::str::FromStr; use crate::parser::{lexer::Token, ast::Ast, parse_error}; use eww_shared_util::Span; use simplexpr::ast::SimplExpr; diff --git a/crates/yuck/src/value/mod.rs b/crates/yuck/src/value/mod.rs index cc26f2d1..7b890d17 100644 --- a/crates/yuck/src/value/mod.rs +++ b/crates/yuck/src/value/mod.rs @@ -1,5 +1,2 @@ -use derive_more::*; -use serde::{Deserialize, Serialize}; - pub mod coords; pub use coords::*; From 45154bbf5962cad9c4e6c76f75d57dd8d740d307 Mon Sep 17 00:00:00 2001 From: Azad <49314270+Akmadan23@users.noreply.github.com> Date: Wed, 8 Mar 2023 20:25:50 +0100 Subject: [PATCH 06/14] Add regex match operator (`=~`) to documentation (#702) --- docs/src/expression_language.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 3cb4b525..65c7bc80 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -23,6 +23,7 @@ Supported currently are the following features: - simple mathematical operations (`+`, `-`, `*`, `/`, `%`) - comparisons (`==`, `!=`, `>`, `<`, `<=`, `>=`) - boolean operations (`||`, `&&`, `!`) +- regex match operator (`=~`) - elvis operator (`?:`) - if the left side is `""` or a JSON `null`, then returns the right side, otherwise evaluates to the left side. From fba770255dd72db8301b5f51ef50ab59e7746515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Mon, 20 Mar 2023 07:40:36 -0400 Subject: [PATCH 07/14] remove box_syntax (#711) Rust removed support for box_syntax in a recent nightly release :'( --- crates/eww/src/main.rs | 1 - crates/simplexpr/src/eval.rs | 8 ++++---- crates/simplexpr/src/lib.rs | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs index 8e51a626..14bc8190 100644 --- a/crates/eww/src/main.rs +++ b/crates/eww/src/main.rs @@ -1,6 +1,5 @@ #![feature(trace_macros)] #![feature(drain_filter)] -#![feature(box_syntax)] #![feature(box_patterns)] #![feature(slice_concat_trait)] #![feature(try_blocks)] diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index d0b48115..76f811da 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -93,14 +93,14 @@ impl SimplExpr { pub fn try_map_var_refs Result + Copy>(self, f: F) -> Result { use SimplExpr::*; Ok(match self { - BinOp(span, box a, op, box b) => BinOp(span, box a.try_map_var_refs(f)?, op, box b.try_map_var_refs(f)?), + BinOp(span, box a, op, box b) => BinOp(span, Box::new(a.try_map_var_refs(f)?), op, Box::new(b.try_map_var_refs(f)?)), Concat(span, elems) => Concat(span, elems.into_iter().map(|x| x.try_map_var_refs(f)).collect::>()?), - UnaryOp(span, op, box a) => UnaryOp(span, op, box a.try_map_var_refs(f)?), + UnaryOp(span, op, box a) => UnaryOp(span, op, Box::new(a.try_map_var_refs(f)?)), IfElse(span, box a, box b, box c) => { - IfElse(span, box a.try_map_var_refs(f)?, box b.try_map_var_refs(f)?, box c.try_map_var_refs(f)?) + IfElse(span, Box::new(a.try_map_var_refs(f)?), Box::new(b.try_map_var_refs(f)?), Box::new(c.try_map_var_refs(f)?)) } JsonAccess(span, safe, box a, box b) => { - JsonAccess(span, safe, box a.try_map_var_refs(f)?, box b.try_map_var_refs(f)?) + JsonAccess(span, safe, Box::new(a.try_map_var_refs(f)?), Box::new(b.try_map_var_refs(f)?)) } FunctionCall(span, name, args) => { FunctionCall(span, name, args.into_iter().map(|x| x.try_map_var_refs(f)).collect::>()?) diff --git a/crates/simplexpr/src/lib.rs b/crates/simplexpr/src/lib.rs index 205b2989..8a402877 100644 --- a/crates/simplexpr/src/lib.rs +++ b/crates/simplexpr/src/lib.rs @@ -1,6 +1,5 @@ #![feature(box_patterns)] #![feature(pattern)] -#![feature(box_syntax)] #![feature(try_blocks)] #![feature(unwrap_infallible)] #![feature(never_type)] From c72b881c3f8f2d2ad8d7a6c337ab3f55ff73ef4b Mon Sep 17 00:00:00 2001 From: n3oney Date: Tue, 7 Mar 2023 23:38:08 +0100 Subject: [PATCH 08/14] feat: add justify property --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 628c693b..24ef0385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Made `and`, `or` and `?:` lazily evaluated in simplexpr (By: ModProg) - Add Vanilla CSS support (By: Ezequiel Ramis) - Add `jq` function, offering jq-style json processing +- Add `justify` property to the label widget, allowing text justification (By: n3oney) ## [0.4.0] (04.09.2022) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index aa222fd2..91662ffe 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -841,7 +841,11 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { // @prop xalign - the alignment of the label text on the x axis (between 0 - 1, 0 -> left, 0.5 -> center, 1 -> right) prop(xalign: as_f64 = 0.5) { gtk_widget.set_xalign(xalign as f32) }, // @prop yalign - the alignment of the label text on the y axis (between 0 - 1, 0 -> bottom, 0.5 -> center, 1 -> top) - prop(yalign: as_f64 = 0.5) { gtk_widget.set_yalign(yalign as f32) } + prop(yalign: as_f64 = 0.5) { gtk_widget.set_yalign(yalign as f32) }, + // @prop justify - the justification of the label text (left, right, center, fill) + prop(justify: as_string = "left") { + gtk_widget.set_justify(parse_justification(&justify)?); + }, }); Ok(gtk_widget) } @@ -1061,6 +1065,16 @@ fn parse_align(o: &str) -> Result { } } +/// @var justification - "left", "right", "center", "fill" +fn parse_justification(j: &str) -> Result { + enum_parse! { "justification", j, + "left" => gtk::Justification::Left, + "right" => gtk::Justification::Right, + "center" => gtk::Justification::Center, + "fill" => gtk::Justification::Fill, + } +} + /// Connect a function to the first map event of a widget. After that first map, the handler will get disconnected. fn connect_first_map, F: Fn(&W) + 'static>(widget: &W, func: F) { let signal_handler_id = std::rc::Rc::new(std::cell::RefCell::new(None)); From de232de41b428b2caf1f41e021e67c0b86e65908 Mon Sep 17 00:00:00 2001 From: kawaki-san <70331483+kawaki-san@users.noreply.github.com> Date: Sun, 26 Mar 2023 10:25:24 +0200 Subject: [PATCH 09/14] feat: `truncate-left` for labels (#721) feat: `truncate-left` for labels Adds a flag that allows truncation to the left of text --------- Co-authored-by: kawaki-san Co-authored-by: elkowar <5300871+elkowar@users.noreply.github.com> --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 28 +++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ef0385..1e38bdc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to eww will be listed here, starting at changes since versio ## [Unreleased] ### Features +- Add `truncate-left` property on `label` widgets (By: kawaki-san) - Add support for safe access (`?.`) in simplexpr (By: oldwomanjosiah) - Allow floating-point numbers in percentages for window-geometry - Add support for safe access with index (`?.[n]`) (By: ModProg) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 91662ffe..ecc8f13e 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -819,14 +819,28 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { def_widget!(bargs, _g, gtk_widget, { // @prop text - the text to display // @prop limit-width - maximum count of characters to display + // @prop truncate_left - whether to truncate on the left side // @prop show_truncated - show whether the text was truncated - prop(text: as_string, limit_width: as_i32 = i32::MAX, show_truncated: as_bool = true) { - let truncated = text.chars().count() > limit_width as usize; - let mut text = text.chars().take(limit_width as usize).collect::(); - - if show_truncated && truncated { - text.push_str("..."); - } + prop(text: as_string, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true) { + let limit_width = limit_width as usize; + let char_count = text.chars().count(); + let text = if char_count > limit_width { + let mut truncated: String = if truncate_left { + text.chars().skip(char_count - limit_width).collect() + } else { + text.chars().take(limit_width).collect() + }; + if show_truncated { + if truncate_left { + truncated.insert_str(0, "..."); + } else { + truncated.push_str("..."); + } + } + truncated + } else { + text + }; let text = unescape::unescape(&text).context(format!("Failed to unescape label text {}", &text))?; let text = unindent(&text); From 642983a066931225aef43d4fba77c6d99e8d580d Mon Sep 17 00:00:00 2001 From: ElKowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:09:03 +0200 Subject: [PATCH 10/14] Default to building with both x11 and wayland (#722) * Default to building with both x11 and wayland * Update CI to include tests and building for wayland and x11 --- .github/workflows/build.yml | 12 +- CHANGELOG.md | 1 + Cargo.lock | 348 +++++++++--------- crates/eww/Cargo.toml | 37 +- crates/eww/src/app.rs | 18 +- crates/eww/src/display_backend.rs | 197 +++++----- crates/eww/src/main.rs | 178 +++++---- crates/eww/src/opts.rs | 9 +- crates/eww/src/server.rs | 12 +- crates/yuck/Cargo.toml | 5 - .../yuck/src/config/backend_window_options.rs | 193 +++++----- .../yuck__parser__test__test-10.snap | 8 + .../yuck__parser__test__test-11.snap | 8 + .../yuck__parser__test__test-12.snap | 8 + .../yuck__parser__test__test-13.snap | 8 + .../yuck__parser__test__test-14.snap | 8 + .../yuck__parser__test__test-15.snap | 8 + .../yuck__parser__test__test-16.snap | 8 + .../yuck__parser__test__test-17.snap | 8 + .../snapshots/yuck__parser__test__test-2.snap | 8 + .../snapshots/yuck__parser__test__test-3.snap | 8 + .../snapshots/yuck__parser__test__test-4.snap | 8 + .../snapshots/yuck__parser__test__test-5.snap | 8 + .../snapshots/yuck__parser__test__test-6.snap | 8 + .../snapshots/yuck__parser__test__test-7.snap | 8 + .../snapshots/yuck__parser__test__test-8.snap | 8 + .../snapshots/yuck__parser__test__test-9.snap | 8 + .../snapshots/yuck__parser__test__test.snap | 8 + 28 files changed, 658 insertions(+), 488 deletions(-) create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-10.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-11.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-12.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-13.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-14.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-15.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-16.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-17.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-2.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-3.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-4.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-5.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-6.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-7.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-8.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test-9.snap create mode 100644 crates/yuck/src/parser/snapshots/yuck__parser__test__test.snap diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a23fb280..92fcae45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,10 +23,16 @@ jobs: components: rustfmt - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 - - name: Build x11 + - uses: r7kamura/rust-problem-matchers@v1 + - name: Check formatting + run: cargo fmt -- --check + - name: Check with default features + run: cargo check + - name: Run tests + run: cargo test + - name: Build x11 only run: cargo check --no-default-features --features=x11 - - name: Build wayland + - name: Build wayland only run: cargo check --no-default-features --features=wayland - name: Build no-backend run: cargo check --no-default-features - diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e38bdc1..75f16733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to eww will be listed here, starting at changes since versio ## [Unreleased] ### Features +- Default to building with x11 and wayland support simultaneously - Add `truncate-left` property on `label` widgets (By: kawaki-san) - Add support for safe access (`?.`) in simplexpr (By: oldwomanjosiah) - Allow floating-point numbers in percentages for window-geometry diff --git a/Cargo.lock b/Cargo.lock index 4c133587..fb114924 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,9 +33,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "ascii-canvas" @@ -54,7 +54,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -104,12 +104,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - [[package]] name = "bincode" version = "1.3.3" @@ -175,7 +169,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -240,9 +234,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.27" +version = "4.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0acbd8d28a0a60d7108d7ae850af6ba34cf2d1257fc646980e5f97ce14275966" +checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" dependencies = [ "bitflags", "clap_derive", @@ -255,15 +249,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.10", ] [[package]] @@ -368,7 +361,7 @@ dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", + "memoffset 0.6.5", "scopeguard", ] @@ -394,7 +387,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -418,7 +411,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.103", ] [[package]] @@ -429,7 +422,7 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -442,7 +435,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.103", ] [[package]] @@ -559,7 +552,7 @@ dependencies = [ "libc", "log", "maplit", - "nix 0.25.0", + "nix 0.26.2", "notify", "once_cell", "pretty_env_logger", @@ -588,14 +581,13 @@ dependencies = [ [[package]] name = "extend" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5216e387a76eebaaf11f6d871ec8a4aae0b25f05456ee21f228e024b1b3610" +checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.10", ] [[package]] @@ -604,7 +596,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" dependencies = [ - "memoffset", + "memoffset 0.6.5", "rustc_version 0.3.3", ] @@ -617,7 +609,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -667,9 +659,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-executor" @@ -690,32 +682,32 @@ checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-core", "futures-macro", @@ -895,7 +887,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -921,17 +913,22 @@ dependencies = [ [[package]] name = "grass" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5bedc3dbd71dcdd41900e1f58e4d431fa69dd67c04ae1f86ae1a0339edd849" +checksum = "f4bfa010e6f9fe2f40727b4aedf67aa54e0439c57f855458efb1f43d730a028f" +dependencies = [ + "grass_compiler", +] + +[[package]] +name = "grass_compiler" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe05b48c9c96f5ec64ad9af20c9016a8d57ec8b979e0f6dbdd9747f32b16df3" dependencies = [ - "beef", "codemap", "indexmap", "lasso", - "num-bigint", - "num-rational", - "num-traits", "once_cell", "phf", ] @@ -1016,7 +1013,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -1057,12 +1054,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" [[package]] name = "humantime" @@ -1138,19 +1132,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e394faa0efb47f9f227f1cd89978f854542b318a6f64fa695489c9c993056656" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "is-terminal" -version = "0.4.0" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae5bc6e2eb41c9def29a3e0f1306382807764b9b53112030eff57435667352d" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.1", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1258,9 +1252,9 @@ dependencies = [ [[package]] name = "lasso" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8647c8a01e5f7878eacb2c323c4c949fdb63773110f0686c7810769874b7e0a" +checksum = "aeb7b21a526375c5ca55f1a6dfd4e1fad9fa4edd750f530252a718a44b2608f0" dependencies = [ "hashbrown 0.11.2", ] @@ -1273,9 +1267,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.136" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55edcf6c0bb319052dea84732cf99db461780fd5e8d3eb46ab6ff312ab31f197" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "linked-hash-map" @@ -1329,6 +1323,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mio" version = "0.8.5" @@ -1338,7 +1341,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1349,35 +1352,36 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nix" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" dependencies = [ + "autocfg", "bitflags", "cfg-if", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] name = "nix" -version = "0.25.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "autocfg", "bitflags", "cfg-if", "libc", - "memoffset", + "memoffset 0.7.1", "pin-utils", + "static_assertions", ] [[package]] name = "notify" -version = "5.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2c66da08abae1c024c01d635253e402341b4060a12e99b31c7594063bf490a" +checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" dependencies = [ "bitflags", "crossbeam-channel", @@ -1388,7 +1392,7 @@ dependencies = [ "libc", "mio", "walkdir", - "winapi", + "windows-sys 0.42.0", ] [[package]] @@ -1400,48 +1404,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.13.1" @@ -1518,7 +1480,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1543,46 +1505,37 @@ dependencies = [ [[package]] name = "phf" -version = "0.9.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ac8b67553a7ca9457ce0e526948cad581819238f4a9d1ea74545851fa24f37" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" dependencies = [ "phf_macros", - "phf_shared 0.9.0", + "phf_shared", "proc-macro-hack", ] [[package]] name = "phf_generator" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43f3220d96e0080cc9ea234978ccd80d904eafb17be31bb0f76daaea6493082" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ - "phf_shared 0.9.0", + "phf_shared", "rand", ] [[package]] name = "phf_macros" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b706f5936eb50ed880ae3009395b43ed19db5bff2ebd459c95e7bf013a89ab86" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" dependencies = [ "phf_generator", - "phf_shared 0.9.0", + "phf_shared", "proc-macro-hack", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "phf_shared" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a68318426de33640f02be62b4ae8eb1261be2efbc337b60c54d845bf4484e0d9" -dependencies = [ - "siphasher", + "syn 1.0.103", ] [[package]] @@ -1672,7 +1625,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.103", "version_check", ] @@ -1695,9 +1648,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" dependencies = [ "unicode-ident", ] @@ -1710,9 +1663,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.21" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1808,14 +1761,14 @@ checksum = "5887de4a01acafd221861463be6113e6e87275e79804e56779f4cdc131c60368" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] name = "regex" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -1824,9 +1777,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "rustc_version" @@ -1848,16 +1801,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.3" +version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1928,7 +1881,7 @@ checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2018,7 +1971,7 @@ checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2046,7 +1999,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared 0.10.0", + "phf_shared", "precomputed-hash", ] @@ -2075,7 +2028,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.103", ] [[package]] @@ -2089,11 +2042,22 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sysinfo" -version = "0.26.5" +version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade661fa5e048ada64ad7901713301c21d2dbc5b65ee7967de8826c111452960" +checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2164,7 +2128,7 @@ checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] @@ -2178,9 +2142,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.21.2" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "bytes", @@ -2193,7 +2157,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -2204,14 +2168,14 @@ checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.103", ] [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", @@ -2352,47 +2316,71 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "x11" @@ -2406,12 +2394,12 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507" +checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" dependencies = [ "gethostname", - "nix 0.24.2", + "nix 0.25.0", "winapi", "winapi-wsapoll", "x11rb-protocol", @@ -2419,11 +2407,11 @@ dependencies = [ [[package]] name = "x11rb-protocol" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67" +checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" dependencies = [ - "nix 0.24.2", + "nix 0.25.0", ] [[package]] diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index b1456b7f..25d26f35 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -11,11 +11,9 @@ edition = "2021" [features] -default = ["x11"] -x11 = ["gdkx11", "x11rb", "yuck/x11"] -wayland = ["gtk-layer-shell", "yuck/wayland"] -[dependencies.cairo-sys-rs] -version = "0.15.1" +default = ["x11", "wayland"] +x11 = ["gdkx11", "x11rb"] +wayland = ["gtk-layer-shell"] [dependencies] gtk = { version = "0.15", features = [ "v3_22" ] } @@ -23,42 +21,43 @@ gdk = "0.15" glib = "0.15" cairo-rs = "0.15" +cairo-sys-rs = "0.15.1" gdk-pixbuf = "0.15" gtk-layer-shell = { version = "0.4", optional = true} gdkx11 = { version = "0.15", optional = true } -x11rb = { version = "0.10", features = ["randr"], optional = true } +x11rb = { version = "0.11.1", features = ["randr"], optional = true } -regex = "1.6" -bincode = "1.3" -anyhow = "1.0" +regex = "1.7.3" +bincode = "1.3.3" +anyhow = "1.0.70" derive_more = "0.99" maplit = "1" -clap = {version = "4.0", features = ["derive"] } +clap = {version = "4.1", features = ["derive"] } serde = {version = "1.0", features = ["derive"]} serde_json = "1.0" -extend = "1" -grass = {version = "0.11", default-features = false} +extend = "1.2" +grass = {version = "0.12.3", default-features = false} itertools = "0.10" log = "0.4" pretty_env_logger = "0.4" libc = "0.2" once_cell = "1.14" -nix = "0.25" +nix = "0.26.2" simple-signal = "1.1" unescape = "0.1" -tokio = { version = "^1.18", features = ["full"] } -futures-core = "0.3" -futures-util = "0.3" -tokio-util = "0.7" +tokio = { version = "1.26.0", features = ["full"] } +futures-core = "0.3.27" +futures-util = "0.3.27" +tokio-util = "0.7.7" -sysinfo = "0.26" +sysinfo = "0.28.4" wait-timeout = "0.2" -notify = "5.0.0" +notify = "5.1.0" codespan-reporting = "0.11" diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index ac4e5131..d65c6ca9 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -1,7 +1,8 @@ use crate::{ config, daemon_response::DaemonResponseSender, - display_backend, error_handling_ctx, + display_backend::DisplayBackend, + error_handling_ctx, gtk::prelude::{ContainerExt, CssProviderExt, GtkWindowExt, StyleContextExt, WidgetExt}, paths::EwwPaths, script_var_handler::ScriptVarHandlerHandle, @@ -98,7 +99,8 @@ impl EwwWindow { } } -pub struct App { +pub struct App { + pub display_backend: B, pub scope_graph: Rc>, pub eww_config: config::EwwConfig, /// Map of all currently open windows @@ -115,7 +117,7 @@ pub struct App { pub paths: EwwPaths, } -impl std::fmt::Debug for App { +impl std::fmt::Debug for App { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("App") .field("scope_graph", &*self.scope_graph.borrow()) @@ -127,7 +129,7 @@ impl std::fmt::Debug for App { } } -impl App { +impl App { /// Handle a [`DaemonCommand`] event. pub fn handle_command(&mut self, event: DaemonCommand) { log::debug!("Handling event: {:?}", &event); @@ -351,7 +353,7 @@ impl App { let monitor_geometry = get_monitor_geometry(monitor.or_else(|| window_def.monitor.clone()))?; - let mut eww_window = initialize_window(monitor_geometry, root_widget, window_def, window_scope)?; + let mut eww_window = initialize_window::(monitor_geometry, root_widget, window_def, window_scope)?; eww_window.gtk_window.style_context().add_class(window_name); // initialize script var handlers for variables. As starting a scriptvar with the script_var_handler is idempodent, @@ -433,13 +435,13 @@ impl App { } } -fn initialize_window( +fn initialize_window( monitor_geometry: gdk::Rectangle, root_widget: gtk::Widget, window_def: WindowDefinition, window_scope: ScopeIndex, ) -> Result { - let window = display_backend::initialize_window(&window_def, monitor_geometry) + let window = B::initialize_window(&window_def, monitor_geometry) .with_context(|| format!("monitor {} is unavailable", window_def.monitor.clone().unwrap()))?; window.set_title(&format!("Eww - {}", window_def.name)); @@ -467,7 +469,7 @@ fn initialize_window( { if let Some(geometry) = window_def.geometry { let _ = apply_window_position(geometry, monitor_geometry, &window); - if window_def.backend_options.window_type != yuck::config::backend_window_options::WindowType::Normal { + if window_def.backend_options.x11.window_type != yuck::config::backend_window_options::X11WindowType::Normal { window.connect_configure_event(move |window, _| { let _ = apply_window_position(geometry, monitor_geometry, window); false diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index d949008c..c7d32901 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -1,98 +1,109 @@ -pub use platform::*; +use yuck::config::window_definition::WindowDefinition; -#[cfg(not(any(feature = "x11", feature = "wayland")))] -mod platform { - use yuck::config::window_definition::{WindowDefinition, WindowStacking}; +#[cfg(feature = "wayland")] +pub use platform_wayland::WaylandBackend; + +#[cfg(feature = "x11")] +pub use platform_x11::{set_xprops, X11Backend}; - pub fn initialize_window(_window_def: &WindowDefinition, _monitor: gdk::Rectangle) -> Option { +pub trait DisplayBackend: Send + Sync + 'static { + fn initialize_window(window_def: &WindowDefinition, monitor: gdk::Rectangle) -> Option; +} + +pub struct NoBackend; + +impl DisplayBackend for NoBackend { + fn initialize_window(_window_def: &WindowDefinition, _monitor: gdk::Rectangle) -> Option { Some(gtk::Window::new(gtk::WindowType::Toplevel)) } } #[cfg(feature = "wayland")] -mod platform { - use gdk; +mod platform_wayland { use gtk::prelude::*; use yuck::config::{ window_definition::{WindowDefinition, WindowStacking}, window_geometry::AnchorAlignment, }; - pub fn initialize_window(window_def: &WindowDefinition, monitor: gdk::Rectangle) -> Option { - let window = gtk::Window::new(gtk::WindowType::Toplevel); - // Initialising a layer shell surface - gtk_layer_shell::init_for_window(&window); - // Sets the monitor where the surface is shown - match window_def.monitor.clone() { - Some(ident) => { + use super::DisplayBackend; + + pub struct WaylandBackend; + + impl DisplayBackend for WaylandBackend { + fn initialize_window(window_def: &WindowDefinition, monitor: gdk::Rectangle) -> Option { + let window = gtk::Window::new(gtk::WindowType::Toplevel); + // Initialising a layer shell surface + gtk_layer_shell::init_for_window(&window); + // Sets the monitor where the surface is shown + if let Some(ident) = window_def.monitor.clone() { let display = gdk::Display::default().expect("could not get default display"); if let Some(monitor) = crate::app::get_monitor_from_display(&display, &ident) { gtk_layer_shell::set_monitor(&window, &monitor); } else { return None; } + }; + window.set_resizable(window_def.resizable); + + // Sets the layer where the layer shell surface will spawn + match window_def.stacking { + WindowStacking::Foreground => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Top), + WindowStacking::Background => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Background), + WindowStacking::Bottom => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Bottom), + WindowStacking::Overlay => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Overlay), } - None => {} - }; - window.set_resizable(window_def.resizable); - - // Sets the layer where the layer shell surface will spawn - match window_def.stacking { - WindowStacking::Foreground => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Top), - WindowStacking::Background => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Background), - WindowStacking::Bottom => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Bottom), - WindowStacking::Overlay => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Overlay), - } - // Sets the keyboard interactivity - gtk_layer_shell::set_keyboard_interactivity(&window, window_def.backend_options.focusable); + // Sets the keyboard interactivity + gtk_layer_shell::set_keyboard_interactivity(&window, window_def.backend_options.wayland.focusable); - if let Some(geometry) = window_def.geometry { - // Positioning surface - let mut top = false; - let mut left = false; - let mut right = false; - let mut bottom = false; + if let Some(geometry) = window_def.geometry { + // Positioning surface + let mut top = false; + let mut left = false; + let mut right = false; + let mut bottom = false; - match geometry.anchor_point.x { - AnchorAlignment::START => left = true, - AnchorAlignment::CENTER => {} - AnchorAlignment::END => right = true, - } - match geometry.anchor_point.y { - AnchorAlignment::START => top = true, - AnchorAlignment::CENTER => {} - AnchorAlignment::END => bottom = true, - } + match geometry.anchor_point.x { + AnchorAlignment::START => left = true, + AnchorAlignment::CENTER => {} + AnchorAlignment::END => right = true, + } + match geometry.anchor_point.y { + AnchorAlignment::START => top = true, + AnchorAlignment::CENTER => {} + AnchorAlignment::END => bottom = true, + } - gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Left, left); - gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Right, right); - gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Top, top); - gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Bottom, bottom); + gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Left, left); + gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Right, right); + gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Top, top); + gtk_layer_shell::set_anchor(&window, gtk_layer_shell::Edge::Bottom, bottom); - let xoffset = geometry.offset.x.pixels_relative_to(monitor.width()); - let yoffset = geometry.offset.y.pixels_relative_to(monitor.height()); + let xoffset = geometry.offset.x.pixels_relative_to(monitor.width()); + let yoffset = geometry.offset.y.pixels_relative_to(monitor.height()); - if left { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Left, xoffset); - } else { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Right, xoffset); + if left { + gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Left, xoffset); + } else { + gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Right, xoffset); + } + if bottom { + gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Bottom, yoffset); + } else { + gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Top, yoffset); + } } - if bottom { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Bottom, yoffset); - } else { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Top, yoffset); + if window_def.backend_options.wayland.exclusive { + gtk_layer_shell::auto_exclusive_zone_enable(&window); } + Some(window) } - if window_def.backend_options.exclusive { - gtk_layer_shell::auto_exclusive_zone_enable(&window); - } - Some(window) } } #[cfg(feature = "x11")] -mod platform { +mod platform_x11 { use anyhow::{Context, Result}; use gtk::{self, prelude::*}; use x11rb::protocol::xproto::ConnectionExt; @@ -104,45 +115,51 @@ mod platform { rust_connection::{DefaultStream, RustConnection}, }; use yuck::config::{ - backend_window_options::{Side, WindowType}, + backend_window_options::{Side, X11WindowType}, window_definition::{WindowDefinition, WindowStacking}, }; - pub fn initialize_window(window_def: &WindowDefinition, _monitor: gdk::Rectangle) -> Option { - let window_type = if window_def.backend_options.wm_ignore { gtk::WindowType::Popup } else { gtk::WindowType::Toplevel }; - let window = gtk::Window::new(window_type); - let wm_class_name = format!("eww-{}", window_def.name); - #[allow(deprecated)] - window.set_wmclass(&wm_class_name, &wm_class_name); - window.set_resizable(window_def.resizable); - window.set_keep_above(window_def.stacking == WindowStacking::Foreground); - window.set_keep_below(window_def.stacking == WindowStacking::Background); - if window_def.backend_options.sticky { - window.stick(); - } else { - window.unstick(); + use super::DisplayBackend; + + pub struct X11Backend; + impl DisplayBackend for X11Backend { + fn initialize_window(window_def: &WindowDefinition, _monitor: gdk::Rectangle) -> Option { + let window_type = + if window_def.backend_options.x11.wm_ignore { gtk::WindowType::Popup } else { gtk::WindowType::Toplevel }; + let window = gtk::Window::new(window_type); + let wm_class_name = format!("eww-{}", window_def.name); + #[allow(deprecated)] + window.set_wmclass(&wm_class_name, &wm_class_name); + window.set_resizable(window_def.resizable); + window.set_keep_above(window_def.stacking == WindowStacking::Foreground); + window.set_keep_below(window_def.stacking == WindowStacking::Background); + if window_def.backend_options.x11.sticky { + window.stick(); + } else { + window.unstick(); + } + Some(window) } - Some(window) } pub fn set_xprops(window: >k::Window, monitor: gdk::Rectangle, window_def: &WindowDefinition) -> Result<()> { - let backend = X11Backend::new()?; + let backend = X11BackendConnection::new()?; backend.set_xprops_for(window, monitor, window_def)?; Ok(()) } - struct X11Backend { + struct X11BackendConnection { conn: RustConnection, root_window: u32, atoms: AtomCollection, } - impl X11Backend { + impl X11BackendConnection { fn new() -> Result { let (conn, screen_num) = RustConnection::connect(None)?; let screen = conn.setup().roots[screen_num].clone(); let atoms = AtomCollection::new(&conn)?.reply()?; - Ok(X11Backend { conn, root_window: screen.root, atoms }) + Ok(X11BackendConnection { conn, root_window: screen.root, atoms }) } fn set_xprops_for( @@ -154,7 +171,7 @@ mod platform { let gdk_window = window.window().context("Couldn't get gdk window from gtk window")?; let win_id = gdk_window.downcast_ref::().context("Failed to get x11 window for gtk window")?.xid() as u32; - let strut_def = window_def.backend_options.struts; + let strut_def = window_def.backend_options.x11.struts; let root_window_geometry = self.conn.get_geometry(self.root_window)?.reply()?; let mon_end_x = (monitor_rect.x() + monitor_rect.width()) as u32 - 1u32; @@ -208,14 +225,14 @@ mod platform { win_id, self.atoms._NET_WM_WINDOW_TYPE, self.atoms.ATOM, - &[match window_def.backend_options.window_type { - WindowType::Dock => self.atoms._NET_WM_WINDOW_TYPE_DOCK, - WindowType::Normal => self.atoms._NET_WM_WINDOW_TYPE_NORMAL, - WindowType::Dialog => self.atoms._NET_WM_WINDOW_TYPE_DIALOG, - WindowType::Toolbar => self.atoms._NET_WM_WINDOW_TYPE_TOOLBAR, - WindowType::Utility => self.atoms._NET_WM_WINDOW_TYPE_UTILITY, - WindowType::Desktop => self.atoms._NET_WM_WINDOW_TYPE_DESKTOP, - WindowType::Notification => self.atoms._NET_WM_WINDOW_TYPE_NOTIFICATION, + &[match window_def.backend_options.x11.window_type { + X11WindowType::Dock => self.atoms._NET_WM_WINDOW_TYPE_DOCK, + X11WindowType::Normal => self.atoms._NET_WM_WINDOW_TYPE_NORMAL, + X11WindowType::Dialog => self.atoms._NET_WM_WINDOW_TYPE_DIALOG, + X11WindowType::Toolbar => self.atoms._NET_WM_WINDOW_TYPE_TOOLBAR, + X11WindowType::Utility => self.atoms._NET_WM_WINDOW_TYPE_UTILITY, + X11WindowType::Desktop => self.atoms._NET_WM_WINDOW_TYPE_DESKTOP, + X11WindowType::Notification => self.atoms._NET_WM_WINDOW_TYPE_NOTIFICATION, }], )? .check()?; diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs index 14bc8190..1e61c3bf 100644 --- a/crates/eww/src/main.rs +++ b/crates/eww/src/main.rs @@ -12,6 +12,7 @@ extern crate gtk_layer_shell as gtk_layer_shell; use anyhow::{Context, Result}; use daemon_response::{DaemonResponse, DaemonResponseReceiver}; +use display_backend::DisplayBackend; use opts::ActionWithServer; use paths::EwwPaths; use std::{os::unix::net, path::Path, time::Duration}; @@ -47,96 +48,127 @@ fn main() { pretty_env_logger::formatted_timed_builder().filter(Some("eww"), log_level_filter).init(); } - let result: Result<()> = try { - let paths = opts - .config_path - .map(EwwPaths::from_config_dir) - .unwrap_or_else(EwwPaths::default) - .context("Failed to initialize eww paths")?; - - let should_restart = match &opts.action { - opts::Action::Daemon => opts.restart, - opts::Action::WithServer(action) => opts.restart && action.can_start_daemon(), - opts::Action::ClientOnly(_) => false, - }; - if should_restart { - let response = handle_server_command(&paths, &ActionWithServer::KillServer, 1); - if let Ok(Some(response)) = response { - handle_daemon_response(response); - } - std::thread::sleep(std::time::Duration::from_millis(200)); + #[allow(unused)] + let use_wayland = opts.force_wayland || detect_wayland(); + #[cfg(all(feature = "wayland", feature = "x11"))] + let result = if use_wayland { + run(opts, eww_binary_name, display_backend::WaylandBackend) + } else { + run(opts, eww_binary_name, display_backend::X11Backend) + }; + + #[cfg(all(not(feature = "wayland"), feature = "x11"))] + let result = { + if use_wayland { + log::warn!("Eww compiled without wayland support. falling back to X11, eventhough wayland was requested."); } + run(opts, eww_binary_name, display_backend::X11Backend) + }; - let would_show_logs = match opts.action { - opts::Action::ClientOnly(action) => { - client::handle_client_only_action(&paths, action)?; - false - } + #[cfg(all(feature = "wayland", not(feature = "x11")))] + let result = run(opts, eww_binary_name, display_backend::WaylandBackend); + + #[cfg(not(any(feature = "wayland", feature = "x11")))] + let result = run(opts, eww_binary_name, display_backend::NoBackend); + + if let Err(err) = result { + error_handling_ctx::print_error(err); + std::process::exit(1); + } +} + +fn detect_wayland() -> bool { + let session_type = std::env::var("XDG_SESSION_TYPE").unwrap_or_default(); + let wayland_display = std::env::var("WAYLAND_DISPLAY").unwrap_or_default(); + session_type.contains("wayland") || (!wayland_display.is_empty() && !session_type.contains("x11")) +} + +fn run(opts: opts::Opt, eww_binary_name: String, display_backend: B) -> Result<()> { + let paths = opts + .config_path + .map(EwwPaths::from_config_dir) + .unwrap_or_else(EwwPaths::default) + .context("Failed to initialize eww paths")?; + + let should_restart = match &opts.action { + opts::Action::Daemon => opts.restart, + opts::Action::WithServer(action) => opts.restart && action.can_start_daemon(), + opts::Action::ClientOnly(_) => false, + }; + if should_restart { + let response = handle_server_command(&paths, &ActionWithServer::KillServer, 1); + if let Ok(Some(response)) = response { + handle_daemon_response(response); + } + std::thread::sleep(std::time::Duration::from_millis(200)); + } + + let would_show_logs = match opts.action { + opts::Action::ClientOnly(action) => { + client::handle_client_only_action(&paths, action)?; + false + } + + // make sure that there isn't already a Eww daemon running. + opts::Action::Daemon if check_server_running(paths.get_ipc_socket_file()) => { + eprintln!("Eww server already running."); + true + } + opts::Action::Daemon => { + log::info!("Initializing Eww server. ({})", paths.get_ipc_socket_file().display()); + let _ = std::fs::remove_file(paths.get_ipc_socket_file()); - // make sure that there isn't already a Eww daemon running. - opts::Action::Daemon if check_server_running(paths.get_ipc_socket_file()) => { - eprintln!("Eww server already running."); - true + if !opts.show_logs { + println!("Run `{} logs` to see any errors while editing your configuration.", eww_binary_name); } - opts::Action::Daemon => { - log::info!("Initializing Eww server. ({})", paths.get_ipc_socket_file().display()); - let _ = std::fs::remove_file(paths.get_ipc_socket_file()); + let fork_result = server::initialize_server(paths.clone(), None, display_backend, !opts.no_daemonize)?; + opts.no_daemonize || fork_result == ForkResult::Parent + } - if !opts.show_logs { - println!("Run `{} logs` to see any errors while editing your configuration.", eww_binary_name); - } - let fork_result = server::initialize_server(paths.clone(), None, !opts.no_daemonize)?; - opts.no_daemonize || fork_result == ForkResult::Parent + opts::Action::WithServer(ActionWithServer::KillServer) => { + if let Some(response) = handle_server_command(&paths, &ActionWithServer::KillServer, 1)? { + handle_daemon_response(response); } + false + } - opts::Action::WithServer(ActionWithServer::KillServer) => { - if let Some(response) = handle_server_command(&paths, &ActionWithServer::KillServer, 1)? { + // a running daemon is necessary for this command + opts::Action::WithServer(action) => { + // attempt to just send the command to a running daemon + match handle_server_command(&paths, &action, 5) { + Ok(Some(response)) => { handle_daemon_response(response); + true } - false - } - - // a running daemon is necessary for this command - opts::Action::WithServer(action) => { - // attempt to just send the command to a running daemon - match handle_server_command(&paths, &action, 5) { - Ok(Some(response)) => { - handle_daemon_response(response); - true + Ok(None) => true, + + Err(err) if action.can_start_daemon() && !opts.no_daemonize => { + // connecting to the daemon failed. Thus, start the daemon here! + log::warn!("Failed to connect to daemon: {}", err); + log::info!("Initializing eww server. ({})", paths.get_ipc_socket_file().display()); + let _ = std::fs::remove_file(paths.get_ipc_socket_file()); + if !opts.show_logs { + println!("Run `{} logs` to see any errors while editing your configuration.", eww_binary_name); } - Ok(None) => true, - - Err(err) if action.can_start_daemon() && !opts.no_daemonize => { - // connecting to the daemon failed. Thus, start the daemon here! - log::warn!("Failed to connect to daemon: {}", err); - log::info!("Initializing eww server. ({})", paths.get_ipc_socket_file().display()); - let _ = std::fs::remove_file(paths.get_ipc_socket_file()); - if !opts.show_logs { - println!("Run `{} logs` to see any errors while editing your configuration.", eww_binary_name); - } - - let (command, response_recv) = action.into_daemon_command(); - // start the daemon and give it the command - let fork_result = server::initialize_server(paths.clone(), Some(command), true)?; - let is_parent = fork_result == ForkResult::Parent; - if let (Some(recv), true) = (response_recv, is_parent) { - listen_for_daemon_response(recv); - } - is_parent + + let (command, response_recv) = action.into_daemon_command(); + // start the daemon and give it the command + let fork_result = server::initialize_server(paths.clone(), Some(command), display_backend, true)?; + let is_parent = fork_result == ForkResult::Parent; + if let (Some(recv), true) = (response_recv, is_parent) { + listen_for_daemon_response(recv); } - Err(err) => Err(err)?, + is_parent } + Err(err) => Err(err)?, } - }; - if would_show_logs && opts.show_logs { - client::handle_client_only_action(&paths, opts::ActionClientOnly::Logs)?; } }; - if let Err(e) = result { - error_handling_ctx::print_error(e); - std::process::exit(1); + if would_show_logs && opts.show_logs { + client::handle_client_only_action(&paths, opts::ActionClientOnly::Logs)?; } + Ok(()) } fn listen_for_daemon_response(mut recv: DaemonResponseReceiver) { diff --git a/crates/eww/src/opts.rs b/crates/eww/src/opts.rs index fc1c4c3d..2880011f 100644 --- a/crates/eww/src/opts.rs +++ b/crates/eww/src/opts.rs @@ -16,6 +16,7 @@ use crate::{ /// Struct that gets generated from `RawOpt`. #[derive(Debug, Serialize, Deserialize, PartialEq)] pub struct Opt { + pub force_wayland: bool, pub log_debug: bool, pub show_logs: bool, pub restart: bool, @@ -32,6 +33,10 @@ struct RawOpt { #[arg(long = "debug", global = true)] log_debug: bool, + /// Force eww to use wayland. This is a no-op if eww was compiled without wayland support. + #[arg(long = "force-wayland", global = true)] + force_wayland: bool, + /// override path to configuration directory (directory that contains eww.yuck and eww.(s)css) #[arg(short, long, global = true)] config: Option, @@ -181,8 +186,8 @@ impl Opt { impl From for Opt { fn from(other: RawOpt) -> Self { - let RawOpt { log_debug, config, show_logs, no_daemonize, restart, action } = other; - Opt { log_debug, show_logs, restart, config_path: config, action, no_daemonize } + let RawOpt { log_debug, force_wayland, config, show_logs, no_daemonize, restart, action } = other; + Opt { log_debug, force_wayland, show_logs, restart, config_path: config, action, no_daemonize } } } diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 2d32142e..5b557fa4 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -1,6 +1,8 @@ use crate::{ app::{self, DaemonCommand}, - config, daemon_response, error_handling_ctx, ipc_server, script_var_handler, + config, daemon_response, + display_backend::DisplayBackend, + error_handling_ctx, ipc_server, script_var_handler, state::scope_graph::ScopeGraph, EwwPaths, }; @@ -16,7 +18,12 @@ use std::{ }; use tokio::sync::mpsc::*; -pub fn initialize_server(paths: EwwPaths, action: Option, should_daemonize: bool) -> Result { +pub fn initialize_server( + paths: EwwPaths, + action: Option, + display_backend: B, + should_daemonize: bool, +) -> Result { let (ui_send, mut ui_recv) = tokio::sync::mpsc::unbounded_channel(); std::env::set_current_dir(&paths.get_config_dir()) @@ -66,6 +73,7 @@ pub fn initialize_server(paths: EwwPaths, action: Option, should_ let (scope_graph_evt_send, mut scope_graph_evt_recv) = tokio::sync::mpsc::unbounded_channel(); let mut app = app::App { + display_backend, scope_graph: Rc::new(RefCell::new(ScopeGraph::from_global_vars( eww_config.generate_initial_state()?, scope_graph_evt_send, diff --git a/crates/yuck/Cargo.toml b/crates/yuck/Cargo.toml index 09d63a2b..9e21c17a 100644 --- a/crates/yuck/Cargo.toml +++ b/crates/yuck/Cargo.toml @@ -10,11 +10,6 @@ homepage = "https://github.com/elkowar/eww" build = "build.rs" -[features] -default = ["x11"] -x11 = [] -wayland = [] - [dependencies] lalrpop-util = "0.19.5" regex = "1.5.5" diff --git a/crates/yuck/src/config/backend_window_options.rs b/crates/yuck/src/config/backend_window_options.rs index 98b1709c..d0691749 100644 --- a/crates/yuck/src/config/backend_window_options.rs +++ b/crates/yuck/src/config/backend_window_options.rs @@ -12,128 +12,109 @@ use eww_shared_util::Span; use super::{attributes::Attributes, window_definition::EnumParseError}; -pub use backend::*; +use crate::error::{DiagError, DiagResultExt}; -#[cfg(feature = "x11")] -mod backend { - use crate::error::{DiagError, DiagResultExt}; - - use super::*; - - #[derive(Debug, Clone, PartialEq, serde::Serialize)] - pub struct BackendWindowOptions { - pub wm_ignore: bool, - pub sticky: bool, - pub window_type: WindowType, - pub struts: StrutDefinition, - } - - impl BackendWindowOptions { - pub fn from_attrs(attrs: &mut Attributes) -> DiagResult { - let struts = attrs.ast_optional("reserve")?; - let window_type = attrs.primitive_optional("windowtype")?; - Ok(Self { - wm_ignore: attrs.primitive_optional("wm-ignore")?.unwrap_or(window_type.is_none() && struts.is_none()), - window_type: window_type.unwrap_or_default(), - sticky: attrs.primitive_optional("sticky")?.unwrap_or(true), - struts: struts.unwrap_or_default(), - }) - } - } +/// Backend-specific options of a window that are backend +#[derive(Debug, Clone, serde::Serialize, PartialEq)] +pub struct BackendWindowOptions { + pub x11: X11BackendWindowOptions, + pub wayland: WlBackendWindowOptions, +} - #[derive(Debug, Clone, PartialEq, Eq, smart_default::SmartDefault, serde::Serialize)] - pub enum WindowType { - #[default] - Dock, - Dialog, - Toolbar, - Normal, - Utility, - Desktop, - Notification, - } - impl FromStr for WindowType { - type Err = EnumParseError; - - fn from_str(s: &str) -> Result { - enum_parse! { "window type", s, - "dock" => Self::Dock, - "toolbar" => Self::Toolbar, - "dialog" => Self::Dialog, - "normal" => Self::Normal, - "utility" => Self::Utility, - "desktop" => Self::Desktop, - "notification" => Self::Notification, - } - } +impl BackendWindowOptions { + pub fn from_attrs(attrs: &mut Attributes) -> DiagResult { + let struts = attrs.ast_optional("reserve")?; + let window_type = attrs.primitive_optional("windowtype")?; + let x11 = X11BackendWindowOptions { + wm_ignore: attrs.primitive_optional("wm-ignore")?.unwrap_or(window_type.is_none() && struts.is_none()), + window_type: window_type.unwrap_or_default(), + sticky: attrs.primitive_optional("sticky")?.unwrap_or(true), + struts: struts.unwrap_or_default(), + }; + let wayland = WlBackendWindowOptions { + exclusive: attrs.primitive_optional("exclusive")?.unwrap_or(false), + focusable: attrs.primitive_optional("focusable")?.unwrap_or(false), + }; + Ok(Self { x11, wayland }) } +} - #[derive(Debug, Clone, Copy, Eq, PartialEq, smart_default::SmartDefault, serde::Serialize)] - pub enum Side { - #[default] - Top, - Left, - Right, - Bottom, - } +#[derive(Debug, Clone, PartialEq, serde::Serialize)] +pub struct X11BackendWindowOptions { + pub wm_ignore: bool, + pub sticky: bool, + pub window_type: X11WindowType, + pub struts: X11StrutDefinition, +} - impl std::str::FromStr for Side { - type Err = EnumParseError; +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)] +pub struct WlBackendWindowOptions { + pub exclusive: bool, + pub focusable: bool, +} - fn from_str(s: &str) -> Result { - enum_parse! { "side", s, - "l" | "left" => Side::Left, - "r" | "right" => Side::Right, - "t" | "top" => Side::Top, - "b" | "bottom" => Side::Bottom, - } +/// Window type of an x11 window +#[derive(Debug, Clone, PartialEq, Eq, smart_default::SmartDefault, serde::Serialize)] +pub enum X11WindowType { + #[default] + Dock, + Dialog, + Toolbar, + Normal, + Utility, + Desktop, + Notification, +} +impl FromStr for X11WindowType { + type Err = EnumParseError; + + fn from_str(s: &str) -> Result { + enum_parse! { "window type", s, + "dock" => Self::Dock, + "toolbar" => Self::Toolbar, + "dialog" => Self::Dialog, + "normal" => Self::Normal, + "utility" => Self::Utility, + "desktop" => Self::Desktop, + "notification" => Self::Notification, } } +} - // Surface definition if the backend for X11 is enable - #[derive(Debug, Clone, Copy, PartialEq, Default, serde::Serialize)] - pub struct StrutDefinition { - pub side: Side, - pub dist: NumWithUnit, - } +#[derive(Debug, Clone, Copy, Eq, PartialEq, smart_default::SmartDefault, serde::Serialize)] +pub enum Side { + #[default] + Top, + Left, + Right, + Bottom, +} - impl FromAstElementContent for StrutDefinition { - const ELEMENT_NAME: &'static str = "struts"; +impl std::str::FromStr for Side { + type Err = EnumParseError; - fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { - let mut attrs = iter.expect_key_values()?; - iter.expect_done().map_err(DiagError::from).note("Check if you are missing a colon in front of a key")?; - Ok(StrutDefinition { side: attrs.primitive_required("side")?, dist: attrs.primitive_required("distance")? }) + fn from_str(s: &str) -> Result { + enum_parse! { "side", s, + "l" | "left" => Side::Left, + "r" | "right" => Side::Right, + "t" | "top" => Side::Top, + "b" | "bottom" => Side::Bottom, } } } -#[cfg(feature = "wayland")] -mod backend { - use super::*; - #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)] - pub struct BackendWindowOptions { - pub exclusive: bool, - pub focusable: bool, - } - impl BackendWindowOptions { - pub fn from_attrs(attrs: &mut Attributes) -> DiagResult { - Ok(Self { - exclusive: attrs.primitive_optional("exclusive")?.unwrap_or(false), - focusable: attrs.primitive_optional("focusable")?.unwrap_or(false), - }) - } - } +#[derive(Debug, Clone, Copy, PartialEq, Default, serde::Serialize)] +pub struct X11StrutDefinition { + pub side: Side, + pub dist: NumWithUnit, } -#[cfg(not(any(feature = "x11", feature = "wayland")))] -mod backend { - use super::*; - #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)] - pub struct BackendWindowOptions; - impl BackendWindowOptions { - pub fn from_attrs(attrs: &mut Attributes) -> DiagResult { - Ok(Self) - } +impl FromAstElementContent for X11StrutDefinition { + const ELEMENT_NAME: &'static str = "struts"; + + fn from_tail>(_span: Span, mut iter: AstIterator) -> DiagResult { + let mut attrs = iter.expect_key_values()?; + iter.expect_done().map_err(DiagError::from).note("Check if you are missing a colon in front of a key")?; + Ok(X11StrutDefinition { side: attrs.primitive_required("side")?, dist: attrs.primitive_required("distance")? }) } } diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-10.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-10.snap new file mode 100644 index 00000000..06bdb332 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-10.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(lol😄 1)\".to_string()))" +--- +Ok( + (lol😄 "1"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-11.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-11.snap new file mode 100644 index 00000000..b3e62b09 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-11.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, r#\"(test \"hi\")\"#.to_string()))" +--- +Ok( + (test "hi"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-12.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-12.snap new file mode 100644 index 00000000..5fc143f6 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-12.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, r#\"(test \"h\\\"i\")\"#.to_string()))" +--- +Ok( + (test "h"i"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-13.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-13.snap new file mode 100644 index 00000000..72424461 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-13.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, r#\"(test \" hi \")\"#.to_string()))" +--- +Ok( + (test " hi "), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-14.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-14.snap new file mode 100644 index 00000000..ee0d13c8 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-14.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(+ (1 2 (* 2 5)))\".to_string()))" +--- +Ok( + (+ ("1" "2" (* "2" "5"))), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-15.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-15.snap new file mode 100644 index 00000000..8a87de7a --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-15.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, r#\"foo ; test\"#.to_string()))" +--- +Ok( + foo, +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-16.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-16.snap new file mode 100644 index 00000000..92e2cdff --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-16.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, r#\"(f arg ; test\n arg2)\"#.to_string()))" +--- +Ok( + (f arg arg2), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-17.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-17.snap new file mode 100644 index 00000000..b50aba8b --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-17.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"\\\"h\\\\\\\"i\\\"\".to_string()))" +--- +Ok( + "h"i", +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-2.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-2.snap new file mode 100644 index 00000000..33418b00 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-2.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(12)\".to_string()))" +--- +Ok( + ("12"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-3.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-3.snap new file mode 100644 index 00000000..cc056a00 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-3.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"1.2\".to_string()))" +--- +Ok( + "1.2", +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-4.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-4.snap new file mode 100644 index 00000000..80dc74fb --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-4.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"-1.2\".to_string()))" +--- +Ok( + "-1.2", +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-5.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-5.snap new file mode 100644 index 00000000..ae1ada3d --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-5.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(1 2)\".to_string()))" +--- +Ok( + ("1" "2"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-6.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-6.snap new file mode 100644 index 00000000..a7263887 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-6.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(1 :foo 1)\".to_string()))" +--- +Ok( + ("1" :foo "1"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-7.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-7.snap new file mode 100644 index 00000000..52db9a10 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-7.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(:foo 1)\".to_string()))" +--- +Ok( + (:foo "1"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-8.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-8.snap new file mode 100644 index 00000000..89610bb4 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-8.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(:foo->: 1)\".to_string()))" +--- +Ok( + (:foo->: "1"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test-9.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-9.snap new file mode 100644 index 00000000..87598c23 --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test-9.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"(foo 1)\".to_string()))" +--- +Ok( + (foo "1"), +) diff --git a/crates/yuck/src/parser/snapshots/yuck__parser__test__test.snap b/crates/yuck/src/parser/snapshots/yuck__parser__test__test.snap new file mode 100644 index 00000000..302ce5dc --- /dev/null +++ b/crates/yuck/src/parser/snapshots/yuck__parser__test__test.snap @@ -0,0 +1,8 @@ +--- +source: crates/yuck/src/parser/mod.rs +assertion_line: 68 +expression: "p.parse(0, Lexer::new(0, \"1\".to_string()))" +--- +Ok( + "1", +) From 992ac0b59aaa8d25ba996cc6683ec2a4ee90d16a Mon Sep 17 00:00:00 2001 From: ElKowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:26:49 +0200 Subject: [PATCH 11/14] Add namespace window option (#723) --- CHANGELOG.md | 1 + crates/eww/src/display_backend.rs | 4 ++++ crates/yuck/src/config/backend_window_options.rs | 2 ++ docs/src/configuration.md | 1 + docs/src/eww.md | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f16733..ef91c8fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to eww will be listed here, starting at changes since versio ## [Unreleased] ### Features +- Add `:namespace` window option - Default to building with x11 and wayland support simultaneously - Add `truncate-left` property on `label` widgets (By: kawaki-san) - Add support for safe access (`?.`) in simplexpr (By: oldwomanjosiah) diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index c7d32901..834be571 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -54,6 +54,10 @@ mod platform_wayland { WindowStacking::Overlay => gtk_layer_shell::set_layer(&window, gtk_layer_shell::Layer::Overlay), } + if let Some(namespace) = &window_def.backend_options.wayland.namespace { + gtk_layer_shell::set_namespace(&window, namespace); + } + // Sets the keyboard interactivity gtk_layer_shell::set_keyboard_interactivity(&window, window_def.backend_options.wayland.focusable); diff --git a/crates/yuck/src/config/backend_window_options.rs b/crates/yuck/src/config/backend_window_options.rs index d0691749..d237a200 100644 --- a/crates/yuck/src/config/backend_window_options.rs +++ b/crates/yuck/src/config/backend_window_options.rs @@ -34,6 +34,7 @@ impl BackendWindowOptions { let wayland = WlBackendWindowOptions { exclusive: attrs.primitive_optional("exclusive")?.unwrap_or(false), focusable: attrs.primitive_optional("focusable")?.unwrap_or(false), + namespace: attrs.primitive_optional("namespace")?, }; Ok(Self { x11, wayland }) } @@ -51,6 +52,7 @@ pub struct X11BackendWindowOptions { pub struct WlBackendWindowOptions { pub exclusive: bool, pub focusable: bool, + pub namespace: Option, } /// Window type of an x11 window diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 144d8a63..d7f62c89 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -81,6 +81,7 @@ Depending on if you are using X11 or Wayland, some additional properties exist: | `stacking` | Where the window should appear in the stack. Possible values: `fg`, `bg`, `overlay`, `bottom`. | | `exclusive` | Whether the compositor should reserve space for the window automatically. | | `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. | +| `namespace` | Set the wayland layersurface namespace eww uses | diff --git a/docs/src/eww.md b/docs/src/eww.md index bc23967e..4a25bd4f 100644 --- a/docs/src/eww.md +++ b/docs/src/eww.md @@ -53,7 +53,7 @@ cd eww ``` Then build: ```bash -cargo build --release +cargo build --release --no-default-features --features x11 ``` **NOTE:** When you're on Wayland, build with: From 88cd3a29dc94da45b480ff532767835658455a29 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 26 Mar 2023 12:40:12 +0200 Subject: [PATCH 12/14] Provide better error and docs for duration type --- crates/eww/src/widgets/widget_definitions.rs | 30 ++++++++++---------- crates/simplexpr/src/dynval.rs | 8 +++++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index ecc8f13e..2cdc9071 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -244,7 +244,7 @@ pub(super) fn resolve_range_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Ran prop(min: as_f64) { gtk_widget.adjustment().set_lower(min)}, // @prop max - the maximum value prop(max: as_f64) { gtk_widget.adjustment().set_upper(max)}, - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop onchange - command executed once the value is changes. The placeholder `{}`, used in the command will be replaced by the new value. prop(timeout: as_duration = Duration::from_millis(200), onchange: as_string) { gtk_widget.set_sensitive(true); @@ -285,7 +285,7 @@ fn build_gtk_combo_box_text(bargs: &mut BuilderArgs) -> Result Result { prop(transition: as_string = "crossfade") { gtk_widget.set_transition_type(parse_transition(&transition)?); }, // @prop reveal - sets if the child is revealed or not prop(reveal: as_bool) { gtk_widget.set_reveal_child(reveal); }, - // @prop duration - the duration of the reveal transition + // @prop duration - the duration of the reveal transition. Default: "500ms" prop(duration: as_duration = Duration::from_millis(500)) { gtk_widget.set_transition_duration(duration.as_millis() as u32); }, }); Ok(gtk_widget) @@ -332,7 +332,7 @@ const WIDGET_NAME_CHECKBOX: &str = "checkbox"; fn build_gtk_checkbox(bargs: &mut BuilderArgs) -> Result { let gtk_widget = gtk::CheckButton::new(); def_widget!(bargs, _g, gtk_widget, { - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop onchecked - action (command) to be executed when checked by the user // @prop onunchecked - similar to onchecked but when the widget is unchecked prop(timeout: as_duration = Duration::from_millis(200), onchecked: as_string = "", onunchecked: as_string = "") { @@ -355,7 +355,7 @@ fn build_gtk_color_button(bargs: &mut BuilderArgs) -> Result { prop(use_alpha: as_bool) {gtk_widget.set_use_alpha(use_alpha);}, // @prop onchange - runs the code when the color was selected - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" prop(timeout: as_duration = Duration::from_millis(200), onchange: as_string) { connect_signal_handler!(gtk_widget, gtk_widget.connect_color_set(move |gtk_widget| { run_command(timeout, &onchange, &[gtk_widget.rgba()]); @@ -376,7 +376,7 @@ fn build_gtk_color_chooser(bargs: &mut BuilderArgs) -> Result Result { }, // @prop onchange - Command to run when the text changes. The placeholder `{}` will be replaced by the value - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" prop(timeout: as_duration = Duration::from_millis(200), onchange: as_string) { connect_signal_handler!(gtk_widget, gtk_widget.connect_changed(move |gtk_widget| { run_command(timeout, &onchange, &[gtk_widget.text().to_string()]); })); }, // @prop onaccept - Command to run when the user hits return in the input field. The placeholder `{}` will be replaced by the value - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" prop(timeout: as_duration = Duration::from_millis(200), onaccept: as_string) { connect_signal_handler!(gtk_widget, gtk_widget.connect_activate(move |gtk_widget| { run_command(timeout, &onaccept, &[gtk_widget.text().to_string()]); @@ -475,7 +475,7 @@ fn build_gtk_button(bargs: &mut BuilderArgs) -> Result { def_widget!(bargs, _g, gtk_widget, { prop( - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" timeout: as_duration = Duration::from_millis(200), // @prop onclick - a command that get's run when the button is clicked onclick: as_string = "", @@ -675,7 +675,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { }); def_widget!(bargs, _g, gtk_widget, { - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop onscroll - event to execute when the user scrolls with the mouse over the widget. The placeholder `{}` used in the command will be replaced with either `up` or `down`. prop(timeout: as_duration = Duration::from_millis(200), onscroll: as_string) { gtk_widget.add_events(gdk::EventMask::SCROLL_MASK); @@ -688,7 +688,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { gtk::Inhibit(false) })); }, - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop onhover - event to execute when the user hovers over the widget prop(timeout: as_duration = Duration::from_millis(200), onhover: as_string) { gtk_widget.add_events(gdk::EventMask::ENTER_NOTIFY_MASK); @@ -699,7 +699,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { gtk::Inhibit(false) })); }, - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop onhoverlost - event to execute when the user losts hovers over the widget prop(timeout: as_duration = Duration::from_millis(200), onhoverlost: as_string) { gtk_widget.add_events(gdk::EventMask::LEAVE_NOTIFY_MASK); @@ -735,7 +735,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { gtk::Inhibit(false) })); }, - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" // @prop ondropped - Command to execute when something is dropped on top of this element. The placeholder `{}` used in the command will be replaced with the uri to the dropped thing. prop(timeout: as_duration = Duration::from_millis(200), ondropped: as_string) { gtk_widget.drag_dest_set( @@ -785,7 +785,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { // TODO the fact that we have the same code here as for button is ugly, as we want to keep consistency prop( - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" timeout: as_duration = Duration::from_millis(200), // @prop onclick - a command that get's run when the button is clicked onclick: as_string = "", @@ -948,7 +948,7 @@ fn build_gtk_calendar(bargs: &mut BuilderArgs) -> Result { // @prop show-week-numbers - show week numbers prop(show_week_numbers: as_bool) { gtk_widget.set_show_week_numbers(show_week_numbers) }, // @prop onclick - command to run when the user selects a date. The `{0}` placeholder will be replaced by the selected day, `{1}` will be replaced by the month, and `{2}` by the year. - // @prop timeout - timeout of the command + // @prop timeout - timeout of the command. Default: "200ms" prop(timeout: as_duration = Duration::from_millis(200), onclick: as_string) { connect_signal_handler!(gtk_widget, gtk_widget.connect_day_selected(move |w| { run_command( diff --git a/crates/simplexpr/src/dynval.rs b/crates/simplexpr/src/dynval.rs index c35b9a91..ebfe672a 100644 --- a/crates/simplexpr/src/dynval.rs +++ b/crates/simplexpr/src/dynval.rs @@ -13,6 +13,10 @@ pub struct ConversionError { pub source: Option>, } +#[derive(Debug, thiserror::Error)] +#[error("Failed to parse duration. Must be a number of milliseconds, or a string like \"150ms\"")] +pub struct DurationParseError; + impl ConversionError { pub fn new(value: DynVal, target_type: &'static str, source: impl std::error::Error + 'static + Sync + Send) -> Self { ConversionError { value, target_type, source: Some(Box::new(source)) } @@ -188,8 +192,10 @@ impl DynVal { } else if s.ends_with('h') { let hours = s.trim_end_matches('h').parse::().map_err(|e| ConversionError::new(self.clone(), "number", e))?; Ok(Duration::from_secs(f64::floor(hours * 60f64 * 60f64) as u64)) + } else if let Ok(millis) = s.parse() { + Ok(Duration::from_millis(millis)) } else { - Err(ConversionError { value: self.clone(), target_type: "duration", source: None }) + Err(ConversionError { value: self.clone(), target_type: "duration", source: Some(Box::new(DurationParseError)) }) } } From e76206817de1cb86ec431dcff7d4b04c8b7d36fc Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 26 Mar 2023 13:10:35 +0200 Subject: [PATCH 13/14] Add timeout log to run_command --- crates/eww/src/widgets/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/eww/src/widgets/mod.rs b/crates/eww/src/widgets/mod.rs index d079169d..e5e25b7c 100644 --- a/crates/eww/src/widgets/mod.rs +++ b/crates/eww/src/widgets/mod.rs @@ -20,7 +20,7 @@ where std::thread::Builder::new() .name("command-execution-thread".to_string()) .spawn(move || { - log::debug!("Running command from widget: {}", cmd); + log::debug!("Running command from widget [timeout: {}ms]: {}", timeout.as_millis(), cmd); let child = Command::new("/bin/sh").arg("-c").arg(&cmd).spawn(); match child { Ok(mut child) => match child.wait_timeout(timeout) { From 850f18567cbefea3ffc78cdeed978ab2bbd4226e Mon Sep 17 00:00:00 2001 From: VuiMuich Date: Mon, 27 Mar 2023 21:33:18 +0200 Subject: [PATCH 14/14] missed Cago.lock, when finishing merge --- Cargo.lock | 3092 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3092 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..ea223f19 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3092 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +dependencies = [ + "const-random", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + +[[package]] +name = "async-broadcast" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" +dependencies = [ + "event-listener", + "futures-core", + "parking_lot", +] + +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cached" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5877db5d1af7fae60d06b5db9430b68056a69b3582a0be8e3691e87654aeb6" +dependencies = [ + "async-trait", + "async_once", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "lazy_static", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10ca87c81aaa3a949dbbe2b5e6c2c45dbc94ba4897e45ea31ff9ec5087be3dc" +dependencies = [ + "cached_proc_macro_types", + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-expr" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35b255461940a32985c627ce82900867c61db1659764d3675ea81963f72a4c6" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "chumsky" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4" +dependencies = [ + "ahash 0.3.8", +] + +[[package]] +name = "clap" +version = "4.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" +dependencies = [ + "bitflags", + "clap_derive", + "clap_lex", + "is-terminal", + "once_cell", + "strsim", + "termcolor", +] + +[[package]] +name = "clap_derive" +version = "4.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "clap_lex" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "codemap" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e769b5c8c8283982a987c6e948e540254f1058d5a74b8794914d4ef5fc2a24" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "concurrent-queue" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "console" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys 0.42.0", +] + +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "crossbeam-channel" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset 0.8.0", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.10", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dyn-clone" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + +[[package]] +name = "enumflags2" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "eww" +version = "0.4.0" +dependencies = [ + "anyhow", + "bincode", + "cairo-rs", + "cairo-sys-rs", + "clap", + "codespan-reporting", + "derive_more", + "eww_shared_util", + "extend", + "futures-core", + "futures-util", + "gdk", + "gdk-pixbuf", + "gdkx11", + "glib", + "grass", + "gtk", + "gtk-layer-shell", + "itertools", + "libc", + "log", + "maplit", + "nix 0.26.2", + "notify", + "once_cell", + "pretty_env_logger", + "regex", + "serde", + "serde_json", + "simple-signal", + "simplexpr", + "stray", + "sysinfo", + "tokio", + "tokio-util", + "unescape", + "wait-timeout", + "x11rb", + "yuck", +] + +[[package]] +name = "eww_shared_util" +version = "0.1.0" +dependencies = [ + "derive_more", + "ref-cast", + "serde", +] + +[[package]] +name = "extend" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "field-offset" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf3a800ff6e860c863ca6d4b16fd999db8b752819c1606884047b73e468535" +dependencies = [ + "memoffset 0.8.0", + "rustc_version", +] + +[[package]] +name = "filetime" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.45.0", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + +[[package]] +name = "futures" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" + +[[package]] +name = "futures-executor" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-sink" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" + +[[package]] +name = "futures-task" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" + +[[package]] +name = "futures-util" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +dependencies = [ + "futures-core", + "futures-macro", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gdkx11" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e62de46d9503381e4ab0b7d7a99b1fda53bd312e19ddc4195ffbe1d76f336cf9" +dependencies = [ + "gdk", + "gdkx11-sys", + "gio", + "glib", + "libc", + "x11", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps", + "x11", +] + +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "grass" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bfa010e6f9fe2f40727b4aedf67aa54e0439c57f855458efb1f43d730a028f" +dependencies = [ + "grass_compiler", +] + +[[package]] +name = "grass_compiler" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe05b48c9c96f5ec64ad9af20c9016a8d57ec8b979e0f6dbdd9747f32b16df3" +dependencies = [ + "codemap", + "indexmap", + "lasso", + "once_cell", + "phf", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-layer-shell" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4316ff523ae445bd6efaf253f217598dd074619fe67b9199b5b0cd5ff99144da" +dependencies = [ + "bitflags", + "gdk", + "glib", + "glib-sys", + "gtk", + "gtk-layer-shell-sys", + "libc", +] + +[[package]] +name = "gtk-layer-shell-sys" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff60230d690445577655416055dbd279d05631b03ab07f935e39f5fe81084c0a" +dependencies = [ + "gdk-sys", + "glib-sys", + "gtk-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "insta" +version = "1.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", + "yaml-rust", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "is-terminal" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jaq-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1452b4acc3a7f49bd8dd516e90ed0c4f688bada805857275f85957aca2c0e7eb" +dependencies = [ + "ahash 0.3.8", + "dyn-clone", + "indexmap", + "itertools", + "jaq-parse", + "log", + "once_cell", + "serde_json", +] + +[[package]] +name = "jaq-parse" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2130a59d64a5476f6feeb6b7e48cbe52ef05d8bc1b9174f50baa93e49052fd" +dependencies = [ + "chumsky", + "serde", +] + +[[package]] +name = "jaq-std" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ab73d2079279e784a52dbbf5f3a5e0d792c89b41fd2c857de87cf698a4e24a" +dependencies = [ + "bincode", + "jaq-parse", +] + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kqueue" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "lalrpop" +version = "0.19.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34313ec00c2eb5c3c87ca6732ea02dcf3af99c3ff7a8fb622ffb99c9d860a87" +dependencies = [ + "ascii-canvas", + "bit-set", + "diff", + "ena", + "is-terminal", + "itertools", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c1f7869c94d214466c5fd432dfed12c379fd87786768d36455892d46b18edd" +dependencies = [ + "regex", +] + +[[package]] +name = "lasso" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb7b21a526375c5ca55f1a6dfd4e1fad9fa4edd750f530252a718a44b2608f0" +dependencies = [ + "hashbrown 0.11.2", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nix" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset 0.7.1", + "pin-utils", + "static_assertions", +] + +[[package]] +name = "notify" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +dependencies = [ + "bitflags", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "mio", + "walkdir", + "windows-sys 0.42.0", +] + +[[package]] +name = "ntapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc51db7b362b205941f71232e56c625156eb9a929f8cf74a428fd5bc094a4afc" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "ordered-stream" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "output_vt100" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" +dependencies = [ + "winapi", +] + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "petgraph" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_macros", + "phf_shared", + "proc-macro-hack", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "pretty_assertions" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +dependencies = [ + "ctor", + "diff", + "output_vt100", + "yansi", +] + +[[package]] +name = "pretty_env_logger" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" +dependencies = [ + "env_logger", + "log", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.36.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.45.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "serde_json" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + +[[package]] +name = "simple-signal" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53f7da44adcc42667d57483bd93f81295f27d66897804b757573b61b6f13288b" +dependencies = [ + "lazy_static", + "libc", +] + +[[package]] +name = "simplexpr" +version = "0.1.0" +dependencies = [ + "cached", + "eww_shared_util", + "insta", + "itertools", + "jaq-core", + "jaq-std", + "lalrpop", + "lalrpop-util", + "once_cell", + "regex", + "serde", + "serde_json", + "static_assertions", + "strsim", + "strum", + "thiserror", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stray" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358c1637c5ba4ccf1b6a0698de81454db644866cc426d1abc6d357b2efede511" +dependencies = [ + "anyhow", + "byteorder", + "chrono", + "log", + "serde", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "zbus", +] + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sysinfo" +version = "0.28.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2f3ca6693feb29a89724516f016488e9aafc7f37264f898593ee4b942f31b" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "rayon", + "winapi", +] + +[[package]] +name = "system-deps" +version = "6.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555fc8147af6256f3931a36bb83ad0023240ce9cf2b319dec8236fd1f220b05f" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "tempfile" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.42.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.10", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tokio" +version = "1.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.45.0", +] + +[[package]] +name = "tokio-macros" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tokio-stream" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "uds_windows" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +dependencies = [ + "tempfile", + "winapi", +] + +[[package]] +name = "unescape" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "winnow" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +dependencies = [ + "memchr", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11rb" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +dependencies = [ + "gethostname", + "nix 0.25.1", + "winapi", + "winapi-wsapoll", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" +dependencies = [ + "nix 0.25.1", +] + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "yuck" +version = "0.1.0" +dependencies = [ + "anyhow", + "codespan-reporting", + "derive_more", + "eww_shared_util", + "insta", + "itertools", + "lalrpop", + "lalrpop-util", + "maplit", + "once_cell", + "pretty_assertions", + "regex", + "serde", + "simplexpr", + "smart-default", + "static_assertions", + "strum", + "thiserror", +] + +[[package]] +name = "zbus" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" +dependencies = [ + "async-broadcast", + "async-channel", + "async-executor", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "dirs", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "lazy_static", + "nix 0.23.2", + "once_cell", + "ordered-stream", + "rand", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "tokio", + "tracing", + "uds_windows", + "winapi", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", +] + +[[package]] +name = "zbus_names" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe4914a985446d6fd287019b5fceccce38303d71407d9e6e711d44954a05d8" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34c20260af4b28b3275d6676c7e2a6be0d4332e8e0aba4616d34007fd84e462a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b22993dbc4d128a17a3b6c92f1c63872dd67198537ee728d8b5d7c40640a8b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +]