[PR #1003] [MERGED] Overhaul .desktop and image resolver code #9516

Closed
opened 2026-05-23 03:56:48 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/1003
Author: @JakeStanger
Created: 5/25/2025
Status: Merged
Merged: 5/25/2025
Merged by: @JakeStanger

Base: masterHead: refactor/image


📝 Commits (4)

  • ca524f1 refactor: fix some strict clippy warnings
  • 3e55d87 refactor: overhaul .desktop and image resolver systems
  • 3a0e102 feat: change icon_overrides to apply to all resolved images
  • 9270225 chore(intellij): add test run config

📊 Changes

40 files changed (+1878 additions, -669 deletions)

View changed files

.idea/runConfigurations/Test.xml (+20 -0)
📝 Cargo.toml (+1 -0)
📝 docs/Configuration guide.md (+6 -6)
📝 src/bar.rs (+3 -23)
📝 src/channels.rs (+31 -0)
📝 src/clients/networkmanager.rs (+1 -1)
📝 src/clients/wayland/mod.rs (+1 -1)
📝 src/config/layout.rs (+2 -4)
📝 src/config/mod.rs (+6 -7)
📝 src/desktop_file.rs (+296 -156)
📝 src/image/gtk.rs (+58 -25)
📝 src/image/mod.rs (+1 -1)
📝 src/image/provider.rs (+276 -215)
📝 src/ipc/server/ironvar.rs (+5 -6)
📝 src/ironvar.rs (+1 -1)
📝 src/main.rs (+27 -6)
📝 src/modules/clipboard.rs (+2 -1)
📝 src/modules/custom/image.rs (+9 -7)
📝 src/modules/custom/mod.rs (+5 -5)
📝 src/modules/focused.rs (+24 -23)

...and 20 more files

📄 Description

This overhauls the .desktop parser and image resolver code to greatly improve their performance.

This is achieved by caching all of the following:

  • .desktop file locations
  • .desktop file contents
  • Image locations
  • Image Pixmaps

The resolvers are fully async and only load data as required, including loading images without blocking the UI.

With the changes come a couple of new features:

  • The system icon theme (as set through dconf/gsettings) will be used if no icon theme is configured. Previously this just fell back to Adwaita.
  • The icon_overrides option now applies to ALL images across all modules, supporting all formats, making it much more powerful. For example you could set icon_overrides.steam = "/path/to/steam.jpg" or icon_overrides.'music/Pink Floyd/Dark Side of the Moon/cover.jpg' = "https://example.com/dsotm.jpg".

BREAKING CHANGE: The PR moves the icon_theme option from the bar-level to the top-level. If setting a custom icon theme, this will need to be updated.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/1003 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 5/25/2025 **Status:** ✅ Merged **Merged:** 5/25/2025 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `refactor/image` --- ### 📝 Commits (4) - [`ca524f1`](https://github.com/JakeStanger/ironbar/commit/ca524f19f6875970dfceba3ada97972216ae201f) refactor: fix some strict clippy warnings - [`3e55d87`](https://github.com/JakeStanger/ironbar/commit/3e55d87c3a90f5b201b259a4af7c70b9addc4da0) refactor: overhaul `.desktop` and image resolver systems - [`3a0e102`](https://github.com/JakeStanger/ironbar/commit/3a0e102afcac028a4dd98035ba992d84b48aca81) feat: change `icon_overrides` to apply to all resolved images - [`9270225`](https://github.com/JakeStanger/ironbar/commit/9270225db8a03e482bf64fa4bfa0ff3bcc4b7b98) chore(intellij): add test run config ### 📊 Changes **40 files changed** (+1878 additions, -669 deletions) <details> <summary>View changed files</summary> ➕ `.idea/runConfigurations/Test.xml` (+20 -0) 📝 `Cargo.toml` (+1 -0) 📝 `docs/Configuration guide.md` (+6 -6) 📝 `src/bar.rs` (+3 -23) 📝 `src/channels.rs` (+31 -0) 📝 `src/clients/networkmanager.rs` (+1 -1) 📝 `src/clients/wayland/mod.rs` (+1 -1) 📝 `src/config/layout.rs` (+2 -4) 📝 `src/config/mod.rs` (+6 -7) 📝 `src/desktop_file.rs` (+296 -156) 📝 `src/image/gtk.rs` (+58 -25) 📝 `src/image/mod.rs` (+1 -1) 📝 `src/image/provider.rs` (+276 -215) 📝 `src/ipc/server/ironvar.rs` (+5 -6) 📝 `src/ironvar.rs` (+1 -1) 📝 `src/main.rs` (+27 -6) 📝 `src/modules/clipboard.rs` (+2 -1) 📝 `src/modules/custom/image.rs` (+9 -7) 📝 `src/modules/custom/mod.rs` (+5 -5) 📝 `src/modules/focused.rs` (+24 -23) _...and 20 more files_ </details> ### 📄 Description This overhauls the `.desktop` parser and image resolver code to greatly improve their performance. This is achieved by caching all of the following: - `.desktop` file locations - `.desktop` file contents - Image locations - Image `Pixmap`s The resolvers are fully async and only load data as required, including loading images without blocking the UI. With the changes come a couple of new features: - The system icon theme (as set through dconf/gsettings) will be used if no icon theme is configured. Previously this just fell back to Adwaita. - The `icon_overrides` option now applies to ALL images across all modules, supporting all formats, making it much more powerful. For example you could set `icon_overrides.steam = "/path/to/steam.jpg"` or `icon_overrides.'music/Pink Floyd/Dark Side of the Moon/cover.jpg' = "https://example.com/dsotm.jpg"`. **BREAKING CHANGE**: The PR moves the `icon_theme` option from the bar-level to the top-level. If setting a custom icon theme, this will need to be updated. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 03:56:48 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#9516
No description provided.