From acbca9462c61e4ab7623cf981f78088cd9d361ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:08:10 +0000 Subject: [PATCH 01/33] build(deps): bump serde from 1.0.198 to 1.0.199 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.198 to 1.0.199. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.198...v1.0.199) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80e1092..b54d230 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2726,18 +2726,18 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote 1.0.35", diff --git a/Cargo.toml b/Cargo.toml index ae24ee6..1bf4b3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,7 +96,7 @@ tracing-error = { version = "0.2.0" , default-features = false } tracing-appender = "0.2.3" strip-ansi-escapes = "0.2.0" color-eyre = "0.6.3" -serde = { version = "1.0.198", features = ["derive"] } +serde = { version = "1.0.199", features = ["derive"] } indexmap = "2.2.6" dirs = "5.0.1" walkdir = "2.5.0" From 5cc060c988de053de6e13e100d5de6813c5071ee Mon Sep 17 00:00:00 2001 From: slowsage <84777606+slowsage@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:17:46 -0400 Subject: [PATCH 02/33] ci(binary): use release tag instead of github.ref_name --- .github/workflows/binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/binary.yml b/.github/workflows/binary.yml index df72e97..5205987 100644 --- a/.github/workflows/binary.yml +++ b/.github/workflows/binary.yml @@ -53,10 +53,10 @@ jobs: - name: Compress the built binary if: ${{ matrix.platform.zipext == '.tar.gz' }} - run: tar -zcvf ${{env.BINARY_NAME}}-${{github.ref_name}}-${{matrix.platform.target}}.tar.gz -C target/${{matrix.platform.target}}/release ${{env.BINARY_NAME}} + run: tar -zcvf ${{env.BINARY_NAME}}-${{needs.get_last_release.outputs.latest_release_tag}}-${{matrix.platform.target}}.tar.gz -C target/${{matrix.platform.target}}/release ${{env.BINARY_NAME}} - name: Upload to release - run: gh release upload ${{needs.get_last_release.outputs.latest_release_tag}} ${{env.BINARY_NAME}}-${{github.ref_name}}-${{matrix.platform.target}}${{matrix.platform.zipext}} + run: gh release upload ${{needs.get_last_release.outputs.latest_release_tag}} ${{env.BINARY_NAME}}-${{needs.get_last_release.outputs.latest_release_tag}}-${{matrix.platform.target}}${{matrix.platform.zipext}} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b846ea0b847d9cac97cced167fee0ba029cbeb55 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 May 2024 00:55:38 +0000 Subject: [PATCH 03/33] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'crane': 'github:ipetkov/crane/ada0fb4dcce4561acb1eb17c59b7306d9d4a95f3?narHash=sha256-LEg6/dmEFxx6Ygti5DO9MOhGNpyB7zdxdWtzv/FCTXk%3D' (2024-03-29) → 'github:ipetkov/crane/a5eca68a2cf11adb32787fc141cddd29ac8eb79c?narHash=sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH%2BDcP4%3D' (2024-04-24) • Updated input 'naersk': 'github:nix-community/naersk/aeb58d5e8faead8980a807c840232697982d47b9?narHash=sha256-/TdeHMPRjjdJub7p7%2Bw55vyABrsJlt5QkznPYy55vKA%3D' (2023-10-27) → 'github:nix-community/naersk/c5037590290c6c7dae2e42e7da1e247e54ed2d49?narHash=sha256-CO8MmVDmqZX2FovL75pu5BvwhW%2BVugc7Q6ze7Hj8heI%3D' (2024-04-19) • Updated input 'naersk/nixpkgs': 'github:NixOS/nixpkgs/807c549feabce7eddbf259dbdcec9e0600a0660d?narHash=sha256-9slQ609YqT9bT/MNX9%2B5k5jltL9zgpn36DpFB7TkttM%3D' (2024-03-29) → 'github:NixOS/nixpkgs/cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae?narHash=sha256-yNAevSKF4krRWacmLUsLK7D7PlfuY3zF0lYnGYNi9vQ%3D' (2024-04-28) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/d8fe5e6c92d0d190646fb9f1056741a229980089?narHash=sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk%3D' (2024-03-29) → 'github:nixos/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994?narHash=sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc%3D' (2024-04-27) • Updated input 'rust-overlay': 'github:oxalica/rust-overlay/f258266af947599e8069df1c2e933189270f143a?narHash=sha256-EJ03x3N9ihhonAttkaCrqxb0djDq3URCuDpmVPbNZhA%3D' (2024-03-31) → 'github:oxalica/rust-overlay/ce35c36f58f82cee6ec959e0d44c587d64281b6f?narHash=sha256-lKTA3XqRo4aVgkyTSCtpcALpGXdmkilHTtN00eRg0QU%3D' (2024-04-30) --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 3a3b651..a1d9b2d 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1711681752, - "narHash": "sha256-LEg6/dmEFxx6Ygti5DO9MOhGNpyB7zdxdWtzv/FCTXk=", + "lastModified": 1713979152, + "narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=", "owner": "ipetkov", "repo": "crane", - "rev": "ada0fb4dcce4561acb1eb17c59b7306d9d4a95f3", + "rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c", "type": "github" }, "original": { @@ -43,11 +43,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1698420672, - "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=", + "lastModified": 1713520724, + "narHash": "sha256-CO8MmVDmqZX2FovL75pu5BvwhW+Vugc7Q6ze7Hj8heI=", "owner": "nix-community", "repo": "naersk", - "rev": "aeb58d5e8faead8980a807c840232697982d47b9", + "rev": "c5037590290c6c7dae2e42e7da1e247e54ed2d49", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1711715736, - "narHash": "sha256-9slQ609YqT9bT/MNX9+5k5jltL9zgpn36DpFB7TkttM=", + "lastModified": 1714314149, + "narHash": "sha256-yNAevSKF4krRWacmLUsLK7D7PlfuY3zF0lYnGYNi9vQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "807c549feabce7eddbf259dbdcec9e0600a0660d", + "rev": "cf8cc1201be8bc71b7cbbbdaf349b22f4f99c7ae", "type": "github" }, "original": { @@ -72,11 +72,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { @@ -102,11 +102,11 @@ ] }, "locked": { - "lastModified": 1711851236, - "narHash": "sha256-EJ03x3N9ihhonAttkaCrqxb0djDq3URCuDpmVPbNZhA=", + "lastModified": 1714443211, + "narHash": "sha256-lKTA3XqRo4aVgkyTSCtpcALpGXdmkilHTtN00eRg0QU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "f258266af947599e8069df1c2e933189270f143a", + "rev": "ce35c36f58f82cee6ec959e0d44c587d64281b6f", "type": "github" }, "original": { From 1971f3bb1ef3d059b29b99527e77ffaaf92240aa Mon Sep 17 00:00:00 2001 From: drendog <53359960+drendog@users.noreply.github.com> Date: Wed, 1 May 2024 22:37:56 +0200 Subject: [PATCH 04/33] docs(volume): update deprecated volume token (#567) --- examples/config.corn | 2 +- examples/config.json | 2 +- examples/config.toml | 2 +- examples/config.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/config.corn b/examples/config.corn index 69b3d5f..253444e 100644 --- a/examples/config.corn +++ b/examples/config.corn @@ -81,7 +81,7 @@ let { $volume = { type = "volume" - format = "{icon} {volume}%" + format = "{icon} {percentage}%" max_volume = 100 icons.volume_high = "󰕾" icons.volume_medium = "󰖀" diff --git a/examples/config.json b/examples/config.json index 87b788b..b984e5f 100644 --- a/examples/config.json +++ b/examples/config.json @@ -74,7 +74,7 @@ }, { "type": "volume", - "format": "{icon} {volume}%", + "format": "{icon} {percentage}%", "max_volume": 100, "icons": { "volume_high": "󰕾", diff --git a/examples/config.toml b/examples/config.toml index 830e858..129d1bf 100644 --- a/examples/config.toml +++ b/examples/config.toml @@ -71,7 +71,7 @@ networks = 3 [[end]] type = "volume" -format = "{icon} {volume}%" +format = "{icon} {percentage}%" max_volume = 100 [end.icons] diff --git a/examples/config.yaml b/examples/config.yaml index 7693414..cff29d5 100644 --- a/examples/config.yaml +++ b/examples/config.yaml @@ -51,7 +51,7 @@ end: - 󰖡 {load_average:1} | {load_average:5} | {load_average:15} - 󰥔 {uptime} - type: volume - format: '{icon} {volume}%' + format: '{icon} {percentage}%' max_volume: 100 icons: volume_high: 󰕾 From 78fcd44c1a3c8d5e0395eb7ad5fedd3bc84c2a0e Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Fri, 3 May 2024 21:38:07 +0100 Subject: [PATCH 05/33] chore: bump version to 0.15.1-pre --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b54d230..2df93c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1592,7 +1592,7 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "ironbar" -version = "0.15.0" +version = "0.15.1-pre" dependencies = [ "cairo-rs", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 1bf4b3e..8f91280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ironbar" -version = "0.15.0" +version = "0.15.1-pre" edition = "2021" license = "MIT" description = "Customisable GTK Layer Shell wlroots/sway bar" From f7a39ddecce514f51646d34d8696e3377e6f7fe9 Mon Sep 17 00:00:00 2001 From: Nadia Date: Fri, 3 May 2024 15:39:09 -0500 Subject: [PATCH 06/33] build: update hyprland-rs to 0.4.0-alpha.1 (#565) this does have some breaking changes in it so it could have other side effects. --- .gitignore | 1 + Cargo.lock | 69 ++++++------------------------ Cargo.toml | 4 +- src/clients/compositor/hyprland.rs | 2 + 4 files changed, 18 insertions(+), 58 deletions(-) diff --git a/.gitignore b/.gitignore index ea8c4bf..0e71e34 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.direnv/ diff --git a/Cargo.lock b/Cargo.lock index 2df93c7..34ecb1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,7 @@ dependencies = [ "cfg-if", "getrandom", "once_cell", + "serde", "version_check", ] @@ -529,12 +530,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "core-foundation" version = "0.9.3" @@ -703,10 +698,8 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote 1.0.35", - "rustc_version", "syn 1.0.109", ] @@ -750,12 +743,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "downcast-rs" version = "1.2.0" @@ -1457,32 +1444,28 @@ dependencies = [ [[package]] name = "hyprland" -version = "0.3.13" +version = "0.4.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87a8f1cc065d451894dd3916c0bc3fcf9b67b276126c05f27b1db912688dde8" +checksum = "54fdc60390459bd6da28ec708ee7a672b8f6680efb8f8f33cbe970da16f40a48" dependencies = [ - "async-trait", + "ahash", "derive_more", - "doc-comment", - "futures", - "hex", "hyprland-macros", - "lazy_static", "num-traits", + "once_cell", "paste", "regex", "serde", "serde_json", "serde_repr", - "strum", "tokio", ] [[package]] name = "hyprland-macros" -version = "0.3.4" +version = "0.4.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c941d3d52e979612af8cb94e8de49000c7fada2014a7791d173ab41339f4e4eb" +checksum = "5dd8ce4c182ce77e485918f49262425ee51a2746fe97f14084869aeff2fbc38e" dependencies = [ "quote 1.0.35", "syn 2.0.48", @@ -1614,6 +1597,7 @@ dependencies = [ "mpris", "nix 0.27.1", "notify", + "num-traits", "regex", "reqwest", "serde", @@ -2033,9 +2017,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -2193,9 +2177,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" @@ -2653,12 +2637,6 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" -[[package]] -name = "rustversion" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" - [[package]] name = "ryu" version = "1.0.13" @@ -2937,28 +2915,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" -[[package]] -name = "strum" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote 1.0.35", - "rustversion", - "syn 2.0.48", -] - [[package]] name = "swayipc-async" version = "2.0.1" @@ -3169,7 +3125,6 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2 0.5.5", diff --git a/Cargo.toml b/Cargo.toml index 8f91280..d603ba0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,7 +148,9 @@ libpulse-binding = { version = "2.28.1", optional = true } # workspaces swayipc-async = { version = "2.0.1", optional = true } -hyprland = { version = "0.3.13", default_features = false, features = ["listener", "tokio", "silent"], optional = true } +hyprland = { version = "0.4.0-alpha.1", features = ["silent"], optional = true } +futures-util = { version = "0.3.30", optional = true } +num-traits = "0.2.18" # shared futures-lite = { version = "2.3.0", optional = true } # workspaces, upower diff --git a/src/clients/compositor/hyprland.rs b/src/clients/compositor/hyprland.rs index 56184eb..d5c453c 100644 --- a/src/clients/compositor/hyprland.rs +++ b/src/clients/compositor/hyprland.rs @@ -186,6 +186,7 @@ impl Client { fn get_workspace(name: &str, active: Option<&Workspace>) -> Option { Workspaces::get() .expect("Failed to get workspaces") + .into_iter() .find_map(|w| { if w.name == name { let vis = Visibility::from((&w, active.map(|w| w.name.as_ref()), &|w| { @@ -228,6 +229,7 @@ impl WorkspaceClient for Client { let workspaces = Workspaces::get() .expect("Failed to get workspaces") + .into_iter() .map(|w| { let vis = Visibility::from((&w, active_id.as_deref(), &is_visible)); From d5e493ec8d5353a988d79bb72fda36f96356d7be Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 4 May 2024 15:00:42 +0100 Subject: [PATCH 07/33] chore: regen lockfile Resolves #569 --- Cargo.lock | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34ecb1c..496a71f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1585,6 +1585,7 @@ dependencies = [ "ctrlc", "dirs", "futures-lite 2.3.0", + "futures-util", "glib", "gtk", "gtk-layer-shell", @@ -1739,16 +1740,6 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.17" @@ -2152,29 +2143,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.4.1", - "smallvec", - "windows-targets 0.48.0", -] - [[package]] name = "paste" version = "1.0.14" @@ -2457,15 +2425,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[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_users" version = "0.4.3" From 3a947d1e141c54ad5ee3c7244ccd7cb43b04e0f2 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 4 May 2024 17:14:39 +0100 Subject: [PATCH 08/33] chore: remove println --- src/modules/focused.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/focused.rs b/src/modules/focused.rs index c63d263..6c21434 100644 --- a/src/modules/focused.rs +++ b/src/modules/focused.rs @@ -81,7 +81,6 @@ impl Module for FocusedModule { while let Ok(event) = wlrx.recv().await { match event { ToplevelEvent::Update(info) => { - println!("{current:?} | {info:?}"); if info.focused { debug!("Changing focus"); From 3a1c60442382f970cdb7669814b6ef3594d9f048 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sun, 5 May 2024 12:27:31 +0100 Subject: [PATCH 09/33] chore(release): v0.15.1 --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 496a71f..6e6fb67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1575,7 +1575,7 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "ironbar" -version = "0.15.1-pre" +version = "0.15.1" dependencies = [ "cairo-rs", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index d603ba0..3e6b4c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ironbar" -version = "0.15.1-pre" +version = "0.15.1" edition = "2021" license = "MIT" description = "Customisable GTK Layer Shell wlroots/sway bar" @@ -157,4 +157,4 @@ futures-lite = { version = "2.3.0", optional = true } # workspaces, upower regex = { version = "1.10.4", default-features = false, features = [ "std", ], optional = true } # music, sys_info -zbus = { version = "3.15.2", default-features = false, features = ["tokio"], optional = true } # notifications, upower \ No newline at end of file +zbus = { version = "3.15.2", default-features = false, features = ["tokio"], optional = true } # notifications, upower From c25440cd3274cb7adf4e8a1c97b4bc88a53841b4 Mon Sep 17 00:00:00 2001 From: JakeStanger Date: Sun, 5 May 2024 11:29:44 +0000 Subject: [PATCH 10/33] docs: update CHANGELOG.md for v0.15.1 [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 634b117..12f42f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v0.15.1] - 2024-05-05 +### :memo: Documentation Changes +- [`5bb8079`](https://github.com/JakeStanger/ironbar/commit/5bb8079dff17bf3fcfccec1e58c37e0867088508) - update CHANGELOG.md for v0.15.0 [skip ci] *(commit by [@JakeStanger](https://github.com/JakeStanger))* +- [`47b6c47`](https://github.com/JakeStanger/ironbar/commit/47b6c477242ad52aae77a6820740d9c5f4bfc263) - **compiling**: add lua deps *(commit by [@JakeStanger](https://github.com/JakeStanger))* +- [`1971f3b`](https://github.com/JakeStanger/ironbar/commit/1971f3bb1ef3d059b29b99527e77ffaaf92240aa) - **volume**: update deprecated volume token *(PR [#567](https://github.com/JakeStanger/ironbar/pull/567) by [@drendog](https://github.com/drendog))* + + ## [v0.15.0] - 2024-04-28 ### :sparkles: New Features - [`f4384b6`](https://github.com/JakeStanger/ironbar/commit/f4384b6252e86d4e2558e1c36810d4ef903bd58c) - enable use of markup in clock module format and format_popup, and update documentation to reflect supporting Pango markup in both *commit by [@Dridus](https://github.com/Dridus))* @@ -565,3 +572,4 @@ It also requires `lua-lgi` as a runtime dependency. [v0.14.0]: https://github.com/JakeStanger/ironbar/compare/v0.13.0...v0.14.0 [v0.14.1]: https://github.com/JakeStanger/ironbar/compare/v0.14.0...v0.14.1 [v0.15.0]: https://github.com/JakeStanger/ironbar/compare/v0.14.3...v0.15.0 +[v0.15.1]: https://github.com/JakeStanger/ironbar/compare/v0.15.0...v0.15.1 From c08441eff44ede4febc28aafc306f1e9bede52b4 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sun, 5 May 2024 12:31:36 +0100 Subject: [PATCH 11/33] chore(readme): add note for v.0.15.1 --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f42f3..adaf6b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v0.15.1] - 2024-05-05 + +Release to bump hyprland-rs version due to Hyprland v0.40 socket path breaking change. + ### :memo: Documentation Changes -- [`5bb8079`](https://github.com/JakeStanger/ironbar/commit/5bb8079dff17bf3fcfccec1e58c37e0867088508) - update CHANGELOG.md for v0.15.0 [skip ci] *(commit by [@JakeStanger](https://github.com/JakeStanger))* - [`47b6c47`](https://github.com/JakeStanger/ironbar/commit/47b6c477242ad52aae77a6820740d9c5f4bfc263) - **compiling**: add lua deps *(commit by [@JakeStanger](https://github.com/JakeStanger))* - [`1971f3b`](https://github.com/JakeStanger/ironbar/commit/1971f3bb1ef3d059b29b99527e77ffaaf92240aa) - **volume**: update deprecated volume token *(PR [#567](https://github.com/JakeStanger/ironbar/pull/567) by [@drendog](https://github.com/drendog))* From 8cb7655af1b9e61dd149b104d5769e3e50858a87 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Mon, 6 May 2024 16:54:07 +0100 Subject: [PATCH 12/33] chore: remove unused num-traits dep --- Cargo.lock | 1 - Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e6fb67..41ad644 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1598,7 +1598,6 @@ dependencies = [ "mpris", "nix 0.27.1", "notify", - "num-traits", "regex", "reqwest", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3e6b4c4..07ee911 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -150,7 +150,6 @@ libpulse-binding = { version = "2.28.1", optional = true } swayipc-async = { version = "2.0.1", optional = true } hyprland = { version = "0.4.0-alpha.1", features = ["silent"], optional = true } futures-util = { version = "0.3.30", optional = true } -num-traits = "0.2.18" # shared futures-lite = { version = "2.3.0", optional = true } # workspaces, upower From 02ace9361786646e475fe8fb458115e456ccafb9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 15:55:54 +0000 Subject: [PATCH 13/33] build(deps): bump serde from 1.0.199 to 1.0.200 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.199 to 1.0.200. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.199...v1.0.200) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41ad644..3ba9e89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2662,18 +2662,18 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.199" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.199" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote 1.0.35", diff --git a/Cargo.toml b/Cargo.toml index 07ee911..812c4ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,7 +96,7 @@ tracing-error = { version = "0.2.0" , default-features = false } tracing-appender = "0.2.3" strip-ansi-escapes = "0.2.0" color-eyre = "0.6.3" -serde = { version = "1.0.199", features = ["derive"] } +serde = { version = "1.0.200", features = ["derive"] } indexmap = "2.2.6" dirs = "5.0.1" walkdir = "2.5.0" From 5e7f576841f94bdfd89d401cb9a2ba1fabb45c1c Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Mon, 6 May 2024 16:46:26 +0100 Subject: [PATCH 14/33] fix(workspaces): add support for hyprland rename event Renaming workspaces on Hyprland will now work as expected. This also refactors the workspace code to depend on IDs rather than names which should make it more robust against the same sort of issue in future. Fixes #469 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/clients/compositor/hyprland.rs | 25 ++++++++++++++++++----- src/clients/compositor/mod.rs | 6 ++++++ src/modules/workspaces.rs | 32 ++++++++++++++++++++---------- 5 files changed, 52 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e6fb67..2816d7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1444,9 +1444,9 @@ dependencies = [ [[package]] name = "hyprland" -version = "0.4.0-alpha.1" +version = "0.4.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54fdc60390459bd6da28ec708ee7a672b8f6680efb8f8f33cbe970da16f40a48" +checksum = "d627cd06fb3389f2554b7a4bb21db8c0bfca8863e6e653702cc4c6dbf20d8276" dependencies = [ "ahash", "derive_more", @@ -2008,9 +2008,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] diff --git a/Cargo.toml b/Cargo.toml index 3e6b4c4..1c2b605 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,7 +148,7 @@ libpulse-binding = { version = "2.28.1", optional = true } # workspaces swayipc-async = { version = "2.0.1", optional = true } -hyprland = { version = "0.4.0-alpha.1", features = ["silent"], optional = true } +hyprland = { version = "0.4.0-alpha.2", features = ["silent"], optional = true } futures-util = { version = "0.3.30", optional = true } num-traits = "0.2.18" diff --git a/src/clients/compositor/hyprland.rs b/src/clients/compositor/hyprland.rs index d5c453c..3932578 100644 --- a/src/clients/compositor/hyprland.rs +++ b/src/clients/compositor/hyprland.rs @@ -149,12 +149,27 @@ impl Client { } { - event_listener.add_workspace_destroy_handler(move |workspace_type| { - let _lock = lock!(lock); - debug!("Received workspace destroy: {workspace_type:?}"); + let tx = tx.clone(); + let lock = lock.clone(); - let name = get_workspace_name(workspace_type); - send!(tx, WorkspaceUpdate::Remove(name)); + event_listener.add_workspace_rename_handler(move |data| { + let _lock = lock!(lock); + + send!( + tx, + WorkspaceUpdate::Rename { + id: data.workspace_id.to_string(), + name: data.workspace_name + } + ); + }); + } + + { + event_listener.add_workspace_destroy_handler(move |data| { + let _lock = lock!(lock); + debug!("Received workspace destroy: {data:?}"); + send!(tx, WorkspaceUpdate::Remove(data.workspace_id.to_string())); }); } diff --git a/src/clients/compositor/mod.rs b/src/clients/compositor/mod.rs index 0371913..6dc2398 100644 --- a/src/clients/compositor/mod.rs +++ b/src/clients/compositor/mod.rs @@ -126,6 +126,12 @@ pub enum WorkspaceUpdate { old: Option, new: Workspace, }, + + Rename { + id: String, + name: String, + }, + /// An update was triggered by the compositor but this was not mapped by Ironbar. /// /// This is purely used for ergonomics within the compositor clients diff --git a/src/modules/workspaces.rs b/src/modules/workspaces.rs index 4eb0755..45e816e 100644 --- a/src/modules/workspaces.rs +++ b/src/modules/workspaces.rs @@ -135,7 +135,7 @@ fn reorder_workspaces(container: >k::Box) { impl WorkspacesModule { fn show_workspace_check(&self, output: &String, work: &Workspace) -> bool { - (work.visibility.is_focused() || !self.hidden.contains(&work.name)) + (work.visibility.is_focused() || !self.hidden.contains(&work.id)) && (self.all_monitors || output == &work.monitor) } } @@ -213,7 +213,7 @@ impl Module for WorkspacesModule { let mut added = HashSet::new(); - let mut add_workspace = |name: &str, visibility: Visibility| { + let mut add_workspace = |id: &str, name: &str, visibility: Visibility| { let item = create_button( name, visibility, @@ -224,13 +224,13 @@ impl Module for WorkspacesModule { ); container.add(&item); - button_map.insert(name.to_string(), item); + button_map.insert(id.to_string(), item); }; // add workspaces from client for workspace in &workspaces { if self.show_workspace_check(&output_name, workspace) { - add_workspace(&workspace.name, workspace.visibility); + add_workspace(&workspace.id, &workspace.name, workspace.visibility); added.insert(workspace.name.to_string()); } } @@ -240,7 +240,11 @@ impl Module for WorkspacesModule { fav_names.push(name.to_string()); if !added.contains(name) { - add_workspace(name, Visibility::Hidden); + // Favourites are added with the same name and ID + // as Hyprland will initialize them this way. + // Since existing workspaces are added above, + // this means there shouldn't be any issues with renaming. + add_workspace(name, name, Visibility::Hidden); added.insert(name.to_string()); } } @@ -265,7 +269,7 @@ impl Module for WorkspacesModule { } } WorkspaceUpdate::Focus { old, new } => { - if let Some(btn) = old.as_ref().and_then(|w| button_map.get(&w.name)) { + if let Some(btn) = old.as_ref().and_then(|w| button_map.get(&w.id)) { if Some(new.monitor) == old.map(|w| w.monitor) { btn.style_context().remove_class("visible"); } @@ -273,7 +277,7 @@ impl Module for WorkspacesModule { btn.style_context().remove_class("focused"); } - let new = button_map.get(&new.name); + let new = button_map.get(&new.id); if let Some(btn) = new { let style = btn.style_context(); @@ -281,9 +285,15 @@ impl Module for WorkspacesModule { style.add_class("focused"); } } + WorkspaceUpdate::Rename { id, name } => { + if let Some(btn) = button_map.get(&id) { + let name = name_map.get(&name).unwrap_or(&name); + btn.set_label(name); + } + } WorkspaceUpdate::Add(workspace) => { if fav_names.contains(&workspace.name) { - let btn = button_map.get(&workspace.name); + let btn = button_map.get(&workspace.id); if let Some(btn) = btn { btn.style_context().remove_class("inactive"); } @@ -306,7 +316,7 @@ impl Module for WorkspacesModule { item.show(); if !name.is_empty() { - button_map.insert(name, item); + button_map.insert(workspace.id, item); } } } @@ -332,9 +342,9 @@ impl Module for WorkspacesModule { item.show(); if !name.is_empty() { - button_map.insert(name, item); + button_map.insert(workspace.id, item); } - } else if let Some(item) = button_map.get(&workspace.name) { + } else if let Some(item) = button_map.get(&workspace.id) { container.remove(item); } } From c6aff14135a0b60ec5ad7069b11a40f9e1205e90 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Tue, 7 May 2024 09:53:20 +0100 Subject: [PATCH 15/33] chore: bump version to 0.16.0-pre --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ba9e89..423af69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1575,7 +1575,7 @@ checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "ironbar" -version = "0.15.1" +version = "0.16.0-pre" dependencies = [ "cairo-rs", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 812c4ee..e6dde62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ironbar" -version = "0.15.1" +version = "0.16.0-pre" edition = "2021" license = "MIT" description = "Customisable GTK Layer Shell wlroots/sway bar" From c45ea02a7d39b30fece3986044a44a64aebf5e16 Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Thu, 9 May 2024 17:25:08 +0100 Subject: [PATCH 16/33] fix(workspaces): regression due to #572 Fixes #574 --- src/clients/compositor/hyprland.rs | 6 ++--- src/clients/compositor/mod.rs | 6 ++--- src/clients/compositor/sway.rs | 14 ++++------- src/modules/workspaces.rs | 40 ++++++++++++++++++------------ test-configs/workspaces.corn | 3 +++ 5 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 test-configs/workspaces.corn diff --git a/src/clients/compositor/hyprland.rs b/src/clients/compositor/hyprland.rs index 3932578..ee526ea 100644 --- a/src/clients/compositor/hyprland.rs +++ b/src/clients/compositor/hyprland.rs @@ -158,7 +158,7 @@ impl Client { send!( tx, WorkspaceUpdate::Rename { - id: data.workspace_id.to_string(), + id: data.workspace_id as i64, name: data.workspace_name } ); @@ -169,7 +169,7 @@ impl Client { event_listener.add_workspace_destroy_handler(move |data| { let _lock = lock!(lock); debug!("Received workspace destroy: {data:?}"); - send!(tx, WorkspaceUpdate::Remove(data.workspace_id.to_string())); + send!(tx, WorkspaceUpdate::Remove(data.workspace_id as i64)); }); } @@ -279,7 +279,7 @@ fn create_is_visible() -> impl Fn(&HWorkspace) -> bool { impl From<(Visibility, HWorkspace)> for Workspace { fn from((visibility, workspace): (Visibility, HWorkspace)) -> Self { Self { - id: workspace.id.to_string(), + id: workspace.id as i64, name: workspace.name, monitor: workspace.monitor, visibility, diff --git a/src/clients/compositor/mod.rs b/src/clients/compositor/mod.rs index 6dc2398..051a7b8 100644 --- a/src/clients/compositor/mod.rs +++ b/src/clients/compositor/mod.rs @@ -74,7 +74,7 @@ impl Compositor { #[derive(Debug, Clone)] pub struct Workspace { /// Unique identifier - pub id: String, + pub id: i64, /// Workspace friendly name pub name: String, /// Name of the monitor (output) the workspace is located on @@ -119,7 +119,7 @@ pub enum WorkspaceUpdate { /// This is re-sent to all subscribers when a new subscription is created. Init(Vec), Add(Workspace), - Remove(String), + Remove(i64), Move(Workspace), /// Declares focus moved from the old workspace to the new. Focus { @@ -128,7 +128,7 @@ pub enum WorkspaceUpdate { }, Rename { - id: String, + id: i64, name: String, }, diff --git a/src/clients/compositor/sway.rs b/src/clients/compositor/sway.rs index 28e8f7f..b3f4197 100644 --- a/src/clients/compositor/sway.rs +++ b/src/clients/compositor/sway.rs @@ -90,7 +90,7 @@ impl From for Workspace { let visibility = Visibility::from(&node); Self { - id: node.id.to_string(), + id: node.id, name: node.name.unwrap_or_default(), monitor: node.output.unwrap_or_default(), visibility, @@ -103,7 +103,7 @@ impl From for Workspace { let visibility = Visibility::from(&workspace); Self { - id: workspace.id.to_string(), + id: workspace.id, name: workspace.name, monitor: workspace.output, visibility, @@ -141,13 +141,9 @@ impl From for WorkspaceUpdate { WorkspaceChange::Init => { Self::Add(event.current.expect("Missing current workspace").into()) } - WorkspaceChange::Empty => Self::Remove( - event - .current - .expect("Missing current workspace") - .name - .unwrap_or_default(), - ), + WorkspaceChange::Empty => { + Self::Remove(event.current.expect("Missing current workspace").id) + } WorkspaceChange::Focus => Self::Focus { old: event.old.map(Workspace::from), new: Workspace::from(event.current.expect("Missing current workspace")), diff --git a/src/modules/workspaces.rs b/src/modules/workspaces.rs index 45e816e..b1a20de 100644 --- a/src/modules/workspaces.rs +++ b/src/modules/workspaces.rs @@ -1,8 +1,9 @@ use crate::clients::compositor::{Visibility, Workspace, WorkspaceClient, WorkspaceUpdate}; use crate::config::CommonConfig; +use crate::gtk_helpers::IronbarGtkExt; use crate::image::new_icon_button; use crate::modules::{Module, ModuleInfo, ModuleParts, ModuleUpdateEvent, WidgetContext}; -use crate::{glib_recv, module_impl, send_async, spawn, try_send}; +use crate::{glib_recv, module_impl, send_async, spawn, try_send, Ironbar}; use color_eyre::{Report, Result}; use gtk::prelude::*; use gtk::{Button, IconTheme}; @@ -133,9 +134,18 @@ fn reorder_workspaces(container: >k::Box) { } } +fn find_btn(map: &HashMap, workspace: &Workspace) -> Option