From b813adec79f7595320b7df8958392dbaab2f5b88 Mon Sep 17 00:00:00 2001 From: June <61218022+itsjunetime@users.noreply.github.com> Date: Sun, 21 Apr 2024 13:55:03 -0600 Subject: [PATCH 01/88] Update ahash to fix yanked version (#1079) --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8baf72e..a3f5942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -1477,7 +1477,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] From 8397744f403c87ab39523b4bf9e0216ad444f1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sun, 21 Apr 2024 20:04:50 +0000 Subject: [PATCH 02/88] fix: bump cargo version (#1080) --- Cargo.lock | 2 +- crates/eww/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3f5942..5d94bd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -920,7 +920,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "eww" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "bincode", diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index a5b62d9..f916499 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eww" -version = "0.5.0" +version = "0.6.0" authors = ["elkowar <5300871+elkowar@users.noreply.github.com>"] description = "Widgets for everyone!" license = "MIT" From acf57a8396d19cd160786223b04b950509e46a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sun, 21 Apr 2024 20:09:14 +0000 Subject: [PATCH 03/88] fix: refactor and fix flake (#1038) * fix: refactor flake * chore: update flake.lock * chore: update changelog * chore: update flake.lock * chore: update changelog --- CHANGELOG.md | 3 ++ flake.lock | 12 ++++---- flake.nix | 77 +++++++++++++++++++++++----------------------------- 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index addfcae..382ee6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to eww will be listed here, starting at changes since versio ## Unreleased +### Fixes +- Fix and refactor nix flake (By: w-lfchen) + ## [0.6.0] (21.04.2024) ### Fixes diff --git a/flake.lock b/flake.lock index 78c3819..d34fa0e 100644 --- a/flake.lock +++ b/flake.lock @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708407374, - "narHash": "sha256-EECzarm+uqnNDCwaGg/ppXCO11qibZ1iigORShkkDf0=", + "lastModified": 1709038661, + "narHash": "sha256-Ys611iT6pChGv954aa4f8oKoDKJG3IXjJjPhnj6uaLY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f33dd27a47ebdf11dc8a5eb05e7c8fbdaf89e73f", + "rev": "8520c158aee718c6e87b56881105fc4223c3c723", "type": "github" }, "original": { @@ -65,11 +65,11 @@ ] }, "locked": { - "lastModified": 1708395022, - "narHash": "sha256-pxHZbfDsLAAcyWz+snbudxhQPlAnK2nWGAqRx11veac=", + "lastModified": 1708999822, + "narHash": "sha256-X55GxqI3oDEfqy38Pt7xyypYNly4bkd/RajFE+FGn+A=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b4ae18c03af976549a0b6e396b2b5be56d275f8b", + "rev": "1a618c62479a6896ac497aaa0d969c6bd8e24911", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ef574e1..e631113 100644 --- a/flake.nix +++ b/flake.nix @@ -13,46 +13,49 @@ outputs = { self, nixpkgs, rust-overlay, flake-compat }: let - pkgsFor = system: - import nixpkgs { - inherit system; - overlays = [ self.overlays.default rust-overlay.overlays.default ]; - }; + overlays = [ (import rust-overlay) self.overlays.default ]; + pkgsFor = system: import nixpkgs { inherit system overlays; }; targetSystems = [ "aarch64-linux" "x86_64-linux" ]; mkRustToolchain = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; in { - overlays.default = final: prev: - let - rust = mkRustToolchain final; + overlays.default = final: prev: { + inherit (self.packages.${prev.system}) eww eww-wayland; + }; - rustPlatform = prev.makeRustPlatform { + packages = nixpkgs.lib.genAttrs targetSystems (system: + let + pkgs = pkgsFor system; + rust = mkRustToolchain pkgs; + rustPlatform = pkgs.makeRustPlatform { cargo = rust; rustc = rust; }; - in { - eww = (prev.eww.override { inherit rustPlatform; }).overrideAttrs - (old: { - version = self.rev or "dirty"; - src = builtins.path { - name = "eww"; - path = prev.lib.cleanSource ./.; - }; - cargoDeps = - rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; - patches = [ ]; - # remove this when nixpkgs includes it - buildInputs = old.buildInputs ++ [ final.libdbusmenu-gtk3 ]; - }); + version = (builtins.fromTOML + (builtins.readFile ./crates/eww/Cargo.toml)).package.version; + in rec { + eww = rustPlatform.buildRustPackage { + version = "${version}-dirty"; + pname = "eww"; - eww-wayland = final.eww; - }; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + cargoBuildFlags = [ "--bin" "eww" ]; - packages = nixpkgs.lib.genAttrs targetSystems (system: - let pkgs = pkgsFor system; - in (self.overlays.default pkgs pkgs) // { - default = self.packages.${system}.eww; + nativeBuildInputs = with pkgs; [ pkg-config wrapGAppsHook ]; + buildInputs = with pkgs; [ + gtk3 + librsvg + gtk-layer-shell + libdbusmenu-gtk3 + ]; + }; + + eww-wayland = nixpkgs.lib.warn + "`eww-wayland` is deprecated due to eww building with both X11 and wayland support by default. Use `eww` instead." + eww; + default = eww; }); devShells = nixpkgs.lib.genAttrs targetSystems (system: @@ -61,20 +64,8 @@ rust = mkRustToolchain pkgs; in { default = pkgs.mkShell { - packages = with pkgs; [ - rust - rust-analyzer-unwrapped - gcc - glib - gdk-pixbuf - librsvg - libdbusmenu-gtk3 - gtk3 - gtk-layer-shell - pkg-config - deno - mdbook - ]; + inputsFrom = [ self.packages.${system}.eww ]; + packages = with pkgs; [ deno mdbook ]; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; }; From 2c8811512460ce6cc75e021d8d081813647699dc Mon Sep 17 00:00:00 2001 From: Rayzeq Date: Fri, 26 Apr 2024 08:59:23 +0200 Subject: [PATCH 04/88] Fix string truncation (#1084) * remove useless check * add `truncate` property * add to CHANGELOG.md --- CHANGELOG.md | 3 +++ crates/eww/src/widgets/widget_definitions.rs | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 382ee6b..cb24c5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ All notable changes to eww will be listed here, starting at changes since versio ### Fixes - Fix and refactor nix flake (By: w-lfchen) +### Features +- Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). + ## [0.6.0] (21.04.2024) ### Fixes diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 696a5bf..d5d97fb 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -894,11 +894,12 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { def_widget!(bargs, _g, gtk_widget, { // @prop text - the text to display + // @prop truncate - whether to truncate text (or pango markup). If `show-truncated` is `false`, or if `limit-width` has a value, this property has no effect and truncation is enabled. // @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. Disabling it will also disable dynamic truncation (the labels won't be truncated more than `limit-width`, even if there is not enough space for them), and will completly disable truncation on pango markup. // @prop unindent - whether to remove leading spaces - prop(text: as_string, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true, unindent: as_bool = true) { + prop(text: as_string, truncate: as_bool = false, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true, unindent: as_bool = true) { let text = if show_truncated { // gtk does weird thing if we set max_width_chars to i32::MAX if limit_width == i32::MAX { @@ -906,10 +907,14 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { } else { gtk_widget.set_max_width_chars(limit_width); } - if truncate_left { - gtk_widget.set_ellipsize(pango::EllipsizeMode::Start); + if truncate || limit_width != i32::MAX { + if truncate_left { + gtk_widget.set_ellipsize(pango::EllipsizeMode::Start); + } else { + gtk_widget.set_ellipsize(pango::EllipsizeMode::End); + } } else { - gtk_widget.set_ellipsize(pango::EllipsizeMode::End); + gtk_widget.set_ellipsize(pango::EllipsizeMode::None); } text @@ -918,7 +923,7 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { let limit_width = limit_width as usize; let char_count = text.chars().count(); - if char_count > limit_width && !show_truncated { + if char_count > limit_width { if truncate_left { text.chars().skip(char_count - limit_width).collect() } else { @@ -934,11 +939,12 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { gtk_widget.set_text(&text); }, // @prop markup - Pango markup to display + // @prop truncate - whether to truncate text (or pango markup). If `show-truncated` is `false`, or if `limit-width` has a value, this property has no effect and truncation is enabled. // @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 truncatedd. Disabling it will also disable dynamic truncation (the labels won't be truncated more than `limit-width`, even if there is not enough space for them), and will completly disable truncation on pango markup. - prop(markup: as_string, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true) { - if show_truncated { + prop(markup: as_string, truncate: as_bool = false, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true) { + if (truncate || limit_width != i32::MAX) && show_truncated { // gtk does weird thing if we set max_width_chars to i32::MAX if limit_width == i32::MAX { gtk_widget.set_max_width_chars(-1); From a4da192d629cc43ef3da984b6f9197579a22afe1 Mon Sep 17 00:00:00 2001 From: Jonathan <94441036+zeapoz@users.noreply.github.com> Date: Sun, 5 May 2024 12:14:44 +0200 Subject: [PATCH 05/88] systray: add `:hover` attribute to tray items (#1091) * systray: add `:hover` attribute to tray items * doc: add entry to changelog --- CHANGELOG.md | 1 + crates/eww/src/widgets/systray.rs | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb24c5a..0f5a6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio ### Features - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). +- Add support for `:hover` css selectors for tray items (By: zeapoz) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/systray.rs b/crates/eww/src/widgets/systray.rs index feab47e..cf06907 100644 --- a/crates/eww/src/widgets/systray.rs +++ b/crates/eww/src/widgets/systray.rs @@ -1,5 +1,6 @@ use crate::widgets::window::Window; use futures::StreamExt; +use gdk::NotifyType; use gtk::{cairo::Surface, gdk::ffi::gdk_cairo_surface_create_from_pixbuf, prelude::*}; use notifier_host; use std::{cell::RefCell, future::Future, rc::Rc}; @@ -130,11 +131,27 @@ impl Drop for Item { impl Item { fn new(id: String, item: notifier_host::Item, icon_size: tokio::sync::watch::Receiver) -> Self { - let widget = gtk::EventBox::new(); - let out_widget = widget.clone(); // copy so we can return it + let gtk_widget = gtk::EventBox::new(); + + // Support :hover selector + gtk_widget.connect_enter_notify_event(|gtk_widget, evt| { + if evt.detail() != NotifyType::Inferior { + gtk_widget.clone().set_state_flags(gtk::StateFlags::PRELIGHT, false); + } + gtk::Inhibit(false) + }); + + gtk_widget.connect_leave_notify_event(|gtk_widget, evt| { + if evt.detail() != NotifyType::Inferior { + gtk_widget.clone().unset_state_flags(gtk::StateFlags::PRELIGHT); + } + gtk::Inhibit(false) + }); + + let out_widget = gtk_widget.clone(); // copy so we can return it let task = glib::MainContext::default().spawn_local(async move { - if let Err(e) = Item::maintain(widget.clone(), item, icon_size).await { + if let Err(e) = Item::maintain(gtk_widget.clone(), item, icon_size).await { log::error!("error for systray item {}: {}", id, e); } }); From 3dca22deb13ba75d417eebf2d88e2b7dc21ed65a Mon Sep 17 00:00:00 2001 From: shouya <526598+shouya@users.noreply.github.com> Date: Mon, 6 May 2024 21:05:32 +0900 Subject: [PATCH 06/88] remove sysinfo/linux-netdevs feature (#1096) --- crates/eww/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index f916499..40c709b 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -61,7 +61,7 @@ regex.workspace = true serde_json.workspace = true serde = {workspace = true, features = ["derive"]} simple-signal.workspace = true -sysinfo = { workspace = true, features = ["linux-netdevs"] } +sysinfo = { workspace = true } tokio-util.workspace = true tokio = { workspace = true, features = ["full"] } unescape.workspace = true From d1fde927d2799211f791e7ea01cffb667c4f2b60 Mon Sep 17 00:00:00 2001 From: Vyacheslav Ananev <57404657+vnva@users.noreply.github.com> Date: Mon, 6 May 2024 19:05:57 +0700 Subject: [PATCH 07/88] systray: fix remove items (#1098) * systray: fix remove item * docs: add entry to CHANGELOG.md --- CHANGELOG.md | 1 + crates/eww/src/widgets/systray.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f5a6f1..32e2aa8 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 ### Fixes - Fix and refactor nix flake (By: w-lfchen) +- Fix remove items from systray (By: vnva) ### Features - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). diff --git a/crates/eww/src/widgets/systray.rs b/crates/eww/src/widgets/systray.rs index cf06907..240a97f 100644 --- a/crates/eww/src/widgets/systray.rs +++ b/crates/eww/src/widgets/systray.rs @@ -106,6 +106,7 @@ impl notifier_host::Host for Tray { fn remove_item(&mut self, id: &str) { if let Some(item) = self.items.get(id) { self.container.remove(&item.widget); + self.items.remove(id); } else { log::warn!("Tried to remove nonexistent item {:?} from systray", id); } From 4d55e9ad63d1fae887726dffcd25a32def23d34f Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:57:48 +0300 Subject: [PATCH 08/88] Add `min` and `max` simplexpr functions (#1123) * Add 'min' and 'max' function calls to simplexpr * Add changelog entry for 'min' and 'max' simplexpr functions --- CHANGELOG.md | 1 + crates/simplexpr/src/eval.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e2aa8..3530092 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 ### Features - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) +- Add `min` and `max` function calls to simplexpr (By: ovalkonia) ## [0.6.0] (21.04.2024) diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index cad180d..f426b79 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -328,6 +328,22 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, + "min" => match args.as_slice() { + [a, b] => { + let a = a.as_f64()?; + let b = b.as_f64()?; + Ok(DynVal::from(f64::min(a, b))) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, + "max" => match args.as_slice() { + [a, b] => { + let a = a.as_f64()?; + let b = b.as_f64()?; + Ok(DynVal::from(f64::max(a, b))) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, "sin" => match args.as_slice() { [num] => { let num = num.as_f64()?; From 696135a6bba3d083d326eda1f81471c636987afb Mon Sep 17 00:00:00 2001 From: elkowar Date: Wed, 21 Aug 2024 18:33:26 +0200 Subject: [PATCH 09/88] Set GDK_BACKEND env var on wayland --- crates/eww/src/display_backend.rs | 4 ++++ crates/eww/src/main.rs | 6 +++++- crates/eww/src/server.rs | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index d416166..16cd866 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -8,6 +8,7 @@ pub use platform_x11::{set_xprops, X11Backend}; pub trait DisplayBackend: Send + Sync + 'static { const IS_X11: bool; + const IS_WAYLAND: bool; fn initialize_window(window_init: &WindowInitiator, monitor: gdk::Rectangle, x: i32, y: i32) -> Option; } @@ -16,6 +17,7 @@ pub struct NoBackend; impl DisplayBackend for NoBackend { const IS_X11: bool = false; + const IS_WAYLAND: bool = false; fn initialize_window(_window_init: &WindowInitiator, _monitor: gdk::Rectangle, x: i32, y: i32) -> Option { Some(Window::new(gtk::WindowType::Toplevel, x, y)) @@ -34,6 +36,7 @@ mod platform_wayland { impl DisplayBackend for WaylandBackend { const IS_X11: bool = false; + const IS_WAYLAND: bool = true; fn initialize_window(window_init: &WindowInitiator, monitor: gdk::Rectangle, x: i32, y: i32) -> Option { let window = Window::new(gtk::WindowType::Toplevel, x, y); @@ -134,6 +137,7 @@ mod platform_x11 { pub struct X11Backend; impl DisplayBackend for X11Backend { const IS_X11: bool = true; + const IS_WAYLAND: bool = false; fn initialize_window(window_init: &WindowInitiator, _monitor: gdk::Rectangle, x: i32, y: i32) -> Option { let window_type = diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs index 0db2b97..ad46da9 100644 --- a/crates/eww/src/main.rs +++ b/crates/eww/src/main.rs @@ -54,11 +54,15 @@ fn main() { } #[allow(unused)] - let use_wayland = opts.force_wayland || detect_wayland(); + let detected_wayland = detect_wayland(); + #[allow(unused)] + let use_wayland = opts.force_wayland || detected_wayland; #[cfg(all(feature = "wayland", feature = "x11"))] let result = if use_wayland { + log::info!("Running on wayland. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); run(opts, eww_binary_name, display_backend::WaylandBackend) } else { + log::info!("Running on X11. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); run(opts, eww_binary_name, display_backend::X11Backend) }; diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 50b24b2..6c5a9d9 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -68,6 +68,9 @@ pub fn initialize_server( } }); + if B::IS_WAYLAND { + std::env::set_var("GDK_BACKEND", "wayland") + } gtk::init()?; log::debug!("Initializing script var handler"); From bd824fcbfd152ad7163228434853e9e4edd3028b Mon Sep 17 00:00:00 2001 From: carschandler <92899389+carschandler@users.noreply.github.com> Date: Thu, 8 Aug 2024 21:27:30 -0500 Subject: [PATCH 10/88] Typo in configuration.md --- docs/src/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/configuration.md b/docs/src/configuration.md index c5fb244..67acc59 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -206,7 +206,7 @@ This may be the most commonly used type of variable. They are useful to access any quickly retrieved value repeatedly, and thus are the perfect choice for showing your time, date, as well as other bits of information such as pending package updates, weather, and battery level. -You can also specify an initial-value. This should prevent eww from waiting for the result of a give command during startup, thus +You can also specify an initial-value. This should prevent eww from waiting for the result of a given command during startup, thus making the startup time faster. **Listening variables (`deflisten`)** From 845773a44bbf9c9e92200db55dbb699eaf8759c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:56:06 +0200 Subject: [PATCH 11/88] chore: update flake.lock --- flake.lock | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index d34fa0e..2ef88d9 100644 --- a/flake.lock +++ b/flake.lock @@ -16,31 +16,13 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1709038661, - "narHash": "sha256-Ys611iT6pChGv954aa4f8oKoDKJG3IXjJjPhnj6uaLY=", + "lastModified": 1722141560, + "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8520c158aee718c6e87b56881105fc4223c3c723", + "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", "type": "github" }, "original": { @@ -59,17 +41,16 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1708999822, - "narHash": "sha256-X55GxqI3oDEfqy38Pt7xyypYNly4bkd/RajFE+FGn+A=", + "lastModified": 1722305989, + "narHash": "sha256-ljiuTGSFuEtudqFqp/5Wr1OuEsVCjur/F2CmlNujSjc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1a618c62479a6896ac497aaa0d969c6bd8e24911", + "rev": "38c2f156fca1868c8be7195ddac150522752f6ab", "type": "github" }, "original": { @@ -77,21 +58,6 @@ "repo": "rust-overlay", "type": "github" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", From 0808e78db2838d471ee7f874d0cb721ad7d80de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:56:36 +0200 Subject: [PATCH 12/88] chore: update toolchain to 1.80.0 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6343bc4..1a17e1d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.76.0" +channel = "1.80.0" components = [ "rust-src" ] profile = "default" From 3b6f868ea6c1cffb72e042b4e34b89fccff8bdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 31 Jul 2024 01:02:27 +0200 Subject: [PATCH 13/88] chore: update gtk and related dependencies to 0.18 co-authored-by: Johan Geluk --- Cargo.lock | 684 ++++++++++-------- crates/eww/Cargo.toml | 17 +- crates/eww/src/app.rs | 1 + crates/eww/src/display_backend.rs | 39 +- crates/eww/src/server.rs | 4 +- crates/eww/src/widgets/build_widget.rs | 2 +- .../eww/src/widgets/circular_progressbar.rs | 9 +- crates/eww/src/widgets/graph.rs | 9 +- crates/eww/src/widgets/systray.rs | 10 +- crates/eww/src/widgets/transform.rs | 7 +- crates/eww/src/widgets/widget_definitions.rs | 29 +- crates/eww/src/widgets/window.rs | 3 +- crates/notifier_host/Cargo.toml | 3 +- crates/notifier_host/src/icon.rs | 2 +- crates/notifier_host/src/item.rs | 4 +- 15 files changed, 454 insertions(+), 369 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d94bd4..bfa5ebe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ - "event-listener", + "event-listener 2.5.3", "futures-core", ] @@ -151,7 +151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] @@ -161,97 +161,143 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.23", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.0.0", + "parking", + "polling 3.7.2", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-process" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "async-io", - "async-lock", - "autocfg", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", "blocking", "cfg-if", - "event-listener", - "futures-lite", - "rustix 0.37.23", - "signal-hook", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", +] + +[[package]] +name = "async-signal" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" +dependencies = [ + "async-io 2.3.3", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", ] [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] name = "atk" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba16453d10c712284061a05f6510f75abeb92b56ba88dfeb48c74775020cc22" +checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" dependencies = [ "atk-sys", - "bitflags 1.3.2", "glib", "libc", ] [[package]] name = "atk-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf0a7ca572fbd5762fd8f8cd65a581e06767bc1234913fe1f43e370cff6e90" +checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -339,11 +385,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ "async-channel", - "async-lock", + "async-lock 2.8.0", "async-task", "atomic-waker", "fastrand 1.9.0", - "futures-lite", + "futures-lite 1.13.0", "log", ] @@ -355,9 +401,9 @@ checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -400,11 +446,11 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cairo-rs" -version = "0.17.10" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3603c4028a5e368d09b51c8b624b9a46edcd7c3778284077a6125af73c9f0a" +checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cairo-sys-rs", "glib", "libc", @@ -414,13 +460,13 @@ dependencies = [ [[package]] name = "cairo-sys-rs" -version = "0.17.10" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691d0c66b1fb4881be80a760cb8fe76ea97218312f9dfe2c9cc0f496ca279cb1" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -434,9 +480,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.4" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", @@ -531,10 +577,10 @@ version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -567,9 +613,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -721,7 +767,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -751,7 +797,7 @@ dependencies = [ "gobject-sys", "gtk-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -853,9 +899,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -863,13 +909,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -893,23 +939,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -918,14 +953,44 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + [[package]] name = "eww" version = "0.6.0" dependencies = [ "anyhow", "bincode", - "cairo-rs", - "cairo-sys-rs", "chrono", "clap", "clap_complete", @@ -934,11 +999,7 @@ dependencies = [ "eww_shared_util", "extend", "futures", - "gdk", - "gdk-pixbuf", "gdkx11", - "glib", - "glib-macros", "grass", "gtk", "gtk-layer-shell", @@ -951,7 +1012,6 @@ dependencies = [ "notify", "once_cell", "ordered-stream", - "pango", "pretty_env_logger", "regex", "serde", @@ -985,7 +1045,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -1063,9 +1123,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1073,9 +1133,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" @@ -1090,9 +1150,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1110,33 +1170,43 @@ dependencies = [ ] [[package]] -name = "futures-macro" -version = "0.3.28" +name = "futures-lite" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1152,11 +1222,10 @@ dependencies = [ [[package]] name = "gdk" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1df5ea52cccd7e3a0897338b5564968274b52f5fd12601e0afa44f454c74d3" +checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" dependencies = [ - "bitflags 1.3.2", "cairo-rs", "gdk-pixbuf", "gdk-sys", @@ -1168,11 +1237,10 @@ dependencies = [ [[package]] name = "gdk-pixbuf" -version = "0.17.10" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695d6bc846438c5708b07007537b9274d883373dd30858ca881d7d71b5540717" +checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ - "bitflags 1.3.2", "gdk-pixbuf-sys", "gio", "glib", @@ -1182,22 +1250,22 @@ dependencies = [ [[package]] name = "gdk-pixbuf-sys" -version = "0.17.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9285ec3c113c66d7d0ab5676599176f1f42f4944ca1b581852215bf5694870cb" +checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ "gio-sys", "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] name = "gdk-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2152de9d38bc67a17b3fe49dc0823af5bf874df59ea088c5f28f31cf103de703" +checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", @@ -1207,14 +1275,14 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 6.1.1", ] [[package]] name = "gdkx11" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9efc60ffeede8e3816d1e4ca54b62107c31b6560f967cd84583c8b23acccf" +checksum = "db2ea8a4909d530f79921290389cbd7c34cb9d623bfe970eaae65ca5f9cd9cce" dependencies = [ "gdk", "gdkx11-sys", @@ -1226,14 +1294,14 @@ dependencies = [ [[package]] name = "gdkx11-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aaa174c09165bb416717bf5cf3132a3dc617a069b09000ac0eae1b921a00740" +checksum = "fee8f00f4ee46cad2939b8990f5c70c94ff882c3028f3cc5abf950fa4ab53043" dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps", + "system-deps 6.1.1", "x11", ] @@ -1249,12 +1317,12 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.2.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "winapi", + "windows-targets 0.48.2", ] [[package]] @@ -1276,11 +1344,10 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gio" -version = "0.17.10" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6973e92937cf98689b6a054a9e56c657ed4ff76de925e36fc331a15f0c5d30a" +checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" dependencies = [ - "bitflags 1.3.2", "futures-channel", "futures-core", "futures-io", @@ -1296,24 +1363,24 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.17.10" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccf87c30a12c469b6d958950f6a9c09f2be20b7773f7e70d20b867fdf2628c3" +checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.1.1", "winapi", ] [[package]] name = "glib" -version = "0.17.10" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fad45ba8d4d2cea612b432717e834f48031cd8853c8aaf43b2c79fec8d144b" +checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "futures-channel", "futures-core", "futures-executor", @@ -1332,38 +1399,37 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.17.10" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca5c79337338391f1ab8058d6698125034ce8ef31b72a442437fa6c8580de26" +checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ - "anyhow", - "heck", - "proc-macro-crate", + "heck 0.4.1", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] name = "glib-sys" -version = "0.17.10" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d80aa6ea7bba0baac79222204aa786a6293078c210abe69ef1336911d4bdc4f0" +checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] name = "gobject-sys" -version = "0.17.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd34c3317740a6358ec04572c1bcfd3ac0b5b6529275fae255b237b314bb8062" +checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -1390,12 +1456,11 @@ dependencies = [ [[package]] name = "gtk" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c4222ab92b08d4d0bab90ddb6185b4e575ceeea8b8cdf00b938d7b6661d966" +checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" dependencies = [ "atk", - "bitflags 1.3.2", "cairo-rs", "field-offset", "futures-channel", @@ -1406,16 +1471,15 @@ dependencies = [ "gtk-sys", "gtk3-macros", "libc", - "once_cell", "pango", "pkg-config", ] [[package]] name = "gtk-layer-shell" -version = "0.6.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "992f5fedb31835424a5280acd162bf348995f617d26969fde8d3dfd389b3ff5f" +checksum = "adb41643070b55cdda5a4a10a338520cff4345395e342b754c02f341e4107383" dependencies = [ "bitflags 2.4.0", "gdk", @@ -1428,22 +1492,22 @@ dependencies = [ [[package]] name = "gtk-layer-shell-sys" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5754bcfaadfc3529116af6ae93559b267d88647f965382153a4b8ea9372be75a" +checksum = "b9aa75cbb5bf5195d8be239b189f2a36cbea223777188c50f0bce124e291fe34" dependencies = [ "gdk-sys", "glib-sys", "gtk-sys", "libc", - "system-deps", + "system-deps 7.0.1", ] [[package]] name = "gtk-sys" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d8eb6a4b93e5a7e6980f7348d08c1cd93d31fae07cf97f20678c5ec41de3d7e" +checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" dependencies = [ "atk-sys", "cairo-sys-rs", @@ -1454,21 +1518,20 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps", + "system-deps 6.1.1", ] [[package]] name = "gtk3-macros" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3efb84d682c9a39c10bd9f24f5a4b9c15cc8c7edc45c19cb2ca2c4fc38b2d95e" +checksum = "c6063efb63db582968fb7df72e1ae68aa6360dcfb0a75143f34fc7d616bad75e" dependencies = [ - "anyhow", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -1502,12 +1565,24 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -1623,7 +1698,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -1634,8 +1709,8 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi", - "rustix 0.38.8", + "hermit-abi 0.3.2", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -1803,9 +1878,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libm" @@ -1827,9 +1902,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -1859,15 +1934,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[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" @@ -1915,28 +1981,14 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "nix" -version = "0.25.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "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" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", - "static_assertions", ] [[package]] @@ -1955,7 +2007,6 @@ name = "notifier_host" version = "0.1.0" dependencies = [ "dbusmenu-gtk3", - "gdk", "gtk", "log", "thiserror", @@ -2012,7 +2063,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.2", "libc", ] @@ -2043,11 +2094,10 @@ dependencies = [ [[package]] name = "pango" -version = "0.17.10" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35be456fc620e61f62dff7ff70fbd54dcbaf0a4b920c0f16de1107c47d921d48" +checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ - "bitflags 1.3.2", "gio", "glib", "libc", @@ -2057,14 +2107,14 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.17.10" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da69f9f3850b0d8990d462f8c709561975e95f689c1cdf0fecdebde78b35195" +checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps", + "system-deps 6.1.1", ] [[package]] @@ -2205,9 +2255,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2237,6 +2287,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2282,7 +2347,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.14", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.2", ] [[package]] @@ -2317,18 +2391,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2429,7 +2503,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2484,9 +2558,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -2498,15 +2572,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", ] [[package]] @@ -2544,22 +2618,22 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2575,13 +2649,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2595,25 +2669,15 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", "digest", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -2695,14 +2759,14 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2764,11 +2828,11 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2784,9 +2848,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -2815,10 +2879,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" dependencies = [ "cfg-expr", - "heck", + "heck 0.4.1", "pkg-config", - "toml", - "version-compare", + "toml 0.7.6", + "version-compare 0.1.1", +] + +[[package]] +name = "system-deps" +version = "7.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922" +dependencies = [ + "cfg-expr", + "heck 0.5.0", + "pkg-config", + "toml 0.8.2", + "version-compare 0.2.0", ] [[package]] @@ -2836,7 +2913,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.8", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -2877,7 +2954,7 @@ checksum = "f1728216d3244de4f14f14f8c15c79be1a7c67867d28d69b719690e2a19fb445" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2933,9 +3010,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -2953,13 +3030,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] @@ -2984,14 +3061,26 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.14", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -3010,12 +3099,24 @@ dependencies = [ ] [[package]] -name = "tracing" -version = "0.1.37" +name = "toml_edit" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3023,20 +3124,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -3049,10 +3150,11 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "uds_windows" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ + "memoffset 0.9.0", "tempfile", "winapi", ] @@ -3099,6 +3201,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +[[package]] +name = "version-compare" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" + [[package]] name = "version_check" version = "0.9.4" @@ -3163,7 +3271,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -3185,7 +3293,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3221,15 +3329,6 @@ 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" @@ -3483,34 +3582,29 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "nix 0.25.1", - "winapi", - "winapi-wsapoll", + "rustix 0.38.34", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56" -dependencies = [ - "nix 0.25.1", -] +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "xdg-home" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" dependencies = [ - "nix 0.26.2", - "winapi", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -3554,9 +3648,9 @@ dependencies = [ [[package]] name = "zbus" -version = "3.14.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast", "async-process", @@ -3565,12 +3659,12 @@ dependencies = [ "byteorder", "derivative", "enumflags2", - "event-listener", + "event-listener 2.5.3", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.26.2", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -3590,11 +3684,11 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.14.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -3604,9 +3698,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" +checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" dependencies = [ "serde", "static_assertions", @@ -3630,14 +3724,14 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.71", ] [[package]] name = "zvariant" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" dependencies = [ "byteorder", "enumflags2", @@ -3649,11 +3743,11 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index 40c709b..f9e2b74 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -21,20 +21,11 @@ eww_shared_util.workspace = true yuck.workspace = true notifier_host.workspace = true -gtk = "0.17.1" -gdk = "0.17.1" -pango = "0.17.1" -glib = "0.17.8" -glib-macros = "0.17.8" +gtk = "0.18.1" -cairo-rs = "0.17" -cairo-sys-rs = "0.17" - -gdk-pixbuf = "0.17" - -gtk-layer-shell = { version = "0.6.1", optional = true } -gdkx11 = { version = "0.17", optional = true } -x11rb = { version = "0.11.1", features = ["randr"], optional = true } +gtk-layer-shell = { version = "0.8.1", optional = true } +gdkx11 = { version = "0.18", optional = true } +x11rb = { version = "0.13.1", features = ["randr"], optional = true } zbus = { version = "3.7.0", default-features = false, features = ["tokio"] } ordered-stream = "0.2.0" diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 41b3364..6be6af7 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -17,6 +17,7 @@ use codespan_reporting::files::Files; use eww_shared_util::{Span, VarName}; use gdk::Monitor; use glib::ObjectExt; +use gtk::{gdk, glib}; use itertools::Itertools; use once_cell::sync::Lazy; use simplexpr::{dynval::DynVal, SimplExpr}; diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index 16cd866..fe80dcb 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -1,5 +1,7 @@ use crate::{widgets::window::Window, window_initiator::WindowInitiator}; +use gtk::gdk; + #[cfg(feature = "wayland")] pub use platform_wayland::WaylandBackend; @@ -27,7 +29,9 @@ impl DisplayBackend for NoBackend { #[cfg(feature = "wayland")] mod platform_wayland { use crate::{widgets::window::Window, window_initiator::WindowInitiator}; + use gtk::gdk; use gtk::prelude::*; + use gtk_layer_shell::LayerShell; use yuck::config::{window_definition::WindowStacking, window_geometry::AnchorAlignment}; use super::DisplayBackend; @@ -41,12 +45,12 @@ mod platform_wayland { fn initialize_window(window_init: &WindowInitiator, monitor: gdk::Rectangle, x: i32, y: i32) -> Option { let window = Window::new(gtk::WindowType::Toplevel, x, y); // Initialising a layer shell surface - gtk_layer_shell::init_for_window(&window); + window.init_layer_shell(); // Sets the monitor where the surface is shown if let Some(ident) = window_init.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); + window.set_monitor(&monitor); } else { return None; } @@ -55,18 +59,18 @@ mod platform_wayland { // Sets the layer where the layer shell surface will spawn match window_init.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), + WindowStacking::Foreground => window.set_layer(gtk_layer_shell::Layer::Top), + WindowStacking::Background => window.set_layer(gtk_layer_shell::Layer::Background), + WindowStacking::Bottom => window.set_layer(gtk_layer_shell::Layer::Bottom), + WindowStacking::Overlay => window.set_layer(gtk_layer_shell::Layer::Overlay), } if let Some(namespace) = &window_init.backend_options.wayland.namespace { - gtk_layer_shell::set_namespace(&window, namespace); + window.set_namespace(namespace); } // Sets the keyboard interactivity - gtk_layer_shell::set_keyboard_interactivity(&window, window_init.backend_options.wayland.focusable); + window.set_keyboard_interactivity(window_init.backend_options.wayland.focusable); if let Some(geometry) = window_init.geometry { // Positioning surface @@ -86,27 +90,27 @@ mod platform_wayland { 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); + window.set_anchor(gtk_layer_shell::Edge::Left, left); + window.set_anchor(gtk_layer_shell::Edge::Right, right); + window.set_anchor(gtk_layer_shell::Edge::Top, top); + window.set_anchor(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()); if left { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Left, xoffset); + window.set_layer_shell_margin(gtk_layer_shell::Edge::Left, xoffset); } else { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Right, xoffset); + window.set_layer_shell_margin(gtk_layer_shell::Edge::Right, xoffset); } if bottom { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Bottom, yoffset); + window.set_layer_shell_margin(gtk_layer_shell::Edge::Bottom, yoffset); } else { - gtk_layer_shell::set_margin(&window, gtk_layer_shell::Edge::Top, yoffset); + window.set_layer_shell_margin(gtk_layer_shell::Edge::Top, yoffset); } } if window_init.backend_options.wayland.exclusive { - gtk_layer_shell::auto_exclusive_zone_enable(&window); + window.auto_exclusive_zone_enable(); } Some(window) } @@ -118,6 +122,7 @@ mod platform_x11 { use crate::{widgets::window::Window, window_initiator::WindowInitiator}; use anyhow::{Context, Result}; use gdk::Monitor; + use gtk::gdk; use gtk::{self, prelude::*}; use x11rb::protocol::xproto::ConnectionExt; diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 6c5a9d9..3814e07 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -95,7 +95,7 @@ pub fn initialize_server( paths, }; - if let Some(screen) = gdk::Screen::default() { + if let Some(screen) = gtk::gdk::Screen::default() { gtk::StyleContext::add_provider_for_screen(&screen, &app.css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION); } @@ -108,7 +108,7 @@ pub fn initialize_server( // initialize all the handlers and tasks running asyncronously let tokio_handle = init_async_part(app.paths.clone(), ui_send); - glib::MainContext::default().spawn_local(async move { + gtk::glib::MainContext::default().spawn_local(async move { // if an action was given to the daemon initially, execute it first. if let Some(action) = action { app.handle_command(action); diff --git a/crates/eww/src/widgets/build_widget.rs b/crates/eww/src/widgets/build_widget.rs index c3a1899..23e76ee 100644 --- a/crates/eww/src/widgets/build_widget.rs +++ b/crates/eww/src/widgets/build_widget.rs @@ -1,8 +1,8 @@ use anyhow::{Context, Result}; use codespan_reporting::diagnostic::Severity; use eww_shared_util::{AttrName, Spanned}; -use gdk::prelude::Cast; use gtk::{ + gdk::prelude::Cast, prelude::{BoxExt, ContainerExt, WidgetExt}, Orientation, }; diff --git a/crates/eww/src/widgets/circular_progressbar.rs b/crates/eww/src/widgets/circular_progressbar.rs index 76861af..9e1baf6 100644 --- a/crates/eww/src/widgets/circular_progressbar.rs +++ b/crates/eww/src/widgets/circular_progressbar.rs @@ -1,7 +1,6 @@ use anyhow::{anyhow, Result}; -use glib::{object_subclass, prelude::*, wrapper}; -use glib_macros::Properties; -use gtk::{prelude::*, subclass::prelude::*}; +use gtk::glib::{self, object_subclass, prelude::*, wrapper, Properties}; +use gtk::{cairo, gdk, prelude::*, subclass::prelude::*}; use std::cell::RefCell; use crate::error_handling_ctx; @@ -154,7 +153,7 @@ impl WidgetImpl for CircProgPriv { self.preferred_height() } - fn draw(&self, cr: &cairo::Context) -> Inhibit { + fn draw(&self, cr: &cairo::Context) -> glib::Propagation { let res: Result<()> = (|| { let value = *self.value.borrow(); let start_at = *self.start_at.borrow(); @@ -226,7 +225,7 @@ impl WidgetImpl for CircProgPriv { error_handling_ctx::print_error(error) }; - gtk::Inhibit(false) + glib::Propagation::Proceed } } diff --git a/crates/eww/src/widgets/graph.rs b/crates/eww/src/widgets/graph.rs index a3a7713..49dc8ed 100644 --- a/crates/eww/src/widgets/graph.rs +++ b/crates/eww/src/widgets/graph.rs @@ -2,9 +2,8 @@ use std::{cell::RefCell, collections::VecDeque}; // https://www.figuiere.net/technotes/notes/tn002/ // https://github.com/gtk-rs/examples/blob/master/src/bin/listbox_model.rs use anyhow::{anyhow, Result}; -use glib::{object_subclass, wrapper}; -use glib_macros::Properties; -use gtk::{prelude::*, subclass::prelude::*}; +use gtk::glib::{self, object_subclass, wrapper, Properties}; +use gtk::{cairo, gdk, prelude::*, subclass::prelude::*}; use crate::error_handling_ctx; @@ -170,7 +169,7 @@ impl WidgetImpl for GraphPriv { (width, width) } - fn draw(&self, cr: &cairo::Context) -> Inhibit { + fn draw(&self, cr: &cairo::Context) -> glib::Propagation { let res: Result<()> = (|| { let history = &*self.history.borrow(); let extra_point = *self.extra_point.borrow(); @@ -276,7 +275,7 @@ impl WidgetImpl for GraphPriv { error_handling_ctx::print_error(error) }; - gtk::Inhibit(false) + glib::Propagation::Proceed } } diff --git a/crates/eww/src/widgets/systray.rs b/crates/eww/src/widgets/systray.rs index 240a97f..67d84f5 100644 --- a/crates/eww/src/widgets/systray.rs +++ b/crates/eww/src/widgets/systray.rs @@ -1,8 +1,6 @@ use crate::widgets::window::Window; use futures::StreamExt; -use gdk::NotifyType; -use gtk::{cairo::Surface, gdk::ffi::gdk_cairo_surface_create_from_pixbuf, prelude::*}; -use notifier_host; +use gtk::{cairo::Surface, gdk, gdk::ffi::gdk_cairo_surface_create_from_pixbuf, gdk::NotifyType, glib, prelude::*}; use std::{cell::RefCell, future::Future, rc::Rc}; // DBus state shared between systray instances, to avoid creating too many connections etc. @@ -139,14 +137,14 @@ impl Item { if evt.detail() != NotifyType::Inferior { gtk_widget.clone().set_state_flags(gtk::StateFlags::PRELIGHT, false); } - gtk::Inhibit(false) + glib::Propagation::Proceed }); gtk_widget.connect_leave_notify_event(|gtk_widget, evt| { if evt.detail() != NotifyType::Inferior { gtk_widget.clone().unset_state_flags(gtk::StateFlags::PRELIGHT); } - gtk::Inhibit(false) + glib::Propagation::Proceed }); let out_widget = gtk_widget.clone(); // copy so we can return it @@ -231,7 +229,7 @@ impl Item { if let Err(result) = result { log::error!("failed to handle mouse click {}: {}", evt.button(), result); } - gtk::Inhibit(true) + glib::Propagation::Stop })); // updates diff --git a/crates/eww/src/widgets/transform.rs b/crates/eww/src/widgets/transform.rs index faa9aa4..79390ac 100644 --- a/crates/eww/src/widgets/transform.rs +++ b/crates/eww/src/widgets/transform.rs @@ -1,6 +1,5 @@ use anyhow::{anyhow, Result}; -use glib::{object_subclass, wrapper}; -use glib_macros::Properties; +use gtk::glib::{self, object_subclass, wrapper, Properties}; use gtk::{prelude::*, subclass::prelude::*}; use std::{cell::RefCell, str::FromStr}; use yuck::value::NumWithUnit; @@ -121,7 +120,7 @@ impl ContainerImpl for TransformPriv { impl BinImpl for TransformPriv {} impl WidgetImpl for TransformPriv { - fn draw(&self, cr: &cairo::Context) -> Inhibit { + fn draw(&self, cr: >k::cairo::Context) -> glib::Propagation { let res: Result<()> = (|| { let rotate = *self.rotate.borrow(); let total_width = self.obj().allocated_width() as f64; @@ -166,7 +165,7 @@ impl WidgetImpl for TransformPriv { error_handling_ctx::print_error(error) }; - gtk::Inhibit(false) + glib::Propagation::Proceed } } diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index d5d97fb..c4d78a6 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -8,10 +8,11 @@ use crate::{ use anyhow::{anyhow, Context, Result}; use codespan_reporting::diagnostic::Severity; use eww_shared_util::Spanned; -use gdk::{ModifierType, NotifyType}; +use gdk::{ModifierType, NotifyType}; use glib::translate::FromGlib; use gtk::{self, glib, prelude::*, DestDefaults, TargetEntry, TargetList}; +use gtk::{gdk, pango}; use itertools::Itertools; use once_cell::sync::Lazy; @@ -232,11 +233,11 @@ pub(super) fn resolve_range_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Ran let is_being_dragged = Rc::new(RefCell::new(false)); gtk_widget.connect_button_press_event(glib::clone!(@strong is_being_dragged => move |_, _| { *is_being_dragged.borrow_mut() = true; - gtk::Inhibit(false) + glib::Propagation::Proceed })); gtk_widget.connect_button_release_event(glib::clone!(@strong is_being_dragged => move |_, _| { *is_being_dragged.borrow_mut() = false; - gtk::Inhibit(false) + glib::Propagation::Proceed })); // We keep track of the last value that has been set via gtk_widget.set_value (by a change in the value property). @@ -507,7 +508,7 @@ fn build_gtk_button(bargs: &mut BuilderArgs) -> Result { 3 => run_command(timeout, &onrightclick, &[] as &[&str]), _ => {}, } - gtk::Inhibit(false) + glib::Propagation::Proceed })); } @@ -729,25 +730,25 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { if evt.detail() != NotifyType::Inferior { gtk_widget.clone().set_state_flags(gtk::StateFlags::PRELIGHT, false); } - gtk::Inhibit(false) + glib::Propagation::Proceed }); gtk_widget.connect_leave_notify_event(|gtk_widget, evt| { if evt.detail() != NotifyType::Inferior { gtk_widget.clone().unset_state_flags(gtk::StateFlags::PRELIGHT); } - gtk::Inhibit(false) + glib::Propagation::Proceed }); // Support :active selector gtk_widget.connect_button_press_event(|gtk_widget, _| { gtk_widget.clone().set_state_flags(gtk::StateFlags::ACTIVE, false); - gtk::Inhibit(false) + glib::Propagation::Proceed }); gtk_widget.connect_button_release_event(|gtk_widget, _| { gtk_widget.clone().unset_state_flags(gtk::StateFlags::ACTIVE); - gtk::Inhibit(false) + glib::Propagation::Proceed }); def_widget!(bargs, _g, gtk_widget, { @@ -761,7 +762,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { if delta != 0f64 { // Ignore the first event https://bugzilla.gnome.org/show_bug.cgi?id=675959 run_command(timeout, &onscroll, &[if delta < 0f64 { "up" } else { "down" }]); } - gtk::Inhibit(false) + glib::Propagation::Proceed })); }, // @prop timeout - timeout of the command. Default: "200ms" @@ -772,7 +773,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { if evt.detail() != NotifyType::Inferior { run_command(timeout, &onhover, &[evt.position().0, evt.position().1]); } - gtk::Inhibit(false) + glib::Propagation::Proceed })); }, // @prop timeout - timeout of the command. Default: "200ms" @@ -783,7 +784,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { if evt.detail() != NotifyType::Inferior { run_command(timeout, &onhoverlost, &[evt.position().0, evt.position().1]); } - gtk::Inhibit(false) + glib::Propagation::Proceed })); }, // @prop cursor - Cursor to show while hovering (see [gtk3-cursors](https://docs.gtk.org/gdk3/ctor.Cursor.new_from_name.html) for possible names) @@ -799,7 +800,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { gdk_window.set_cursor(gdk::Cursor::from_name(&display, &cursor).as_ref()); } } - gtk::Inhibit(false) + glib::Propagation::Proceed })); connect_signal_handler!(gtk_widget, gtk_widget.connect_leave_notify_event(move |widget, _evt| { if _evt.detail() != NotifyType::Inferior { @@ -808,7 +809,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { gdk_window.set_cursor(None); } } - gtk::Inhibit(false) + glib::Propagation::Proceed })); }, // @prop timeout - timeout of the command. Default: "200ms" @@ -878,7 +879,7 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { 3 => run_command(timeout, &onrightclick, &[] as &[&str]), _ => {}, } - gtk::Inhibit(false) + glib::Propagation::Proceed })); } }); diff --git a/crates/eww/src/widgets/window.rs b/crates/eww/src/widgets/window.rs index 4e6c0dc..1a7b861 100644 --- a/crates/eww/src/widgets/window.rs +++ b/crates/eww/src/widgets/window.rs @@ -1,5 +1,4 @@ -use glib::{object_subclass, wrapper}; -use glib_macros::Properties; +use gtk::glib::{self, object_subclass, wrapper, Properties}; use gtk::{prelude::*, subclass::prelude::*}; use std::cell::RefCell; diff --git a/crates/notifier_host/Cargo.toml b/crates/notifier_host/Cargo.toml index 10a7d6c..af2ccbd 100644 --- a/crates/notifier_host/Cargo.toml +++ b/crates/notifier_host/Cargo.toml @@ -9,8 +9,7 @@ repository = "https://github.com/elkowar/eww" homepage = "https://github.com/elkowar/eww" [dependencies] -gtk = "0.17.1" -gdk = "0.17.1" +gtk = "0.18.1" zbus = { version = "3.7.0", default-features = false, features = ["tokio"] } dbusmenu-gtk3 = "0.1.0" diff --git a/crates/notifier_host/src/icon.rs b/crates/notifier_host/src/icon.rs index 45057e4..c903a15 100644 --- a/crates/notifier_host/src/icon.rs +++ b/crates/notifier_host/src/icon.rs @@ -105,7 +105,7 @@ fn icon_from_name( ) -> std::result::Result { let theme = if let Some(path) = theme_path { let theme = gtk::IconTheme::new(); - theme.prepend_search_path(&path); + theme.prepend_search_path(path); theme } else { gtk::IconTheme::default().expect("Could not get default gtk theme") diff --git a/crates/notifier_host/src/item.rs b/crates/notifier_host/src/item.rs index 70317eb..a6cb2af 100644 --- a/crates/notifier_host/src/item.rs +++ b/crates/notifier_host/src/item.rs @@ -88,9 +88,9 @@ impl Item { Ok(()) } - pub async fn popup_menu(&self, event: &gdk::EventButton, x: i32, y: i32) -> zbus::Result<()> { + pub async fn popup_menu(&self, event: >k::gdk::EventButton, x: i32, y: i32) -> zbus::Result<()> { if let Some(menu) = &self.gtk_menu { - menu.popup_at_pointer(event.downcast_ref::()); + menu.popup_at_pointer(event.downcast_ref::()); Ok(()) } else { self.sni.context_menu(x, y).await From 8b9d65f80072b9e4da1f2457481d5ff363913d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 31 Jul 2024 01:09:15 +0200 Subject: [PATCH 14/88] chore: use cargo to update almost all dependencies --- Cargo.lock | 1210 ++++++++++++++++++++++------------------------------ 1 file changed, 503 insertions(+), 707 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfa5ebe..73d4b9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,20 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -43,18 +32,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -73,47 +62,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -121,9 +111,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "ascii-canvas" @@ -146,13 +136,14 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.9.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] @@ -185,7 +176,7 @@ dependencies = [ "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.0.0", + "futures-lite 2.3.0", "parking", "polling 3.7.2", "rustix 0.38.34", @@ -239,14 +230,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "async-signal" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ "async-io 2.3.3", "async-lock 3.4.0", @@ -274,7 +265,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -297,26 +288,26 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -329,9 +320,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bincode" @@ -365,9 +356,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -380,24 +371,22 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel", - "async-lock 2.8.0", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite 1.13.0", - "log", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -407,9 +396,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cached" @@ -417,10 +406,10 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "355face540df58778b96814c48abb3c2ed67c4878a8087ab1819c1fedeec505f" dependencies = [ - "ahash 0.8.9", + "ahash", "cached_proc_macro", "cached_proc_macro_types", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "instant", "once_cell", "thiserror", @@ -450,7 +439,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "cairo-sys-rs", "glib", "libc", @@ -466,17 +455,14 @@ checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] name = "cc" -version = "1.0.82" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" -dependencies = [ - "libc", -] +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" [[package]] name = "cfg-expr" @@ -496,38 +482,37 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.52.6", ] [[package]] name = "chrono-tz" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1369bc6b9e9a7dfdae2055f6ec151fe9c554a9d23d357c0237cee2e25eaabb7" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" dependencies = [ "chrono", "chrono-tz-build", - "phf 0.11.2", + "phf", ] [[package]] name = "chrono-tz-build" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f5ebdc942f57ed96d560a6d1a459bae5851102a25d5bf89dc04ae453e31ecf" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" dependencies = [ "parse-zoneinfo", - "phf 0.11.2", + "phf", "phf_codegen", ] @@ -537,14 +522,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] name = "clap" -version = "4.5.1" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", "clap_derive", @@ -552,42 +537,42 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] name = "clap_complete" -version = "4.5.1" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c" +checksum = "c6ae69fbb0833c6fcd5a8d4b8609f108c7ad95fc11e248d853ff2c42a90df26a" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "codemap" @@ -607,9 +592,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "concurrent-queue" @@ -622,14 +607,14 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -640,61 +625,52 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -767,7 +743,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -797,16 +773,7 @@ dependencies = [ "gobject-sys", "gtk-sys", "libc", - "system-deps 6.1.1", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", + "system-deps 6.2.2", ] [[package]] @@ -822,15 +789,15 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -872,21 +839,21 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -915,14 +882,14 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -1045,7 +1012,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1059,9 +1026,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "field-offset" @@ -1069,20 +1036,20 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "rustc_version", ] [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -1108,9 +1075,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1139,9 +1106,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1171,9 +1138,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.0.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1155db57329dca6d018b61e76b1488ce9a2e5e44028cac420a5898f4fcef63" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "futures-core", "pin-project-lite", @@ -1187,7 +1154,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1258,7 +1225,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1275,7 +1242,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1301,7 +1268,7 @@ dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", "x11", ] @@ -1322,25 +1289,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gio" @@ -1370,7 +1339,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", "winapi", ] @@ -1380,7 +1349,7 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "futures-channel", "futures-core", "futures-executor", @@ -1404,11 +1373,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1418,7 +1387,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1429,29 +1398,30 @@ checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ "glib-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] name = "grass" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7746cd9bf09f9bb7d98638774a70642000356f543898d9a352cd043f82744528" +checksum = "a46def7216d331efa51a6aa796ef777bfdfe9605378382827a553344b7e5eefc" dependencies = [ + "getrandom", "grass_compiler", ] [[package]] name = "grass_compiler" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187adfc0b34289c7f8f3819453ce9da3177c3d73f40ac74bb17faba578813d45" +checksum = "f39216c1843182f78541276fec96f88406861f16aa19cc9f8add70f8e67b7577" dependencies = [ "codemap", - "indexmap 1.9.3", + "indexmap", "lasso", "once_cell", - "phf 0.10.1", + "phf", ] [[package]] @@ -1481,7 +1451,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb41643070b55cdda5a4a10a338520cff4345395e342b754c02f341e4107383" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "gdk", "glib", "glib-sys", @@ -1518,7 +1488,7 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] @@ -1531,31 +1501,25 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.7.8", + "ahash", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.9", + "ahash", "allocator-api2", ] @@ -1573,9 +1537,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hermit-abi" @@ -1591,9 +1555,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hifijson" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ef6b41c333e6dd2a4aaa59125a19b633cd17e7aaf372b2260809777bcdef4a" +checksum = "9958ab3ce3170c061a27679916bd9b969eceeb5e8b120438e6751d0987655c42" [[package]] name = "humantime" @@ -1603,16 +1567,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core", ] [[package]] @@ -1632,22 +1596,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1672,22 +1626,21 @@ dependencies = [ [[package]] name = "insta" -version = "1.31.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0770b0a3d4c70567f0d58331f3088b0e4c4f56c9b8d764efe654b4a5d46de3a" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" dependencies = [ "console", "lazy_static", "linked-hash-map", "similar", - "yaml-rust", ] [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1698,27 +1651,33 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.34", - "windows-sys 0.48.0", + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.52.0", ] [[package]] -name = "itertools" -version = "0.10.5" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -1734,37 +1693,37 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jaq-core" -version = "1.2.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d6a5713b8f33675abfac79d1db0022a3f28764b2a6b96a185c199ad8dab86d" +checksum = "d6fda09ee08c84c81293fdf811d9ebaa87b327557b5391f290c926d728c2ddd4" dependencies = [ "aho-corasick", "base64", + "chrono", "hifijson", "jaq-interpret", "libm", "log", "regex", - "time 0.3.34", "urlencoding", ] [[package]] name = "jaq-interpret" -version = "1.2.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f569e38e5fc677db8dfda89ee0b4c25b3f53e811b16434fd14bdc5b43fc362ac" +checksum = "2fe95ec3c24af3fd9f3dd1091593f5e49b003a66c496a8aa39d764d0a06ae17b" dependencies = [ - "ahash 0.8.9", + "ahash", "dyn-clone", "hifijson", - "indexmap 2.0.0", + "indexmap", "jaq-syn", "once_cell", "serde_json", @@ -1772,9 +1731,9 @@ dependencies = [ [[package]] name = "jaq-parse" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6f8beb9f9922546419e774e24199e8a968f54c63a5a2323c8f3ef3321ace14" +checksum = "0346d7d3146cdda8acd929581f3d6626a332356c74d5c95aeaffaac2eb6dee82" dependencies = [ "chumsky", "jaq-syn", @@ -1782,9 +1741,9 @@ dependencies = [ [[package]] name = "jaq-std" -version = "1.2.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7871c59297cbfdd18f6f1bbbafaad24e97fd555ee1e2a1be7a40a5a20f551a" +checksum = "d6e83f491752a1bbc4fa05a8e80d4ce1139119f9c3fd8e3400b604776c2e0129" dependencies = [ "bincode", "jaq-parse", @@ -1793,18 +1752,18 @@ dependencies = [ [[package]] name = "jaq-syn" -version = "1.1.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d60101fb791b20c982731d848ed6e7d25363656497647c2093b68bd88398d6" +checksum = "1ba44fe4428c71304604261ecbae047ee9cfb60c4f1a6bd222ebbb31726d3948" dependencies = [ "serde", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1831,50 +1790,49 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" dependencies = [ "ascii-canvas", "bit-set", - "diff", "ena", - "is-terminal", - "itertools 0.10.5", + "itertools 0.11.0", "lalrpop-util", "petgraph", "pico-args", "regex", - "regex-syntax 0.7.4", + "regex-syntax", "string_cache", "term", "tiny-keccak", "unicode-xid", + "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex", + "regex-automata", ] [[package]] name = "lasso" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb7b21a526375c5ca55f1a6dfd4e1fad9fa4edd750f530252a718a44b2608f0" +checksum = "4644821e1c3d7a560fe13d842d13f587c07348a1a05d3a797152d41c90c56df2" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.13.2", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -1888,6 +1846,16 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1908,9 +1876,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1918,9 +1886,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "maplit" @@ -1930,9 +1898,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -1945,39 +1913,51 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] [[package]] -name = "new_debug_unreachable" -version = "1.0.4" +name = "mio" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" @@ -1997,7 +1977,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "cfg-if", "libc", ] @@ -2020,7 +2000,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -2028,7 +2008,7 @@ dependencies = [ "kqueue", "libc", "log", - "mio", + "mio 0.8.11", "walkdir", "windows-sys 0.48.0", ] @@ -2042,36 +2022,20 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.2", - "libc", -] - [[package]] name = "object" -version = "0.31.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" dependencies = [ "memchr", ] @@ -2114,20 +2078,20 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.1.1", + "system-deps 6.2.2", ] [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2135,45 +2099,34 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.48.2", + "windows-targets 0.52.6", ] [[package]] name = "parse-zoneinfo" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" dependencies = [ "regex", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 1.9.3", -] - -[[package]] -name = "phf" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" -dependencies = [ - "phf_macros", - "phf_shared 0.10.0", - "proc-macro-hack", + "indexmap", ] [[package]] @@ -2182,6 +2135,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ + "phf_macros", "phf_shared 0.11.2", ] @@ -2191,20 +2145,10 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "phf_generator 0.11.2", + "phf_generator", "phf_shared 0.11.2", ] -[[package]] -name = "phf_generator" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" -dependencies = [ - "phf_shared 0.10.0", - "rand", -] - [[package]] name = "phf_generator" version = "0.11.2" @@ -2217,16 +2161,15 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", - "proc-macro-hack", + "phf_generator", + "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -2266,10 +2209,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.27" +name = "piper" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" @@ -2302,17 +2256,15 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +dependencies = [ + "zerocopy", + "zerocopy-derive", +] [[package]] name = "precomputed-hash" @@ -2347,15 +2299,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit 0.19.14", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ + "toml_datetime", "toml_edit 0.20.2", ] @@ -2383,12 +2336,6 @@ dependencies = [ "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.86" @@ -2439,9 +2386,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2459,93 +2406,87 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -2576,7 +2517,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -2585,15 +2526,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2612,9 +2553,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" @@ -2633,16 +2574,17 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -2655,14 +2597,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -2680,18 +2622,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "similar" -version = "2.2.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" [[package]] name = "simple-signal" @@ -2725,31 +2667,31 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "strsim 0.11.0", + "strsim 0.11.1", "strum", "thiserror", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smart-default" @@ -2759,7 +2701,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2774,9 +2716,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2809,30 +2751,30 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2848,9 +2790,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -2859,9 +2801,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.5" +version = "0.30.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" +checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2869,20 +2811,20 @@ dependencies = [ "ntapi", "once_cell", "rayon", - "windows 0.52.0", + "windows", ] [[package]] name = "system-deps" -version = "6.1.1" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c2de8a4d8f4b823d634affc9cd2a74ec98c53a756f317e529a48046cbf71f3" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", - "heck 0.4.1", + "heck 0.5.0", "pkg-config", - "toml 0.7.6", - "version-compare 0.1.1", + "toml", + "version-compare", ] [[package]] @@ -2894,27 +2836,26 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.2", - "version-compare 0.2.0", + "toml", + "version-compare", ] [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.0", - "redox_syscall 0.3.5", + "fastrand 2.1.0", "rustix 0.38.34", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2930,73 +2871,31 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.46" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9207952ae1a003f42d3d5e892dac3c6ba42aa6ac0c79a6a91a2b5cb4253e75c" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.46" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1728216d3244de4f14f14f8c15c79be1a7c67867d28d69b719690e2a19fb445" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", -] - -[[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 = "time" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" -dependencies = [ - "num-conv", - "time-core", + "syn 2.0.72", ] [[package]] @@ -3010,40 +2909,39 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.1", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -3052,18 +2950,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.14", -] - [[package]] name = "toml" version = "0.8.2" @@ -3078,22 +2964,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", - "serde", - "serde_spanned", + "indexmap", "toml_datetime", "winnow", ] @@ -3104,7 +2988,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.0.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -3130,7 +3014,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -3144,9 +3028,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" @@ -3154,7 +3038,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "tempfile", "winapi", ] @@ -3167,15 +3051,15 @@ checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -3191,15 +3075,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "version-compare" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "version-compare" @@ -3209,9 +3087,9 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -3224,26 +3102,20 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 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" @@ -3252,9 +3124,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3262,24 +3134,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3287,22 +3159,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "winapi" @@ -3322,11 +3194,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -3335,15 +3207,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.2", -] - [[package]] name = "windows" version = "0.52.0" @@ -3351,7 +3214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -3360,16 +3223,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.6", ] [[package]] @@ -3378,7 +3232,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.2", + "windows-targets 0.48.5", ] [[package]] @@ -3387,185 +3241,135 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.48.2", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", - "windows_i686_msvc 0.48.2", - "windows_x86_64_gnu 0.48.2", - "windows_x86_64_gnullvm 0.48.2", - "windows_x86_64_msvc 0.48.2", -] - -[[package]] -name = "windows-targets" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" -dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_i686_gnu" -version = "0.52.3" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.11" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e461589e194280efaa97236b73623445efa195aa633fd7004f39805707a9d53" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -3607,15 +3411,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[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" @@ -3709,22 +3504,23 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] From 89d8bfe5c2f492ea8ec84cc113ef7d1832971634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 31 Jul 2024 01:41:02 +0200 Subject: [PATCH 15/88] nix: switch to nixfmt-rfc-style --- default.nix | 15 ++++++----- flake.nix | 71 ++++++++++++++++++++++++++++++++++------------------- shell.nix | 15 ++++++----- 3 files changed, 64 insertions(+), 37 deletions(-) diff --git a/default.nix b/default.nix index 80aeb43..6466507 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,9 @@ -(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); -in fetchTarball { - url = - "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; -}) { src = ./.; }).defaultNix +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } +) { src = ./.; }).defaultNix diff --git a/flake.nix b/flake.nix index e631113..6de91fe 100644 --- a/flake.nix +++ b/flake.nix @@ -11,20 +11,31 @@ }; }; - outputs = { self, nixpkgs, rust-overlay, flake-compat }: + outputs = + { + self, + nixpkgs, + rust-overlay, + flake-compat, + }: let - overlays = [ (import rust-overlay) self.overlays.default ]; + overlays = [ + (import rust-overlay) + self.overlays.default + ]; pkgsFor = system: import nixpkgs { inherit system overlays; }; - targetSystems = [ "aarch64-linux" "x86_64-linux" ]; - mkRustToolchain = pkgs: - pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - in { - overlays.default = final: prev: { - inherit (self.packages.${prev.system}) eww eww-wayland; - }; + targetSystems = [ + "aarch64-linux" + "x86_64-linux" + ]; + mkRustToolchain = pkgs: pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + in + { + overlays.default = final: prev: { inherit (self.packages.${prev.system}) eww eww-wayland; }; - packages = nixpkgs.lib.genAttrs targetSystems (system: + packages = nixpkgs.lib.genAttrs targetSystems ( + system: let pkgs = pkgsFor system; rust = mkRustToolchain pkgs; @@ -32,18 +43,24 @@ cargo = rust; rustc = rust; }; - version = (builtins.fromTOML - (builtins.readFile ./crates/eww/Cargo.toml)).package.version; - in rec { + version = (builtins.fromTOML (builtins.readFile ./crates/eww/Cargo.toml)).package.version; + in + rec { eww = rustPlatform.buildRustPackage { version = "${version}-dirty"; pname = "eww"; src = ./.; cargoLock.lockFile = ./Cargo.lock; - cargoBuildFlags = [ "--bin" "eww" ]; + cargoBuildFlags = [ + "--bin" + "eww" + ]; - nativeBuildInputs = with pkgs; [ pkg-config wrapGAppsHook ]; + nativeBuildInputs = with pkgs; [ + pkg-config + wrapGAppsHook + ]; buildInputs = with pkgs; [ gtk3 librsvg @@ -52,26 +69,30 @@ ]; }; - eww-wayland = nixpkgs.lib.warn - "`eww-wayland` is deprecated due to eww building with both X11 and wayland support by default. Use `eww` instead." - eww; + eww-wayland = nixpkgs.lib.warn "`eww-wayland` is deprecated due to eww building with both X11 and wayland support by default. Use `eww` instead." eww; default = eww; - }); + } + ); - devShells = nixpkgs.lib.genAttrs targetSystems (system: + devShells = nixpkgs.lib.genAttrs targetSystems ( + system: let pkgs = pkgsFor system; rust = mkRustToolchain pkgs; - in { + in + { default = pkgs.mkShell { inputsFrom = [ self.packages.${system}.eww ]; - packages = with pkgs; [ deno mdbook ]; + packages = with pkgs; [ + deno + mdbook + ]; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; }; - }); + } + ); - formatter = - nixpkgs.lib.genAttrs targetSystems (system: (pkgsFor system).nixfmt); + formatter = nixpkgs.lib.genAttrs targetSystems (system: (pkgsFor system).nixfmt-rfc-style); }; } diff --git a/shell.nix b/shell.nix index fa2a56c..493783d 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,9 @@ -(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); -in fetchTarball { - url = - "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; - sha256 = lock.nodes.flake-compat.locked.narHash; -}) { src = ./.; }).shellNix +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in + fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + } +) { src = ./.; }).shellNix From 57a5d9963a839b409e616aba598574d88b6536c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:08:15 +0200 Subject: [PATCH 16/88] chore: update a few dependencies --- Cargo.lock | 192 ++++++++++++++++++++++++------------ Cargo.toml | 44 ++++----- crates/eww/Cargo.toml | 9 +- crates/simplexpr/Cargo.toml | 4 +- 4 files changed, 159 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73d4b9c..9e63c2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ dependencies = [ "getrandom", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -396,35 +396,35 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9" [[package]] name = "cached" -version = "0.48.1" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355face540df58778b96814c48abb3c2ed67c4878a8087ab1819c1fedeec505f" +checksum = "b4d73155ae6b28cf5de4cfc29aeb02b8a1c6dab883cb015d15cd514e42766846" dependencies = [ "ahash", "cached_proc_macro", "cached_proc_macro_types", "hashbrown 0.14.5", - "instant", "once_cell", "thiserror", + "web-time", ] [[package]] name = "cached_proc_macro" -version = "0.19.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d52f526f7cbc875b296856ca8c964a9f6290556922c303a8a3883e3c676e6a1" +checksum = "2f42a145ed2d10dce2191e1dcf30cfccfea9026660e143662ba5eec4017d5daa" dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -480,6 +480,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -496,9 +502,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" dependencies = [ "chrono", "chrono-tz-build", @@ -507,9 +513,9 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" dependencies = [ "parse-zoneinfo", "phf", @@ -527,9 +533,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" dependencies = [ "clap_builder", "clap_derive", @@ -537,30 +543,30 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] name = "clap_complete" -version = "4.5.11" +version = "4.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ae69fbb0833c6fcd5a8d4b8609f108c7ad95fc11e248d853ff2c42a90df26a" +checksum = "a8670053e87c316345e384ca1f3eba3006fc6355ed8b8a1140d104e109e3df34" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -690,9 +696,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -700,27 +706,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 1.0.109", + "strsim", + "syn 2.0.72", ] [[package]] name = "darling_macro" -version = "0.14.4" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -974,7 +980,7 @@ dependencies = [ "libc", "log", "maplit", - "nix 0.27.1", + "nix 0.29.0", "notifier_host", "notify", "once_cell", @@ -1576,7 +1582,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1596,9 +1602,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1741,12 +1747,10 @@ dependencies = [ [[package]] name = "jaq-std" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e83f491752a1bbc4fa05a8e80d4ce1139119f9c3fd8e3400b604776c2e0129" +checksum = "bfbaa55578fd3b70433b594a370741e0c364e4afff92cc0099623fce87311bc1" dependencies = [ - "bincode", - "jaq-parse", "jaq-syn", ] @@ -1973,12 +1977,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.6.0", "cfg-if", + "cfg_aliases", "libc", ] @@ -2258,12 +2263,11 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" dependencies = [ - "zerocopy", - "zerocopy-derive", + "zerocopy 0.6.6", ] [[package]] @@ -2667,7 +2671,7 @@ dependencies = [ "serde", "serde_json", "static_assertions", - "strsim 0.11.1", + "strsim", "strum", "thiserror", ] @@ -2743,12 +2747,6 @@ dependencies = [ "precomputed-hash", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -2801,15 +2799,14 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.13" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b4ddaee55fb2bea2bf0e5000747e5f5c0de765e5a5ff87f4cd106439f4bb3" +checksum = "d4115055da5f572fff541dd0c4e61b0262977f453cc9fe04be83aba25a89bdab" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", "rayon", "windows", ] @@ -3176,6 +3173,16 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3209,11 +3216,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.52.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ - "windows-core", + "windows-core 0.57.0", "windows-targets 0.52.6", ] @@ -3226,6 +3233,49 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -3502,14 +3552,34 @@ dependencies = [ "zvariant", ] +[[package]] +name = "zerocopy" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" +dependencies = [ + "byteorder", + "zerocopy-derive 0.6.6", +] + [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy-derive" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c886a87..0a94d49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,51 +6,51 @@ resolver = "2" simplexpr = { version = "0.1.0", path = "crates/simplexpr" } eww_shared_util = { version = "0.1.0", path = "crates/eww_shared_util" } -yuck = { version = "0.1.0", path = "crates/yuck", default-features = false} +yuck = { version = "0.1.0", path = "crates/yuck", default-features = false } notifier_host = { version = "0.1.0", path = "crates/notifier_host" } -anyhow = "1.0.79" +anyhow = "1.0.86" bincode = "1.3.3" -cached = "0.48.0" -chrono = "0.4.26" -chrono-tz = "0.8.2" -clap = {version = "4.5.1", features = ["derive"] } -clap_complete = "4.5.1" +cached = "0.53.1" +chrono = "0.4.38" +chrono-tz = "0.9.0" +clap = { version = "4.5.1", features = ["derive"] } +clap_complete = "4.5.12" codespan-reporting = "0.11" derive_more = "0.99" extend = "1.2" -futures = "0.3.28" -grass = {version = "0.13.1", default-features = false} +futures = "0.3.30" +grass = { version = "0.13.1", default-features = false } insta = "1.7" itertools = "0.12.1" -jaq-core = "1.2.1" -jaq-parse = "1.0.2" -jaq-std = {version = "1.2.1", features = ["bincode"]} -jaq-interpret = "1.2.1" -jaq-syn = "1.1.0" -lalrpop = { version = "0.20.0", features = ["unicode"] } -lalrpop-util = { version = "0.20.0", features = ["unicode"] } +jaq-core = "1.5.1" +jaq-parse = "1.0.3" +jaq-std = "1.6.0" +jaq-interpret = "1.5.0" +jaq-syn = "1.6.0" +lalrpop = { version = "0.20.2", features = ["unicode"] } +lalrpop-util = { version = "0.20.2", features = ["unicode"] } libc = "0.2" log = "0.4" maplit = "1" -nix = "0.27.1" +nix = "0.29.0" notify = "6.1.1" once_cell = "1.19" pretty_assertions = "1.4.0" pretty_env_logger = "0.5.0" ref-cast = "1.0.22" -regex = "1.10.3" +regex = "1.10.5" serde_json = "1.0" -serde = {version = "1.0", features = ["derive"]} +serde = { version = "1.0", features = ["derive"] } simple-signal = "1.1" smart-default = "0.7.1" static_assertions = "1.1.0" strsim = "0.11" strum = { version = "0.26", features = ["derive"] } -sysinfo = "0.30.5" +sysinfo = "0.31.2" thiserror = "1.0" -tokio-util = "0.7.8" -tokio = { version = "1.36.0", features = ["full"] } +tokio-util = "0.7.11" +tokio = { version = "1.39.2", features = ["full"] } unescape = "0.1" wait-timeout = "0.2" diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index f9e2b74..bb26a44 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -9,7 +9,6 @@ homepage = "https://github.com/elkowar/eww" edition = "2021" - [features] default = ["x11", "wayland"] x11 = ["gdkx11", "x11rb"] @@ -30,16 +29,16 @@ x11rb = { version = "0.13.1", features = ["randr"], optional = true } zbus = { version = "3.7.0", default-features = false, features = ["tokio"] } ordered-stream = "0.2.0" -anyhow.workspace = true +anyhow.workspace = true bincode.workspace = true chrono.workspace = true -clap = {workspace = true, features = ["derive"] } +clap = { workspace = true, features = ["derive"] } clap_complete.workspace = true codespan-reporting.workspace = true derive_more.workspace = true extend.workspace = true futures.workspace = true -grass = {workspace = true, default-features = false} +grass = { workspace = true, default-features = false } itertools.workspace = true libc.workspace = true log.workspace = true @@ -50,7 +49,7 @@ once_cell.workspace = true pretty_env_logger.workspace = true regex.workspace = true serde_json.workspace = true -serde = {workspace = true, features = ["derive"]} +serde = { workspace = true, features = ["derive"] } simple-signal.workspace = true sysinfo = { workspace = true } tokio-util.workspace = true diff --git a/crates/simplexpr/Cargo.toml b/crates/simplexpr/Cargo.toml index 420c04d..099d5dd 100644 --- a/crates/simplexpr/Cargo.toml +++ b/crates/simplexpr/Cargo.toml @@ -20,14 +20,14 @@ chrono.workspace = true itertools.workspace = true jaq-core.workspace = true jaq-parse.workspace = true -jaq-std = {workspace = true, features = ["bincode"]} +jaq-std.workspace = true jaq-interpret.workspace = true jaq-syn.workspace = true lalrpop-util.workspace = true once_cell.workspace = true regex.workspace = true serde_json.workspace = true -serde = {workspace = true, features = ["derive"]} +serde = { workspace = true, features = ["derive"] } static_assertions.workspace = true strsim.workspace = true strum = { workspace = true, features = ["derive"] } From dc395648521a8f0ba8f73032974d0ea852bafed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:29:55 +0200 Subject: [PATCH 17/88] chore: update itertools; update zbus --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- crates/eww/Cargo.toml | 2 +- crates/notifier_host/Cargo.toml | 2 +- crates/yuck/src/parser/ast_iterator.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e63c2e..2a723b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -976,7 +976,7 @@ dependencies = [ "grass", "gtk", "gtk-layer-shell", - "itertools 0.12.1", + "itertools 0.13.0", "libc", "log", "maplit", @@ -1690,9 +1690,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -2658,7 +2658,7 @@ dependencies = [ "chrono-tz", "eww_shared_util", "insta", - "itertools 0.12.1", + "itertools 0.13.0", "jaq-core", "jaq-interpret", "jaq-parse", @@ -3476,7 +3476,7 @@ dependencies = [ "derive_more", "eww_shared_util", "insta", - "itertools 0.12.1", + "itertools 0.13.0", "lalrpop", "lalrpop-util", "maplit", diff --git a/Cargo.toml b/Cargo.toml index 0a94d49..14a6af2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ extend = "1.2" futures = "0.3.30" grass = { version = "0.13.1", default-features = false } insta = "1.7" -itertools = "0.12.1" +itertools = "0.13.0" jaq-core = "1.5.1" jaq-parse = "1.0.3" jaq-std = "1.6.0" diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index bb26a44..e925d26 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -26,7 +26,7 @@ gtk-layer-shell = { version = "0.8.1", optional = true } gdkx11 = { version = "0.18", optional = true } x11rb = { version = "0.13.1", features = ["randr"], optional = true } -zbus = { version = "3.7.0", default-features = false, features = ["tokio"] } +zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } ordered-stream = "0.2.0" anyhow.workspace = true diff --git a/crates/notifier_host/Cargo.toml b/crates/notifier_host/Cargo.toml index af2ccbd..5426e22 100644 --- a/crates/notifier_host/Cargo.toml +++ b/crates/notifier_host/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://github.com/elkowar/eww" [dependencies] gtk = "0.18.1" -zbus = { version = "3.7.0", default-features = false, features = ["tokio"] } +zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } dbusmenu-gtk3 = "0.1.0" log.workspace = true diff --git a/crates/yuck/src/parser/ast_iterator.rs b/crates/yuck/src/parser/ast_iterator.rs index 603fdca..4cb6c2f 100644 --- a/crates/yuck/src/parser/ast_iterator.rs +++ b/crates/yuck/src/parser/ast_iterator.rs @@ -90,7 +90,7 @@ impl> AstIterator { parse_key_values(self, true) } - pub fn put_back(&mut self, ast: Ast) { + pub fn put_back(&mut self, ast: Ast) -> Option { self.remaining_span.0 = ast.span().0; self.iter.put_back(ast) } From 088809d7e8a3ade9d17bf6916845473033c25255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:36:54 +0200 Subject: [PATCH 18/88] chore(cargo): move gtk, zbus to workspace --- Cargo.toml | 2 ++ crates/eww/Cargo.toml | 5 ++--- crates/notifier_host/Cargo.toml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 14a6af2..60505e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ derive_more = "0.99" extend = "1.2" futures = "0.3.30" grass = { version = "0.13.1", default-features = false } +gtk = "0.18.1" insta = "1.7" itertools = "0.13.0" jaq-core = "1.5.1" @@ -53,6 +54,7 @@ tokio-util = "0.7.11" tokio = { version = "1.39.2", features = ["full"] } unescape = "0.1" wait-timeout = "0.2" +zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } [profile.dev] split-debuginfo = "unpacked" diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index e925d26..fa3837c 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -20,13 +20,10 @@ eww_shared_util.workspace = true yuck.workspace = true notifier_host.workspace = true -gtk = "0.18.1" - gtk-layer-shell = { version = "0.8.1", optional = true } gdkx11 = { version = "0.18", optional = true } x11rb = { version = "0.13.1", features = ["randr"], optional = true } -zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } ordered-stream = "0.2.0" anyhow.workspace = true @@ -39,6 +36,7 @@ derive_more.workspace = true extend.workspace = true futures.workspace = true grass = { workspace = true, default-features = false } +gtk.workspace = true itertools.workspace = true libc.workspace = true log.workspace = true @@ -56,3 +54,4 @@ tokio-util.workspace = true tokio = { workspace = true, features = ["full"] } unescape.workspace = true wait-timeout.workspace = true +zbus = { workspace = true, default-features = false, features = ["tokio"] } diff --git a/crates/notifier_host/Cargo.toml b/crates/notifier_host/Cargo.toml index 5426e22..c4fd64f 100644 --- a/crates/notifier_host/Cargo.toml +++ b/crates/notifier_host/Cargo.toml @@ -9,10 +9,10 @@ repository = "https://github.com/elkowar/eww" homepage = "https://github.com/elkowar/eww" [dependencies] -gtk = "0.18.1" -zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } dbusmenu-gtk3 = "0.1.0" +gtk.workspace = true log.workspace = true thiserror.workspace = true tokio = { workspace = true, features = ["full"] } +zbus = { workspace = true, default-features = false, features = ["tokio"] } From eda9d1e80369af9d116524d6064db12219bcd4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:31:56 +0200 Subject: [PATCH 19/88] fix: fix lints --- crates/eww/src/window_arguments.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/eww/src/window_arguments.rs b/crates/eww/src/window_arguments.rs index 44681e9..5a07979 100644 --- a/crates/eww/src/window_arguments.rs +++ b/crates/eww/src/window_arguments.rs @@ -59,10 +59,10 @@ impl WindowArguments { // Ensure that the arguments passed to the window that are already interpreted by eww (id, screen) // are set to the correct values - if expected_args.contains(&"id".to_string()) { + if expected_args.contains(&String::from("id")) { local_variables.insert(VarName::from("id"), DynVal::from(self.instance_id.clone())); } - if self.monitor.is_some() && expected_args.contains(&"screen".to_string()) { + if self.monitor.is_some() && expected_args.contains(&String::from("screen")) { let mon_dyn = DynVal::from(&self.monitor.clone().unwrap()); local_variables.insert(VarName::from("screen"), mon_dyn); } From 71ba5024421dd475e800c55f3efce1dd887cdc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:25:08 +0200 Subject: [PATCH 20/88] chore: update zbus --- Cargo.lock | 330 +++++------------- Cargo.toml | 2 +- crates/notifier_host/src/host.rs | 4 +- crates/notifier_host/src/icon.rs | 8 +- crates/notifier_host/src/item.rs | 2 +- .../src/proxy/dbus_status_notifier_item.rs | 69 ++-- .../src/proxy/dbus_status_notifier_watcher.rs | 39 +-- crates/notifier_host/src/watcher.rs | 20 +- 8 files changed, 162 insertions(+), 312 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a723b2..35ac7f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,12 +126,14 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.5.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 2.5.3", + "event-listener", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] @@ -146,80 +148,54 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2 0.4.10", - "waker-fn", -] - [[package]] name = "async-io" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.4.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling", + "rustix", "slab", "tracing", "windows-sys 0.52.0", ] -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-lock" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "1.8.1" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", + "async-channel", + "async-io", + "async-lock", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.34", - "windows-sys 0.48.0", + "event-listener", + "futures-lite", + "rustix", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -239,13 +215,13 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", + "async-io", + "async-lock", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix", "signal-hook-registry", "slab", "windows-sys 0.52.0", @@ -378,7 +354,7 @@ dependencies = [ "async-channel", "async-task", "futures-io", - "futures-lite 2.3.0", + "futures-lite", "piper", ] @@ -782,17 +758,6 @@ dependencies = [ "system-deps 6.2.2", ] -[[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.18" @@ -870,6 +835,12 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + [[package]] name = "enumflags2" version = "0.7.10" @@ -920,23 +891,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.1" @@ -954,7 +908,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.1", + "event-listener", "pin-project-lite", ] @@ -980,7 +934,7 @@ dependencies = [ "libc", "log", "maplit", - "nix 0.29.0", + "nix", "notifier_host", "notify", "once_cell", @@ -1021,15 +975,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.1.0" @@ -1042,7 +987,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.1", + "memoffset", "rustc_version", ] @@ -1127,28 +1072,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ + "fastrand", "futures-core", + "futures-io", + "parking", "pin-project-lite", ] @@ -1379,7 +1312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", @@ -1642,26 +1575,6 @@ dependencies = [ "similar", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "is-terminal" version = "0.4.12" @@ -1866,12 +1779,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1906,15 +1813,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[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.9.1" @@ -1963,18 +1861,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", -] - [[package]] name = "nix" version = "0.29.0" @@ -1985,6 +1871,7 @@ dependencies = [ "cfg-if", "cfg_aliases", "libc", + "memoffset", ] [[package]] @@ -2220,7 +2107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand", "futures-io", ] @@ -2230,22 +2117,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - [[package]] name = "polling" version = "3.7.2" @@ -2256,7 +2127,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix", "tracing", "windows-sys 0.52.0", ] @@ -2308,14 +2179,22 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_datetime", "toml_edit 0.20.2", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2501,20 +2380,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.34" @@ -2524,7 +2389,7 @@ dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -2708,16 +2573,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.7" @@ -2782,7 +2637,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] @@ -2850,8 +2704,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", + "fastrand", + "rustix", "windows-sys 0.52.0", ] @@ -2917,7 +2771,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "tracing", "windows-sys 0.52.0", @@ -2961,9 +2815,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -2992,6 +2846,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.40" @@ -3035,7 +2900,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.1", + "memoffset", "tempfile", "winapi", ] @@ -3097,12 +2962,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - [[package]] name = "walkdir" version = "2.5.0" @@ -3441,7 +3300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "rustix 0.38.34", + "rustix", "x11rb-protocol", ] @@ -3493,24 +3352,21 @@ dependencies = [ [[package]] name = "zbus" -version = "3.15.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" dependencies = [ "async-broadcast", "async-process", "async-recursion", "async-trait", - "byteorder", - "derivative", "enumflags2", - "event-listener 2.5.3", + "event-listener", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.26.4", - "once_cell", + "nix", "ordered-stream", "rand", "serde", @@ -3520,7 +3376,7 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "winapi", + "windows-sys 0.52.0", "xdg-home", "zbus_macros", "zbus_names", @@ -3529,23 +3385,22 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "regex", - "syn 1.0.109", + "syn 2.0.72", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.6.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" dependencies = [ "serde", "static_assertions", @@ -3595,13 +3450,12 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" dependencies = [ - "byteorder", + "endi", "enumflags2", - "libc", "serde", "static_assertions", "zvariant_derive", @@ -3609,24 +3463,24 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.2" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] diff --git a/Cargo.toml b/Cargo.toml index 60505e9..003ee21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ tokio-util = "0.7.11" tokio = { version = "1.39.2", features = ["full"] } unescape = "0.1" wait-timeout = "0.2" -zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } +zbus = { version = "4.4.0", default-features = false, features = ["tokio"] } [profile.dev] split-debuginfo = "unpacked" diff --git a/crates/notifier_host/src/host.rs b/crates/notifier_host/src/host.rs index b937395..723322e 100644 --- a/crates/notifier_host/src/host.rs +++ b/crates/notifier_host/src/host.rs @@ -88,7 +88,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro // initial items first for svc in try_!(snw.registered_status_notifier_items().await) { - match Item::from_address(snw.connection(), &svc).await { + match Item::from_address(snw.inner().connection(), &svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(&svc, item); @@ -110,7 +110,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro if item_names.contains(svc) { log::info!("Got duplicate new item: {:?}", svc); } else { - match Item::from_address(snw.connection(), svc).await { + match Item::from_address(snw.inner().connection(), svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(svc, item); diff --git a/crates/notifier_host/src/icon.rs b/crates/notifier_host/src/icon.rs index c903a15..ad6fdb1 100644 --- a/crates/notifier_host/src/icon.rs +++ b/crates/notifier_host/src/icon.rs @@ -136,7 +136,7 @@ pub async fn load_icon_from_sni( let icon_from_name: std::result::Result = (async { // fetch icon name let icon_name = sni.icon_name().await; - log::debug!("dbus: {} icon_name -> {:?}", sni.destination(), icon_name); + log::debug!("dbus: {} icon_name -> {:?}", sni.inner().destination(), icon_name); let icon_name = match icon_name { Ok(s) if s.is_empty() => return Err(IconError::NotAvailable), Ok(s) => s, @@ -152,7 +152,7 @@ pub async fn load_icon_from_sni( // otherwise, fetch icon theme and lookup using icon_from_name let icon_theme_path = sni.icon_theme_path().await; - log::debug!("dbus: {} icon_theme_path -> {:?}", sni.destination(), icon_theme_path); + log::debug!("dbus: {} icon_theme_path -> {:?}", sni.inner().destination(), icon_theme_path); let icon_theme_path = match icon_theme_path { Ok(p) if p.is_empty() => None, Ok(p) => Some(p), @@ -179,7 +179,7 @@ pub async fn load_icon_from_sni( match icon_from_name { Ok(p) => return Some(p), // got an icon! Err(IconError::NotAvailable) => {} // this error is expected, don't log - Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.destination(), e), + Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.inner().destination(), e), }; // Can't get it from name + theme, try the pixmap @@ -199,7 +199,7 @@ pub async fn load_icon_from_sni( match icon_from_pixmaps { Ok(p) => return Some(p), Err(IconError::NotAvailable) => {} - Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.destination(), e), + Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.inner().destination(), e), }; // Tray didn't provide a valid icon so use the default fallback one. diff --git a/crates/notifier_host/src/item.rs b/crates/notifier_host/src/item.rs index a6cb2af..ad63f34 100644 --- a/crates/notifier_host/src/item.rs +++ b/crates/notifier_host/src/item.rs @@ -82,7 +82,7 @@ impl Item { } pub async fn set_menu(&mut self, widget: >k::EventBox) -> zbus::Result<()> { - let menu = dbusmenu_gtk3::Menu::new(self.sni.destination(), &self.sni.menu().await?); + let menu = dbusmenu_gtk3::Menu::new(self.sni.inner().destination(), &self.sni.menu().await?); menu.set_attach_widget(Some(widget)); self.gtk_menu = Some(menu); Ok(()) diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs index 5c57b2a..051f180 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs @@ -1,20 +1,18 @@ -//! # DBus interface proxy for: `org.kde.StatusNotifierItem` +//! # D-Bus interface proxy for: `org.kde.StatusNotifierItem` //! -//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. -//! Source: `dbus-status-notifier-item.xml`. +//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. +//! Source: `dbus_status_notifier_item.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the -//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. - -// suppress warning from generated code -#![allow(clippy::type_complexity)] - -use zbus::dbus_proxy; - -#[dbus_proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] +//! More information can be found in the [Writing a client proxy] section of the zbus +//! documentation. +//! +//! +//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html +//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, +use zbus::proxy; +#[proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] trait StatusNotifierItem { /// Activate method fn activate(&self, x: i32, y: i32) -> zbus::Result<()>; @@ -29,86 +27,87 @@ trait StatusNotifierItem { fn secondary_activate(&self, x: i32, y: i32) -> zbus::Result<()>; /// NewAttentionIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_attention_icon(&self) -> zbus::Result<()>; /// NewIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_icon(&self) -> zbus::Result<()>; /// NewOverlayIcon signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_overlay_icon(&self) -> zbus::Result<()>; /// NewStatus signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_status(&self, status: &str) -> zbus::Result<()>; /// NewTitle signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_title(&self) -> zbus::Result<()>; /// NewToolTip signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn new_tool_tip(&self) -> zbus::Result<()>; /// AttentionIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_name(&self) -> zbus::Result; /// AttentionIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_icon_pixmap(&self) -> zbus::Result)>>; /// AttentionMovieName property - #[dbus_proxy(property)] + #[zbus(property)] fn attention_movie_name(&self) -> zbus::Result; /// Category property - #[dbus_proxy(property)] + #[zbus(property)] fn category(&self) -> zbus::Result; /// IconName property - #[dbus_proxy(property(emits_changed_signal = "false"))] + #[zbus(property)] fn icon_name(&self) -> zbus::Result; /// IconPixmap property - #[dbus_proxy(property(emits_changed_signal = "false"))] + #[zbus(property)] fn icon_pixmap(&self) -> zbus::Result)>>; /// IconThemePath property - #[dbus_proxy(property)] + #[zbus(property)] fn icon_theme_path(&self) -> zbus::Result; /// Id property - #[dbus_proxy(property)] + #[zbus(property)] fn id(&self) -> zbus::Result; /// ItemIsMenu property - #[dbus_proxy(property)] + #[zbus(property)] fn item_is_menu(&self) -> zbus::Result; /// Menu property - #[dbus_proxy(property)] + #[zbus(property)] fn menu(&self) -> zbus::Result; /// OverlayIconName property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_name(&self) -> zbus::Result; /// OverlayIconPixmap property - #[dbus_proxy(property)] + #[zbus(property)] fn overlay_icon_pixmap(&self) -> zbus::Result)>>; /// Status property - #[dbus_proxy(property)] + #[zbus(property)] fn status(&self) -> zbus::Result; /// Title property - #[dbus_proxy(property)] + #[zbus(property)] fn title(&self) -> zbus::Result; /// ToolTip property - #[dbus_proxy(property)] - fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>)>; + #[zbus(property)] + #[allow(clippy::type_complexity)] + fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>, String, String)>; } diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs index 9ac2eaa..3336baa 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs @@ -1,21 +1,18 @@ -//! # DBus interface proxy for: `org.kde.StatusNotifierWatcher` +//! # D-Bus interface proxy for: `org.kde.StatusNotifierWatcher` //! -//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. -//! Source: `dbus-status-notifier-watcher.xml`. +//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. +//! Source: `dbus_status_notifier_watcher.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the -//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. - -use zbus::dbus_proxy; - -#[dbus_proxy( - default_service = "org.kde.StatusNotifierWatcher", - interface = "org.kde.StatusNotifierWatcher", - default_path = "/StatusNotifierWatcher" -)] +//! More information can be found in the [Writing a client proxy] section of the zbus +//! documentation. +//! +//! +//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html +//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, +use zbus::proxy; +#[proxy(interface = "org.kde.StatusNotifierWatcher", assume_defaults = true)] trait StatusNotifierWatcher { /// RegisterStatusNotifierHost method fn register_status_notifier_host(&self, service: &str) -> zbus::Result<()>; @@ -24,30 +21,30 @@ trait StatusNotifierWatcher { fn register_status_notifier_item(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierHostRegistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_registered(&self) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_host_unregistered(&self) -> zbus::Result<()>; /// StatusNotifierItemRegistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_registered(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[dbus_proxy(signal)] + #[zbus(signal)] fn status_notifier_item_unregistered(&self, service: &str) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[dbus_proxy(property)] + #[zbus(property)] fn is_status_notifier_host_registered(&self) -> zbus::Result; /// ProtocolVersion property - #[dbus_proxy(property)] + #[zbus(property)] fn protocol_version(&self) -> zbus::Result; /// RegisteredStatusNotifierItems property - #[dbus_proxy(property)] + #[zbus(property)] fn registered_status_notifier_items(&self) -> zbus::Result>; } diff --git a/crates/notifier_host/src/watcher.rs b/crates/notifier_host/src/watcher.rs index a0e7c13..677e378 100644 --- a/crates/notifier_host/src/watcher.rs +++ b/crates/notifier_host/src/watcher.rs @@ -1,5 +1,5 @@ use crate::names; -use zbus::{dbus_interface, export::ordered_stream::OrderedStreamExt, Interface}; +use zbus::{export::ordered_stream::OrderedStreamExt, interface, Interface}; /// An instance of [`org.kde.StatusNotifierWatcher`]. It only tracks what tray items and trays /// exist, and doesn't have any logic for displaying items (for that, see [`Host`][`crate::Host`]). @@ -23,7 +23,7 @@ pub struct Watcher { /// /// Methods and properties correspond to methods and properties on the DBus service that can be /// used by others, while signals are events that we generate that other services listen to. -#[dbus_interface(name = "org.kde.StatusNotifierWatcher")] +#[interface(name = "org.kde.StatusNotifierWatcher")] impl Watcher { /// RegisterStatusNotifierHost method async fn register_status_notifier_host( @@ -89,15 +89,15 @@ impl Watcher { } /// StatusNotifierHostRegistered signal. - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_host_registered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_host_unregistered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[dbus_interface(property)] + #[zbus(property)] async fn is_status_notifier_host_registered(&self) -> bool { let hosts = self.hosts.lock().unwrap(); // unwrap: mutex poisoning is okay !hosts.is_empty() @@ -159,15 +159,15 @@ impl Watcher { } /// StatusNotifierItemRegistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_registered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[dbus_interface(signal)] + #[zbus(signal)] async fn status_notifier_item_unregistered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// RegisteredStatusNotifierItems property - #[dbus_interface(property)] + #[zbus(property)] async fn registered_status_notifier_items(&self) -> Vec { let items = self.items.lock().unwrap(); // unwrap: mutex poisoning is okay items.iter().cloned().collect() @@ -176,7 +176,7 @@ impl Watcher { // ------------------------------------------------------------------------ /// ProtocolVersion property - #[dbus_interface(property)] + #[zbus(property)] fn protocol_version(&self) -> i32 { 0 } @@ -244,7 +244,7 @@ async fn parse_service<'a>( ) -> zbus::fdo::Result<(zbus::names::UniqueName<'static>, &'a str)> { if service.starts_with('/') { // they sent us just the object path - if let Some(sender) = hdr.sender()? { + if let Some(sender) = hdr.sender() { Ok((sender.to_owned(), service)) } else { log::warn!("unknown sender"); From 5cec8736a7fd4a0702e3a599f8667b52209f12b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:47:38 +0200 Subject: [PATCH 21/88] docs: update zbus-xmlgen generation commands; add zbus-xmlgen to development shell --- crates/notifier_host/src/proxy/mod.rs | 7 ++++--- flake.nix | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/notifier_host/src/proxy/mod.rs b/crates/notifier_host/src/proxy/mod.rs index 8c8e9df..58b5128 100644 --- a/crates/notifier_host/src/proxy/mod.rs +++ b/crates/notifier_host/src/proxy/mod.rs @@ -2,9 +2,10 @@ //! //! The interface XML files were taken from //! [Waybar](https://github.com/Alexays/Waybar/tree/master/protocol), and the proxies were -//! generated with [zbus-xmlgen](https://docs.rs/crate/zbus_xmlgen/latest) by running `zbus-xmlgen -//! dbus_status_notifier_item.xml` and `zbus-xmlgen dbus_status_notifier_watcher.xml`. At the -//! moment, `dbus_menu.xml` isn't used. +//! generated with [zbus-xmlgen](https://docs.rs/crate/zbus_xmlgen/latest) by running +//! `zbus-xmlgen file crates/notifier_host/src/proxy/dbus_status_notifier_item.xml` and +//! `zbus-xmlgen file crates/notifier_host/src/proxy/dbus_status_notifier_watcher.xml`. +//! At the moment, `dbus_menu.xml` isn't used. //! //! For more information, see ["Writing a client proxy" in the zbus //! tutorial](https://dbus2.github.io/zbus/). diff --git a/flake.nix b/flake.nix index 6de91fe..8ddf153 100644 --- a/flake.nix +++ b/flake.nix @@ -86,6 +86,7 @@ packages = with pkgs; [ deno mdbook + zbus-xmlgen ]; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; From 65fab811e93103632c6ba777a5b02543a632bc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:50:58 +0200 Subject: [PATCH 22/88] chore: automatically update a few dependencies --- Cargo.lock | 54 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35ac7f1..aa2d6dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,9 +372,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cached" @@ -2183,7 +2183,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_edit 0.20.2", + "toml_edit 0.20.7", ] [[package]] @@ -2338,9 +2338,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -2448,9 +2448,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", "memchr", @@ -2803,14 +2803,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.20", ] [[package]] @@ -2830,20 +2830,18 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap", - "serde", - "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -2854,7 +2852,20 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.18", ] [[package]] @@ -3283,6 +3294,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + [[package]] name = "x11" version = "2.21.0" From 7aa571eef19873162e9000d180ade1869076f06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:26:28 +0200 Subject: [PATCH 23/88] docs: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3530092..0d0ef84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix remove items from systray (By: vnva) ### Features +- Update rust toolchain to 1.80.0 (By: w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) From a96b7ec7ebd500baf2a3c4892bb373db25804bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Sun, 4 Aug 2024 12:23:19 +0200 Subject: [PATCH 24/88] chore: automatically update a few dependencies --- Cargo.lock | 52 +++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa2d6dd..9a66181 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ dependencies = [ "getrandom", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -2134,11 +2134,11 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.6.6", + "zerocopy", ] [[package]] @@ -2699,12 +2699,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys 0.52.0", ] @@ -3071,11 +3072,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3164,6 +3165,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3427,34 +3437,14 @@ dependencies = [ "zvariant", ] -[[package]] -name = "zerocopy" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" -dependencies = [ - "byteorder", - "zerocopy-derive 0.6.6", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy-derive" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "byteorder", + "zerocopy-derive", ] [[package]] From e4ea48938605c9524736945dafa617f16f22e4b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:25:49 +0200 Subject: [PATCH 25/88] fix: update grass; re-enable default features for grass --- CHANGELOG.md | 1 + Cargo.lock | 10 ++++++---- Cargo.toml | 2 +- crates/eww/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d0ef84..1bc1c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to eww will be listed here, starting at changes since versio ## Unreleased ### Fixes +- Re-enable some scss features (By: w-lfchen) - Fix and refactor nix flake (By: w-lfchen) - Fix remove items from systray (By: vnva) diff --git a/Cargo.lock b/Cargo.lock index 9a66181..6588ee2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1342,25 +1342,27 @@ dependencies = [ [[package]] name = "grass" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a46def7216d331efa51a6aa796ef777bfdfe9605378382827a553344b7e5eefc" +checksum = "f7a68216437ef68f0738e48d6c7bb9e6e6a92237e001b03d838314b068f33c94" dependencies = [ + "clap", "getrandom", "grass_compiler", ] [[package]] name = "grass_compiler" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39216c1843182f78541276fec96f88406861f16aa19cc9f8add70f8e67b7577" +checksum = "2d9e3df7f0222ce5184154973d247c591d9aadc28ce7a73c6cd31100c9facff6" dependencies = [ "codemap", "indexmap", "lasso", "once_cell", "phf", + "rand", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 003ee21..98fcd32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ codespan-reporting = "0.11" derive_more = "0.99" extend = "1.2" futures = "0.3.30" -grass = { version = "0.13.1", default-features = false } +grass = "0.13.4" gtk = "0.18.1" insta = "1.7" itertools = "0.13.0" diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index fa3837c..4c7a444 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -35,7 +35,7 @@ codespan-reporting.workspace = true derive_more.workspace = true extend.workspace = true futures.workspace = true -grass = { workspace = true, default-features = false } +grass.workspace = true gtk.workspace = true itertools.workspace = true libc.workspace = true From 4288771181af83951903de9b76a90ac8e70991cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:06:57 +0200 Subject: [PATCH 26/88] chore: automatically update a few dependencies --- Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6588ee2..e5ea914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" [[package]] name = "cfg-expr" @@ -1927,9 +1927,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -2430,18 +2430,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", @@ -2701,15 +2701,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From fdac6b5cd9b2ae28e91e8ce4d817b8240ad49b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:12:22 +0200 Subject: [PATCH 27/88] chore: update derive_more to 1.0 --- Cargo.lock | 22 ++++++++++++---------- Cargo.toml | 8 +++++++- crates/eww/src/geometry.rs | 4 ++-- crates/eww_shared_util/src/wrappers.rs | 10 +++++----- crates/yuck/src/value/coords.rs | 14 +++++++------- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5ea914..e4e7056 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -599,12 +599,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[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.6" @@ -760,15 +754,23 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn 2.0.72", + "unicode-xid", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 98fcd32..b457ed4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,13 @@ chrono-tz = "0.9.0" clap = { version = "4.5.1", features = ["derive"] } clap_complete = "4.5.12" codespan-reporting = "0.11" -derive_more = "0.99" +derive_more = { version = "1", features = [ + "as_ref", + "debug", + "display", + "from", + "from_str", +] } extend = "1.2" futures = "0.3.30" grass = "0.13.4" diff --git a/crates/eww/src/geometry.rs b/crates/eww/src/geometry.rs index bde5180..efe6352 100644 --- a/crates/eww/src/geometry.rs +++ b/crates/eww/src/geometry.rs @@ -1,7 +1,7 @@ -use derive_more::*; +use derive_more::{Debug, *}; #[derive(Debug, Copy, Clone, Eq, PartialEq, Display)] -#[display(fmt = ".x*.y:.width*.height")] +#[display(".x*.y:.width*.height")] pub struct Rect { pub x: i32, pub y: i32, diff --git a/crates/eww_shared_util/src/wrappers.rs b/crates/eww_shared_util/src/wrappers.rs index ef07c79..c9beb80 100644 --- a/crates/eww_shared_util/src/wrappers.rs +++ b/crates/eww_shared_util/src/wrappers.rs @@ -1,11 +1,11 @@ -use derive_more::*; +use derive_more::{Debug, *}; use ref_cast::RefCast; use serde::{Deserialize, Serialize}; /// The name of a variable #[repr(transparent)] -#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, DebugCustom, RefCast)] -#[debug(fmt = "VarName({})", .0)] +#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, Debug, RefCast)] +#[debug("VarName({})", _0)] pub struct VarName(pub String); impl std::borrow::Borrow for VarName { @@ -34,8 +34,8 @@ impl From for VarName { /// The name of an attribute #[repr(transparent)] -#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, DebugCustom, RefCast)] -#[debug(fmt="AttrName({})", .0)] +#[derive(Clone, Hash, PartialEq, Eq, Serialize, Deserialize, AsRef, From, FromStr, Display, Debug, RefCast)] +#[debug("AttrName({})", _0)] pub struct AttrName(pub String); impl AttrName { diff --git a/crates/yuck/src/value/coords.rs b/crates/yuck/src/value/coords.rs index f500dff..4c999db 100644 --- a/crates/yuck/src/value/coords.rs +++ b/crates/yuck/src/value/coords.rs @@ -1,4 +1,4 @@ -use derive_more::*; +use derive_more::{Debug, *}; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use smart_default::SmartDefault; @@ -14,13 +14,13 @@ pub enum Error { MalformedCoords, } -#[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, DebugCustom, SmartDefault)] +#[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, Debug, SmartDefault)] pub enum NumWithUnit { - #[display(fmt = "{}%", .0)] - #[debug(fmt = "{}%", .0)] + #[display("{}%", _0)] + #[debug("{}%", _0)] Percent(f32), - #[display(fmt = "{}px", .0)] - #[debug(fmt = "{}px", .0)] + #[display("{}px", _0)] + #[debug("{}px", _0)] #[default] Pixels(i32), } @@ -58,7 +58,7 @@ impl FromStr for NumWithUnit { } #[derive(Clone, Copy, PartialEq, Deserialize, Serialize, Display, Default)] -#[display(fmt = "{}*{}", x, y)] +#[display("{}*{}", x, y)] pub struct Coords { pub x: NumWithUnit, pub y: NumWithUnit, From 44e7b63c85903c567ceb1dea9684bce2bdf39879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:01:52 +0200 Subject: [PATCH 28/88] chore: automatically update a few dependencies --- Cargo.lock | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4e7056..6087648 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,9 +509,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.13" +version = "4.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "c937d4061031a6d0c8da4b9a4f98a172fc2976dfb1c19213a9cf7d0d3c837e36" dependencies = [ "clap_builder", "clap_derive", @@ -519,9 +519,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "85379ba512b21a328adf887e85f7742d12e96eb31f3ef077df4ffc26b506ffed" dependencies = [ "anstream", "anstyle", @@ -531,9 +531,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.12" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8670053e87c316345e384ca1f3eba3006fc6355ed8b8a1140d104e109e3df34" +checksum = "aa3c596da3cf0983427b0df0dba359df9182c13bd5b519b585a482b0c351f4e8" dependencies = [ "clap", ] @@ -995,14 +995,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -1775,6 +1775,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -2001,7 +2002,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -2291,15 +2292,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -3346,12 +3338,12 @@ checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "xdg-home" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From ffe43eda85a7e51c4e3b244e0786d588b58fa308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Sun, 11 Aug 2024 20:51:25 +0200 Subject: [PATCH 29/88] chore: automatically update a few dependencies --- Cargo.lock | 124 ++++++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6087648..b4245ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,9 +150,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock", "cfg-if", @@ -164,7 +164,7 @@ dependencies = [ "rustix", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.2.3" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" +checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" dependencies = [ "async-channel", "async-io", @@ -195,7 +195,7 @@ dependencies = [ "futures-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -206,14 +206,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] name = "async-signal" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ "async-io", "async-lock", @@ -224,7 +224,7 @@ dependencies = [ "rustix", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -241,7 +241,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -400,7 +400,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.8" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" [[package]] name = "cfg-expr" @@ -509,9 +509,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.14" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c937d4061031a6d0c8da4b9a4f98a172fc2976dfb1c19213a9cf7d0d3c837e36" +checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" dependencies = [ "clap_builder", "clap_derive", @@ -519,9 +519,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.14" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85379ba512b21a328adf887e85f7742d12e96eb31f3ef077df4ffc26b506ffed" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -531,9 +531,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.13" +version = "4.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa3c596da3cf0983427b0df0dba359df9182c13bd5b519b585a482b0c351f4e8" +checksum = "1d11bff0290e9a266fc9b4ce6fa96c2bf2ca3f9724c41c10202ac1daf7a087f8" dependencies = [ "clap", ] @@ -547,7 +547,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -601,9 +601,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" @@ -685,7 +685,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -696,7 +696,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -769,7 +769,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "unicode-xid", ] @@ -861,7 +861,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -974,7 +974,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1095,7 +1095,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1318,7 +1318,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1444,7 +1444,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2066,7 +2066,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2107,9 +2107,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", "fastrand", @@ -2124,9 +2124,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", @@ -2134,7 +2134,7 @@ dependencies = [ "pin-project-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2329,7 +2329,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2424,29 +2424,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.205" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.205" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "a11b3b6ce5cfd25b9759a24c3ed4bf24e23893866863547de4655518c951bcd4" dependencies = [ "itoa", "memchr", @@ -2462,7 +2462,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2566,7 +2566,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2623,7 +2623,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2638,9 +2638,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -2743,7 +2743,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2782,7 +2782,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2884,7 +2884,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3007,7 +3007,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-shared", ] @@ -3029,7 +3029,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3072,7 +3072,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -3120,7 +3120,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3131,7 +3131,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3418,7 +3418,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "zvariant_utils", ] @@ -3451,7 +3451,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3476,7 +3476,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "zvariant_utils", ] @@ -3488,5 +3488,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] From 56e2fdae55bf01ad3d90a91519c3328a66d128fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:22:47 +0200 Subject: [PATCH 30/88] chore: automatically update a few dependencies --- Cargo.lock | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4245ed..066aa79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -531,9 +531,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.14" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d11bff0290e9a266fc9b4ce6fa96c2bf2ca3f9724c41c10202ac1daf7a087f8" +checksum = "9c677cd0126f3026d8b093fa29eae5d812fde5c05bc66dbb29d0374eea95113a" dependencies = [ "clap", ] @@ -607,9 +607,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -1682,9 +1682,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1850,9 +1850,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -2424,18 +2424,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.206" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.206" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", @@ -2444,9 +2444,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.123" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a11b3b6ce5cfd25b9759a24c3ed4bf24e23893866863547de4655518c951bcd4" +checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" dependencies = [ "itoa", "memchr", @@ -2764,7 +2764,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -2988,19 +2988,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -3013,9 +3014,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3023,9 +3024,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -3036,9 +3037,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-time" From c69aa92c36c3d3c74d7d5a815c3c99f00e89fdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:05:21 +0200 Subject: [PATCH 31/88] chore: automatically update a few dependencies --- Cargo.lock | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 066aa79..9f3219b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,9 +436,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.10" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" +checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" +dependencies = [ + "shlex", +] [[package]] name = "cfg-expr" @@ -1539,9 +1542,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -2485,6 +2488,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" From faa73137b4f2d21e21a2918ac0cb4c3ef28952d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:03:20 +0200 Subject: [PATCH 32/88] chore: update toolchain to 1.80.1 --- CHANGELOG.md | 2 +- Cargo.lock | 14 +++++++------- flake.lock | 12 ++++++------ rust-toolchain.toml | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bc1c40..79f4c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix remove items from systray (By: vnva) ### Features -- Update rust toolchain to 1.80.0 (By: w-lfchen) +- Update rust toolchain to 1.80.1 (By: w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) diff --git a/Cargo.lock b/Cargo.lock index 9f3219b..5570578 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.11" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" +checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" dependencies = [ "shlex", ] @@ -1584,11 +1584,11 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -2447,9 +2447,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", diff --git a/flake.lock b/flake.lock index 2ef88d9..ccf21d5 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722141560, - "narHash": "sha256-Ul3rIdesWaiW56PS/Ak3UlJdkwBrD4UcagCmXZR9Z7Y=", + "lastModified": 1723635686, + "narHash": "sha256-iNYh7Kb0D+MQ8IHM4+8bT1bUS5RNW6gVSDe2yTO1aAk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "038fb464fcfa79b4f08131b07f2d8c9a6bcc4160", + "rev": "0cb2fd7c59fed0cd82ef858cbcbdb552b9a33465", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1722305989, - "narHash": "sha256-ljiuTGSFuEtudqFqp/5Wr1OuEsVCjur/F2CmlNujSjc=", + "lastModified": 1723688259, + "narHash": "sha256-WzeUR1MG9MnJnh9T7qcVe/v12qHvJvzdc3Z5HCeE2ns=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "38c2f156fca1868c8be7195ddac150522752f6ab", + "rev": "6e75319846684326d900daff1e2e11338cc80d2b", "type": "github" }, "original": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1a17e1d..4168f18 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.80.0" +channel = "1.80.1" components = [ "rust-src" ] profile = "default" From b62094fa5d7fd3a749072a7b592da2a7077d61f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= <115360611+W-lfchen@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:29:54 +0200 Subject: [PATCH 33/88] chore: automatically update a few dependencies --- Cargo.lock | 139 +++++++++++++++++++++++++++-------------------------- 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5570578..7c5b7da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -241,7 +241,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -385,7 +385,7 @@ dependencies = [ "ahash", "cached_proc_macro", "cached_proc_macro_types", - "hashbrown 0.14.5", + "hashbrown", "once_cell", "thiserror", "web-time", @@ -400,7 +400,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.12" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ "shlex", ] @@ -453,6 +453,16 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-expr" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -507,14 +517,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" dependencies = [ - "hashbrown 0.14.5", + "hashbrown", ] [[package]] name = "clap" -version = "4.5.15" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -534,9 +544,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.16" +version = "4.5.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c677cd0126f3026d8b093fa29eae5d812fde5c05bc66dbb29d0374eea95113a" +checksum = "9340e41703683548f486fdfdce615b0520dd220d18b1d4ce5abbc87d461c221b" dependencies = [ "clap", ] @@ -550,7 +560,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -688,7 +698,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -699,7 +709,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -772,7 +782,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "unicode-xid", ] @@ -864,7 +874,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -977,7 +987,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1098,7 +1108,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1321,7 +1331,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1416,7 +1426,7 @@ dependencies = [ "glib-sys", "gtk-sys", "libc", - "system-deps 7.0.1", + "system-deps 7.0.2", ] [[package]] @@ -1447,16 +1457,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", + "syn 2.0.75", ] [[package]] @@ -1547,7 +1548,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown", ] [[package]] @@ -1745,11 +1746,11 @@ dependencies = [ [[package]] name = "lasso" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4644821e1c3d7a560fe13d842d13f587c07348a1a05d3a797152d41c90c56df2" +checksum = "6e14eda50a3494b3bf7b9ce51c52434a761e383d7238ce1dd5dcec2fbc13e9fb" dependencies = [ - "hashbrown 0.13.2", + "hashbrown", ] [[package]] @@ -1760,9 +1761,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libm" @@ -2069,7 +2070,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2306,9 +2307,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -2332,7 +2333,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2427,22 +2428,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2465,7 +2466,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2575,7 +2576,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2632,7 +2633,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2647,9 +2648,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -2676,7 +2677,7 @@ version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr", + "cfg-expr 0.15.8", "heck 0.5.0", "pkg-config", "toml", @@ -2685,11 +2686,11 @@ dependencies = [ [[package]] name = "system-deps" -version = "7.0.1" +version = "7.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922" +checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031" dependencies = [ - "cfg-expr", + "cfg-expr 0.16.0", "heck 0.5.0", "pkg-config", "toml", @@ -2752,7 +2753,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2766,9 +2767,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -2791,7 +2792,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2893,7 +2894,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2942,9 +2943,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "urlencoding" @@ -3017,7 +3018,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-shared", ] @@ -3039,7 +3040,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3130,7 +3131,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -3141,7 +3142,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -3428,7 +3429,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "zvariant_utils", ] @@ -3461,7 +3462,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -3486,7 +3487,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "zvariant_utils", ] @@ -3498,5 +3499,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] From 367363975e29c8eedfd63d3fbe717d3ac768a25d Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Sat, 24 Aug 2024 13:30:06 +0300 Subject: [PATCH 34/88] Fix: the gtk `stack` widget bugfix (#1119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed the gtk stack widget * Add changelog entry for the stack widget bugfix * Small code style improvement Co-authored-by: Wölfchen --------- Co-authored-by: ElKowar Co-authored-by: Wölfchen --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 44 ++++++++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79f4c5f..aa04fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Re-enable some scss features (By: w-lfchen) - Fix and refactor nix flake (By: w-lfchen) - Fix remove items from systray (By: vnva) +- Fix the gtk `stack` widget (By: ovalkonia) ### Features - Update rust toolchain to 1.80.1 (By: w-lfchen) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index c4d78a6..ac451eb 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1089,6 +1089,27 @@ const WIDGET_NAME_STACK: &str = "stack"; /// @desc A widget that displays one of its children at a time fn build_gtk_stack(bargs: &mut BuilderArgs) -> Result { let gtk_widget = gtk::Stack::new(); + + if bargs.widget_use.children.len() < 1 { + return Err(DiagError(gen_diagnostic!("stack must contain at least one element", bargs.widget_use.span)).into()); + } + + let children = bargs.widget_use.children.iter().map(|child| { + build_gtk_widget( + bargs.scope_graph, + bargs.widget_defs.clone(), + bargs.calling_scope, + child.clone(), + bargs.custom_widget_invocation.clone(), + ) + }); + + for (i, child) in children.enumerate() { + let child = child?; + gtk_widget.add_named(&child, &i.to_string()); + child.show(); + } + def_widget!(bargs, _g, gtk_widget, { // @prop selected - index of child which should be shown prop(selected: as_i32) { gtk_widget.set_visible_child_name(&selected.to_string()); }, @@ -1098,28 +1119,7 @@ fn build_gtk_stack(bargs: &mut BuilderArgs) -> Result { prop(same_size: as_bool = false) { gtk_widget.set_homogeneous(same_size); } }); - match bargs.widget_use.children.len().cmp(&1) { - Ordering::Less => { - Err(DiagError(gen_diagnostic!("stack must contain at least one element", bargs.widget_use.span)).into()) - } - Ordering::Greater | Ordering::Equal => { - let children = bargs.widget_use.children.iter().map(|child| { - build_gtk_widget( - bargs.scope_graph, - bargs.widget_defs.clone(), - bargs.calling_scope, - child.clone(), - bargs.custom_widget_invocation.clone(), - ) - }); - for (i, child) in children.enumerate() { - let child = child?; - gtk_widget.add_named(&child, &i.to_string()); - child.show(); - } - Ok(gtk_widget) - } - } + Ok(gtk_widget) } const WIDGET_NAME_TRANSFORM: &str = "transform"; From f01396f9d5a85e5d1da0f0d23515b96bd94ad0e4 Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Sat, 24 Aug 2024 13:30:23 +0300 Subject: [PATCH 35/88] Fix: the gtk `expander` widget bugfix (#1132) * Fixed the gtk `expander` widget * Add changelog entry for the `expander` widget bugfix --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 36 +++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa04fc9..aa38d01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix nix flake - Fix `jq` (By: w-lfchen) - Labels now use gtk's truncation system (By: Rayzeq). +- Fix the gtk `expander` widget (By: ovalkonia) ### Features - Add `systray` widget (By: ralismark) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index ac451eb..dc8aae7 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -315,12 +315,46 @@ const WIDGET_NAME_EXPANDER: &str = "expander"; /// @desc A widget that can expand and collapse, showing/hiding it's children. fn build_gtk_expander(bargs: &mut BuilderArgs) -> Result { let gtk_widget = gtk::Expander::new(None); + + match bargs.widget_use.children.len().cmp(&1) { + Ordering::Less => { + return Err(DiagError(gen_diagnostic!("expander must contain exactly one element", bargs.widget_use.span)).into()); + } + Ordering::Greater => { + let (_, additional_children) = bargs.widget_use.children.split_at(1); + // we know that there is more than one child, so unwrapping on first and last here is fine. + let first_span = additional_children.first().unwrap().span(); + let last_span = additional_children.last().unwrap().span(); + return Err(DiagError(gen_diagnostic!( + "expander must contain exactly one element, but got more", + first_span.to(last_span) + )) + .into()); + } + Ordering::Equal => { + let mut children = bargs.widget_use.children.iter().map(|child| { + build_gtk_widget( + bargs.scope_graph, + bargs.widget_defs.clone(), + bargs.calling_scope, + child.clone(), + bargs.custom_widget_invocation.clone(), + ) + }); + // we have exactly one child, we can unwrap + let child = children.next().unwrap()?; + gtk_widget.add(&child); + child.show(); + } + } + def_widget!(bargs, _g, gtk_widget, { // @prop name - name of the expander - prop(name: as_string) {gtk_widget.set_label(Some(&name));}, + prop(name: as_string) { gtk_widget.set_label(Some(&name)); }, // @prop expanded - sets if the tree is expanded prop(expanded: as_bool) { gtk_widget.set_expanded(expanded); } }); + Ok(gtk_widget) } From 5212e62fd379ee6f972af9ef19b251f03dc619a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sat, 24 Aug 2024 13:02:33 +0200 Subject: [PATCH 36/88] feat: add fill-svg and preserve-aspect-ratio attributes to image widget (#1148) * feat: add fill-svg attribute to image widget Co-authored-by: Eddy Otsutsuki <23711001+hypernova7@users.noreply.github.com> * feat: add preserve-aspect-ratio attribute to image widget * docs: document new attributes; changelog entry --------- Co-authored-by: Eddy Otsutsuki <23711001+hypernova7@users.noreply.github.com> --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 27 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa38d01..77119b8 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 ### Features - Update rust toolchain to 1.80.1 (By: w-lfchen) +- Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index dc8aae7..12225bd 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -571,12 +571,35 @@ fn build_gtk_image(bargs: &mut BuilderArgs) -> Result { // @prop path - path to the image file // @prop image-width - width of the image // @prop image-height - height of the image - prop(path: as_string, image_width: as_i32 = -1, image_height: as_i32 = -1) { + // @prop preserve-aspect-ratio - whether to keep the aspect ratio when resizing an image. Default: true, false doesn't work for all image types + // @prop fill-svg - sets the color of svg images + prop(path: as_string, image_width: as_i32 = -1, image_height: as_i32 = -1, preserve_aspect_ratio: as_bool = true, fill_svg: as_string = "") { + if !path.ends_with(".svg") && !fill_svg.is_empty() { + log::warn!("Fill attribute ignored, file is not an svg image"); + } + if path.ends_with(".gif") { let pixbuf_animation = gtk::gdk_pixbuf::PixbufAnimation::from_file(std::path::PathBuf::from(path))?; gtk_widget.set_from_animation(&pixbuf_animation); } else { - let pixbuf = gtk::gdk_pixbuf::Pixbuf::from_file_at_size(std::path::PathBuf::from(path), image_width, image_height)?; + let pixbuf; + // populate the pixel buffer + if path.ends_with(".svg") && !fill_svg.is_empty() { + let svg_data = std::fs::read_to_string(std::path::PathBuf::from(path.clone()))?; + // The fastest way to add/change fill color + let svg_data = if svg_data.contains("fill=") { + let reg = regex::Regex::new(r#"fill="[^"]*""#)?; + reg.replace(&svg_data, &format!("fill=\"{}\"", fill_svg)) + } else { + let reg = regex::Regex::new(r")?; + stream.close(None::<>k::gio::Cancellable>)?; + } else { + pixbuf = gtk::gdk_pixbuf::Pixbuf::from_file_at_scale(std::path::PathBuf::from(path), image_width, image_height, preserve_aspect_ratio)?; + } gtk_widget.set_from_pixbuf(Some(&pixbuf)); } }, From 6b6e236e2ec0451dbda88d100700d5e8b1740715 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Sun, 25 Aug 2024 19:15:18 +0530 Subject: [PATCH 37/88] docs: changed kB to bytes in `EWW_RAM` description (#1075) --- 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 13cf1e6..4032325 100644 --- a/crates/eww/src/config/inbuilt.rs +++ b/crates/eww/src/config/inbuilt.rs @@ -34,7 +34,7 @@ define_builtin_vars! { // @prop { : temperature } "EWW_TEMPS" [2] => || Ok(DynVal::from(get_temperatures())), - // @desc EWW_RAM - Information on ram and swap usage in kB. + // @desc EWW_RAM - Information on ram and swap usage in bytes. // @prop { total_mem, free_mem, total_swap, free_swap, available_mem, used_mem, used_mem_perc } "EWW_RAM" [2] => || Ok(DynVal::from(get_ram())), From fefba66ff52e2fa746329fe9a82c6be8bab41c4e Mon Sep 17 00:00:00 2001 From: mario-kr Date: Sun, 25 Aug 2024 15:45:33 +0200 Subject: [PATCH 38/88] Fix: EWW_NET wrong values for TX/RX stats (#1108) * Fix: EWW_NET wrong values for TX/RX stats The sysinfo crate, structure Networks, basically caches one value of total_received/total_transmitted each (as well as other metrics) and returns the difference between those two values when queried via the `received()` and `transmitted()` functions. These values are updated by both the `refresh()` and `refresh_list()` functions; so by calling both of them right after each other like previously done here, sets both the cached total_received/... and the current total_received/... to nearly the same value. `refresh_list()` also updates the list of interfaces on a host, with a marginally small performance impact for doing so (I measured slightly more than 100 microseconds on my machine (0.1 milliseconds), around 20-25% more than with `refresh()`), especially considering this is run only every 2 seconds. * Add changelog entry for the EWW_NET bugfix --- CHANGELOG.md | 1 + crates/eww/src/config/system_stats.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77119b8..2b407c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix and refactor nix flake (By: w-lfchen) - Fix remove items from systray (By: vnva) - Fix the gtk `stack` widget (By: ovalkonia) +- Fix values in the `EWW_NET` variable (By: mario-kr) ### Features - Update rust toolchain to 1.80.1 (By: w-lfchen) diff --git a/crates/eww/src/config/system_stats.rs b/crates/eww/src/config/system_stats.rs index 995d7ad..b4c46b7 100644 --- a/crates/eww/src/config/system_stats.rs +++ b/crates/eww/src/config/system_stats.rs @@ -212,7 +212,6 @@ pub fn net() -> String { let (ref mut last_refresh, ref mut networks) = &mut *NETWORKS.lock().unwrap(); networks.refresh_list(); - networks.refresh(); let elapsed = last_refresh.next_refresh(); networks From 3342234894a0cca3d4eadab6410181b01bfa61df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sun, 25 Aug 2024 15:51:26 +0200 Subject: [PATCH 39/88] fix: fix changelog, warnings and lints (#1155) * fix!: eliminate some dead code * fix: fix lints Combined diff of a7a09ea192b6f06b1984709029dc3bfe0481759e and bfc5cb9cb020dd256484eb5e4344e12e4a3b2ceb Co-authored-by: Johan Geluk * fix: remove unnecessary allow; fix capitalization * chore: automatically update a few dependencies * fix: fix lint i introduced this in #1119, whoops * docs: move #1132's changelog entry --------- Co-authored-by: Johan Geluk --- CHANGELOG.md | 2 +- Cargo.lock | 94 ++++++++++---------- crates/eww/src/app.rs | 18 ++-- crates/eww/src/main.rs | 19 ++-- crates/eww/src/server.rs | 8 +- crates/eww/src/widgets/systray.rs | 7 +- crates/eww/src/widgets/widget_definitions.rs | 2 +- crates/eww/src/window_initiator.rs | 2 - 8 files changed, 76 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b407c6..87dc54b 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 - Fix remove items from systray (By: vnva) - Fix the gtk `stack` widget (By: ovalkonia) - Fix values in the `EWW_NET` variable (By: mario-kr) +- Fix the gtk `expander` widget (By: ovalkonia) ### Features - Update rust toolchain to 1.80.1 (By: w-lfchen) @@ -25,7 +26,6 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix nix flake - Fix `jq` (By: w-lfchen) - Labels now use gtk's truncation system (By: Rayzeq). -- Fix the gtk `expander` widget (By: ovalkonia) ### Features - Add `systray` widget (By: ralismark) diff --git a/Cargo.lock b/Cargo.lock index 7c5b7da..3a1ac66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -241,7 +241,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -400,7 +400,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.13" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "shlex", ] @@ -544,9 +544,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.22" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9340e41703683548f486fdfdce615b0520dd220d18b1d4ce5abbc87d461c221b" +checksum = "531d7959c5bbb6e266cecdd0f20213639c3a5c3e4d615f97db87661745f781ff" dependencies = [ "clap", ] @@ -560,7 +560,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -698,7 +698,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -709,7 +709,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -782,7 +782,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "unicode-xid", ] @@ -874,7 +874,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -987,14 +987,14 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "field-offset" @@ -1108,7 +1108,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1331,7 +1331,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1457,7 +1457,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2070,7 +2070,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2239,9 +2239,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2333,7 +2333,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2428,29 +2428,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -2466,7 +2466,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2576,7 +2576,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2633,7 +2633,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2648,9 +2648,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -2659,9 +2659,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4115055da5f572fff541dd0c4e61b0262977f453cc9fe04be83aba25a89bdab" +checksum = "2b92e0bdf838cbc1c4c9ba14f9c97a7ec6cdcd1ae66b10e1e42775a25553f45d" dependencies = [ "core-foundation-sys", "libc", @@ -2753,7 +2753,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2792,7 +2792,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2894,7 +2894,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3018,7 +3018,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -3040,7 +3040,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3131,7 +3131,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3142,7 +3142,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3429,7 +3429,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "zvariant_utils", ] @@ -3462,7 +3462,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3487,7 +3487,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "zvariant_utils", ] @@ -3499,5 +3499,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 6be6af7..965d86c 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -1,5 +1,4 @@ use crate::{ - config, daemon_response::DaemonResponseSender, display_backend::DisplayBackend, error_handling_ctx, @@ -24,6 +23,7 @@ use simplexpr::{dynval::DynVal, SimplExpr}; use std::{ cell::RefCell, collections::{HashMap, HashSet}, + marker::PhantomData, rc::Rc, }; use tokio::sync::mpsc::UnboundedSender; @@ -88,10 +88,6 @@ pub enum DaemonCommand { /// An opened window. #[derive(Debug)] pub struct EwwWindow { - /// Every window has an id, uniquely identifying it. - /// If no specific ID was specified whilst starting the window, - /// this will be the same as the window name. - pub instance_id: String, pub name: String, pub scope_index: ScopeIndex, pub gtk_window: Window, @@ -112,11 +108,13 @@ impl EwwWindow { } } -pub struct App { - pub display_backend: B, +pub struct App { pub scope_graph: Rc>, pub eww_config: config::EwwConfig, - /// Map of all currently open windows by their IDs + /// Map of all currently open windows to their unique IDs + /// If no specific ID was specified whilst starting the window, + /// it will be the same as the window name. + /// Therefore, only one window of a given name can exist when not using IDs. pub open_windows: HashMap, pub instance_id_to_args: HashMap, /// Window names that are supposed to be open, but failed. @@ -132,9 +130,10 @@ pub struct App { pub window_close_timer_abort_senders: HashMap>, pub paths: EwwPaths, + pub phantom: PhantomData, } -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()) @@ -573,7 +572,6 @@ fn initialize_window( window.show_all(); Ok(EwwWindow { - instance_id: window_init.id.clone(), name: window_init.name.clone(), gtk_window: window, scope_index: window_scope, diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs index ad46da9..eb2b7d3 100644 --- a/crates/eww/src/main.rs +++ b/crates/eww/src/main.rs @@ -53,32 +53,31 @@ fn main() { return; } - #[allow(unused)] let detected_wayland = detect_wayland(); #[allow(unused)] let use_wayland = opts.force_wayland || detected_wayland; #[cfg(all(feature = "wayland", feature = "x11"))] let result = if use_wayland { log::info!("Running on wayland. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); - run(opts, eww_binary_name, display_backend::WaylandBackend) + run::(opts, eww_binary_name) } else { log::info!("Running on X11. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); - run(opts, eww_binary_name, display_backend::X11Backend) + run::(opts, eww_binary_name) }; #[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."); + log::warn!("Eww compiled without wayland support. Falling back to X11, eventhough wayland was requested."); } - run(opts, eww_binary_name, display_backend::X11Backend) + run::(opts, eww_binary_name) }; #[cfg(all(feature = "wayland", not(feature = "x11")))] - let result = run(opts, eww_binary_name, display_backend::WaylandBackend); + let result = run::(opts, eww_binary_name); #[cfg(not(any(feature = "wayland", feature = "x11")))] - let result = run(opts, eww_binary_name, display_backend::NoBackend); + let result = run::(opts, eww_binary_name); if let Err(err) = result { error_handling_ctx::print_error(err); @@ -92,7 +91,7 @@ fn detect_wayland() -> bool { 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<()> { +fn run(opts: opts::Opt, eww_binary_name: String) -> Result<()> { let paths = opts .config_path .map(EwwPaths::from_config_dir) @@ -132,7 +131,7 @@ fn run(opts: opts::Opt, eww_binary_name: String, display_back 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, display_backend, !opts.no_daemonize)?; + let fork_result = server::initialize_server::(paths.clone(), None, !opts.no_daemonize)?; opts.no_daemonize || fork_result == ForkResult::Parent } @@ -164,7 +163,7 @@ fn run(opts: opts::Opt, eww_binary_name: String, display_back 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 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); diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 3814e07..57af1e5 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -1,5 +1,5 @@ use crate::{ - app::{self, DaemonCommand}, + app::{self, App, DaemonCommand}, config, daemon_response, display_backend::DisplayBackend, error_handling_ctx, ipc_server, script_var_handler, @@ -12,6 +12,7 @@ use std::{ cell::RefCell, collections::{HashMap, HashSet}, io::Write, + marker::PhantomData, os::unix::io::AsRawFd, path::Path, rc::Rc, @@ -22,7 +23,6 @@ use tokio::sync::mpsc::*; 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(); @@ -78,8 +78,7 @@ pub fn initialize_server( let (scope_graph_evt_send, mut scope_graph_evt_recv) = tokio::sync::mpsc::unbounded_channel(); - let mut app = app::App { - display_backend, + let mut app: App = app::App { scope_graph: Rc::new(RefCell::new(ScopeGraph::from_global_vars( eww_config.generate_initial_state()?, scope_graph_evt_send, @@ -93,6 +92,7 @@ pub fn initialize_server( app_evt_send: ui_send.clone(), window_close_timer_abort_senders: HashMap::new(), paths, + phantom: PhantomData, }; if let Some(screen) = gtk::gdk::Screen::default() { diff --git a/crates/eww/src/widgets/systray.rs b/crates/eww/src/widgets/systray.rs index 67d84f5..bfd0aa8 100644 --- a/crates/eww/src/widgets/systray.rs +++ b/crates/eww/src/widgets/systray.rs @@ -1,6 +1,11 @@ use crate::widgets::window::Window; use futures::StreamExt; -use gtk::{cairo::Surface, gdk, gdk::ffi::gdk_cairo_surface_create_from_pixbuf, gdk::NotifyType, glib, prelude::*}; +use gtk::{ + cairo::Surface, + gdk::{self, ffi::gdk_cairo_surface_create_from_pixbuf, NotifyType}, + glib, + prelude::*, +}; use std::{cell::RefCell, future::Future, rc::Rc}; // DBus state shared between systray instances, to avoid creating too many connections etc. diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 12225bd..b83c681 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1147,7 +1147,7 @@ const WIDGET_NAME_STACK: &str = "stack"; fn build_gtk_stack(bargs: &mut BuilderArgs) -> Result { let gtk_widget = gtk::Stack::new(); - if bargs.widget_use.children.len() < 1 { + if bargs.widget_use.children.is_empty() { return Err(DiagError(gen_diagnostic!("stack must contain at least one element", bargs.widget_use.span)).into()); } diff --git a/crates/eww/src/window_initiator.rs b/crates/eww/src/window_initiator.rs index cb2cda0..f2dc559 100644 --- a/crates/eww/src/window_initiator.rs +++ b/crates/eww/src/window_initiator.rs @@ -17,7 +17,6 @@ use crate::window_arguments::WindowArguments; pub struct WindowInitiator { pub backend_options: BackendWindowOptions, pub geometry: Option, - pub id: String, pub local_variables: HashMap, pub monitor: Option, pub name: String, @@ -37,7 +36,6 @@ impl WindowInitiator { Ok(WindowInitiator { backend_options: window_def.backend_options.eval(&vars)?, geometry, - id: args.instance_id.clone(), monitor, name: window_def.name.clone(), resizable: window_def.eval_resizable(&vars)?, From 510b824e7545a7c98e050522a7bc93d884c53432 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Sun, 25 Aug 2024 16:03:52 +0200 Subject: [PATCH 40/88] Use gdk_screen_get_monitor_plug_name to provide more consistent monitor names on wayland (#1129) * workaround gdk not providing right monitor informations on wayland * move gdk workaround for plug name into a separate function * adjust changelog --- CHANGELOG.md | 1 + Cargo.lock | 1 + crates/eww/Cargo.toml | 4 +++- crates/eww/src/app.rs | 14 +++++++++++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87dc54b..2f9d205 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 - Fix the gtk `stack` widget (By: ovalkonia) - Fix values in the `EWW_NET` variable (By: mario-kr) - Fix the gtk `expander` widget (By: ovalkonia) +- Fix wayland monitor names support (By: dragonnn) ### Features - Update rust toolchain to 1.80.1 (By: w-lfchen) diff --git a/Cargo.lock b/Cargo.lock index 3a1ac66..b44e5a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -941,6 +941,7 @@ dependencies = [ "eww_shared_util", "extend", "futures", + "gdk-sys", "gdkx11", "grass", "gtk", diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index 4c7a444..d934c45 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -23,9 +23,12 @@ notifier_host.workspace = true gtk-layer-shell = { version = "0.8.1", optional = true } gdkx11 = { version = "0.18", optional = true } x11rb = { version = "0.13.1", features = ["randr"], optional = true } +gdk-sys = "0.18.0" ordered-stream = "0.2.0" + +grass.workspace = true anyhow.workspace = true bincode.workspace = true chrono.workspace = true @@ -35,7 +38,6 @@ codespan-reporting.workspace = true derive_more.workspace = true extend.workspace = true futures.workspace = true -grass.workspace = true gtk.workspace = true itertools.workspace = true libc.workspace = true diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 965d86c..2da4ab2 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -625,6 +625,18 @@ fn get_gdk_monitor(identifier: Option) -> Result { Ok(monitor) } +/// Get the name of monitor plug for given monitor number +/// workaround gdk not providing this information on wayland in regular calls +/// gdk_screen_get_monitor_plug_name is deprecated but works fine for that case +fn get_monitor_plug_name(display: &gdk::Display, monitor_num: i32) -> Option<&str> { + unsafe { + use glib::translate::ToGlibPtr; + let plug_name_pointer = gdk_sys::gdk_screen_get_monitor_plug_name(display.default_screen().to_glib_none().0, monitor_num); + use std::ffi::CStr; + CStr::from_ptr(plug_name_pointer).to_str().ok() + } +} + /// Returns the [Monitor][gdk::Monitor] structure corresponding to the identifer. /// Outside of x11, only [MonitorIdentifier::Numeric] is supported pub fn get_monitor_from_display(display: &gdk::Display, identifier: &MonitorIdentifier) -> Option { @@ -642,7 +654,7 @@ pub fn get_monitor_from_display(display: &gdk::Display, identifier: &MonitorIden MonitorIdentifier::Name(name) => { for m in 0..display.n_monitors() { if let Some(model) = display.monitor(m).and_then(|x| x.model()) { - if model == *name { + if model == *name || Some(name.as_str()) == get_monitor_plug_name(display, m) { return display.monitor(m); } } From dc4def532765b78acf713713b71c99b2dcb5ca83 Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Sun, 25 Aug 2024 17:14:35 +0300 Subject: [PATCH 41/88] Add scss support for style property (#1121) * Add scss support for the ':style' widget property * Add changelog entry for the scss support for the ':style' property --------- Co-authored-by: ElKowar --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9d205..2e9fedb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) +- Add scss support for the `:style` widget property (By: ovalkonia) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index b83c681..39686b0 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -209,10 +209,10 @@ pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Wi prop(visible: as_bool = true) { if visible { gtk_widget.show(); } else { gtk_widget.hide(); } }, - // @prop style - inline css style applied to the widget + // @prop style - inline scss style applied to the widget prop(style: as_string) { gtk_widget.reset_style(); - css_provider.load_from_data(format!("* {{ {} }}", style).as_bytes())?; + css_provider.load_from_data(grass::from_string(format!("* {{ {} }}", style), &grass::Options::default())?.as_bytes())?; gtk_widget.style_context().add_provider(&css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION) }, // @prop css - scss code applied to the widget, i.e.: `button {color: red;}` From 452cab7677f517afdef9334c0d6007ce6195c4af Mon Sep 17 00:00:00 2001 From: Leni Aniva <107011294+lenianiva@users.noreply.github.com> Date: Sun, 25 Aug 2024 10:15:43 -0400 Subject: [PATCH 42/88] feat: Add option for graph drawing direction (#1113) * feat: Add option for vertical graph * doc: Add feature to changelog --- CHANGELOG.md | 1 + crates/eww/src/widgets/graph.rs | 38 ++++++++++++++++---- crates/eww/src/widgets/widget_definitions.rs | 6 ++++ 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e9fedb..173bf0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add support for `:hover` css selectors for tray items (By: zeapoz) - Add scss support for the `:style` widget property (By: ovalkonia) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) +- Add `flip-x`, `flip-y`, `vertical` options to the graph widget to determine its direction ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/graph.rs b/crates/eww/src/widgets/graph.rs index 49dc8ed..0d5f46f 100644 --- a/crates/eww/src/widgets/graph.rs +++ b/crates/eww/src/widgets/graph.rs @@ -38,6 +38,13 @@ pub struct GraphPriv { #[property(get, set, nick = "Time Range", blurb = "The Time Range", minimum = 0u64, maximum = u64::MAX, default = 10u64)] time_range: RefCell, + #[property(get, set, nick = "Flip X", blurb = "Flip the x axis", default = true)] + flip_x: RefCell, + #[property(get, set, nick = "Flip Y", blurb = "Flip the y axis", default = true)] + flip_y: RefCell, + #[property(get, set, nick = "Vertical", blurb = "Exchange the x and y axes", default = false)] + vertical: RefCell, + history: RefCell>, extra_point: RefCell>, last_updated_at: RefCell, @@ -53,6 +60,9 @@ impl Default for GraphPriv { max: RefCell::new(100.0), dynamic: RefCell::new(true), time_range: RefCell::new(10), + flip_x: RefCell::new(true), + flip_y: RefCell::new(true), + vertical: RefCell::new(false), history: RefCell::new(VecDeque::new()), extra_point: RefCell::new(None), last_updated_at: RefCell::new(std::time::Instant::now()), @@ -77,6 +87,16 @@ impl GraphPriv { } history.push_back(v); } + /** + * Receives normalized (0-1) coordinates `x` and `y` and convert them to the + * point on the widget. + */ + fn value_to_point(&self, width: f64, height: f64, x: f64, y: f64) -> (f64, f64) { + let x = if *self.flip_x.borrow() { 1.0 - x } else { x }; + let y = if *self.flip_y.borrow() { 1.0 - y } else { y }; + let (x, y) = if *self.vertical.borrow() { (y, x) } else { (x, y) }; + (width * x, height * y) + } } impl ObjectImpl for GraphPriv { @@ -110,6 +130,15 @@ impl ObjectImpl for GraphPriv { "line-style" => { self.line_style.replace(value.get().unwrap()); } + "flip-x" => { + self.flip_x.replace(value.get().unwrap()); + } + "flip-y" => { + self.flip_y.replace(value.get().unwrap()); + } + "vertical" => { + self.vertical.replace(value.get().unwrap()); + } x => panic!("Tried to set inexistant property of Graph: {}", x,), } } @@ -214,18 +243,15 @@ impl WidgetImpl for GraphPriv { .iter() .map(|(instant, value)| { let t = last_updated_at.duration_since(*instant).as_millis() as f64; - let x = width * (1.0 - (t / time_range)); - let y = height * (1.0 - ((value - min) / value_range)); - (x, y) + self.value_to_point(width, height, t / time_range, (value - min) / value_range) }) .collect::>(); // Aad an extra point outside of the graph to extend the line to the left if let Some((instant, value)) = extra_point { let t = last_updated_at.duration_since(instant).as_millis() as f64; - let x = -width * ((t - time_range) / time_range); - let y = height * (1.0 - ((value - min) / value_range)); - points.push_front((x, y)); + let (x, y) = self.value_to_point(width, height, (t - time_range) / time_range, (value - min) / value_range); + points.push_front(if *self.vertical.borrow() { (x, -y) } else { (-x, y) }); } points }; diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 39686b0..4cfd762 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1246,6 +1246,12 @@ fn build_graph(bargs: &mut BuilderArgs) -> Result { // @prop line-style - changes the look of the edges in the graph. Values: "miter" (default), "round", // "bevel" prop(line_style: as_string) { w.set_property("line-style", line_style); }, + // @prop flip-x - whether the x axis should go from high to low + prop(flip_x: as_bool) { w.set_property("flip-x", flip_x); }, + // @prop flip-y - whether the y axis should go from high to low + prop(flip_y: as_bool) { w.set_property("flip-y", flip_y); }, + // @prop vertical - if set to true, the x and y axes will be exchanged + prop(vertical: as_bool) { w.set_property("vertical", vertical); }, }); Ok(w) } From 96529d37fadef4d5ccd774d8d5f0ab8ab93c885c Mon Sep 17 00:00:00 2001 From: PrettyCoffee <66521452+PrettyCoffee@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:24:31 +0200 Subject: [PATCH 43/88] docs: Add example for data structures (#595) --- docs/src/configuration.md | 2 + docs/src/examples.md | 4 + .../data-structures-preview.png | Bin 0 -> 9150 bytes examples/data-structures/eww.scss | 29 +++++++ examples/data-structures/eww.yuck | 73 ++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 examples/data-structures/data-structures-preview.png create mode 100644 examples/data-structures/eww.scss create mode 100644 examples/data-structures/eww.yuck diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 67acc59..ed1460b 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -381,6 +381,8 @@ If you want to display a list of values, you can use the `for`-Element to fill a This can be useful in many situations, for example when generating a workspace list from a JSON representation of your workspaces. In many cases, this can be used instead of `literal`, and should most likely be preferred in those cases. +To see how to declare and use more advanced data structures, check out the [data structures example](/examples/data-structures/eww.yuck). + ## Splitting up your configuration As time passes, your configuration might grow larger and larger. Luckily, you can easily split up your configuration into multiple files! diff --git a/docs/src/examples.md b/docs/src/examples.md index 8f50497..54da0ec 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -4,3 +4,7 @@ These configurations of eww are available in the `examples/` directory of the [r An eww bar configuration: ![Example bar](https://github.com/elkowar/eww/raw/master/examples/eww-bar/eww-bar.png) + +A demo on how to declare and use data structures: + +![Data structure example](/examples/data-structures/data-structures-preview.png) diff --git a/examples/data-structures/data-structures-preview.png b/examples/data-structures/data-structures-preview.png new file mode 100644 index 0000000000000000000000000000000000000000..f4dc51951f0c3036f1e91d2e5d445bf9fed68991 GIT binary patch literal 9150 zcmaKSMNr&9vBF&6WlFG7~FO9|LUvS ztv&3ayQ})pmp=4+{a%E!q7)_?2^s(Zm@?Ahs{iWkzfeMf|Cig`2gv>vR7YuT7XZK- z_)oy4Fk_Jd02Lr3E~@Tf0LyVV(woaU?cGn!Xop%9t2k(+McIyYk1QJ11ukB-7SPwx z)&-iSnKjBR?(W&SfgTe@P_iU30|!L#P;lUFcHrAqoD=q_M-u1$N<&xd_MbV5cv?z` z6V{MNeO~HLvNs%RO4>KPCr_UyPjlawfajzWwl9b06A(gQF=wz!N?jgV0Gx_?$XMC{YyL{!Mzt z#*{+d$x7_A#HrX%MW*}VJ`91Y%eaD7D;PfaTNpmyzfO+G$GIydY^zD123#)m`kzKv z7${7!7{OxYD;3)xQxy#T53rI{C{MGf2TSpjRC>Q^Hy4(ztqB%4Rdm!Am6)G0FA-av z$16s*U@pGAVI9%9MW|Jf?49 zN~Xe%+j#7=nmnXuifN@oH4jg==c=ulEy>uiV^n>TkSSz~^LXk5VO<9I#IZR6;w71) zh6k`B+&JO&RCr)|eYu=LRE3&T&x)>|A>gv$y)3gl;$RotNHm zIUd`FjS;q)$k2_+yKsY3a&1q>C+f@>EqIUV3!Enp5!ltQ2;+Hy?-t1Wi|9&M4U+>8 z7h4;Bt=RVPkWXf-=)Z7I9XSH=i9ARuD1k141V8UC2z?^W^Y>h?{ z6u?P8rEh8PAmoyZbG+diuZm{$GTYAQxkQfzvUFXpIEuW(_YFb~p%(UcO=BZk_pZ7h zbJsKFMm?t}YU>It^?UTY{C*O&I_~d#_ebW95o%J%Xv7z|;mqEEfg*9GK?dutEt9h7 zO_@50&C#t5)N<^lxFFKnlupETZ1y{96m%GOd@NM?QeG%`L|Jywahm)0>1|tybUORA z<@JZkwWHx}?q!eD-Sf7tAcJ%@gC_T(z}(n7=dK^nkHA5QCC4WA%Qo^<1nzmq3J>|i z+3-b2$xaKRih2EIG1qTd^N40Mt9=&p5UU3{64X%|axOfxm_vCTiuar|kc408eaZ(v zo?2izv$wf^m-Wak2C4@=B6o&)p1S95uaEtv8+Lj#OTwz@f=PR0wCWUL()Zz`=g}4K z@q!OiDuOT>yD(De8*(ECvPvc0#LmUqh&xDsro2BxzY>hit_|k?oiX9tgW7Jo+VOR3pQ5ebybqN#VwQbQs2}TrB z$rfHg3s^Wieev^F6m^?r(wtLuw7A*+vA6se|JlBa3%{T5y4P#bwBoytLNX7#ta(1i*DketuMMB5 zOFi9<*QQb5NSt_WnM7Be;J~*Ew(;L9f>0~FWF=}CXAxk?C&_ma+2pvw_}O2kJ8T0RM zVR^PC(eVTtO8ktHwV`#EJ+}Y-&d@8fIJ9dEDv&QSHfb8JqRKW5(Kk8OR#<=XSYT8E zFRu$U{n|!U{_5=CzRBAWu+}^H^sns> zQe02U7q6=v31Mu2_&XdIufO_;oyGBCA^ZwZ{)8jJH)BS~5gu-)W>^}5y30_N(F z1kyBy`6717&;N_TMhH&mk z+~Z}Wfan)do3>oFt&_zl+Kl#5zQTiVIG{v`AW5fDScKz0o()P_Rv^_ zIfLFhSIA7&H&6-DIf>mb03^Lh!&e#mdU4&DM#l6RhW z#Jt2P))F&!h`)_**ITT5X za!boH!%2lJs_MYW4jOe)0wS0lbNQqJWlih@vf+}dI*j7;i9UWjnJBUAQU>|x;h{+s z`)x|eDAVu+@H$k0)>miTb0_th_jp6~a@K^!OSWY0+7VJ)y!Q8r5)`#c5Y=4T-uOPt z{1M4rLFt%yC8bZ=;y7rcaBr?Yv24@Y?E043mm#o^)0VHUEfZip!0qmrOjM4?gudrn zn%~0pSIUbr&FIqW^yK1;PqPr#+xT-GN+4lxSC!Z5vlhasFlBU#6Og3vJ!*6X_Fc5N z91zd&e5|Xs&s{K1;MLgE!VO>>Xu1Ad5d|L-@Mokh>EY64)c`@nyAvru?QWV#w;e-|J4 zb>CX~Oy|9mP*IoV))At&E7;O^Q6<+bm}yuw5+2AMZI=><;1~>9fKi%3 zcm|-6WRz^ACAu?Os&j@<)9_^?TU{P%CgXK%r2$eL3`U5eby_TvMF~5+{#5xhmU=Wa ztZB?gsR;?j%{rdBngnzNXm8-*@}@v6Y63gvCQcIl2cw%y#2e|nws?F(vWLnJ`$q1a zE5vf{IH7>!eZT**yRk}!sp!ZZv|b?g+c(UI)3y%Pu|^VwZh zbM2dXZ+o9V=Y&8&fU$|^z~0-Ju-emJ>#gF|{y%iA!HSHd(bu&YMNCWxR0J4lQ>0mr z^k_3gC}R}`GBz$<+;Me2SLwJ_(eqWIf~FdUoTRC1l5LA2yjCcp8XU`{J1eCD@can! zGI|3M6j*Pe6K;1@>BFvxpN$}aMA`kc(^_Ij~Wsd9&RX_{8mzvSX1D0xEMe}~!Y6xA}4 z=5*a*L$m}&4llU!co+R{if8gm)c+lWrCex9%0ag+8JL;wevSxZIDjuC@b$9) zy+p|%Un;Zp#na28d@RoFid#ofc|qY<36;6R2>M>K>iuPP@SC45JGeQinx`wg0N{f< zv!K#X(^mQ8&PU-KQ6=_6vrg7B^;WnBVID#{2@?`z!h44w+^-<7k1uJFS>{Y~5pEaO zyl3;_j#i8|AXM-?28xH3za{otk9Z>&;8bZJJ+#XJe@G$@U>WOunP`Dr4*|moj)qFN zd0z_tg7o#{)4Vs&62zqbuF*gMVj?nr*M}=Xcb|D9c9bA0ltDPj$hMudTh_Qp<>Prm zx{jNKbr=2FL}%Dm-jK;&1V%^7-=3LM?DAfpm6gX%_*gmshaXd!wk|@7_u$mhTC1lx zeSZ=A79>HceX0n_{j76c(2y!%sV61mJ2?9o23vG0&^J-Nt4Mc+$2O zGbN#Xrj)*=^uBd5wuqB%3Ma+jlwE{IWp$Mu1J=C5@q zu7^F2Xef{+w2C3xmwvh42-(jB7$PZCpge@>g$?X{2P5TZakNWk-ONeA((?1Of1XD} zVV~ zyEZ_}H;-A#RFeE>Z;`lAa=#Y3O%d_kvnODB2E;LG{LsIkcmF-@=*0UZ@-c7Y>8u6U ze738lghs%N-Cbp`E3+M60s2LZqTazL-lww9<+hf!Yvq9M*et~cla118{mJ&SzGemk z159HVM*l#IR#FzHU{FLhNARlL_)^C9j!MF+VE#1TRT!3${Yq{rwNftgF(RR9^!wEp z4H_Vx_V94uAMF1m-lShSN6zoFXi^W4gV;S|Nee*O{hxM7GiP#bjT{fclwS7FlQ034 zu|p_+ChmyluU{+f1^$|g&q-~nM^_yJc7r1feS@qpZphmX< zgn|+9b)#?%0c6c*?l*H4NDgrtbZ?>sKIA! zvT&?)+Osgtn|p4g{O&i4L8J4a0?3w;m37_u+10Jn7rgf1Ikyv7&JfAgb(NL7 zE(FYUn(Jt2n$N%c+m+buXC?^b(l|WZ%*Rp4uiQh958#It;;z%yX0$yuHP;~B0OH4` zTlLA4As2&3#joncU)P(No~J%2nEfPIWo?ud4xLLFtXt+(=&mS~TsYEB9T}|~7~jI_ zU`-d85~}aJ`z_hn+)Au(hw=+PrAl7z8zNPRbfWW(UhTTs+i2)-VTtya`3Z9{-Hd7J z%GJZ9xp4wA&=YT-?jT&JIPDyi`Z(mR5sX`ybl7q-4s!okP~>z!@TDdsU!8(PKL8Q1 zt@>13%kEIsfMc)vCuD}GMPsEl$D*1!Q?3+GwF z)oTqemZ5#0dGUyDLZH=N5+!0a0YjAY&?bcI76ke+b?zTnq3=z_M1#tVDKQly0(=q=8s`-`^mBm=P_TC|Kjb$;}OvpA^v%lbaO$MZzD@CJ2KdS zt7a`D6X{2I84PX$!>0if@-H(?{pc04Y*(1=zM`pg?O2@9-0+M zAD*$)@YUb+x+xxvola}TCVn#R-5SRllVVd(%;mNCC`L$R4z_TvZG#v#f_cmboNtmZ z-lwVTu~e}Y=m`XvfhR*C#+qqDMaei{=PvgApP{92kx68$vR8a6V1$r-JSq z`nrt_?vIaxzP_gR8N{)4Q8vT|rQAv@DKro!#C~Vp-l;wPA;!tKho>M253A(sd3 z;S5kHjJo9RXi7>8X{u*u<#}f@1Ot%T{buJN-C1G7&igZL|D8N#Cc>tNf`QeXk@|2WLXknSc$9iGT%KWzc&+Q~1fLNBW zb*hjrTlL#gGGC{7TtJ$nuQxyFW>VkI-2-mj0#?n5=1V1&Hhg}wi1uC|((>yS-kkhpOd@qD@0jB5F+j69U{qat+1gVlbAgU zC$1-0LBR1<)4t2u*WKZC#&oC%7L;FE#el4=*?RN4JXD&t!T8w=z<`Wr>2m+LSUo;Q zrfgH1wuaQ4Y;N9*TT_W^yK04?dGmnk>`Wdj?mP6A%z8V~TI7==E-`ZuhOK-|4U0pyVML8VZ@5G`<}!rmCx|ptXuX zNay|dA)3|SDvf!ZbK4s^_9M$jj|*mZp)<;C|q#zYGC>lNmg zhBrc)OO)Qm8^Tb>61foQCLh9BO3CYdoGc6q5_Z_2zz9XVME_DS-J)qwUR^ygHFbJ? z%)-d%c|EsKL8!66zXwkhQl;DY5IUt-x<%xFYBd8Q@LwM@;*@OEx!kIi*c=vzCZfR- zBb`KF4+_Q(7QHaPeLs&uHEJlC(A9B2+O(HFyl)AtIWZ1{*ft+r2T4L)sN!h{DN(Tb zd?$?!xxy{9YrL+({Jzfboe5%hqCeR0J?z1%bB+#Z)Dyy=hJ!vJARK7 zYNn0o)rytF&eyZM&bul^-Q*$S4w`J-Pk#QCC^g#Z%4!;S*uwYKARN7BXRwmeRCCU|7@v5bX4Z~=W-O`c%$kTp~;ar;sc4X=W5 zs$HzQ;|W!lKc_1M=`T@8lWt76!VoPC)A)nKao^FEhsIg+Ha3 zma9S@gy_V-^cv}K2ZvaZHPBwWHeKmkI`JW^OZ4qVU_;n7q%QwNsQtYsw%2~5ZaUn(`_Hdc|5@NTVH3- z51;Y(TNNI1Rtz@~snYn-;f2qK$cNy+1+4qQufWfP%{Ic+%B_{CO)F^xW%>m%e57d9 zWon|dpLJxmc#N@(n;t^F-|YPk^}yg@Atl~}B=a{Fqt4kH><0>|86ksei3u=Avl4gr z8!};!S))&PpLhPU-Md_flrLE?`9LKNF6&&7X#gn63dYRas=q-+C+Kce7Kn~%IvbLvNOb85vp%fc3HXp zuKR>1ozP!in6$$a`Rd-E{>d=G4&<{K4`1G`ZIV3>`6uS#r$nRE1ktmYr<3WX4rSp7 zsw(4J1Cf;Kh$!Jm*{D@czY-SdF=gj+V}+zN9_oYXg;smwR6ESTu(w%%S0VPD5TO>X zM~;F92JF^K1A2=|W7l^$NEiqP2-WYBzYyS}im8-Qmm9Z|5t)%oWPfDqA-mlvz-#zB zP24EMj?xi4G_~e4!Bm+qlYeaK^`GVZ1FRPzuj)#8OIp;%3}Yy|sl_}Aav}I(q}d1% zO#^?4pfUM8Ne1a}LZ2Z+III%RxKW#Rb)ecapXp)#XH>hwPjpOj$y`N@%}OTyEIJwr zj5&jN$RZ-5uhfEfw28`mK#X?Yw7mo4i+B1O-s>q%MuuS|L7w9OP{K+s2paSLw>01dqD?7q( z{IVvR%3$_`x5(Wl7MdGNe=gDgXy{;4Rx-HrBt(vtv{EeTU92Sq5Ba+fHR~$S>7H!R zm5b5)T`Yn$9NI<ugM4Et0M`>AAIQc@ z%ZA%4=c|^3kPu3^;&!wOk!T`CADt)>(#ea}u>z2k zTGF15+6`+!aj8#sPkVBtreWw5)=!t+8^W{H>q#YQ{JAgZZu_HBH&462z90cDlD^54 z`?((Oj(Z!Y_pKj2F#;t1+FT22K5YuHZMebGqL#|50f0OHwIt6MmH>|=vSzY%g>1Oi zej22w>3Y7G@Ybt=IWZ%}v|bB~oKNQ;o%hmN?tgPhpnY?Xa80iS1}C%W>ycuG>FV`( z5~B$_Y0mU&u)Ywzk{CyU{ET7g1N4yMy{|ZoWT|jRg5ABS%^Nx?!hF+3J)D#|5-?L{ zXUUZa)4f!Z&pu@{GEtmAnj}H(JCQcEM4XMp--*vWgVR{HPO;Gs`S<{X^_!!f;IMC> zTfJ}XTUWYmonT|NU4L9Ug_b){#UbUL4zHw9f~H!i79455?;dNzl1JeJnpbA&Q9!f4 zcNV=qf2(QiV35GNs?e@a^9aE8{lDk#qJmQ+@zJ%HdZK++T^2vb4_)o$!^<*9d8-LC zxB!kU7JMZV-^@+wpbE)tm^#?-X`)3;Di*%1R+#DFdP`ayJQvQull|F1zjJpnB1y2@ z*Z=l=?}TIVOU~a&06;MNj~4*BJfEKP_1*B2sO%ocFMj7E!Lt(Go^#2Y3E_u*Z;iK0 z@?HKbki5sQzlV(2agUtu!Sc&piRlv>sj<->Lo4MD!zDOTgTLfW$%RMmw)P4(!#j40 zd{zFT!cHS&E17da_jUV5ofUq5MzE&=f{~Hq8R3-BE6o3)qQd0DUf4fo;98cEDvz(J zd&6m8SkPnYsG(u?iluX#IARcMK()Opox=OoXlmCeD4np%P~<~PWiawOf9(C(pOq1= z`QrG9Q21wr9f7yYb}ek{xA%4{Exxahujd(mdDwLERxGi84iBRs%M49A28S()SFpu} zO^h(^>LI)59P8Av3r?T!TjY8bL{Vin>_k#}w4E%mz1ofyz0~S!nxtgMTyKF5J3V7~ zZZG5PeQ(wc*Pj#~ra-CMzWaur7l-8Ym4=<&@o#?0TPYxsN8k{pvFSFP{uI?#0jdmJ zHIfH%1l(0+J3Bjs8$F>BNtiQQ`yC1k4B|8@_8$!E_&cS`KU4fL8k>5l-Z}Mqs-86r zX(ldN@O>%Jq(C*qUm46CS$mksIj*IA93;i|cN!kbWKQ*W6GRBmTJSl1Cgh~_-fn(8 zIl4VRL|<6D2+Lb{_4R71&0Wq!B%$6r6I;zb4x?y$-P1H6b!wN5iqh55nXl1bSy>@P zdjo|+F(iWv%UajInXW~WAn*U4{MMMeB#tKlF1`y9VZ>B^b`-aSkub0fZ?rlXQsFc$ z*-^B5LqahzV@k)O&@ZZ^zoWmrx%IxgN?i40VHC2GPR1_pLX43omPLJ^99(Eh?IlS& zbK0U9NPBB4b1oB1k2fXzv!qw;^B_? Date: Sun, 25 Aug 2024 10:24:43 -0400 Subject: [PATCH 44/88] add `EWW_BATTERY` support in (free|open|net)bsd (#645) * add `EWW_BATTERY` support in (free|open|net)bsd * add `EWW_BATTERY` support in (free|open|net)bsd --------- Co-authored-by: ElKowar --- CHANGELOG.md | 1 + crates/eww/src/config/system_stats.rs | 48 ++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 173bf0a..e1e8192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,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 support for the `EWW_BATTERY` magic variable in FreeBSD, OpenBSD, and NetBSD (By: dangerdyke) - Add `justify` property to the label widget, allowing text justification (By: n3oney) - Add `EWW_TIME` magic variable (By: Erenoit) - Add trigonometric functions (`sin`, `cos`, `tan`, `cot`) and degree/radian conversions (`degtorad`, `radtodeg`) (By: end-4) diff --git a/crates/eww/src/config/system_stats.rs b/crates/eww/src/config/system_stats.rs index b4c46b7..36d9e8e 100644 --- a/crates/eww/src/config/system_stats.rs +++ b/crates/eww/src/config/system_stats.rs @@ -1,4 +1,4 @@ -use crate::util::IterAverage; +use crate::{regex, util::IterAverage}; use anyhow::{Context, Result}; use once_cell::sync::Lazy; use std::{fs::read_to_string, sync::Mutex}; @@ -202,8 +202,54 @@ pub fn get_battery_capacity() -> Result { Ok(serde_json::to_string(&(Data { batteries, total_avg: (current / total) * 100_f64 })).unwrap()) } +#[cfg(any(target_os = "netbsd", target_os = "freebsd", target_os = "openbsd"))] +pub fn get_battery_capacity() -> Result { + let batteries = String::from_utf8( + // I have only tested `apm` on FreeBSD, but it *should* work on all of the listed targets, + // based on what I can tell from their online man pages. + std::process::Command::new("apm") + .output() + .context("\nError while getting the battery values on bsd, with `apm`: ")? + .stdout, + )?; + + // `apm` output should look something like this: + // $ apm + // ... + // Remaining battery life: 87% + // Remaining battery time: unknown + // Number of batteries: 1 + // Battery 0 + // Battery Status: charging + // Remaining battery life: 87% + // Remaining battery time: unknown + // ... + // last 4 lines are repeated for each battery. + // see also: + // https://www.freebsd.org/cgi/man.cgi?query=apm&manpath=FreeBSD+13.1-RELEASE+and+Ports + // https://man.openbsd.org/amd64/apm.8 + // https://man.netbsd.org/apm.8 + let mut json = String::from('{'); + let re_total = regex!(r"(?m)^Remaining battery life: (\d+)%"); + let re_single = regex!(r"(?sm)^Battery (\d+):.*?Status: (\w+).*?(\d+)%"); + for bat in re_single.captures_iter(&batteries) { + json.push_str(&format!( + r#""BAT{}": {{ "status": "{}", "capacity": {} }}, "#, + bat.get(1).unwrap().as_str(), + bat.get(2).unwrap().as_str(), + bat.get(3).unwrap().as_str(), + )) + } + + json.push_str(&format!(r#""total_avg": {}}}"#, re_total.captures(&batteries).unwrap().get(1).unwrap().as_str())); + Ok(json) +} + #[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "linux"))] +#[cfg(not(target_os = "netbsd"))] +#[cfg(not(target_os = "freebsd"))] +#[cfg(not(target_os = "openbsd"))] pub fn get_battery_capacity() -> Result { Err(anyhow::anyhow!("Eww doesn't support your OS for getting the battery capacity")) } From 16250aee862cfab755bbfdb9686df152a2c4aa71 Mon Sep 17 00:00:00 2001 From: Schrottkatze <68819302+schrottkatze@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:03:33 +0000 Subject: [PATCH 45/88] Fix Typo ("procent" -> "percent") (#1169) --- 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 4032325..ba29939 100644 --- a/crates/eww/src/config/inbuilt.rs +++ b/crates/eww/src/config/inbuilt.rs @@ -42,7 +42,7 @@ define_builtin_vars! { // @prop { : { name, total, free, used, used_perc } } "EWW_DISK" [2] => || Ok(DynVal::from(get_disks())), - // @desc EWW_BATTERY - Battery capacity in procent of the main battery + // @desc EWW_BATTERY - Battery capacity in percent of the main battery // @prop { : { capacity, status } } "EWW_BATTERY" [2] => || Ok(DynVal::from( match get_battery_capacity() { From 057297b4a339a4f72a6adf4ab587ebde2c331fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sun, 25 Aug 2024 17:44:34 +0000 Subject: [PATCH 46/88] fix: remove unused import (#1168) --- crates/eww/src/config/system_stats.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/eww/src/config/system_stats.rs b/crates/eww/src/config/system_stats.rs index 36d9e8e..787b3de 100644 --- a/crates/eww/src/config/system_stats.rs +++ b/crates/eww/src/config/system_stats.rs @@ -1,4 +1,4 @@ -use crate::{regex, util::IterAverage}; +use crate::util::IterAverage; use anyhow::{Context, Result}; use once_cell::sync::Lazy; use std::{fs::read_to_string, sync::Mutex}; From 1d3a18609252b92fcba465f33fab4709f8bc3b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Wed, 28 Aug 2024 08:29:52 +0000 Subject: [PATCH 47/88] fix: make formattime follow system locale (#1177) closes #869 Co-authored-by: CrumblyLiquid --- Cargo.lock | 8 ++++++++ crates/eww_shared_util/Cargo.toml | 1 + crates/eww_shared_util/src/lib.rs | 2 ++ crates/eww_shared_util/src/locale.rs | 14 ++++++++++++++ crates/simplexpr/Cargo.toml | 2 +- crates/simplexpr/src/eval.rs | 10 +++++++--- 6 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 crates/eww_shared_util/src/locale.rs diff --git a/Cargo.lock b/Cargo.lock index b44e5a0..6b5b3c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -485,6 +485,7 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "pure-rust-locales", "wasm-bindgen", "windows-targets 0.52.6", ] @@ -975,6 +976,7 @@ dependencies = [ name = "eww_shared_util" version = "0.1.0" dependencies = [ + "chrono", "derive_more", "ref-cast", "serde", @@ -2238,6 +2240,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pure-rust-locales" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" + [[package]] name = "quote" version = "1.0.37" diff --git a/crates/eww_shared_util/Cargo.toml b/crates/eww_shared_util/Cargo.toml index 24a9108..45d26dc 100644 --- a/crates/eww_shared_util/Cargo.toml +++ b/crates/eww_shared_util/Cargo.toml @@ -12,3 +12,4 @@ homepage = "https://github.com/elkowar/eww" serde.workspace = true derive_more.workspace = true ref-cast.workspace = true +chrono = { workspace = true, features = ["unstable-locales"] } diff --git a/crates/eww_shared_util/src/lib.rs b/crates/eww_shared_util/src/lib.rs index 299f994..7161120 100644 --- a/crates/eww_shared_util/src/lib.rs +++ b/crates/eww_shared_util/src/lib.rs @@ -1,6 +1,8 @@ +pub mod locale; pub mod span; pub mod wrappers; +pub use locale::*; pub use span::*; pub use wrappers::*; diff --git a/crates/eww_shared_util/src/locale.rs b/crates/eww_shared_util/src/locale.rs new file mode 100644 index 0000000..028e84b --- /dev/null +++ b/crates/eww_shared_util/src/locale.rs @@ -0,0 +1,14 @@ +use chrono::Locale; +use std::env::var; + +/// Returns the `Locale` enum based on the `LC_TIME` environment variable. +/// If the environment variable is not defined or is malformed use the POSIX locale. +pub fn get_locale() -> Locale { + let locale_string: String = + var("LC_TIME").map_or_else(|_| "C".to_string(), |v| v.split(".").next().unwrap_or("C").to_string()); + + match (&*locale_string).try_into() { + Ok(x) => x, + Err(_) => Locale::POSIX, + } +} diff --git a/crates/simplexpr/Cargo.toml b/crates/simplexpr/Cargo.toml index 099d5dd..2b94ae9 100644 --- a/crates/simplexpr/Cargo.toml +++ b/crates/simplexpr/Cargo.toml @@ -16,7 +16,7 @@ eww_shared_util.workspace = true cached.workspace = true chrono-tz.workspace = true -chrono.workspace = true +chrono = { workspace = true, features = ["unstable-locales"] } itertools.workspace = true jaq-core.workspace = true jaq-parse.workspace = true diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index f426b79..6325782 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -7,7 +7,7 @@ use crate::{ ast::{AccessType, BinOp, SimplExpr, UnaryOp}, dynval::{ConversionError, DynVal}, }; -use eww_shared_util::{Span, Spanned, VarName}; +use eww_shared_util::{get_locale, Span, Spanned, VarName}; use std::{ collections::HashMap, convert::{Infallible, TryFrom, TryInto}, @@ -467,12 +467,16 @@ fn call_expr_function(name: &str, args: Vec) -> Result t.format(&format.as_string()?).to_string(), + LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => { + t.format_localized(&format.as_string()?, get_locale()).to_string() + } LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())), })) } [timestamp, format] => Ok(DynVal::from(match Local.timestamp_opt(timestamp.as_i64()?, 0) { - LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => t.format(&format.as_string()?).to_string(), + LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => { + t.format_localized(&format.as_string()?, get_locale()).to_string() + } LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())), })), _ => Err(EvalError::WrongArgCount(name.to_string())), From e08c6a20ec1bc22844ebda38d163278c8efa6ee1 Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:21:31 +0200 Subject: [PATCH 48/88] docs(readme): improve spacing (#886) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 686e31c..c11012c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Documentation **and instructions on how to install** can be found [here](https:/ Dharmx also wrote a nice, beginner friendly introductory guide for eww [here](https://dharmx.is-a.dev/eww-powermenu/). ## Eww needs your opinion! + I've hit a bit of a design roadblock for one of the bigger features that are in the works right now. **Please read through https://github.com/elkowar/eww/discussions/453 and share your thoughts, ideas and opinions!** @@ -59,12 +60,12 @@ I've hit a bit of a design roadblock for one of the bigger features that are in - ## Contribewwting If you want to contribute anything, like adding new widgets, features, or subcommands (including sample configs), you should definitely do so. ### Steps + 1. Fork this repository 2. Install dependencies 3. Smash your head against the keyboard from frustration (coding is hard) From 4a53c12006d7eb61f9ce5abc9e7548eae264df37 Mon Sep 17 00:00:00 2001 From: MunsMan <48153666+MunsMan@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:29:27 +0200 Subject: [PATCH 49/88] Fixing missing commas in example (#1174) --- docs/src/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/configuration.md b/docs/src/configuration.md index ed1460b..78775e1 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -61,7 +61,7 @@ This field can be: - the string ``, in which case eww tries to identify the primary display (which may fail, especially on wayland) - an integer, declaring the monitor index - the name of the monitor -- a string containing a JSON-array of monitor matchers, such as: `'["" "HDMI-A-1" "PHL 345B1C" 0]'`. Eww will try to find a match in order, allowing you to specify fallbacks. +- a string containing a JSON-array of monitor matchers, such as: `'["", "HDMI-A-1", "PHL 345B1C", 0]'`. Eww will try to find a match in order, allowing you to specify fallbacks. **`geometry`-properties** From 52d3669881f962755033a2a8caa04a23456bda57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Fri, 30 Aug 2024 10:53:02 +0000 Subject: [PATCH 50/88] fix: fix system tray not displaying anything (#1181) * fix: update snw's default path * docs: document changes to autogenerated files --- .../notifier_host/src/proxy/dbus_status_notifier_watcher.rs | 6 +++++- crates/notifier_host/src/proxy/mod.rs | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs index 3336baa..4ffb98f 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs @@ -12,7 +12,11 @@ //! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html //! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, use zbus::proxy; -#[proxy(interface = "org.kde.StatusNotifierWatcher", assume_defaults = true)] +#[proxy( + default_service = "org.kde.StatusNotifierWatcher", + interface = "org.kde.StatusNotifierWatcher", + default_path = "/StatusNotifierWatcher" +)] trait StatusNotifierWatcher { /// RegisterStatusNotifierHost method fn register_status_notifier_host(&self, service: &str) -> zbus::Result<()>; diff --git a/crates/notifier_host/src/proxy/mod.rs b/crates/notifier_host/src/proxy/mod.rs index 58b5128..deb98d4 100644 --- a/crates/notifier_host/src/proxy/mod.rs +++ b/crates/notifier_host/src/proxy/mod.rs @@ -5,6 +5,11 @@ //! generated with [zbus-xmlgen](https://docs.rs/crate/zbus_xmlgen/latest) by running //! `zbus-xmlgen file crates/notifier_host/src/proxy/dbus_status_notifier_item.xml` and //! `zbus-xmlgen file crates/notifier_host/src/proxy/dbus_status_notifier_watcher.xml`. +//! +//! Note that the `dbus_status_notifier_watcher.rs` file has been slightly adjusted, the +//! default arguments to the [proxy](https://docs.rs/zbus/4.4.0/zbus/attr.proxy.html) +//! macro need some adjusting. +//! //! At the moment, `dbus_menu.xml` isn't used. //! //! For more information, see ["Writing a client proxy" in the zbus From 6db0f95c57c28ac00448717342502a37275bc670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sat, 31 Aug 2024 17:57:17 +0000 Subject: [PATCH 51/88] fix: demote two logging statements to debug (#1183) * fix: demote two logging statements to debug * fix: remove some trailing whitespace in log message --- crates/eww/src/main.rs | 4 ++-- crates/eww/src/server.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/eww/src/main.rs b/crates/eww/src/main.rs index eb2b7d3..853a8fb 100644 --- a/crates/eww/src/main.rs +++ b/crates/eww/src/main.rs @@ -58,10 +58,10 @@ fn main() { let use_wayland = opts.force_wayland || detected_wayland; #[cfg(all(feature = "wayland", feature = "x11"))] let result = if use_wayland { - log::info!("Running on wayland. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); + log::debug!("Running on wayland. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); run::(opts, eww_binary_name) } else { - log::info!("Running on X11. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); + log::debug!("Running on X11. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland); run::(opts, eww_binary_name) }; diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 57af1e5..8e22d3f 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -57,7 +57,7 @@ pub fn initialize_server( ┏━━━━━━━━━━━━━━━━━━━━━━━┓ ┃Initializing eww daemon┃ ┗━━━━━━━━━━━━━━━━━━━━━━━┛ - "# +"# ); simple_signal::set_handler(&[simple_signal::Signal::Int, simple_signal::Signal::Term], move |_| { From bb916c652bf940bb3c8b10933730367427dfb51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Donk=C3=B3?= Date: Tue, 3 Sep 2024 14:33:37 +0200 Subject: [PATCH 52/88] Clean up example SCSS file (#644) --- examples/eww-bar/eww.scss | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/examples/eww-bar/eww.scss b/examples/eww-bar/eww.scss index efa2a50..49bc28c 100644 --- a/examples/eww-bar/eww.scss +++ b/examples/eww-bar/eww.scss @@ -1,8 +1,8 @@ * { - all: unset; //Unsets everything so you can style everything from scratch + all: unset; // Unsets everything so you can style everything from scratch } -//Global Styles +// Global Styles .bar { background-color: #3a3a3a; color: #b0b4bc; @@ -22,6 +22,7 @@ color: #000000; border-radius: 10px; } + .metric scale trough { all: unset; background-color: #4e4e4e; @@ -31,24 +32,11 @@ margin-left: 10px; margin-right: 20px; } -.metric scale trough highlight { - all: unset; - background-color: #D35D6E; - color: #000000; - border-radius: 10px; -} -.metric scale trough { - all: unset; - background-color: #4e4e4e; - border-radius: 50px; - min-height: 3px; - min-width: 50px; - margin-left: 10px; - margin-right: 20px; -} + .label-ram { font-size: large; } + .workspaces button:hover { color: #D35D6E; } From 8661abf2bf07f5a809fc995233d93810cc1ac871 Mon Sep 17 00:00:00 2001 From: mario-kr Date: Tue, 3 Sep 2024 14:34:39 +0200 Subject: [PATCH 53/88] Implement explicitly setting a center of rotation (#783) * Add changelog entry for transform-origin-properties * Implement explicitly setting a center of rotation The transform-Widget provides "rotate" to rotate its child. However, the default center of rotation is (0, 0) (aka top-left), so it was not possible to, for example, rotate a child in-place. This commit implements the additional options `transform-origin-x` and `transform-origin-y`. Both are optional, and the default value is 0.0 for each, so previous configurations should produce the same results. * Fix: transform order should be rotate->translate->scale --- CHANGELOG.md | 1 + crates/eww/src/widgets/transform.rs | 30 ++++++++++++++++++-- crates/eww/src/widgets/widget_definitions.rs | 4 +++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e8192..84c0486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add scss support for the `:style` widget property (By: ovalkonia) - Add `min` and `max` function calls to simplexpr (By: ovalkonia) - Add `flip-x`, `flip-y`, `vertical` options to the graph widget to determine its direction +- Add `transform-origin-x`/`transform-origin-y` properties to transform widget (By: mario-kr) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/transform.rs b/crates/eww/src/widgets/transform.rs index 79390ac..5e184b6 100644 --- a/crates/eww/src/widgets/transform.rs +++ b/crates/eww/src/widgets/transform.rs @@ -17,6 +17,12 @@ pub struct TransformPriv { #[property(get, set, nick = "Rotate", blurb = "The Rotation", minimum = f64::MIN, maximum = f64::MAX, default = 0f64)] rotate: RefCell, + #[property(get, set, nick = "Transform-Origin X", blurb = "X coordinate (%/px) for the Transform-Origin", default = None)] + transform_origin_x: RefCell>, + + #[property(get, set, nick = "Transform-Origin Y", blurb = "Y coordinate (%/px) for the Transform-Origin", default = None)] + transform_origin_y: RefCell>, + #[property(get, set, nick = "Translate x", blurb = "The X Translation", default = None)] translate_x: RefCell>, @@ -37,6 +43,8 @@ impl Default for TransformPriv { fn default() -> Self { TransformPriv { rotate: RefCell::new(0.0), + transform_origin_x: RefCell::new(None), + transform_origin_y: RefCell::new(None), translate_x: RefCell::new(None), translate_y: RefCell::new(None), scale_x: RefCell::new(None), @@ -57,6 +65,14 @@ impl ObjectImpl for TransformPriv { self.rotate.replace(value.get().unwrap()); self.obj().queue_draw(); // Queue a draw call with the updated value } + "transform-origin-x" => { + self.transform_origin_x.replace(value.get().unwrap()); + self.obj().queue_draw(); // Queue a draw call with the updated value + } + "transform-origin-y" => { + self.transform_origin_y.replace(value.get().unwrap()); + self.obj().queue_draw(); // Queue a draw call with the updated value + } "translate-x" => { self.translate_x.replace(value.get().unwrap()); self.obj().queue_draw(); // Queue a draw call with the updated value @@ -128,6 +144,15 @@ impl WidgetImpl for TransformPriv { cr.save()?; + let transform_origin_x = match &*self.transform_origin_x.borrow() { + Some(rcx) => NumWithUnit::from_str(rcx)?.pixels_relative_to(total_width as i32) as f64, + None => 0.0, + }; + let transform_origin_y = match &*self.transform_origin_y.borrow() { + Some(rcy) => NumWithUnit::from_str(rcy)?.pixels_relative_to(total_height as i32) as f64, + None => 0.0, + }; + let translate_x = match &*self.translate_x.borrow() { Some(tx) => NumWithUnit::from_str(tx)?.pixels_relative_to(total_width as i32) as f64, None => 0.0, @@ -148,9 +173,10 @@ impl WidgetImpl for TransformPriv { None => 1.0, }; - cr.scale(scale_x, scale_y); + cr.translate(transform_origin_x, transform_origin_y); cr.rotate(perc_to_rad(rotate)); - cr.translate(translate_x, translate_y); + cr.translate(translate_x - transform_origin_x, translate_y - transform_origin_y); + cr.scale(scale_x, scale_y); // Children widget if let Some(child) = &*self.content.borrow() { diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 4cfd762..0fb88f1 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1188,6 +1188,10 @@ fn build_transform(bargs: &mut BuilderArgs) -> Result { def_widget!(bargs, _g, w, { // @prop rotate - the percentage to rotate prop(rotate: as_f64) { w.set_property("rotate", rotate); }, + // @prop transform-origin-x - x coordinate of origin of transformation (px or %) + prop(transform_origin_x: as_string) { w.set_property("transform-origin-x", transform_origin_x) }, + // @prop transform-origin-y - y coordinate of origin of transformation (px or %) + prop(transform_origin_y: as_string) { w.set_property("transform-origin-y", transform_origin_y) }, // @prop translate-x - the amount to translate in the x direction (px or %) prop(translate_x: as_string) { w.set_property("translate-x", translate_x); }, // @prop translate-y - the amount to translate in the y direction (px or %) From e242d40e3522b27bf087addba23fc7588099b7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Thu, 26 Sep 2024 17:22:24 +0000 Subject: [PATCH 54/88] revert: zbus 4 -> 3 (#1203) * revert: zbus 4 -> 3 This reverts commit 71ba5024421dd475e800c55f3efce1dd887cdc56. * chore: update dependencies * chore: manually edit lockfile * chore: dependency updates --- Cargo.lock | 644 +++++++++++------- Cargo.toml | 8 +- crates/notifier_host/src/host.rs | 4 +- crates/notifier_host/src/icon.rs | 8 +- crates/notifier_host/src/item.rs | 2 +- .../src/proxy/dbus_status_notifier_item.rs | 69 +- .../src/proxy/dbus_status_notifier_watcher.rs | 35 +- crates/notifier_host/src/watcher.rs | 20 +- 8 files changed, 455 insertions(+), 335 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b5b3c9..c62fe87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -111,9 +111,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "ascii-canvas" @@ -126,14 +126,12 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.7.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ - "event-listener", - "event-listener-strategy", + "event-listener 2.5.3", "futures-core", - "pin-project-lite", ] [[package]] @@ -148,54 +146,80 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + [[package]] name = "async-io" version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite", + "futures-lite 2.3.0", "parking", - "polling", - "rustix", + "polling 3.7.3", + "rustix 0.38.37", "slab", "tracing", "windows-sys 0.59.0", ] +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + [[package]] name = "async-lock" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener", + "event-listener 5.3.1", "event-listener-strategy", "pin-project-lite", ] [[package]] name = "async-process" -version = "2.2.4" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" dependencies = [ - "async-channel", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "async-signal", - "async-task", "blocking", "cfg-if", - "event-listener", - "futures-lite", - "rustix", - "tracing", - "windows-sys 0.59.0", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.37", + "windows-sys 0.48.0", ] [[package]] @@ -206,7 +230,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -215,13 +239,13 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io", - "async-lock", + "async-io 2.3.4", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix", + "rustix 0.38.37", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -235,13 +259,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -281,17 +305,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -311,18 +335,18 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" [[package]] name = "bitflags" @@ -354,7 +378,7 @@ dependencies = [ "async-channel", "async-task", "futures-io", - "futures-lite", + "futures-lite 2.3.0", "piper", ] @@ -372,9 +396,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cached" @@ -400,7 +424,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -436,9 +460,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.14" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "shlex", ] @@ -492,9 +516,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" +checksum = "cd6dd8046d00723a59a2f8c5f295c515b9bb9a331ee4f8f3d4dd49e428acd3b6" dependencies = [ "chrono", "chrono-tz-build", @@ -503,12 +527,11 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" +checksum = "e94fea34d77a245229e7746bd2beb786cd2a896f306ff491fb8cecb3074b10a7" dependencies = [ "parse-zoneinfo", - "phf", "phf_codegen", ] @@ -523,9 +546,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.16" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -533,9 +556,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -545,23 +568,23 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.23" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531d7959c5bbb6e266cecdd0f20213639c3a5c3e4d615f97db87661745f781ff" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -621,9 +644,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -662,12 +685,6 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -699,7 +716,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -710,7 +727,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -766,6 +783,17 @@ dependencies = [ "system-deps 6.2.2", ] +[[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 = "1.0.0" @@ -783,7 +811,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "unicode-xid", ] @@ -851,12 +879,6 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" -[[package]] -name = "endi" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" - [[package]] name = "enumflags2" version = "0.7.10" @@ -875,7 +897,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -907,6 +929,23 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -924,7 +963,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener", + "event-listener 5.3.1", "pin-project-lite", ] @@ -947,11 +986,11 @@ dependencies = [ "grass", "gtk", "gtk-layer-shell", - "itertools 0.13.0", + "itertools", "libc", "log", "maplit", - "nix", + "nix 0.29.0", "notifier_host", "notify", "once_cell", @@ -990,7 +1029,16 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", ] [[package]] @@ -1005,15 +1053,15 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset", + "memoffset 0.9.1", "rustc_version", ] [[package]] name = "filetime" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", @@ -1090,16 +1138,28 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand", "futures-core", - "futures-io", - "parking", "pin-project-lite", ] @@ -1111,7 +1171,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1264,9 +1324,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "gio" @@ -1330,11 +1390,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck 0.4.1", - "proc-macro-crate 2.0.0", + "proc-macro-crate 2.0.2", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1460,7 +1520,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1517,9 +1577,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1546,9 +1606,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -1576,9 +1636,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.39.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" dependencies = [ "console", "lazy_static", @@ -1586,6 +1646,26 @@ dependencies = [ "similar", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "is-terminal" version = "0.4.13" @@ -1603,15 +1683,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -1696,6 +1767,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "kqueue" version = "1.0.8" @@ -1718,31 +1798,31 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.20.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +checksum = "6e56f323e2d610628d1f5bdd39168a774674ac7989ed67011963bb3f71edd797" dependencies = [ "ascii-canvas", "bit-set", "ena", - "itertools 0.11.0", + "itertools", "lalrpop-util", "petgraph", "pico-args", "regex", "regex-syntax", + "sha3", "string_cache", "term", - "tiny-keccak", "unicode-xid", "walkdir", ] [[package]] name = "lalrpop-util" -version = "0.20.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +checksum = "108dc8f5dabad92c65a03523055577d847f5dcc00f3e7d3a68bc4d48e01d8fe1" dependencies = [ "regex-automata", ] @@ -1791,6 +1871,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1825,6 +1911,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[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.9.1" @@ -1836,11 +1931,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -1873,6 +1968,18 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset 0.7.1", +] + [[package]] name = "nix" version = "0.29.0" @@ -1883,7 +1990,6 @@ dependencies = [ "cfg-if", "cfg_aliases", "libc", - "memoffset", ] [[package]] @@ -1937,9 +2043,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -1987,9 +2093,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2073,7 +2179,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2119,7 +2225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand", + "fastrand 2.1.1", "futures-io", ] @@ -2129,6 +2235,22 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + [[package]] name = "polling" version = "3.7.3" @@ -2139,7 +2261,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.37", "tracing", "windows-sys 0.59.0", ] @@ -2161,9 +2283,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -2191,20 +2313,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ - "toml_edit 0.20.7", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -2307,9 +2421,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -2342,7 +2456,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2382,23 +2496,37 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -2437,29 +2565,29 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -2475,7 +2603,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2498,6 +2626,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -2538,7 +2676,7 @@ dependencies = [ "chrono-tz", "eww_shared_util", "insta", - "itertools 0.13.0", + "itertools", "jaq-core", "jaq-interpret", "jaq-parse", @@ -2585,7 +2723,17 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", ] [[package]] @@ -2642,7 +2790,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2652,14 +2800,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", + "quote", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -2668,9 +2817,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.31.3" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b92e0bdf838cbc1c4c9ba14f9c97a7ec6cdcd1ae66b10e1e42775a25553f45d" +checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" dependencies = [ "core-foundation-sys", "libc", @@ -2719,9 +2868,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.1.1", "once_cell", - "rustix", + "rustix 0.38.37", "windows-sys 0.59.0", ] @@ -2762,23 +2911,14 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", + "syn 2.0.77", ] [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -2787,7 +2927,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tokio-macros", "tracing", "windows-sys 0.52.0", @@ -2801,14 +2941,14 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -2819,21 +2959,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -2846,42 +2986,20 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] name = "toml_edit" -version = "0.20.7" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -2903,7 +3021,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2927,7 +3045,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset", + "memoffset 0.9.1", "tempfile", "winapi", ] @@ -2940,21 +3058,21 @@ checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "urlencoding" @@ -2989,6 +3107,12 @@ dependencies = [ "libc", ] +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + [[package]] name = "walkdir" version = "2.5.0" @@ -3027,7 +3151,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -3049,7 +3173,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3092,7 +3216,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3140,7 +3264,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3151,7 +3275,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3320,15 +3444,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" -dependencies = [ - "memchr", -] - [[package]] name = "x11" version = "2.21.0" @@ -3346,7 +3461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "rustix", + "rustix 0.38.37", "x11rb-protocol", ] @@ -3368,9 +3483,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yuck" @@ -3381,7 +3496,7 @@ dependencies = [ "derive_more", "eww_shared_util", "insta", - "itertools 0.13.0", + "itertools", "lalrpop", "lalrpop-util", "maplit", @@ -3398,21 +3513,24 @@ dependencies = [ [[package]] name = "zbus" -version = "4.4.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast", "async-process", "async-recursion", "async-trait", + "byteorder", + "derivative", "enumflags2", - "event-listener", + "event-listener 2.5.3", "futures-core", "futures-sink", "futures-util", "hex", - "nix", + "nix 0.26.4", + "once_cell", "ordered-stream", "rand", "serde", @@ -3422,7 +3540,7 @@ dependencies = [ "tokio", "tracing", "uds_windows", - "windows-sys 0.52.0", + "winapi", "xdg-home", "zbus_macros", "zbus_names", @@ -3431,22 +3549,23 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.4.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.76", + "regex", + "syn 1.0.109", "zvariant_utils", ] [[package]] name = "zbus_names" -version = "3.0.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c" +checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" dependencies = [ "serde", "static_assertions", @@ -3471,17 +3590,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "zvariant" -version = "4.2.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" dependencies = [ - "endi", + "byteorder", "enumflags2", + "libc", "serde", "static_assertions", "zvariant_derive", @@ -3489,24 +3609,24 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.2.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 1.0.109", "zvariant_utils", ] [[package]] name = "zvariant_utils" -version = "2.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 1.0.109", ] diff --git a/Cargo.toml b/Cargo.toml index b457ed4..398a4c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ anyhow = "1.0.86" bincode = "1.3.3" cached = "0.53.1" chrono = "0.4.38" -chrono-tz = "0.9.0" +chrono-tz = "0.10.0" clap = { version = "4.5.1", features = ["derive"] } clap_complete = "4.5.12" codespan-reporting = "0.11" @@ -35,8 +35,8 @@ jaq-parse = "1.0.3" jaq-std = "1.6.0" jaq-interpret = "1.5.0" jaq-syn = "1.6.0" -lalrpop = { version = "0.20.2", features = ["unicode"] } -lalrpop-util = { version = "0.20.2", features = ["unicode"] } +lalrpop = { version = "0.21", features = ["unicode"] } +lalrpop-util = { version = "0.21", features = ["unicode"] } libc = "0.2" log = "0.4" maplit = "1" @@ -60,7 +60,7 @@ tokio-util = "0.7.11" tokio = { version = "1.39.2", features = ["full"] } unescape = "0.1" wait-timeout = "0.2" -zbus = { version = "4.4.0", default-features = false, features = ["tokio"] } +zbus = { version = "3.15.2", default-features = false, features = ["tokio"] } [profile.dev] split-debuginfo = "unpacked" diff --git a/crates/notifier_host/src/host.rs b/crates/notifier_host/src/host.rs index 723322e..b937395 100644 --- a/crates/notifier_host/src/host.rs +++ b/crates/notifier_host/src/host.rs @@ -88,7 +88,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro // initial items first for svc in try_!(snw.registered_status_notifier_items().await) { - match Item::from_address(snw.inner().connection(), &svc).await { + match Item::from_address(snw.connection(), &svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(&svc, item); @@ -110,7 +110,7 @@ pub async fn run_host(host: &mut dyn Host, snw: &proxy::StatusNotifierWatcherPro if item_names.contains(svc) { log::info!("Got duplicate new item: {:?}", svc); } else { - match Item::from_address(snw.inner().connection(), svc).await { + match Item::from_address(snw.connection(), svc).await { Ok(item) => { item_names.insert(svc.to_owned()); host.add_item(svc, item); diff --git a/crates/notifier_host/src/icon.rs b/crates/notifier_host/src/icon.rs index ad6fdb1..c903a15 100644 --- a/crates/notifier_host/src/icon.rs +++ b/crates/notifier_host/src/icon.rs @@ -136,7 +136,7 @@ pub async fn load_icon_from_sni( let icon_from_name: std::result::Result = (async { // fetch icon name let icon_name = sni.icon_name().await; - log::debug!("dbus: {} icon_name -> {:?}", sni.inner().destination(), icon_name); + log::debug!("dbus: {} icon_name -> {:?}", sni.destination(), icon_name); let icon_name = match icon_name { Ok(s) if s.is_empty() => return Err(IconError::NotAvailable), Ok(s) => s, @@ -152,7 +152,7 @@ pub async fn load_icon_from_sni( // otherwise, fetch icon theme and lookup using icon_from_name let icon_theme_path = sni.icon_theme_path().await; - log::debug!("dbus: {} icon_theme_path -> {:?}", sni.inner().destination(), icon_theme_path); + log::debug!("dbus: {} icon_theme_path -> {:?}", sni.destination(), icon_theme_path); let icon_theme_path = match icon_theme_path { Ok(p) if p.is_empty() => None, Ok(p) => Some(p), @@ -179,7 +179,7 @@ pub async fn load_icon_from_sni( match icon_from_name { Ok(p) => return Some(p), // got an icon! Err(IconError::NotAvailable) => {} // this error is expected, don't log - Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.inner().destination(), e), + Err(e) => log::warn!("failed to get icon by name for {}: {}", sni.destination(), e), }; // Can't get it from name + theme, try the pixmap @@ -199,7 +199,7 @@ pub async fn load_icon_from_sni( match icon_from_pixmaps { Ok(p) => return Some(p), Err(IconError::NotAvailable) => {} - Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.inner().destination(), e), + Err(e) => log::warn!("failed to get icon pixmap for {}: {}", sni.destination(), e), }; // Tray didn't provide a valid icon so use the default fallback one. diff --git a/crates/notifier_host/src/item.rs b/crates/notifier_host/src/item.rs index ad63f34..a6cb2af 100644 --- a/crates/notifier_host/src/item.rs +++ b/crates/notifier_host/src/item.rs @@ -82,7 +82,7 @@ impl Item { } pub async fn set_menu(&mut self, widget: >k::EventBox) -> zbus::Result<()> { - let menu = dbusmenu_gtk3::Menu::new(self.sni.inner().destination(), &self.sni.menu().await?); + let menu = dbusmenu_gtk3::Menu::new(self.sni.destination(), &self.sni.menu().await?); menu.set_attach_widget(Some(widget)); self.gtk_menu = Some(menu); Ok(()) diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs index 051f180..5c57b2a 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_item.rs @@ -1,18 +1,20 @@ -//! # D-Bus interface proxy for: `org.kde.StatusNotifierItem` +//! # DBus interface proxy for: `org.kde.StatusNotifierItem` //! -//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. -//! Source: `dbus_status_notifier_item.xml`. +//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. +//! Source: `dbus-status-notifier-item.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the [Writing a client proxy] section of the zbus -//! documentation. -//! -//! -//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html -//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, -use zbus::proxy; -#[proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] +//! More information can be found in the +//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) +//! section of the zbus documentation. + +// suppress warning from generated code +#![allow(clippy::type_complexity)] + +use zbus::dbus_proxy; + +#[dbus_proxy(interface = "org.kde.StatusNotifierItem", assume_defaults = true)] trait StatusNotifierItem { /// Activate method fn activate(&self, x: i32, y: i32) -> zbus::Result<()>; @@ -27,87 +29,86 @@ trait StatusNotifierItem { fn secondary_activate(&self, x: i32, y: i32) -> zbus::Result<()>; /// NewAttentionIcon signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_attention_icon(&self) -> zbus::Result<()>; /// NewIcon signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_icon(&self) -> zbus::Result<()>; /// NewOverlayIcon signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_overlay_icon(&self) -> zbus::Result<()>; /// NewStatus signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_status(&self, status: &str) -> zbus::Result<()>; /// NewTitle signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_title(&self) -> zbus::Result<()>; /// NewToolTip signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn new_tool_tip(&self) -> zbus::Result<()>; /// AttentionIconName property - #[zbus(property)] + #[dbus_proxy(property)] fn attention_icon_name(&self) -> zbus::Result; /// AttentionIconPixmap property - #[zbus(property)] + #[dbus_proxy(property)] fn attention_icon_pixmap(&self) -> zbus::Result)>>; /// AttentionMovieName property - #[zbus(property)] + #[dbus_proxy(property)] fn attention_movie_name(&self) -> zbus::Result; /// Category property - #[zbus(property)] + #[dbus_proxy(property)] fn category(&self) -> zbus::Result; /// IconName property - #[zbus(property)] + #[dbus_proxy(property(emits_changed_signal = "false"))] fn icon_name(&self) -> zbus::Result; /// IconPixmap property - #[zbus(property)] + #[dbus_proxy(property(emits_changed_signal = "false"))] fn icon_pixmap(&self) -> zbus::Result)>>; /// IconThemePath property - #[zbus(property)] + #[dbus_proxy(property)] fn icon_theme_path(&self) -> zbus::Result; /// Id property - #[zbus(property)] + #[dbus_proxy(property)] fn id(&self) -> zbus::Result; /// ItemIsMenu property - #[zbus(property)] + #[dbus_proxy(property)] fn item_is_menu(&self) -> zbus::Result; /// Menu property - #[zbus(property)] + #[dbus_proxy(property)] fn menu(&self) -> zbus::Result; /// OverlayIconName property - #[zbus(property)] + #[dbus_proxy(property)] fn overlay_icon_name(&self) -> zbus::Result; /// OverlayIconPixmap property - #[zbus(property)] + #[dbus_proxy(property)] fn overlay_icon_pixmap(&self) -> zbus::Result)>>; /// Status property - #[zbus(property)] + #[dbus_proxy(property)] fn status(&self) -> zbus::Result; /// Title property - #[zbus(property)] + #[dbus_proxy(property)] fn title(&self) -> zbus::Result; /// ToolTip property - #[zbus(property)] - #[allow(clippy::type_complexity)] - fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>, String, String)>; + #[dbus_proxy(property)] + fn tool_tip(&self) -> zbus::Result<(String, Vec<(i32, i32, Vec)>)>; } diff --git a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs index 4ffb98f..9ac2eaa 100644 --- a/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs +++ b/crates/notifier_host/src/proxy/dbus_status_notifier_watcher.rs @@ -1,18 +1,17 @@ -//! # D-Bus interface proxy for: `org.kde.StatusNotifierWatcher` +//! # DBus interface proxy for: `org.kde.StatusNotifierWatcher` //! -//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. -//! Source: `dbus_status_notifier_watcher.xml`. +//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. +//! Source: `dbus-status-notifier-watcher.xml`. //! //! You may prefer to adapt it, instead of using it verbatim. //! -//! More information can be found in the [Writing a client proxy] section of the zbus -//! documentation. -//! -//! -//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html -//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, -use zbus::proxy; -#[proxy( +//! More information can be found in the +//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) +//! section of the zbus documentation. + +use zbus::dbus_proxy; + +#[dbus_proxy( default_service = "org.kde.StatusNotifierWatcher", interface = "org.kde.StatusNotifierWatcher", default_path = "/StatusNotifierWatcher" @@ -25,30 +24,30 @@ trait StatusNotifierWatcher { fn register_status_notifier_item(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierHostRegistered signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn status_notifier_host_registered(&self) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn status_notifier_host_unregistered(&self) -> zbus::Result<()>; /// StatusNotifierItemRegistered signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn status_notifier_item_registered(&self, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[zbus(signal)] + #[dbus_proxy(signal)] fn status_notifier_item_unregistered(&self, service: &str) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[zbus(property)] + #[dbus_proxy(property)] fn is_status_notifier_host_registered(&self) -> zbus::Result; /// ProtocolVersion property - #[zbus(property)] + #[dbus_proxy(property)] fn protocol_version(&self) -> zbus::Result; /// RegisteredStatusNotifierItems property - #[zbus(property)] + #[dbus_proxy(property)] fn registered_status_notifier_items(&self) -> zbus::Result>; } diff --git a/crates/notifier_host/src/watcher.rs b/crates/notifier_host/src/watcher.rs index 677e378..a0e7c13 100644 --- a/crates/notifier_host/src/watcher.rs +++ b/crates/notifier_host/src/watcher.rs @@ -1,5 +1,5 @@ use crate::names; -use zbus::{export::ordered_stream::OrderedStreamExt, interface, Interface}; +use zbus::{dbus_interface, export::ordered_stream::OrderedStreamExt, Interface}; /// An instance of [`org.kde.StatusNotifierWatcher`]. It only tracks what tray items and trays /// exist, and doesn't have any logic for displaying items (for that, see [`Host`][`crate::Host`]). @@ -23,7 +23,7 @@ pub struct Watcher { /// /// Methods and properties correspond to methods and properties on the DBus service that can be /// used by others, while signals are events that we generate that other services listen to. -#[interface(name = "org.kde.StatusNotifierWatcher")] +#[dbus_interface(name = "org.kde.StatusNotifierWatcher")] impl Watcher { /// RegisterStatusNotifierHost method async fn register_status_notifier_host( @@ -89,15 +89,15 @@ impl Watcher { } /// StatusNotifierHostRegistered signal. - #[zbus(signal)] + #[dbus_interface(signal)] async fn status_notifier_host_registered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// StatusNotifierHostUnregistered signal - #[zbus(signal)] + #[dbus_interface(signal)] async fn status_notifier_host_unregistered(ctxt: &zbus::SignalContext<'_>) -> zbus::Result<()>; /// IsStatusNotifierHostRegistered property - #[zbus(property)] + #[dbus_interface(property)] async fn is_status_notifier_host_registered(&self) -> bool { let hosts = self.hosts.lock().unwrap(); // unwrap: mutex poisoning is okay !hosts.is_empty() @@ -159,15 +159,15 @@ impl Watcher { } /// StatusNotifierItemRegistered signal - #[zbus(signal)] + #[dbus_interface(signal)] async fn status_notifier_item_registered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// StatusNotifierItemUnregistered signal - #[zbus(signal)] + #[dbus_interface(signal)] async fn status_notifier_item_unregistered(ctxt: &zbus::SignalContext<'_>, service: &str) -> zbus::Result<()>; /// RegisteredStatusNotifierItems property - #[zbus(property)] + #[dbus_interface(property)] async fn registered_status_notifier_items(&self) -> Vec { let items = self.items.lock().unwrap(); // unwrap: mutex poisoning is okay items.iter().cloned().collect() @@ -176,7 +176,7 @@ impl Watcher { // ------------------------------------------------------------------------ /// ProtocolVersion property - #[zbus(property)] + #[dbus_interface(property)] fn protocol_version(&self) -> i32 { 0 } @@ -244,7 +244,7 @@ async fn parse_service<'a>( ) -> zbus::fdo::Result<(zbus::names::UniqueName<'static>, &'a str)> { if service.starts_with('/') { // they sent us just the object path - if let Some(sender) = hdr.sender() { + if let Some(sender) = hdr.sender()? { Ok((sender.to_owned(), service)) } else { log::warn!("unknown sender"); From 23f80cd25e3f0684bce165d291e8c06cafe94e79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Thu, 10 Oct 2024 17:25:09 +0000 Subject: [PATCH 55/88] nix: update flake-compat (#1197) * nix: update flake-compat * nix: use edolstra/flake-compat#65 as input --- default.nix | 4 +++- flake.lock | 8 ++++---- flake.nix | 5 +---- shell.nix | 4 +++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index 6466507..1d976a3 100644 --- a/default.nix +++ b/default.nix @@ -3,7 +3,9 @@ lock = builtins.fromJSON (builtins.readFile ./flake.lock); in fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + url = + lock.nodes.flake-compat.locked.url + or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; sha256 = lock.nodes.flake-compat.locked.narHash; } ) { src = ./.; }).defaultNix diff --git a/flake.lock b/flake.lock index ccf21d5..bdecde7 100644 --- a/flake.lock +++ b/flake.lock @@ -1,17 +1,17 @@ { "nodes": { "flake-compat": { - "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1709944340, + "narHash": "sha256-xr54XK0SjczlUxRo5YwodibUSlpivS9bqHt8BNyWVQA=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "baa7aa7bd0a570b3b9edd0b8da859fee3ffaa4d4", "type": "github" }, "original": { "owner": "edolstra", + "ref": "refs/pull/65/head", "repo": "flake-compat", "type": "github" } diff --git a/flake.nix b/flake.nix index 8ddf153..7c164eb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,6 @@ { inputs = { - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; + flake-compat.url = "github:edolstra/flake-compat/refs/pull/65/head"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; rust-overlay = { url = "github:oxalica/rust-overlay"; diff --git a/shell.nix b/shell.nix index 493783d..d178307 100644 --- a/shell.nix +++ b/shell.nix @@ -3,7 +3,9 @@ lock = builtins.fromJSON (builtins.readFile ./flake.lock); in fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + url = + lock.nodes.flake-compat.locked.url + or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; sha256 = lock.nodes.flake-compat.locked.narHash; } ) { src = ./.; }).shellNix From ef32bf2c3f740e6a107b46eeaefae2e636bdc168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Thu, 10 Oct 2024 17:26:00 +0000 Subject: [PATCH 56/88] feat: update toolchain to 1.81.0 (#1195) * flake.lock: update * feat: switch to 1.81.0 toolchain * fix: fix new warnings and lints * chore: update changelog entry * chore: automatically update a few dependencies --- CHANGELOG.md | 2 +- Cargo.lock | 104 ++++++++++++------------- crates/eww/src/error_handling_ctx.rs | 3 - crates/yuck/src/parser/ast_iterator.rs | 3 +- flake.lock | 12 +-- rust-toolchain.toml | 2 +- 6 files changed, 61 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84c0486..3cf59e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix wayland monitor names support (By: dragonnn) ### Features -- Update rust toolchain to 1.80.1 (By: w-lfchen) +- Update rust toolchain to 1.81.0 (By: w-lfchen) - Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). - Add support for `:hover` css selectors for tray items (By: zeapoz) diff --git a/Cargo.lock b/Cargo.lock index c62fe87..01f6598 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -259,13 +259,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -299,9 +299,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -424,7 +424,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -460,9 +460,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" dependencies = [ "shlex", ] @@ -479,9 +479,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8" +checksum = "d0890061c4d3223e7267f3bad2ec40b997d64faac1c2815a4a9d95018e2b9e9c" dependencies = [ "smallvec", "target-lexicon", @@ -584,7 +584,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -716,7 +716,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -727,7 +727,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -811,7 +811,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "unicode-xid", ] @@ -897,7 +897,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1029,7 +1029,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1171,7 +1171,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1394,7 +1394,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1489,7 +1489,7 @@ dependencies = [ "glib-sys", "gtk-sys", "libc", - "system-deps 7.0.2", + "system-deps 7.0.3", ] [[package]] @@ -1520,7 +1520,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1844,9 +1844,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libm" @@ -2179,7 +2179,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2231,9 +2231,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" @@ -2421,9 +2421,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ "bitflags 2.6.0", ] @@ -2456,7 +2456,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2580,7 +2580,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2603,14 +2603,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -2723,7 +2723,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2790,7 +2790,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2806,9 +2806,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -2844,11 +2844,11 @@ dependencies = [ [[package]] name = "system-deps" -version = "7.0.2" +version = "7.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031" +checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" dependencies = [ - "cfg-expr 0.16.0", + "cfg-expr 0.17.0", "heck 0.5.0", "pkg-config", "toml", @@ -2896,22 +2896,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2941,7 +2941,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3021,7 +3021,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3151,7 +3151,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -3173,7 +3173,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3264,7 +3264,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3275,7 +3275,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3590,7 +3590,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] diff --git a/crates/eww/src/error_handling_ctx.rs b/crates/eww/src/error_handling_ctx.rs index 05af272..8a0ff40 100644 --- a/crates/eww/src/error_handling_ctx.rs +++ b/crates/eww/src/error_handling_ctx.rs @@ -31,9 +31,6 @@ pub fn print_error(err: anyhow::Error) { } pub fn format_error(err: &anyhow::Error) -> String { - for err in err.chain() { - format!("chain: {}", err); - } anyhow_err_to_diagnostic(err).and_then(|diag| stringify_diagnostic(diag).ok()).unwrap_or_else(|| format!("{:?}", err)) } diff --git a/crates/yuck/src/parser/ast_iterator.rs b/crates/yuck/src/parser/ast_iterator.rs index 4cb6c2f..214c707 100644 --- a/crates/yuck/src/parser/ast_iterator.rs +++ b/crates/yuck/src/parser/ast_iterator.rs @@ -100,9 +100,8 @@ impl> Iterator for AstIterator { type Item = Ast; fn next(&mut self) -> Option { - self.iter.next().map(|x| { + self.iter.next().inspect(|x| { self.remaining_span.0 = x.span().1; - x }) } } diff --git a/flake.lock b/flake.lock index bdecde7..eed9a12 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723635686, - "narHash": "sha256-iNYh7Kb0D+MQ8IHM4+8bT1bUS5RNW6gVSDe2yTO1aAk=", + "lastModified": 1725534445, + "narHash": "sha256-Yd0FK9SkWy+ZPuNqUgmVPXokxDgMJoGuNpMEtkfcf84=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0cb2fd7c59fed0cd82ef858cbcbdb552b9a33465", + "rev": "9bb1e7571aadf31ddb4af77fc64b2d59580f9a39", "type": "github" }, "original": { @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1723688259, - "narHash": "sha256-WzeUR1MG9MnJnh9T7qcVe/v12qHvJvzdc3Z5HCeE2ns=", + "lastModified": 1725675754, + "narHash": "sha256-hXW3csqePOcF2e/PYnpXj72KEYyNj2HzTrVNmS/F7Ug=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6e75319846684326d900daff1e2e11338cc80d2b", + "rev": "8cc45e678e914a16c8e224c3237fb07cf21e5e54", "type": "github" }, "original": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4168f18..31d61a3 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.80.1" +channel = "1.81.0" components = [ "rust-src" ] profile = "default" From 9a7e69953956b6364c85c5d2a1d76b02aa1421b0 Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:15:32 +0300 Subject: [PATCH 57/88] Some docs updates (#1179) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Export magic constants during server initialization * `docs`: add `magic constants` descriptions (or at least try) * `docs`: add `min` and `max` simplexpr functions entries * `docs`: `expander` should contain single child * Update docs/src/magic-vars.md Co-authored-by: Wölfchen * `docs`: fix the heat units typo * Revert "Export magic constants during server initialization" This reverts commit 09fbdde6c99a4c4c8af39b76496878f99a28d568. * Revert "Update docs/src/magic-vars.md" This reverts commit b3dbfadfb2143cc0d3e2e21c0cf43ed0a96a53cf. * Revert "`docs`: add `magic constants` descriptions (or at least try)" This reverts commit f03aebf0dd2fba10c67c608f72570c230d0eb8ea. --------- Co-authored-by: Wölfchen --- crates/eww/src/config/inbuilt.rs | 2 +- crates/eww/src/widgets/widget_definitions.rs | 3 ++- docs/src/expression_language.md | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/eww/src/config/inbuilt.rs b/crates/eww/src/config/inbuilt.rs index ba29939..687fb05 100644 --- a/crates/eww/src/config/inbuilt.rs +++ b/crates/eww/src/config/inbuilt.rs @@ -30,7 +30,7 @@ macro_rules! define_builtin_vars { } define_builtin_vars! { - // @desc EWW_TEMPS - Heat of the components in Celcius + // @desc EWW_TEMPS - Heat of the components in degree Celsius // @prop { : temperature } "EWW_TEMPS" [2] => || Ok(DynVal::from(get_temperatures())), diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 0fb88f1..394237a 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -312,7 +312,8 @@ fn build_gtk_combo_box_text(bargs: &mut BuilderArgs) -> Result Result { let gtk_widget = gtk::Expander::new(None); diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 15dfc6e..1c493e0 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -40,6 +40,7 @@ Supported currently are the following features: - some function calls: - `round(number, decimal_digits)`: Round a number to the given amount of decimals - `sin(number)`, `cos(number)`, `tan(number)`, `cot(number)`: Calculate the trigonometric value of a given number in **radians** + - `min(a, b)`, `max(a, b)`: Get the smaller or bigger number out of two given numbers - `degtorad(number)`: Converts a number from degrees to radians - `radtodeg(number)`: Converts a number from radians to degrees - `replace(string, regex, replacement)`: Replace matches of a given regex in a string From 8de378dc10460b234c7230bdc390d92938c3fa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Fri, 11 Oct 2024 11:27:24 +0000 Subject: [PATCH 58/88] feat: button improvements (#1187) * feat: add keyboard support for button presses Co-authored-by: Julian Schuler <31921487+julianschuler@users.noreply.github.com> * chore: attribution * fix: activate eventbox on button release; minor fixes * docs: improve button and eventbox documentation Co-authored-by: Julian Schuler <31921487+julianschuler@users.noreply.github.com> --------- Co-authored-by: Julian Schuler <31921487+julianschuler@users.noreply.github.com> --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 61 ++++++++++++-------- 2 files changed, 37 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cf59e1..90db61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `min` and `max` function calls to simplexpr (By: ovalkonia) - Add `flip-x`, `flip-y`, `vertical` options to the graph widget to determine its direction - Add `transform-origin-x`/`transform-origin-y` properties to transform widget (By: mario-kr) +- Add keyboard support for button presses (By: julianschuler) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 394237a..29c14a0 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -38,16 +38,16 @@ use yuck::{ /// thus not connecting a new handler unless the condition is met. macro_rules! connect_signal_handler { ($widget:ident, if $cond:expr, $connect_expr:expr) => {{ + const KEY:&str = std::concat!("signal-handler:", std::line!()); unsafe { - let key = ::std::concat!("signal-handler:", ::std::line!()); - let old = $widget.data::(key); + let old = $widget.data::(KEY); if let Some(old) = old { let a = old.as_ref().as_raw(); $widget.disconnect(gtk::glib::SignalHandlerId::from_glib(a)); } - $widget.set_data::(key, $connect_expr); + $widget.set_data::(KEY, $connect_expr); } }}; ($widget:ident, $connect_expr:expr) => {{ @@ -495,7 +495,6 @@ fn build_gtk_input(bargs: &mut BuilderArgs) -> Result { prop(value: as_string) { gtk_widget.set_text(&value); }, - // @prop onchange - Command to run when the text changes. The placeholder `{}` will be replaced by the value // @prop timeout - timeout of the command. Default: "200ms" prop(timeout: as_duration = Duration::from_millis(200), onchange: as_string) { @@ -520,7 +519,7 @@ fn build_gtk_input(bargs: &mut BuilderArgs) -> Result { const WIDGET_NAME_BUTTON: &str = "button"; /// @widget button -/// @desc A button +/// @desc A button containing any widget as it's child. Events are triggered on release. fn build_gtk_button(bargs: &mut BuilderArgs) -> Result { let gtk_widget = gtk::Button::new(); @@ -528,15 +527,22 @@ fn build_gtk_button(bargs: &mut BuilderArgs) -> Result { prop( // @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 + // @prop onclick - command to run when the button is activated either by leftclicking or keyboard onclick: as_string = "", - // @prop onmiddleclick - a command that get's run when the button is middleclicked + // @prop onmiddleclick - command to run when the button is middleclicked onmiddleclick: as_string = "", - // @prop onrightclick - a command that get's run when the button is rightclicked + // @prop onrightclick - command to run when the button is rightclicked onrightclick: as_string = "" ) { - gtk_widget.add_events(gdk::EventMask::BUTTON_PRESS_MASK); - connect_signal_handler!(gtk_widget, gtk_widget.connect_button_press_event(move |_, evt| { + // animate button upon right-/middleclick (if gtk theme supports it) + // since we do this, we can't use `connect_clicked` as that would always run `onclick` as well + connect_signal_handler!(gtk_widget, gtk_widget.connect_button_press_event(move |button, _| { + button.emit_activate(); + glib::Propagation::Proceed + })); + let onclick_ = onclick.clone(); + // mouse click events + connect_signal_handler!(gtk_widget, gtk_widget.connect_button_release_event(move |_, evt| { match evt.button() { 1 => run_command(timeout, &onclick, &[] as &[&str]), 2 => run_command(timeout, &onmiddleclick, &[] as &[&str]), @@ -545,8 +551,18 @@ fn build_gtk_button(bargs: &mut BuilderArgs) -> Result { } glib::Propagation::Proceed })); + // keyboard events + connect_signal_handler!(gtk_widget, gtk_widget.connect_key_release_event(move |_, evt| { + match evt.scancode() { + // return + 36 => run_command(timeout, &onclick_, &[] as &[&str]), + // space + 65 => run_command(timeout, &onclick_, &[] as &[&str]), + _ => {}, + } + glib::Propagation::Proceed + })); } - }); Ok(gtk_widget) } @@ -786,26 +802,26 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { // Support :hover selector gtk_widget.connect_enter_notify_event(|gtk_widget, evt| { if evt.detail() != NotifyType::Inferior { - gtk_widget.clone().set_state_flags(gtk::StateFlags::PRELIGHT, false); + gtk_widget.set_state_flags(gtk::StateFlags::PRELIGHT, false); } glib::Propagation::Proceed }); gtk_widget.connect_leave_notify_event(|gtk_widget, evt| { if evt.detail() != NotifyType::Inferior { - gtk_widget.clone().unset_state_flags(gtk::StateFlags::PRELIGHT); + gtk_widget.unset_state_flags(gtk::StateFlags::PRELIGHT); } glib::Propagation::Proceed }); // Support :active selector gtk_widget.connect_button_press_event(|gtk_widget, _| { - gtk_widget.clone().set_state_flags(gtk::StateFlags::ACTIVE, false); + gtk_widget.set_state_flags(gtk::StateFlags::ACTIVE, false); glib::Propagation::Proceed }); gtk_widget.connect_button_release_event(|gtk_widget, _| { - gtk_widget.clone().unset_state_flags(gtk::StateFlags::ACTIVE); + gtk_widget.unset_state_flags(gtk::StateFlags::ACTIVE); glib::Propagation::Proceed }); @@ -916,21 +932,18 @@ 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. Default: "200ms" timeout: as_duration = Duration::from_millis(200), - // @prop onclick - a command that get's run when the button is clicked + // @prop onclick - command to run when the widget is clicked onclick: as_string = "", - // @prop onmiddleclick - a command that get's run when the button is middleclicked + // @prop onmiddleclick - command to run when the widget is middleclicked onmiddleclick: as_string = "", - // @prop onrightclick - a command that get's run when the button is rightclicked + // @prop onrightclick - command to run when the widget is rightclicked onrightclick: as_string = "" ) { gtk_widget.add_events(gdk::EventMask::BUTTON_PRESS_MASK); - connect_signal_handler!(gtk_widget, gtk_widget.connect_button_press_event(move |_, evt| { + connect_signal_handler!(gtk_widget, gtk_widget.connect_button_release_event(move |_, evt| { match evt.button() { 1 => run_command(timeout, &onclick, &[] as &[&str]), 2 => run_command(timeout, &onmiddleclick, &[] as &[&str]), @@ -941,7 +954,6 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result { })); } }); - Ok(gtk_widget) } @@ -1182,8 +1194,7 @@ fn build_gtk_stack(bargs: &mut BuilderArgs) -> Result { const WIDGET_NAME_TRANSFORM: &str = "transform"; /// @widget transform -/// @desc A widget that applies transformations to its content. They are applied in the following -/// order: rotate->translate->scale) +/// @desc A widget that applies transformations to its content. They are applied in the following order: rotate -> translate -> scale fn build_transform(bargs: &mut BuilderArgs) -> Result { let w = Transform::new(); def_widget!(bargs, _g, w, { From 26ff08f9ad097ebd35f713d0c47c6325f4976ebc Mon Sep 17 00:00:00 2001 From: ElKowar Date: Fri, 11 Oct 2024 15:34:44 +0200 Subject: [PATCH 59/88] Add platform section to bug-report issue template --- .github/ISSUE_TEMPLATE/bug_report.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 275d789..8279df9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,4 +1,4 @@ -name: Bug report + name: Bug report description: Report a bug you have encountered title: "[BUG] " labels: bug @@ -37,3 +37,9 @@ body: description: "If applicable, provide additional context or screenshots here." validations: required: false + - type: textarea + attributes: + label: "Platform and environment" + description: "Does this happen on wayland, X11, or on both? What WM/Compositor are you using? Which version of eww are you using? (when using a git version, optimally provide the exact commit ref). + validations: + required: true From 49b37f86e6ab9dcc8f2eb3f8c91a1febacfef283 Mon Sep 17 00:00:00 2001 From: ElKowar Date: Fri, 11 Oct 2024 15:35:19 +0200 Subject: [PATCH 60/88] Fix bug_report issue template --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 8279df9..b01a061 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -40,6 +40,6 @@ body: - type: textarea attributes: label: "Platform and environment" - description: "Does this happen on wayland, X11, or on both? What WM/Compositor are you using? Which version of eww are you using? (when using a git version, optimally provide the exact commit ref). + description: "Does this happen on wayland, X11, or on both? What WM/Compositor are you using? Which version of eww are you using? (when using a git version, optimally provide the exact commit ref)." validations: required: true From 8801fa36a057b0c1d2d57585673496f0bc4240d2 Mon Sep 17 00:00:00 2001 From: ElKowar Date: Fri, 11 Oct 2024 15:36:21 +0200 Subject: [PATCH 61/88] fix bug_report issue template even more --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b01a061..8e1f9b6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,4 +1,4 @@ - name: Bug report +name: Bug report description: Report a bug you have encountered title: "[BUG] " labels: bug From 50ec181fc7ff2a68d6330e8897de2c5179575935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Sat, 12 Oct 2024 07:49:50 +0200 Subject: [PATCH 62/88] feat: support empty string for safe access operator (#1176) * chore: apply pr #629 Co-authored-by: Roland Fredenhagen * style: early return * feat: err on empty json string * docs: update docs * test: update test in accordance with decision * chore: attribution * docs: improve wording * docs: add breaking change notice to changelog * fix(changelog): fix pr link --------- Co-authored-by: Roland Fredenhagen --- CHANGELOG.md | 5 +++++ crates/simplexpr/src/eval.rs | 9 ++++++--- docs/src/expression_language.md | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90db61f..3710363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to eww will be listed here, starting at changes since versio ## Unreleased +### BREAKING CHANGES +- [#1176](https://github.com/elkowar/eww/pull/1176) changed safe access (`?.`) behavior: + Attempting to index in an empty JSON string (`'""'`) is now an error. + ### Fixes - Re-enable some scss features (By: w-lfchen) - Fix and refactor nix flake (By: w-lfchen) @@ -23,6 +27,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `flip-x`, `flip-y`, `vertical` options to the graph widget to determine its direction - Add `transform-origin-x`/`transform-origin-y` properties to transform widget (By: mario-kr) - Add keyboard support for button presses (By: julianschuler) +- Support empty string for safe access operator (By: ModProg) ## [0.6.0] (21.04.2024) diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index 6325782..ecb644e 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -268,6 +268,10 @@ impl SimplExpr { let is_safe = *safe == AccessType::Safe; + // Needs to be done first as `as_json_value` fails on empty string + if is_safe && val.as_string()?.is_empty() { + return Ok(DynVal::from(&serde_json::Value::Null).at(*span)); + } match val.as_json_value()? { serde_json::Value::Array(val) => { let index = index.as_i32()?; @@ -281,9 +285,6 @@ impl SimplExpr { .unwrap_or(&serde_json::Value::Null); Ok(DynVal::from(indexed_value).at(*span)) } - serde_json::Value::String(val) if val.is_empty() && is_safe => { - Ok(DynVal::from(&serde_json::Value::Null).at(*span)) - } serde_json::Value::Null if is_safe => Ok(DynVal::from(&serde_json::Value::Null).at(*span)), _ => Err(EvalError::CannotIndex(format!("{}", val)).at(*span)), } @@ -564,6 +565,8 @@ mod tests { string_to_string(r#""Hello""#) => Ok(DynVal::from("Hello".to_string())), safe_access_to_existing(r#"{ "a": { "b": 2 } }.a?.b"#) => Ok(DynVal::from(2)), safe_access_to_missing(r#"{ "a": { "b": 2 } }.b?.b"#) => Ok(DynVal::from(&serde_json::Value::Null)), + safe_access_to_empty(r#"""?.test"#) => Ok(DynVal::from(&serde_json::Value::Null)), + safe_access_to_empty_json_string(r#"'""'?.test"#) => Err(super::EvalError::CannotIndex("\"\"".to_string())), safe_access_index_to_existing(r#"[1, 2]?.[1]"#) => Ok(DynVal::from(2)), safe_access_index_to_missing(r#""null"?.[1]"#) => Ok(DynVal::from(&serde_json::Value::Null)), safe_access_index_to_non_indexable(r#"32?.[1]"#) => Err(super::EvalError::CannotIndex("32".to_string())), diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 1c493e0..0fb51e6 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -28,10 +28,10 @@ Supported currently are the following features: - if the left side is `""` or a JSON `null`, then returns the right side, otherwise evaluates to the left side. - Safe Access operator (`?.`) or (`?.[index]`) - - if the left side is `""` or a JSON `null`, then return `null`. Otherwise, - attempt to index. + - if the left side is an empty string or a JSON `null`, then return `null`. Otherwise, + attempt to index. Note that indexing an empty JSON string (`'""'`) is an error. - This can still cause an error to occur if the left hand side exists but is - not an object. + not an object or an array. (`Number` or `String`). - conditionals (`condition ? 'value' : 'other value'`) - numbers, strings, booleans and variable references (`12`, `'hi'`, `true`, `some_variable`) From 86dc4a4636dad3999db29975d8a720831a076695 Mon Sep 17 00:00:00 2001 From: shobu13 Date: Wed, 20 Nov 2024 09:42:05 +0100 Subject: [PATCH 63/88] Update expression_language.md (#1231) add clarification for regex operator --- docs/src/expression_language.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 0fb51e6..becb044 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -24,6 +24,8 @@ Supported currently are the following features: - comparisons (`==`, `!=`, `>`, `<`, `<=`, `>=`) - boolean operations (`||`, `&&`, `!`) - regex match operator (`=~`) + - Rust regex style, left hand is regex, right hand is string + - ex: workspace.name =~ '^special:.+$' - elvis operator (`?:`) - if the left side is `""` or a JSON `null`, then returns the right side, otherwise evaluates to the left side. From a8dd2f251fdb05f20a4275f2ef53057e13177ac8 Mon Sep 17 00:00:00 2001 From: Nycta <163431396+Nycta-b424b3c7@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:03:56 +0300 Subject: [PATCH 64/88] Add "Activate Linux" to README.md (#1242) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c11012c..cc969a7 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,14 @@ I've hit a bit of a design roadblock for one of the bigger features that are in +* [Activate Linux by Nycta](https://github.com/Nycta-b424b3c7/eww_activate-linux) + +
+ +![Activate Linux](https://raw.githubusercontent.com/Nycta-b424b3c7/eww_activate-linux/refs/heads/master/activate-linux.png) + +
+ ## Contribewwting If you want to contribute anything, like adding new widgets, features, or subcommands (including sample configs), you should definitely do so. From f2b687043e555da681f465c54f0802d34f3488a5 Mon Sep 17 00:00:00 2001 From: ElKowar Date: Sat, 21 Dec 2024 16:56:36 +0100 Subject: [PATCH 65/88] Reference yolk in Readme --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc969a7..a5ebd21 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,14 @@ Documentation **and instructions on how to install** can be found [here](https:/ Dharmx also wrote a nice, beginner friendly introductory guide for eww [here](https://dharmx.is-a.dev/eww-powermenu/). -## Eww needs your opinion! +## Check out another cool project by me -I've hit a bit of a design roadblock for one of the bigger features that are in the works right now. + -**Please read through https://github.com/elkowar/eww/discussions/453 and share your thoughts, ideas and opinions!** +I'm currently busy working [yolk](https://github.com/elkowar/yolk), +which is a dotfile management solution that supports a unique spin on templating: *templating without template files*. + +To find out more, check out the [website and documentation](https://elkowar.github.io/yolk)! ## Examples From c3b28d8fe5fe9eb8c4d00aff9478f3ccb1dbc3cb Mon Sep 17 00:00:00 2001 From: ovalkonia <60359793+ovalkonia@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:29:26 +0200 Subject: [PATCH 66/88] `powi`/`powf` simplexpr functions (#1255) * Add `powi`/`powf` expressions * Update docs --- crates/simplexpr/src/eval.rs | 16 ++++++++++++++++ docs/src/expression_language.md | 1 + 2 files changed, 17 insertions(+) diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index ecb644e..545f956 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -345,6 +345,22 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, + "powi" => match args.as_slice() { + [num, n] => { + let num = num.as_f64()?; + let n = n.as_i32()?; + Ok(DynVal::from(f64::powi(num, n))) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, + "powf" => match args.as_slice() { + [num, n] => { + let num = num.as_f64()?; + let n = n.as_f64()?; + Ok(DynVal::from(f64::powf(num, n))) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, "sin" => match args.as_slice() { [num] => { let num = num.as_f64()?; diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index becb044..150cf0e 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -43,6 +43,7 @@ Supported currently are the following features: - `round(number, decimal_digits)`: Round a number to the given amount of decimals - `sin(number)`, `cos(number)`, `tan(number)`, `cot(number)`: Calculate the trigonometric value of a given number in **radians** - `min(a, b)`, `max(a, b)`: Get the smaller or bigger number out of two given numbers + - `powi(num, n)`, `powf(num, n)`: Raise number `num` to power `n`. `powi` expects `n` to be of type `i32` - `degtorad(number)`: Converts a number from degrees to radians - `radtodeg(number)`: Converts a number from radians to degrees - `replace(string, regex, replacement)`: Replace matches of a given regex in a string From 95124ad27443c478782a3c9fda50b243e7153779 Mon Sep 17 00:00:00 2001 From: Roberto <85315700+robertlc04@users.noreply.github.com> Date: Thu, 26 Dec 2024 20:31:45 -0300 Subject: [PATCH 67/88] Fixing examples.md (#1257) Error for the path load of the image for the data structure example --- docs/src/examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/examples.md b/docs/src/examples.md index 54da0ec..0de030a 100644 --- a/docs/src/examples.md +++ b/docs/src/examples.md @@ -7,4 +7,4 @@ An eww bar configuration: A demo on how to declare and use data structures: -![Data structure example](/examples/data-structures/data-structures-preview.png) +![Data structure example](https://github.com/elkowar/eww/raw/master/examples/data-structures/data-structures-preview.png) From 2c81b3fbc7ae66431acac8e71479ce567498ccc6 Mon Sep 17 00:00:00 2001 From: GallowsDove <71831019+GallowsDove@users.noreply.github.com> Date: Fri, 27 Dec 2024 00:44:06 +0100 Subject: [PATCH 68/88] feat: Add support for on-demand window focus on wayland (#1215) * feat: Add support for on-demand window focus on wayland * fix: cargo fmt * Update CHANGELOG.md with OnDemand focusable * fix: add v0_6 feature to gtk-layer-shell in eww/cargo.toml --- CHANGELOG.md | 1 + crates/eww/Cargo.toml | 2 +- crates/eww/src/display_backend.rs | 12 ++++-- .../yuck/src/config/backend_window_options.rs | 42 +++++++++++++++---- docs/src/configuration.md | 12 +++--- examples/data-structures/eww.yuck | 2 +- 6 files changed, 52 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3710363..7ee0298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix wayland monitor names support (By: dragonnn) ### Features +- Add OnDemand support for focusable on wayland (By: GallowsDove) - Update rust toolchain to 1.81.0 (By: w-lfchen) - Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). diff --git a/crates/eww/Cargo.toml b/crates/eww/Cargo.toml index d934c45..cd6e2e6 100644 --- a/crates/eww/Cargo.toml +++ b/crates/eww/Cargo.toml @@ -20,7 +20,7 @@ eww_shared_util.workspace = true yuck.workspace = true notifier_host.workspace = true -gtk-layer-shell = { version = "0.8.1", optional = true } +gtk-layer-shell = { version = "0.8.1", optional = true, features=["v0_6"] } gdkx11 = { version = "0.18", optional = true } x11rb = { version = "0.13.1", features = ["randr"], optional = true } gdk-sys = "0.18.0" diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index fe80dcb..87ca8aa 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -28,14 +28,14 @@ impl DisplayBackend for NoBackend { #[cfg(feature = "wayland")] mod platform_wayland { + use super::DisplayBackend; use crate::{widgets::window::Window, window_initiator::WindowInitiator}; use gtk::gdk; use gtk::prelude::*; - use gtk_layer_shell::LayerShell; + use gtk_layer_shell::{KeyboardMode, LayerShell}; + use yuck::config::backend_window_options::WlWindowFocusable; use yuck::config::{window_definition::WindowStacking, window_geometry::AnchorAlignment}; - use super::DisplayBackend; - pub struct WaylandBackend; impl DisplayBackend for WaylandBackend { @@ -70,7 +70,11 @@ mod platform_wayland { } // Sets the keyboard interactivity - window.set_keyboard_interactivity(window_init.backend_options.wayland.focusable); + match window_init.backend_options.wayland.focusable { + WlWindowFocusable::None => window.set_keyboard_mode(KeyboardMode::None), + WlWindowFocusable::Exclusive => window.set_keyboard_mode(KeyboardMode::Exclusive), + WlWindowFocusable::OnDemand => window.set_keyboard_mode(KeyboardMode::OnDemand), + } if let Some(geometry) = window_init.geometry { // Positioning surface diff --git a/crates/yuck/src/config/backend_window_options.rs b/crates/yuck/src/config/backend_window_options.rs index 1314664..bb6f28c 100644 --- a/crates/yuck/src/config/backend_window_options.rs +++ b/crates/yuck/src/config/backend_window_options.rs @@ -7,6 +7,7 @@ use simplexpr::{ SimplExpr, }; +use super::{attributes::Attributes, window_definition::EnumParseError}; use crate::{ enum_parse, error::DiagResult, @@ -14,8 +15,7 @@ use crate::{ value::{coords, NumWithUnit}, }; use eww_shared_util::{Span, VarName}; - -use super::{attributes::Attributes, window_definition::EnumParseError}; +use simplexpr::dynval::ConversionError; use crate::error::{DiagError, DiagResultExt}; @@ -27,6 +27,8 @@ pub enum Error { CoordsError(#[from] coords::Error), #[error(transparent)] EvalError(#[from] EvalError), + #[error(transparent)] + ConversionError(#[from] ConversionError), } /// Backend-specific options of a window @@ -45,6 +47,7 @@ impl BackendWindowOptionsDef { pub fn from_attrs(attrs: &mut Attributes) -> DiagResult { let struts = attrs.ast_optional("reserve")?; let window_type = attrs.ast_optional("windowtype")?; + let focusable = attrs.ast_optional("focusable")?; let x11 = X11BackendWindowOptionsDef { sticky: attrs.ast_optional("sticky")?, struts, @@ -53,7 +56,7 @@ impl BackendWindowOptionsDef { }; let wayland = WlBackendWindowOptionsDef { exclusive: attrs.ast_optional("exclusive")?, - focusable: attrs.ast_optional("focusable")?, + focusable, namespace: attrs.ast_optional("namespace")?, }; @@ -109,7 +112,7 @@ impl X11BackendWindowOptionsDef { #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize)] pub struct WlBackendWindowOptions { pub exclusive: bool, - pub focusable: bool, + pub focusable: WlWindowFocusable, pub namespace: Option, } @@ -122,10 +125,13 @@ pub struct WlBackendWindowOptionsDef { } impl WlBackendWindowOptionsDef { - fn eval(&self, local_variables: &HashMap) -> Result { + fn eval(&self, local_variables: &HashMap) -> Result { Ok(WlBackendWindowOptions { exclusive: eval_opt_expr_as_bool(&self.exclusive, false, local_variables)?, - focusable: eval_opt_expr_as_bool(&self.focusable, false, local_variables)?, + focusable: match &self.focusable { + Some(expr) => WlWindowFocusable::from_dynval(&expr.eval(local_variables)?)?, + None => WlWindowFocusable::default(), + }, namespace: match &self.namespace { Some(expr) => Some(expr.eval(local_variables)?.as_string()?), None => None, @@ -145,6 +151,28 @@ fn eval_opt_expr_as_bool( }) } +#[derive(Debug, Clone, PartialEq, Eq, smart_default::SmartDefault, serde::Serialize)] +pub enum WlWindowFocusable { + #[default] + None, + Exclusive, + OnDemand, +} +impl FromStr for WlWindowFocusable { + type Err = EnumParseError; + + fn from_str(s: &str) -> Result { + enum_parse! { "focusable", s, + "none" => Self::None, + "exclusive" => Self::Exclusive, + "ondemand" => Self::OnDemand, + // legacy support + "true" => Self::Exclusive, + "false" => Self::None, + } + } +} + /// Window type of an x11 window #[derive(Debug, Clone, PartialEq, Eq, smart_default::SmartDefault, serde::Serialize)] pub enum X11WindowType { @@ -182,7 +210,7 @@ pub enum Side { Bottom, } -impl std::str::FromStr for Side { +impl FromStr for Side { type Err = EnumParseError; fn from_str(s: &str) -> Result { diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 78775e1..0cc16da 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -86,12 +86,12 @@ Depending on if you are using X11 or Wayland, some additional properties exist: #### Wayland -| Property | Description | -| ----------: | ------------------------------------------------------------ | -| `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. Either `true` or `false`. | -| `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. Either `true` or `false`. | -| `namespace` | Set the wayland layersurface namespace eww uses. Accepts a `string` value. | +| Property | Description | +| ----------: |------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `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. Either `true` or `false`. | +| `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. Possible values: `none`, `exclusive` and `ondemand`. | +| `namespace` | Set the wayland layersurface namespace eww uses. Accepts a `string` value. | diff --git a/examples/data-structures/eww.yuck b/examples/data-structures/eww.yuck index c7ad974..f1a3416 100644 --- a/examples/data-structures/eww.yuck +++ b/examples/data-structures/eww.yuck @@ -65,7 +65,7 @@ (defwindow data-structures :monitor 0 :exclusive false - :focusable false + :focusable none :geometry (geometry :anchor "center" ) From 81398d6d28f19dc9e9932a1f9c69f58fcf95f09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Thu, 26 Dec 2024 23:49:31 +0000 Subject: [PATCH 69/88] fix: improve scope handling (#1189) * fix: first attempt at fixing scopes for widgets with children * fix: new scope for every child * chore: remove debug print --- crates/eww/src/widgets/build_widget.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/eww/src/widgets/build_widget.rs b/crates/eww/src/widgets/build_widget.rs index 23e76ee..ea49f40 100644 --- a/crates/eww/src/widgets/build_widget.rs +++ b/crates/eww/src/widgets/build_widget.rs @@ -306,13 +306,14 @@ fn build_children_special_widget( .children .get(nth_value as usize) .with_context(|| format!("No child at index {}", nth_value))?; - let new_child_widget = build_gtk_widget( - tree, - widget_defs.clone(), - custom_widget_invocation.scope, - nth_child_widget_use.clone(), - None, + let scope = tree.register_new_scope( + format!("child {nth_value}"), + Some(custom_widget_invocation.scope), + calling_scope, + HashMap::new(), )?; + let new_child_widget = + build_gtk_widget(tree, widget_defs.clone(), scope, nth_child_widget_use.clone(), None)?; child_container.children().iter().for_each(|f| child_container.remove(f)); child_container.set_child(Some(&new_child_widget)); new_child_widget.show(); @@ -323,7 +324,13 @@ fn build_children_special_widget( )?; } else { for child in &custom_widget_invocation.children { - let child_widget = build_gtk_widget(tree, widget_defs.clone(), custom_widget_invocation.scope, child.clone(), None)?; + let scope = tree.register_new_scope( + String::from("child"), + Some(custom_widget_invocation.scope), + calling_scope, + HashMap::new(), + )?; + let child_widget = build_gtk_widget(tree, widget_defs.clone(), scope, child.clone(), None)?; gtk_container.add(&child_widget); } } From 6ee166707fb644d501a6d9151a491d07916ca4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C3=B6lfchen?= Date: Fri, 27 Dec 2024 22:49:28 +0000 Subject: [PATCH 70/88] feat: add `raw-output` for `jq` (#1199) * feat: add raw-output arg to jq Co-authored-by: Roman Hargrave * test: add some test cases for jq raw output * refactor: improve run_jaq_function * docs: document changes --------- Co-authored-by: Roman Hargrave --- CHANGELOG.md | 1 + crates/simplexpr/src/eval.rs | 30 ++++++++++++++++++++---------- docs/src/expression_language.md | 17 ++++++++++------- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ee0298..4190368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to eww will be listed here, starting at changes since versio ### Features - Add OnDemand support for focusable on wayland (By: GallowsDove) +- Add jq `raw-output` support (By: RomanHargrave) - Update rust toolchain to 1.81.0 (By: w-lfchen) - Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen) - Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq). diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index 545f956..d75c2c4 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -472,7 +472,9 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, "jq" => match args.as_slice() { - [json, code] => run_jaq_function(json.as_json_value()?, code.as_string()?) + [json, code] => run_jaq_function(json.as_json_value()?, code.as_string()?, "") + .map_err(|e| EvalError::Spanned(code.span(), Box::new(e))), + [json, code, args] => run_jaq_function(json.as_json_value()?, code.as_string()?, &args.as_string()?) .map_err(|e| EvalError::Spanned(code.span(), Box::new(e))), _ => Err(EvalError::WrongArgCount(name.to_string())), }, @@ -522,16 +524,20 @@ fn prepare_jaq_filter(code: String) -> Result, EvalEr Ok(Arc::new(filter)) } -fn run_jaq_function(json: serde_json::Value, code: String) -> Result { - let filter: Arc = prepare_jaq_filter(code)?; - let inputs = jaq_interpret::RcIter::new(std::iter::empty()); - let out = filter - .run((jaq_interpret::Ctx::new([], &inputs), jaq_interpret::Val::from(json))) - .map(|x| x.map(Into::::into)) - .map(|x| x.map(|x| DynVal::from_string(serde_json::to_string(&x).unwrap()))) +fn run_jaq_function(json: serde_json::Value, code: String, args: &str) -> Result { + use jaq_interpret::{Ctx, RcIter, Val}; + prepare_jaq_filter(code)? + .run((Ctx::new([], &RcIter::new(std::iter::empty())), Val::from(json))) + .map(|r| r.map(Into::::into)) + .map(|x| { + x.map(|val| match (args, val) { + ("r", serde_json::Value::String(s)) => DynVal::from_string(s), + // invalid arguments are silently ignored + (_, v) => DynVal::from_string(serde_json::to_string(&v).unwrap()), + }) + }) .collect::>() - .map_err(|e| EvalError::JaqError(e.to_string()))?; - Ok(out) + .map_err(|e| EvalError::JaqError(e.to_string())) } #[cfg(test)] @@ -592,5 +598,9 @@ mod tests { lazy_evaluation_or(r#"true || "null".test"#) => Ok(DynVal::from(true)), lazy_evaluation_elvis(r#""test"?: "null".test"#) => Ok(DynVal::from("test")), jq_basic_index(r#"jq("[7,8,9]", ".[0]")"#) => Ok(DynVal::from(7)), + jq_raw_arg(r#"jq("[ \"foo\" ]", ".[0]", "r")"#) => Ok(DynVal::from("foo")), + jq_empty_arg(r#"jq("[ \"foo\" ]", ".[0]", "")"#) => Ok(DynVal::from(r#""foo""#)), + jq_invalid_arg(r#"jq("[ \"foo\" ]", ".[0]", "hello")"#) => Ok(DynVal::from(r#""foo""#)), + jq_no_arg(r#"jq("[ \"foo\" ]", ".[0]")"#) => Ok(DynVal::from(r#""foo""#)), } } diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 150cf0e..726ff79 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -47,14 +47,17 @@ Supported currently are the following features: - `degtorad(number)`: Converts a number from degrees to radians - `radtodeg(number)`: Converts a number from radians to degrees - `replace(string, regex, replacement)`: Replace matches of a given regex in a string - - `search(string, regex)`: Search for a given regex in a string (returns array) - - `matches(string, regex)`: check if a given string matches a given regex (returns bool) - - `captures(string, regex)`: Get the captures of a given regex in a string (returns array) - - `strlength(value)`: Gets the length of the string + - `search(string, regex)`: Search for a given regex in a string (returns array) + - `matches(string, regex)`: check if a given string matches a given regex (returns bool) + - `captures(string, regex)`: Get the captures of a given regex in a string (returns array) + - `strlength(value)`: Gets the length of the string - `substring(string, start, length)`: Return a substring of given length starting at the given index - - `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). + - `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://jqlang.github.io/jq/manual/) style command on a json value. (Uses [jaq](https://crates.io/crates/jaq) internally). + - `jq(value, jq_filter_string, args)`: Emulate command line flags for jq, see [the docs](https://jqlang.github.io/jq/manual/#invoking-jq) on invoking jq for details. Invalid flags are silently ignored. + Currently supported flags: + - `"r"`: If the result is a string, it won't be formatted as a JSON string. The equivalent jq flag is `--raw-output`. - `get_env(string)`: Gets the specified enviroment variable - `formattime(unix_timestamp, format_str, timezone)`: Gets the time in a given format from UNIX timestamp. Check [chrono's documentation](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) for more From a7bd80ac1ec77f0c473c7ec70240f8329bffa07b Mon Sep 17 00:00:00 2001 From: Mirko Hahn <4210075+mirhahn@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:20:26 +0100 Subject: [PATCH 71/88] fix: get_locale follows posix standard (#1264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: get_locale follows posix standard * refactor: more concise and legible get_locale function Co-authored-by: Wölfchen --------- Co-authored-by: Wölfchen --- CHANGELOG.md | 1 + crates/eww_shared_util/src/locale.rs | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4190368..123475c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix values in the `EWW_NET` variable (By: mario-kr) - Fix the gtk `expander` widget (By: ovalkonia) - Fix wayland monitor names support (By: dragonnn) +- `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) ### Features - Add OnDemand support for focusable on wayland (By: GallowsDove) diff --git a/crates/eww_shared_util/src/locale.rs b/crates/eww_shared_util/src/locale.rs index 028e84b..08184dc 100644 --- a/crates/eww_shared_util/src/locale.rs +++ b/crates/eww_shared_util/src/locale.rs @@ -1,14 +1,12 @@ use chrono::Locale; use std::env::var; -/// Returns the `Locale` enum based on the `LC_TIME` environment variable. +/// Returns the `Locale` enum based on the `LC_ALL`, `LC_TIME`, and `LANG` environment variables in +/// that order, which is the precedence order prescribed by Section 8.2 of POSIX.1-2017. /// If the environment variable is not defined or is malformed use the POSIX locale. pub fn get_locale() -> Locale { - let locale_string: String = - var("LC_TIME").map_or_else(|_| "C".to_string(), |v| v.split(".").next().unwrap_or("C").to_string()); - - match (&*locale_string).try_into() { - Ok(x) => x, - Err(_) => Locale::POSIX, - } + var("LC_ALL") + .or_else(|_| var("LC_TIME")) + .or_else(|_| var("LANG")) + .map_or(Locale::POSIX, |v| v.split('.').next().and_then(|x| x.try_into().ok()).unwrap_or_default()) } From 593a4f4666f0bc42790d6d033e64a2b38449090f Mon Sep 17 00:00:00 2001 From: Lorenzo Bodini <32436755+topongo@users.noreply.github.com> Date: Tue, 14 Jan 2025 20:11:56 +0100 Subject: [PATCH 72/88] add `log` to expressions (#1271) * feat: add `log` to expressions * changelog: add `log` --- CHANGELOG.md | 1 + crates/simplexpr/src/eval.rs | 8 ++++++++ docs/src/expression_language.md | 1 + 3 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 123475c..96154b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `transform-origin-x`/`transform-origin-y` properties to transform widget (By: mario-kr) - Add keyboard support for button presses (By: julianschuler) - Support empty string for safe access operator (By: ModProg) +- Add `log` function calls to simplexpr (By: topongo) ## [0.6.0] (21.04.2024) diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index d75c2c4..8ee0d84 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -500,6 +500,14 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, + "log" => match args.as_slice() { + [num, n] => { + let num = num.as_f64()?; + let n = n.as_f64()?; + Ok(DynVal::from(f64::log(num, n))) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, _ => Err(EvalError::UnknownFunction(name.to_string())), } diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 726ff79..106776a 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -44,6 +44,7 @@ Supported currently are the following features: - `sin(number)`, `cos(number)`, `tan(number)`, `cot(number)`: Calculate the trigonometric value of a given number in **radians** - `min(a, b)`, `max(a, b)`: Get the smaller or bigger number out of two given numbers - `powi(num, n)`, `powf(num, n)`: Raise number `num` to power `n`. `powi` expects `n` to be of type `i32` + - `log(num, n)`: Calculate the base `n` logarithm of `num`. `num`, `n` and return type are `f64` - `degtorad(number)`: Converts a number from degrees to radians - `radtodeg(number)`: Converts a number from radians to degrees - `replace(string, regex, replacement)`: Replace matches of a given regex in a string From e7b95688a73a50cf5c781e139fa2218070c95055 Mon Sep 17 00:00:00 2001 From: vaporii <124741890+vaporii@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:10:20 -0600 Subject: [PATCH 73/88] add lines and wrap-mode properties to label widget (#1278) * add :lines property to label widget * add :lines property and fix some other little stuff * quick documentation fix --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96154b3..e5acadd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add keyboard support for button presses (By: julianschuler) - Support empty string for safe access operator (By: ModProg) - Add `log` function calls to simplexpr (By: topongo) +- Add `:lines` and `:wrap-mode` properties to label widget (By: vaporii) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 29c14a0..c5158ea 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1013,7 +1013,7 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { // @prop truncate - whether to truncate text (or pango markup). If `show-truncated` is `false`, or if `limit-width` has a value, this property has no effect and truncation is enabled. // @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 truncatedd. Disabling it will also disable dynamic truncation (the labels won't be truncated more than `limit-width`, even if there is not enough space for them), and will completly disable truncation on pango markup. + // @prop show-truncated - show whether the text was truncated. Disabling it will also disable dynamic truncation (the labels won't be truncated more than `limit-width`, even if there is not enough space for them), and will completly disable truncation on pango markup. prop(markup: as_string, truncate: as_bool = false, limit_width: as_i32 = i32::MAX, truncate_left: as_bool = false, show_truncated: as_bool = true) { if (truncate || limit_width != i32::MAX) && show_truncated { // gtk does weird thing if we set max_width_chars to i32::MAX @@ -1050,6 +1050,14 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { prop(justify: as_string = "left") { gtk_widget.set_justify(parse_justification(&justify)?); }, + // @prop wrap-mode - how text is wrapped. possible options: $wrap-mode + prop(wrap_mode: as_string = "word") { + gtk_widget.set_wrap_mode(parse_wrap_mode(&wrap_mode)?); + }, + // @prop lines - maximum number of lines to display (only works when `limit-width` has a value). A value of -1 (default) disables the limit. + prop(lines: as_i32 = -1) { + gtk_widget.set_lines(lines); + } }); Ok(gtk_widget) } @@ -1384,6 +1392,14 @@ fn parse_gravity(g: &str) -> Result { } } +/// @var wrap-mode - "word", "char" +fn parse_wrap_mode(w: &str) -> Result { + enum_parse! { "wrap-mode", w, + "word" => gtk::pango::WrapMode::Word, + "char" => gtk::pango::WrapMode::Char + } +} + /// 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 c6decc815a845db0eeaf7066fe787bb03fb58771 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Wed, 5 Feb 2025 14:11:35 -0500 Subject: [PATCH 74/88] feat: add subcommand to force-poll variable (#1227) * feat: add subcommand for force-polling variable * docs: document the new `eww poll` subcommand --- CHANGELOG.md | 1 + crates/eww/src/app.rs | 23 +++++++++++++++++++++++ crates/eww/src/opts.rs | 11 +++++++++++ crates/eww/src/script_var_handler.rs | 2 +- docs/src/configuration.md | 3 +++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5acadd..a8fa060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to eww will be listed here, starting at changes since versio - `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) ### Features +- Add `eww poll` subcommand to force-poll a variable (By: kiana-S) - Add OnDemand support for focusable on wayland (By: GallowsDove) - Add jq `raw-output` support (By: RomanHargrave) - Update rust toolchain to 1.81.0 (By: w-lfchen) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 2da4ab2..38a3f84 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -45,6 +45,7 @@ use yuck::{ pub enum DaemonCommand { NoOp, UpdateVars(Vec<(VarName, DynVal)>), + PollVars(Vec), ReloadConfigAndCss(DaemonResponseSender), OpenInspector, OpenMany { @@ -167,6 +168,11 @@ impl App { self.update_global_variable(var_name, new_value); } } + DaemonCommand::PollVars(names) => { + for var_name in names { + self.force_poll_variable(var_name); + } + } DaemonCommand::ReloadConfigAndCss(sender) => { let mut errors = Vec::new(); @@ -336,6 +342,23 @@ impl App { } } + fn force_poll_variable(&mut self, name: VarName) { + match self.eww_config.get_script_var(&name) { + Err(err) => error_handling_ctx::print_error(err), + Ok(var) => { + if let ScriptVarDefinition::Poll(poll_var) = var { + log::debug!("force-polling var {}", &name); + match script_var_handler::run_poll_once(&poll_var) { + Err(err) => error_handling_ctx::print_error(err), + Ok(value) => self.update_global_variable(name, value), + } + } else { + error_handling_ctx::print_error(anyhow!("Script var '{}' is not polling", name)) + } + } + } + } + /// Close a window and do all the required cleanups in the scope_graph and script_var_handler fn close_window(&mut self, instance_id: &str) -> Result<()> { if let Some(old_abort_send) = self.window_close_timer_abort_senders.remove(instance_id) { diff --git a/crates/eww/src/opts.rs b/crates/eww/src/opts.rs index b635a28..fb010c6 100644 --- a/crates/eww/src/opts.rs +++ b/crates/eww/src/opts.rs @@ -98,6 +98,16 @@ pub enum ActionWithServer { mappings: Vec<(VarName, DynVal)>, }, + /// Update a polling variable using its script. + /// + /// This will force the variable to be updated even if its + /// automatic polling is disabled. + #[command(name = "poll")] + Poll { + /// Variables to be polled + names: Vec, + }, + /// Open the GTK debugger #[command(name = "inspector", alias = "debugger")] OpenInspector, @@ -254,6 +264,7 @@ impl ActionWithServer { pub fn into_daemon_command(self) -> (app::DaemonCommand, Option) { let command = match self { ActionWithServer::Update { mappings } => app::DaemonCommand::UpdateVars(mappings), + ActionWithServer::Poll { names } => app::DaemonCommand::PollVars(names), ActionWithServer::OpenInspector => app::DaemonCommand::OpenInspector, ActionWithServer::KillServer => app::DaemonCommand::KillServer, diff --git a/crates/eww/src/script_var_handler.rs b/crates/eww/src/script_var_handler.rs index 717d4d9..885bbb6 100644 --- a/crates/eww/src/script_var_handler.rs +++ b/crates/eww/src/script_var_handler.rs @@ -196,7 +196,7 @@ impl PollVarHandler { } } -fn run_poll_once(var: &PollScriptVar) -> Result { +pub fn run_poll_once(var: &PollScriptVar) -> Result { match &var.command { VarSource::Shell(span, command) => { script_var::run_command(command).map_err(|e| anyhow!(create_script_var_failed_warn(*span, &var.name, &e.to_string()))) diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 0cc16da..1e0a4de 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -209,6 +209,9 @@ and thus are the perfect choice for showing your time, date, as well as other bi You can also specify an initial-value. This should prevent eww from waiting for the result of a given command during startup, thus making the startup time faster. +To externally update a polling variable, `eww update` can be used like with basic variables to assign a value. +You can also call `eww poll` to poll the variable outside of its usual interval, or even while it isn't running at all. + **Listening variables (`deflisten`)** ```lisp From 49b3066a6ab6cbc765240f6d46d3fb0d6171d7a2 Mon Sep 17 00:00:00 2001 From: Joel S Date: Thu, 6 Feb 2025 05:14:49 +1000 Subject: [PATCH 75/88] fix: Load systray items that are registered without a path (#1230) Co-authored-by: ElKowar --- CHANGELOG.md | 1 + Cargo.lock | 76 ++++++++++++++++++-------------- crates/notifier_host/Cargo.toml | 2 + crates/notifier_host/src/item.rs | 65 ++++++++++++++++++++++++++- 4 files changed, 111 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8fa060..44b261e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix values in the `EWW_NET` variable (By: mario-kr) - Fix the gtk `expander` widget (By: ovalkonia) - Fix wayland monitor names support (By: dragonnn) +- Load systray items that are registered without a path (By: Kage-Yami) - `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) ### Features diff --git a/Cargo.lock b/Cargo.lock index 01f6598..7c03984 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -265,7 +265,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -424,7 +424,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -584,7 +584,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -716,7 +716,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -727,7 +727,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -811,7 +811,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "unicode-xid", ] @@ -897,7 +897,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1029,7 +1029,7 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1171,7 +1171,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1394,7 +1394,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1520,7 +1520,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1999,6 +1999,8 @@ dependencies = [ "dbusmenu-gtk3", "gtk", "log", + "quick-xml", + "serde", "thiserror", "tokio", "zbus", @@ -2179,7 +2181,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2360,6 +2362,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1190fd18ae6ce9e137184f207593877e70f39b015040156b1e05081cdfe3733a" +[[package]] +name = "quick-xml" +version = "0.37.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" version = "1.0.37" @@ -2456,7 +2468,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2565,22 +2577,22 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2603,7 +2615,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2723,7 +2735,7 @@ checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2790,7 +2802,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2806,9 +2818,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -2911,7 +2923,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2941,7 +2953,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3021,7 +3033,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3151,7 +3163,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -3173,7 +3185,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3264,7 +3276,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3275,7 +3287,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3590,7 +3602,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] diff --git a/crates/notifier_host/Cargo.toml b/crates/notifier_host/Cargo.toml index c4fd64f..e1dc048 100644 --- a/crates/notifier_host/Cargo.toml +++ b/crates/notifier_host/Cargo.toml @@ -10,6 +10,8 @@ homepage = "https://github.com/elkowar/eww" [dependencies] dbusmenu-gtk3 = "0.1.0" +quick-xml = { version = "0.37.1", features = ["serialize"] } +serde = "1.0.215" gtk.workspace = true log.workspace = true diff --git a/crates/notifier_host/src/item.rs b/crates/notifier_host/src/item.rs index a6cb2af..889937d 100644 --- a/crates/notifier_host/src/item.rs +++ b/crates/notifier_host/src/item.rs @@ -1,6 +1,8 @@ use crate::*; use gtk::{self, prelude::*}; +use serde::Deserialize; +use zbus::fdo::IntrospectableProxy; /// Recognised values of [`org.freedesktop.StatusNotifierItem.Status`]. /// @@ -61,7 +63,12 @@ impl Item { if let Some((addr, path)) = service.split_once('/') { (addr.to_owned(), format!("/{}", path)) } else if service.starts_with(':') { - (service[0..6].to_owned(), names::ITEM_OBJECT.to_owned()) + ( + service.to_owned(), + resolve_pathless_address(con, service, "/".to_owned()) + .await? + .ok_or_else(|| zbus::Error::Failure(format!("no StatusNotifierItem found for {service}")))?, + ) } else { return Err(zbus::Error::Address(service.to_owned())); } @@ -105,3 +112,59 @@ impl Item { load_icon_from_sni(&self.sni, size, scale).await } } + +#[derive(Deserialize)] +struct DBusNode { + #[serde(default)] + interface: Vec, + + #[serde(default)] + node: Vec, + + #[serde(rename = "@name")] + name: Option, +} + +#[derive(Deserialize)] +struct DBusInterface { + #[serde(rename = "@name")] + name: String, +} + +async fn resolve_pathless_address(con: &zbus::Connection, service: &str, path: String) -> zbus::Result> { + let introspection_xml = + IntrospectableProxy::builder(con).destination(service)?.path(path.as_str())?.build().await?.introspect().await?; + + let dbus_node = + quick_xml::de::from_str::(&introspection_xml).map_err(|err| zbus::Error::Failure(err.to_string()))?; + + if dbus_node.interface.iter().any(|interface| interface.name == "org.kde.StatusNotifierItem") { + // This item implements the desired interface, so bubble it back up + Ok(Some(path)) + } else { + for node in dbus_node.node { + if let Some(name) = node.name { + if name == "StatusNotifierItem" { + // If this exists, then there's a good chance DBus may not think anything + // implements the desired interface, so just bubble this up instead. + return Ok(Some(join_to_path(&path, name))); + } + + let path = Box::pin(resolve_pathless_address(con, service, join_to_path(&path, name))).await?; + + if path.is_some() { + // Return the first item found from a child + return Ok(path); + } + } + } + + // No children had the item we want... + Ok(None) + } +} + +fn join_to_path(path: &str, name: String) -> String { + // Make sure we don't double-up on the leading slash + format!("{path}/{name}", path = if path == "/" { "" } else { path }) +} From b6b7bc8453a5deecae0f0f4cc0c5f8639df97964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bbb651=20=F0=9F=87=AE=F0=9F=87=B1?= <53972231+bbb651@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:17:57 +0200 Subject: [PATCH 76/88] Avoid recreating windows when only duration changes (#1236) This avoids possible flicker with windows such as OSDs. The logic to do this was added in #263 but broke when durations were added. Fixes #260. --- crates/eww/src/app.rs | 83 ++++++++++++++++++------------ crates/eww/src/window_arguments.rs | 11 ++++ 2 files changed, 61 insertions(+), 33 deletions(-) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 38a3f84..9494a9d 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -390,14 +390,24 @@ impl App { self.failed_windows.remove(instance_id); log::info!("Opening window {} as '{}'", window_args.window_name, instance_id); - // if an instance of this is already running, close it - if self.open_windows.contains_key(instance_id) { - self.close_window(instance_id)?; - } - + // if an instance of this is already running and arguments haven't change, only update duration + let reuse_window = if self.open_windows.contains_key(instance_id) { + if self.instance_id_to_args.get(instance_id).is_some_and(|args| window_args.can_reuse_window_with_args(args)) { + true + } else { + self.close_window(instance_id)?; + false + } + } else { + false + }; self.instance_id_to_args.insert(instance_id.to_string(), window_args.clone()); let open_result: Result<_> = (|| { + if reuse_window { + return Ok(()); + } + let window_name: &str = &window_args.window_name; let window_def = self.eww_config.get_window(window_name)?.clone(); @@ -454,38 +464,12 @@ impl App { } })); - let duration = window_args.duration; - if let Some(duration) = duration { - let app_evt_sender = self.app_evt_send.clone(); - - let (abort_send, abort_recv) = futures::channel::oneshot::channel(); - - glib::MainContext::default().spawn_local({ - let instance_id = instance_id.to_string(); - async move { - tokio::select! { - _ = glib::timeout_future(duration) => { - let (response_sender, mut response_recv) = daemon_response::create_pair(); - let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; - if let Err(err) = app_evt_sender.send(command) { - log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); - } - _ = response_recv.recv().await; - } - _ = abort_recv => {} - } - } - }); - - if let Some(old_abort_send) = self.window_close_timer_abort_senders.insert(instance_id.to_string(), abort_send) { - _ = old_abort_send.send(()); - } - } - self.open_windows.insert(instance_id.to_string(), eww_window); Ok(()) })(); + self.update_window_duration(instance_id, window_args.duration); + if let Err(err) = open_result { self.failed_windows.insert(instance_id.to_string()); Err(err).with_context(|| format!("failed to open window `{}`", instance_id)) @@ -494,6 +478,39 @@ impl App { } } + fn update_window_duration(&mut self, instance_id: &str, duration: Option) { + if let Some(duration) = duration { + let app_evt_sender = self.app_evt_send.clone(); + + let (abort_send, abort_recv) = futures::channel::oneshot::channel(); + + glib::MainContext::default().spawn_local({ + let instance_id = instance_id.to_string(); + async move { + tokio::select! { + _ = glib::timeout_future(duration) => { + let (response_sender, mut response_recv) = daemon_response::create_pair(); + let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; + if let Err(err) = app_evt_sender.send(command) { + log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); + } + _ = response_recv.recv().await; + } + _ = abort_recv => {} + } + } + }); + + if let Some(old_abort_send) = self.window_close_timer_abort_senders.insert(instance_id.to_string(), abort_send) { + _ = old_abort_send.send(()); + } + } else { + if let Some(old_abort_send) = self.window_close_timer_abort_senders.remove(instance_id) { + _ = old_abort_send.send(()); + } + } + } + /// Load the given configuration, reloading all script-vars and attempting to reopen all windows that where opened. pub fn load_config(&mut self, config: config::EwwConfig) -> Result<()> { log::info!("Reloading windows"); diff --git a/crates/eww/src/window_arguments.rs b/crates/eww/src/window_arguments.rs index 5a07979..b6e6475 100644 --- a/crates/eww/src/window_arguments.rs +++ b/crates/eww/src/window_arguments.rs @@ -87,4 +87,15 @@ impl WindowArguments { Ok(local_variables) } + + // Compares all values except `duration`, since it's not used by the window itself + pub fn can_reuse_window_with_args(&self, other: &Self) -> bool { + self.window_name == other.window_name + && self.instance_id == other.instance_id + && self.anchor == other.anchor + && self.args == other.args + && self.monitor == other.monitor + && self.pos == other.pos + && self.size == other.size + } } From 29fa1587c3a4704a2bee0778099aca945d486e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?bbb651=20=F0=9F=87=AE=F0=9F=87=B1?= <53972231+bbb651@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:43:46 +0200 Subject: [PATCH 77/88] Force recreating windows on config change (#1284) Fixes the regression from #1236 preventing hot reload. This can be made granular, e.g. for changes that don't effect all windows or css chnages not requiring a full window restart --- crates/eww/src/app.rs | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 9494a9d..b7c37d5 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -217,7 +217,10 @@ impl App { .filter(|(win_id, ..)| win_id.is_empty() || win_id == id) .map(|(_, n, v)| (n.clone(), v.clone())) .collect(); - self.open_window(&WindowArguments::new_from_args(id.to_string(), config_name.clone(), window_args)?) + self.open_window( + &WindowArguments::new_from_args(id.to_string(), config_name.clone(), window_args)?, + false, + ) } }) .filter_map(Result::err); @@ -242,16 +245,19 @@ impl App { let result = if should_toggle && is_open { self.close_window(&instance_id) } else { - self.open_window(&WindowArguments { - instance_id, - window_name, - pos, - size, - monitor, - anchor, - duration, - args: args.unwrap_or_default().into_iter().collect(), - }) + self.open_window( + &WindowArguments { + instance_id, + window_name, + pos, + size, + monitor, + anchor, + duration, + args: args.unwrap_or_default().into_iter().collect(), + }, + false, + ) }; sender.respond_with_result(result)?; @@ -385,13 +391,13 @@ impl App { Ok(()) } - fn open_window(&mut self, window_args: &WindowArguments) -> Result<()> { + fn open_window(&mut self, window_args: &WindowArguments, dirty: bool) -> Result<()> { let instance_id = &window_args.instance_id; self.failed_windows.remove(instance_id); log::info!("Opening window {} as '{}'", window_args.window_name, instance_id); // if an instance of this is already running and arguments haven't change, only update duration - let reuse_window = if self.open_windows.contains_key(instance_id) { + let reuse_window = if !dirty && self.open_windows.contains_key(instance_id) { if self.instance_id_to_args.get(instance_id).is_some_and(|args| window_args.can_reuse_window_with_args(args)) { true } else { @@ -530,7 +536,7 @@ impl App { let window_arguments = self.instance_id_to_args.get(instance_id).with_context(|| { format!("Cannot reopen window, initial parameters were not saved correctly for {instance_id}") })?; - self.open_window(&window_arguments.clone())?; + self.open_window(&window_arguments.clone(), true)?; } Ok(()) } From 5b4cc3e7a8055afb758421f4a114ef4032806e39 Mon Sep 17 00:00:00 2001 From: ipsvn <80017804+ipsvn@users.noreply.github.com> Date: Sun, 16 Feb 2025 15:46:18 +0000 Subject: [PATCH 78/88] Add value-pos to scale widget (#1285) * Add value-pos to gtk scale * add possible values to value-pos * add value-pos change to CHANGELOG.md --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44b261e..d94afd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Support empty string for safe access operator (By: ModProg) - Add `log` function calls to simplexpr (By: topongo) - Add `:lines` and `:wrap-mode` properties to label widget (By: vaporii) +- Add `value-pos` to scale widget (By: ipsvn) ## [0.6.0] (21.04.2024) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index c5158ea..226406b 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -459,6 +459,9 @@ fn build_gtk_scale(bargs: &mut BuilderArgs) -> Result { // @prop draw-value - draw the value of the property prop(draw_value: as_bool = false) { gtk_widget.set_draw_value(draw_value) }, + // @prop value-pos - position of the drawn value. possible values: $position + prop(value_pos: as_string) { gtk_widget.set_value_pos(parse_position_type(&value_pos)?) }, + // @prop round-digits - Sets the number of decimals to round the value to when it changes prop(round_digits: as_i32 = 0) { gtk_widget.set_round_digits(round_digits) } @@ -1381,6 +1384,16 @@ fn parse_justification(j: &str) -> Result { } } +/// @var position - "left", "right", "top", "bottom" +fn parse_position_type(g: &str) -> Result { + enum_parse! { "position", g, + "left" => gtk::PositionType::Left, + "right" => gtk::PositionType::Right, + "top" => gtk::PositionType::Top, + "bottom" => gtk::PositionType::Bottom, + } +} + /// @var gravity - "south", "east", "west", "north", "auto" fn parse_gravity(g: &str) -> Result { enum_parse! { "gravity", g, From a9aa0f96892f20e4741e94f4cd46ca31106e492c Mon Sep 17 00:00:00 2001 From: ElKowar Date: Tue, 25 Mar 2025 20:08:09 +0100 Subject: [PATCH 79/88] Revert hot-reloading regressions (#1296) * Revert "Force recreating windows on config change (#1284)" This reverts commit 29fa1587c3a4704a2bee0778099aca945d486e77. * Revert "Avoid recreating windows when only duration changes (#1236)" This reverts commit b6b7bc8453a5deecae0f0f4cc0c5f8639df97964. --- crates/eww/src/app.rs | 115 ++++++++++++----------------- crates/eww/src/window_arguments.rs | 11 --- 2 files changed, 46 insertions(+), 80 deletions(-) diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index b7c37d5..38a3f84 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -217,10 +217,7 @@ impl App { .filter(|(win_id, ..)| win_id.is_empty() || win_id == id) .map(|(_, n, v)| (n.clone(), v.clone())) .collect(); - self.open_window( - &WindowArguments::new_from_args(id.to_string(), config_name.clone(), window_args)?, - false, - ) + self.open_window(&WindowArguments::new_from_args(id.to_string(), config_name.clone(), window_args)?) } }) .filter_map(Result::err); @@ -245,19 +242,16 @@ impl App { let result = if should_toggle && is_open { self.close_window(&instance_id) } else { - self.open_window( - &WindowArguments { - instance_id, - window_name, - pos, - size, - monitor, - anchor, - duration, - args: args.unwrap_or_default().into_iter().collect(), - }, - false, - ) + self.open_window(&WindowArguments { + instance_id, + window_name, + pos, + size, + monitor, + anchor, + duration, + args: args.unwrap_or_default().into_iter().collect(), + }) }; sender.respond_with_result(result)?; @@ -391,29 +385,19 @@ impl App { Ok(()) } - fn open_window(&mut self, window_args: &WindowArguments, dirty: bool) -> Result<()> { + fn open_window(&mut self, window_args: &WindowArguments) -> Result<()> { let instance_id = &window_args.instance_id; self.failed_windows.remove(instance_id); log::info!("Opening window {} as '{}'", window_args.window_name, instance_id); - // if an instance of this is already running and arguments haven't change, only update duration - let reuse_window = if !dirty && self.open_windows.contains_key(instance_id) { - if self.instance_id_to_args.get(instance_id).is_some_and(|args| window_args.can_reuse_window_with_args(args)) { - true - } else { - self.close_window(instance_id)?; - false - } - } else { - false - }; + // if an instance of this is already running, close it + if self.open_windows.contains_key(instance_id) { + self.close_window(instance_id)?; + } + self.instance_id_to_args.insert(instance_id.to_string(), window_args.clone()); let open_result: Result<_> = (|| { - if reuse_window { - return Ok(()); - } - let window_name: &str = &window_args.window_name; let window_def = self.eww_config.get_window(window_name)?.clone(); @@ -470,12 +454,38 @@ impl App { } })); + let duration = window_args.duration; + if let Some(duration) = duration { + let app_evt_sender = self.app_evt_send.clone(); + + let (abort_send, abort_recv) = futures::channel::oneshot::channel(); + + glib::MainContext::default().spawn_local({ + let instance_id = instance_id.to_string(); + async move { + tokio::select! { + _ = glib::timeout_future(duration) => { + let (response_sender, mut response_recv) = daemon_response::create_pair(); + let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; + if let Err(err) = app_evt_sender.send(command) { + log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); + } + _ = response_recv.recv().await; + } + _ = abort_recv => {} + } + } + }); + + if let Some(old_abort_send) = self.window_close_timer_abort_senders.insert(instance_id.to_string(), abort_send) { + _ = old_abort_send.send(()); + } + } + self.open_windows.insert(instance_id.to_string(), eww_window); Ok(()) })(); - self.update_window_duration(instance_id, window_args.duration); - if let Err(err) = open_result { self.failed_windows.insert(instance_id.to_string()); Err(err).with_context(|| format!("failed to open window `{}`", instance_id)) @@ -484,39 +494,6 @@ impl App { } } - fn update_window_duration(&mut self, instance_id: &str, duration: Option) { - if let Some(duration) = duration { - let app_evt_sender = self.app_evt_send.clone(); - - let (abort_send, abort_recv) = futures::channel::oneshot::channel(); - - glib::MainContext::default().spawn_local({ - let instance_id = instance_id.to_string(); - async move { - tokio::select! { - _ = glib::timeout_future(duration) => { - let (response_sender, mut response_recv) = daemon_response::create_pair(); - let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; - if let Err(err) = app_evt_sender.send(command) { - log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); - } - _ = response_recv.recv().await; - } - _ = abort_recv => {} - } - } - }); - - if let Some(old_abort_send) = self.window_close_timer_abort_senders.insert(instance_id.to_string(), abort_send) { - _ = old_abort_send.send(()); - } - } else { - if let Some(old_abort_send) = self.window_close_timer_abort_senders.remove(instance_id) { - _ = old_abort_send.send(()); - } - } - } - /// Load the given configuration, reloading all script-vars and attempting to reopen all windows that where opened. pub fn load_config(&mut self, config: config::EwwConfig) -> Result<()> { log::info!("Reloading windows"); @@ -536,7 +513,7 @@ impl App { let window_arguments = self.instance_id_to_args.get(instance_id).with_context(|| { format!("Cannot reopen window, initial parameters were not saved correctly for {instance_id}") })?; - self.open_window(&window_arguments.clone(), true)?; + self.open_window(&window_arguments.clone())?; } Ok(()) } diff --git a/crates/eww/src/window_arguments.rs b/crates/eww/src/window_arguments.rs index b6e6475..5a07979 100644 --- a/crates/eww/src/window_arguments.rs +++ b/crates/eww/src/window_arguments.rs @@ -87,15 +87,4 @@ impl WindowArguments { Ok(local_variables) } - - // Compares all values except `duration`, since it's not used by the window itself - pub fn can_reuse_window_with_args(&self, other: &Self) -> bool { - self.window_name == other.window_name - && self.instance_id == other.instance_id - && self.anchor == other.anchor - && self.args == other.args - && self.monitor == other.monitor - && self.pos == other.pos - && self.size == other.size - } } From c999033c297582cd56b57d2a6062bfd36cc1dfed Mon Sep 17 00:00:00 2001 From: elkowar Date: Sun, 27 Apr 2025 00:47:45 +0200 Subject: [PATCH 80/88] Add wikipedia link to widget essay --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a5ebd21..b53fb18 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Dharmx also wrote a nice, beginner friendly introductory guide for eww [here](ht I'm currently busy working [yolk](https://github.com/elkowar/yolk), which is a dotfile management solution that supports a unique spin on templating: *templating without template files*. -To find out more, check out the [website and documentation](https://elkowar.github.io/yolk)! +To find out more, check out the [website and documentation](https://elkowar.github.io/yolk)! ## Examples @@ -82,3 +82,7 @@ If you want to contribute anything, like adding new widgets, features, or subcom 3. Smash your head against the keyboard from frustration (coding is hard) 4. Write down your changes in CHANGELOG.md 5. Open a pull request once you're finished + +## Widget + +https://en.wikipedia.org/wiki/Wikipedia:Widget From eb59d155a269983050f0fb0c025c46b13be689f1 Mon Sep 17 00:00:00 2001 From: Lucas Baumann <41015240+luca3s@users.noreply.github.com> Date: Sun, 11 May 2025 13:11:13 +0200 Subject: [PATCH 81/88] Add warning for invalid exclusive and anchor combination (#1316) --- CHANGELOG.md | 1 + crates/eww/src/display_backend.rs | 7 +++++++ docs/src/configuration.md | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d94afd6..e20c84a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to eww will be listed here, starting at changes since versio - `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) ### Features +- Add warning and docs for incompatible `:anchor` and `:exclusive` options - Add `eww poll` subcommand to force-poll a variable (By: kiana-S) - Add OnDemand support for focusable on wayland (By: GallowsDove) - Add jq `raw-output` support (By: RomanHargrave) diff --git a/crates/eww/src/display_backend.rs b/crates/eww/src/display_backend.rs index 87ca8aa..1a29810 100644 --- a/crates/eww/src/display_backend.rs +++ b/crates/eww/src/display_backend.rs @@ -112,6 +112,13 @@ mod platform_wayland { } else { window.set_layer_shell_margin(gtk_layer_shell::Edge::Top, yoffset); } + // https://github.com/elkowar/eww/issues/296 + if window_init.backend_options.wayland.exclusive + && geometry.anchor_point.x != AnchorAlignment::CENTER + && geometry.anchor_point.y != AnchorAlignment::CENTER + { + log::warn!("When ':exclusive true' the anchor has to include 'center', otherwise exlcusive won't work") + } } if window_init.backend_options.wayland.exclusive { window.auto_exclusive_zone_enable(); diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 1e0a4de..e37c1cd 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -89,7 +89,7 @@ Depending on if you are using X11 or Wayland, some additional properties exist: | Property | Description | | ----------: |------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `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. Either `true` or `false`. | +| `exclusive` | Whether the compositor should reserve space for the window automatically. Either `true` or `false`. If `true` `:anchor` has to include `center`. | | `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. Possible values: `none`, `exclusive` and `ondemand`. | | `namespace` | Set the wayland layersurface namespace eww uses. Accepts a `string` value. | From 2c6523a372c688d141373bd9b7ac26d84b458eda Mon Sep 17 00:00:00 2001 From: Martin Bogdanov Date: Sun, 11 May 2025 16:08:43 +0300 Subject: [PATCH 82/88] Add floor() and ceil() (#1315) * add floor() and ceil() functions to simplexpr, akin to round() * document addition of floor() and ceil() * remove unnecessary second argument for floor() and ceil() * Update documentation --------- Co-authored-by: Martin Bogdanov --- CHANGELOG.md | 1 + Cargo.lock | 2 +- crates/simplexpr/src/eval.rs | 14 ++++++++++++++ docs/src/expression_language.md | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e20c84a..6fe1a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `log` function calls to simplexpr (By: topongo) - Add `:lines` and `:wrap-mode` properties to label widget (By: vaporii) - Add `value-pos` to scale widget (By: ipsvn) +- Add `floor` and `ceil` function calls to simplexpr (By: wsbankenstein) ## [0.6.0] (21.04.2024) diff --git a/Cargo.lock b/Cargo.lock index 7c03984..dbe73fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index 8ee0d84..fc56c85 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -329,6 +329,20 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, + "floor" => match args.as_slice() { + [num] => { + let num = num.as_f64()?; + Ok(DynVal::from(num.floor())) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, + "ceil" => match args.as_slice() { + [num] => { + let num = num.as_f64()?; + Ok(DynVal::from(num.ceil())) + } + _ => Err(EvalError::WrongArgCount(name.to_string())), + }, "min" => match args.as_slice() { [a, b] => { let a = a.as_f64()?; diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 106776a..f9c0757 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -41,6 +41,8 @@ Supported currently are the following features: - for this, the object/array value needs to refer to a variable that contains a valid json string. - some function calls: - `round(number, decimal_digits)`: Round a number to the given amount of decimals + - `floor(number)`: Round a number up to the nearest integer + - `ceil(number)`: Round a number down to the nearest integer - `sin(number)`, `cos(number)`, `tan(number)`, `cot(number)`: Calculate the trigonometric value of a given number in **radians** - `min(a, b)`, `max(a, b)`: Get the smaller or bigger number out of two given numbers - `powi(num, n)`, `powf(num, n)`: Raise number `num` to power `n`. `powi` expects `n` to be of type `i32` From 20d0997636d01c9d202d23added5765d7a22e183 Mon Sep 17 00:00:00 2001 From: elkowar Date: Tue, 13 May 2025 23:09:23 +0200 Subject: [PATCH 83/88] fix documentation of ceil and floor (fixes #1319) --- docs/src/expression_language.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index f9c0757..480b2d5 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -41,8 +41,8 @@ Supported currently are the following features: - for this, the object/array value needs to refer to a variable that contains a valid json string. - some function calls: - `round(number, decimal_digits)`: Round a number to the given amount of decimals - - `floor(number)`: Round a number up to the nearest integer - - `ceil(number)`: Round a number down to the nearest integer + - `floor(number)`: Round a number down to the nearest integer + - `ceil(number)`: Round a number up to the nearest integer - `sin(number)`, `cos(number)`, `tan(number)`, `cot(number)`: Calculate the trigonometric value of a given number in **radians** - `min(a, b)`, `max(a, b)`: Get the smaller or bigger number out of two given numbers - `powi(num, n)`, `powf(num, n)`: Raise number `num` to power `n`. `powi` expects `n` to be of type `i32` From e953141fa938f82e0be5598b8c0b58e54601bf4c Mon Sep 17 00:00:00 2001 From: Lucas Baumann <41015240+luca3s@users.noreply.github.com> Date: Tue, 13 May 2025 23:12:06 +0200 Subject: [PATCH 84/88] Fix crash on NaN or infinite graph value (#1318) --- CHANGELOG.md | 1 + crates/eww/src/widgets/widget_definitions.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe1a61..d6c593f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio Attempting to index in an empty JSON string (`'""'`) is now an error. ### Fixes +- Fix crash on NaN or infinite graph value (By: luca3s) - Re-enable some scss features (By: w-lfchen) - Fix and refactor nix flake (By: w-lfchen) - Fix remove items from systray (By: vnva) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 226406b..e8d7607 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1252,7 +1252,14 @@ fn build_graph(bargs: &mut BuilderArgs) -> Result { let w = super::graph::Graph::new(); def_widget!(bargs, _g, w, { // @prop value - the value, between 0 - 100 - prop(value: as_f64) { w.set_property("value", value); }, + prop(value: as_f64) { + if value.is_nan() || value.is_infinite() { + return Err(DiagError(gen_diagnostic!( + format!("Graph's value should never be NaN or infinite") + )).into()); + } + w.set_property("value", value); + }, // @prop thickness - the thickness of the line prop(thickness: as_f64) { w.set_property("thickness", thickness); }, // @prop time-range - the range of time to show From 15315a05ece87aa36fd6b0ff54f6484823e40cda Mon Sep 17 00:00:00 2001 From: UnnaturalTwilight <107954129+UnnaturalTwilight@users.noreply.github.com> Date: Tue, 13 May 2025 17:13:15 -0400 Subject: [PATCH 85/88] Add wordchar wrap mode (#1306) * Add wordchar wrap mode * documentation * Fix docs generation to properly include options for wrap-mode --------- Co-authored-by: Cal --- crates/eww/src/widgets/widget_definitions.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index e8d7607..8284d0f 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -1053,7 +1053,7 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { prop(justify: as_string = "left") { gtk_widget.set_justify(parse_justification(&justify)?); }, - // @prop wrap-mode - how text is wrapped. possible options: $wrap-mode + // @prop wrap-mode - how text is wrapped. possible options: $wrap_mode prop(wrap_mode: as_string = "word") { gtk_widget.set_wrap_mode(parse_wrap_mode(&wrap_mode)?); }, @@ -1412,11 +1412,12 @@ fn parse_gravity(g: &str) -> Result { } } -/// @var wrap-mode - "word", "char" +/// @var wrap_mode - "word", "char", "wordchar" fn parse_wrap_mode(w: &str) -> Result { enum_parse! { "wrap-mode", w, "word" => gtk::pango::WrapMode::Word, - "char" => gtk::pango::WrapMode::Char + "char" => gtk::pango::WrapMode::Char, + "wordchar" => gtk::pango::WrapMode::WordChar } } From 98c220126d912b935987766f56650b55f3e226eb Mon Sep 17 00:00:00 2001 From: Lucas Baumann <41015240+luca3s@users.noreply.github.com> Date: Sun, 18 May 2025 15:39:46 +0200 Subject: [PATCH 86/88] Fix crash on invalid formattime (#1317) * catch failure to format to format time instead of panicking * update chrono * use new API --- CHANGELOG.md | 1 + Cargo.lock | 12 +++++++++--- crates/simplexpr/src/eval.rs | 16 ++++++++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c593f..3911aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to eww will be listed here, starting at changes since versio Attempting to index in an empty JSON string (`'""'`) is now an error. ### Fixes +- Fix crash on invalid `formattime` format string (By: luca3s) - Fix crash on NaN or infinite graph value (By: luca3s) - Re-enable some scss features (By: w-lfchen) - Fix and refactor nix flake (By: w-lfchen) diff --git a/Cargo.lock b/Cargo.lock index dbe73fc..158aff4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -501,9 +501,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", @@ -511,7 +511,7 @@ dependencies = [ "num-traits", "pure-rust-locales", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -3290,6 +3290,12 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-result" version = "0.1.2" diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index fc56c85..556c72a 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -501,14 +501,26 @@ fn call_expr_function(name: &str, args: Vec) -> Result { - t.format_localized(&format.as_string()?, get_locale()).to_string() + let format = format.as_string()?; + let delayed_format = t.format_localized(&format, get_locale()); + let mut buffer = String::new(); + if delayed_format.write_to(&mut buffer).is_err() { + return Err(EvalError::ChronoError("Invalid time formatting string: ".to_string() + &format)); + } + buffer } LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())), })) } [timestamp, format] => Ok(DynVal::from(match Local.timestamp_opt(timestamp.as_i64()?, 0) { LocalResult::Single(t) | LocalResult::Ambiguous(t, _) => { - t.format_localized(&format.as_string()?, get_locale()).to_string() + let format = format.as_string()?; + let delayed_format = t.format_localized(&format, get_locale()); + let mut buffer = String::new(); + if delayed_format.write_to(&mut buffer).is_err() { + return Err(EvalError::ChronoError("Invalid time formatting string: ".to_string() + &format)); + } + buffer } LocalResult::None => return Err(EvalError::ChronoError("Invalid UNIX timestamp".to_string())), })), From 0e409d4a52bd3d37d0aa0ad4e2d7f3b9a8adcdb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 17 Jun 2025 09:48:34 +0200 Subject: [PATCH 87/88] Improve multi-monitor handling under wayland (#1276) * fix: improve multi-monitor handling under wayland When a monitor gets disconnected, the destroy event of all associated windows gets called, and the window gets removed. This patch changes that behavior: the window is still closed but the configuration is kept using the existing reload mechanism. In addition, a callback is added to listen for new monitors, triggering a reload when a new monitor gets connected. This logic also reloads already running windows, which has a positive and negative effect: - positive: if currently running e.g. on the second monitor specified in the list, the window can get moved to the first monitor - negative: if reloading starts it on the same monitor, it gets reset (e.g. graphs) I also had to work around an issue: the monitor model is not yet available immediately when a new monitor callback triggers. Waiting in the callback does not help (I tried 10 seconds). However, waiting outside, it always became available after 10ms. Tested with a dual monitor setup under KDE through a combinations of: - enabling/disabling individual monitors - switching between monitors - specifying a specific monitor in the yuck config - specifying a list of specific monitors in the yuck config In all these cases the behavior is as expected, and the widget gets loaded on the first available monitor (or stays unloaded until one becomes available). It also works when opening a window without any of the configured monitors being available. There is one remaining error from GTK when closing the window: GLib-GObject-CRITICAL **: 20:06:05.912: ../gobject/gsignal.c:2684: instance '0x55a4ab4be2d0' has no handler with id '136' This comes from the `self.gtk_window.disconnect(handler_id)` call. To prevent that we'd have to reset `destroy_event_handler_id`. * fix: do not call gtk::main_iteration_do while waiting for monitor model Executors that poll a future cannot be called recursively (in this case glib::main_context_futures::TaskSource::poll). So we cannot call gtk::main_iteration_do here, which in some cases led to the future being polled again, which raised a panic in the form of: thread 'main' panicked at glib/src/main_context_futures.rs:238:56: called `Result::unwrap()` on an `Err` value: EnterError We can just remove it as tokio::time::sleep() ensures the main thread continues to process (gtk) events during that time. --- CHANGELOG.md | 1 + crates/eww/src/app.rs | 72 +++++++++++++++++++++++++++++++--------- crates/eww/src/opts.rs | 2 +- crates/eww/src/server.rs | 39 ++++++++++++++++------ 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3911aa3..9eb4084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Fix wayland monitor names support (By: dragonnn) - Load systray items that are registered without a path (By: Kage-Yami) - `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) +- Improve multi-monitor handling under wayland (By: bkueng) ### Features - Add warning and docs for incompatible `:anchor` and `:exclusive` options diff --git a/crates/eww/src/app.rs b/crates/eww/src/app.rs index 38a3f84..c89e6f6 100644 --- a/crates/eww/src/app.rs +++ b/crates/eww/src/app.rs @@ -68,6 +68,7 @@ pub enum DaemonCommand { }, CloseWindows { windows: Vec, + auto_reopen: bool, sender: DaemonResponseSender, }, KillServer, @@ -147,16 +148,34 @@ impl std::fmt::Debug for App { } } +/// Wait until the .model() is available for all monitors (or there is a timeout) +async fn wait_for_monitor_model() { + let display = gdk::Display::default().expect("could not get default display"); + let start = std::time::Instant::now(); + loop { + let all_monitors_set = + (0..display.n_monitors()).all(|i| display.monitor(i).and_then(|monitor| monitor.model()).is_some()); + if all_monitors_set { + break; + } + tokio::time::sleep(Duration::from_millis(10)).await; + if std::time::Instant::now() - start > Duration::from_millis(500) { + log::warn!("Timed out waiting for monitor model to be set"); + break; + } + } +} + impl App { /// Handle a [`DaemonCommand`] event, logging any errors that occur. - pub fn handle_command(&mut self, event: DaemonCommand) { - if let Err(err) = self.try_handle_command(event) { + pub async fn handle_command(&mut self, event: DaemonCommand) { + if let Err(err) = self.try_handle_command(event).await { error_handling_ctx::print_error(err); } } /// Try to handle a [`DaemonCommand`] event. - fn try_handle_command(&mut self, event: DaemonCommand) -> Result<()> { + async fn try_handle_command(&mut self, event: DaemonCommand) -> Result<()> { log::debug!("Handling event: {:?}", &event); match event { DaemonCommand::NoOp => {} @@ -174,6 +193,10 @@ impl App { } } DaemonCommand::ReloadConfigAndCss(sender) => { + // Wait for all monitor models to be set. When a new monitor gets added, this + // might not immediately be the case. And if we were to wait inside the + // connect_monitor_added callback, model() never gets set. So instead we wait here. + wait_for_monitor_model().await; let mut errors = Vec::new(); let config_result = config::read_from_eww_paths(&self.paths); @@ -200,7 +223,7 @@ impl App { DaemonCommand::CloseAll => { log::info!("Received close command, closing all windows"); for window_name in self.open_windows.keys().cloned().collect::>() { - self.close_window(&window_name)?; + self.close_window(&window_name, false)?; } } DaemonCommand::OpenMany { windows, args, should_toggle, sender } => { @@ -209,7 +232,7 @@ impl App { .map(|w| { let (config_name, id) = w; if should_toggle && self.open_windows.contains_key(id) { - self.close_window(id) + self.close_window(id, false) } else { log::debug!("Config: {}, id: {}", config_name, id); let window_args = args @@ -240,7 +263,7 @@ impl App { let is_open = self.open_windows.contains_key(&instance_id); let result = if should_toggle && is_open { - self.close_window(&instance_id) + self.close_window(&instance_id, false) } else { self.open_window(&WindowArguments { instance_id, @@ -256,9 +279,10 @@ impl App { sender.respond_with_result(result)?; } - DaemonCommand::CloseWindows { windows, sender } => { - let errors = windows.iter().map(|window| self.close_window(window)).filter_map(Result::err); - sender.respond_with_error_list(errors)?; + DaemonCommand::CloseWindows { windows, auto_reopen, sender } => { + let errors = windows.iter().map(|window| self.close_window(window, auto_reopen)).filter_map(Result::err); + // Ignore sending errors, as the channel might already be closed + let _ = sender.respond_with_error_list(errors); } DaemonCommand::PrintState { all, sender } => { let scope_graph = self.scope_graph.borrow(); @@ -360,7 +384,7 @@ impl App { } /// Close a window and do all the required cleanups in the scope_graph and script_var_handler - fn close_window(&mut self, instance_id: &str) -> Result<()> { + fn close_window(&mut self, instance_id: &str, auto_reopen: bool) -> Result<()> { if let Some(old_abort_send) = self.window_close_timer_abort_senders.remove(instance_id) { _ = old_abort_send.send(()); } @@ -380,7 +404,17 @@ impl App { self.script_var_handler.stop_for_variable(unused_var.clone()); } - self.instance_id_to_args.remove(instance_id); + if auto_reopen { + self.failed_windows.insert(instance_id.to_string()); + // There might be an alternative monitor available already, so try to re-open it immediately. + // This can happen for example when a monitor gets disconnected and another connected, + // and the connection event happens before the disconnect. + if let Some(window_arguments) = self.instance_id_to_args.get(instance_id) { + let _ = self.open_window(&window_arguments.clone()); + } + } else { + self.instance_id_to_args.remove(instance_id); + } Ok(()) } @@ -392,7 +426,7 @@ impl App { // if an instance of this is already running, close it if self.open_windows.contains_key(instance_id) { - self.close_window(instance_id)?; + self.close_window(instance_id, false)?; } self.instance_id_to_args.insert(instance_id.to_string(), window_args.clone()); @@ -445,9 +479,17 @@ impl App { move |_| { // we don't care about the actual error response from the daemon as this is mostly just a fallback. // Generally, this should get disconnected before the gtk window gets destroyed. - // It serves as a fallback for when the window is closed manually. + // This callback is triggered in 2 cases: + // - When the monitor of this window gets disconnected + // - When the window is closed manually. + // We don't distinguish here and assume the window should be reopened once a monitor + // becomes available again let (response_sender, _) = daemon_response::create_pair(); - let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; + let command = DaemonCommand::CloseWindows { + windows: vec![instance_id.clone()], + auto_reopen: true, + sender: response_sender, + }; if let Err(err) = app_evt_sender.send(command) { log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); } @@ -466,7 +508,7 @@ impl App { tokio::select! { _ = glib::timeout_future(duration) => { let (response_sender, mut response_recv) = daemon_response::create_pair(); - let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], sender: response_sender }; + let command = DaemonCommand::CloseWindows { windows: vec![instance_id.clone()], auto_reopen: false, sender: response_sender }; if let Err(err) = app_evt_sender.send(command) { log::error!("Error sending close window command to daemon after gtk window destroy event: {}", err); } diff --git a/crates/eww/src/opts.rs b/crates/eww/src/opts.rs index fb010c6..eba9a04 100644 --- a/crates/eww/src/opts.rs +++ b/crates/eww/src/opts.rs @@ -292,7 +292,7 @@ impl ActionWithServer { }) } ActionWithServer::CloseWindows { windows } => { - return with_response_channel(|sender| app::DaemonCommand::CloseWindows { windows, sender }); + return with_response_channel(|sender| app::DaemonCommand::CloseWindows { windows, auto_reopen: false, sender }); } ActionWithServer::Reload => return with_response_channel(app::DaemonCommand::ReloadConfigAndCss), ActionWithServer::ListWindows => return with_response_channel(app::DaemonCommand::ListWindows), diff --git a/crates/eww/src/server.rs b/crates/eww/src/server.rs index 8e22d3f..718fdb7 100644 --- a/crates/eww/src/server.rs +++ b/crates/eww/src/server.rs @@ -105,13 +105,15 @@ pub fn initialize_server( } } + connect_monitor_added(ui_send.clone()); + // initialize all the handlers and tasks running asyncronously let tokio_handle = init_async_part(app.paths.clone(), ui_send); gtk::glib::MainContext::default().spawn_local(async move { // if an action was given to the daemon initially, execute it first. if let Some(action) = action { - app.handle_command(action); + app.handle_command(action).await; } loop { @@ -120,7 +122,7 @@ pub fn initialize_server( app.scope_graph.borrow_mut().handle_scope_graph_event(scope_graph_evt); }, Some(ui_event) = ui_recv.recv() => { - app.handle_command(ui_event); + app.handle_command(ui_event).await; } else => break, } @@ -136,6 +138,29 @@ pub fn initialize_server( Ok(ForkResult::Child) } +fn connect_monitor_added(ui_send: UnboundedSender) { + let display = gtk::gdk::Display::default().expect("could not get default display"); + display.connect_monitor_added({ + move |_display: >k::gdk::Display, _monitor: >k::gdk::Monitor| { + log::info!("New monitor connected, reloading configuration"); + let _ = reload_config_and_css(&ui_send); + } + }); +} + +fn reload_config_and_css(ui_send: &UnboundedSender) -> Result<()> { + let (daemon_resp_sender, mut daemon_resp_response) = daemon_response::create_pair(); + ui_send.send(DaemonCommand::ReloadConfigAndCss(daemon_resp_sender))?; + tokio::spawn(async move { + match daemon_resp_response.recv().await { + Some(daemon_response::DaemonResponse::Success(_)) => log::info!("Reloaded config successfully"), + Some(daemon_response::DaemonResponse::Failure(e)) => eprintln!("{}", e), + None => log::error!("No response to reload configuration-reload request"), + } + }); + Ok(()) +} + fn init_async_part(paths: EwwPaths, ui_send: UnboundedSender) -> tokio::runtime::Handle { let rt = tokio::runtime::Builder::new_multi_thread() .thread_name("main-async-runtime") @@ -216,20 +241,12 @@ async fn run_filewatch>(config_dir: P, evt_send: UnboundedSender< debounce_done.store(true, Ordering::SeqCst); }); - let (daemon_resp_sender, mut daemon_resp_response) = daemon_response::create_pair(); // without this sleep, reading the config file sometimes gives an empty file. // This is probably a result of editors not locking the file correctly, // and eww being too fast, thus reading the file while it's empty. // There should be some cleaner solution for this, but this will do for now. tokio::time::sleep(std::time::Duration::from_millis(50)).await; - evt_send.send(app::DaemonCommand::ReloadConfigAndCss(daemon_resp_sender))?; - tokio::spawn(async move { - match daemon_resp_response.recv().await { - Some(daemon_response::DaemonResponse::Success(_)) => log::info!("Reloaded config successfully"), - Some(daemon_response::DaemonResponse::Failure(e)) => eprintln!("{}", e), - None => log::error!("No response to reload configuration-reload request"), - } - }); + reload_config_and_css(&evt_send)?; } }, else => break From fddb4a09b107237819e661151e007b99b5cab36d Mon Sep 17 00:00:00 2001 From: Lorenzo Bodini <32436755+topongo@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:11:18 +0200 Subject: [PATCH 88/88] add `formatbytes` to expressions (#1333) * feat: add `log` to expressions * changelog: add `log` * feat: add `formatbytes` to expressions --- CHANGELOG.md | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 1 + crates/simplexpr/Cargo.toml | 1 + crates/simplexpr/src/eval.rs | 32 ++++++++++++++++++++++++++++++++ docs/src/expression_language.md | 5 +++++ 6 files changed, 47 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb4084..072640e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add `:lines` and `:wrap-mode` properties to label widget (By: vaporii) - Add `value-pos` to scale widget (By: ipsvn) - Add `floor` and `ceil` function calls to simplexpr (By: wsbankenstein) +- Add `formatbytes` function calls to simplexpr (By: topongo) ## [0.6.0] (21.04.2024) diff --git a/Cargo.lock b/Cargo.lock index 158aff4..f479f98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -400,6 +400,12 @@ version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +[[package]] +name = "bytesize" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c8f83209414aacf0eeae3cf730b18d6981697fba62f200fcfb92b9f082acba" + [[package]] name = "cached" version = "0.53.1" @@ -2683,6 +2689,7 @@ dependencies = [ name = "simplexpr" version = "0.1.0" dependencies = [ + "bytesize", "cached", "chrono", "chrono-tz", diff --git a/Cargo.toml b/Cargo.toml index 398a4c7..08f50fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ notifier_host = { version = "0.1.0", path = "crates/notifier_host" } anyhow = "1.0.86" bincode = "1.3.3" +bytesize = "2.0.1" cached = "0.53.1" chrono = "0.4.38" chrono-tz = "0.10.0" diff --git a/crates/simplexpr/Cargo.toml b/crates/simplexpr/Cargo.toml index 2b94ae9..dc5d7fd 100644 --- a/crates/simplexpr/Cargo.toml +++ b/crates/simplexpr/Cargo.toml @@ -14,6 +14,7 @@ build = "build.rs" [dependencies] eww_shared_util.workspace = true +bytesize.workspace = true cached.workspace = true chrono-tz.workspace = true chrono = { workspace = true, features = ["unstable-locales"] } diff --git a/crates/simplexpr/src/eval.rs b/crates/simplexpr/src/eval.rs index 556c72a..4c137a0 100644 --- a/crates/simplexpr/src/eval.rs +++ b/crates/simplexpr/src/eval.rs @@ -1,3 +1,4 @@ +use bytesize::ByteSize; use cached::proc_macro::cached; use chrono::{Local, LocalResult, TimeZone}; use itertools::Itertools; @@ -61,6 +62,9 @@ pub enum EvalError { #[error("Error parsing date: {0}")] ChronoError(String), + #[error("Error parsing byte format mode: {0}")] + ByteFormatModeError(String), + #[error("{1}")] Spanned(Span, Box), } @@ -534,6 +538,34 @@ fn call_expr_function(name: &str, args: Vec) -> Result Err(EvalError::WrongArgCount(name.to_string())), }, + "formatbytes" => { + let (bytes, short, mode) = match args.as_slice() { + [bytes] => (bytes.as_i64()?, false, "iec".to_owned()), + [bytes, short] => (bytes.as_i64()?, short.as_bool()?, "iec".to_owned()), + [bytes, short, mode] => (bytes.as_i64()?, short.as_bool()?, mode.as_string()?), + _ => return Err(EvalError::WrongArgCount(name.to_string())), + }; + let neg = bytes < 0; + let disp = ByteSize(bytes.abs() as u64).display(); + let disp = match mode.as_str() { + "iec" => { + if short { + disp.iec_short() + } else { + disp.iec() + } + } + "si" => { + if short { + disp.si_short() + } else { + disp.si() + } + } + _ => return Err(EvalError::ByteFormatModeError(mode)), + }; + Ok(DynVal::from(if neg { format!("-{disp}") } else { disp.to_string() })) + } _ => Err(EvalError::UnknownFunction(name.to_string())), } diff --git a/docs/src/expression_language.md b/docs/src/expression_language.md index 480b2d5..867b641 100644 --- a/docs/src/expression_language.md +++ b/docs/src/expression_language.md @@ -70,3 +70,8 @@ Supported currently are the following features: Same as other `formattime`, but does not accept timezone. Instead, it uses system's local timezone. Check [chrono's documentation](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) for more information about format string. + - `formatbytes(bytes, short, format_mode)`: Display bytes in a human-readable format. + Arguments: + - `bytes`: `i64` of bytes, supports negative sizes. + - `short`: set true for a compact version (default: false) + - `format_mode`: set to either to "iec" (eg. `1.0 GiB`) or "si" (eg. `1.2 GB`) (default: "iec")