Skip to content

fix(nix/linux): allow tray-icon to compile on linux - #199

Open
jonknapp wants to merge 3 commits into
borgbase:mainfrom
jonknapp:bugfix/fix-nix-libxdo
Open

jonknapp wants to merge 3 commits into
borgbase:mainfrom
jonknapp:bugfix/fix-nix-libxdo

Conversation

@jonknapp

@jonknapp jonknapp commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Not in use since db89109 and keeping it breaks the nix build.

error info
error: Cannot build '/nix/store/y735fgjmwhb65zacwq3jk3vpdlwa940k-vykar-gui-0.20.1.drv'.
       Reason: builder failed with exit code 101.
       Output paths:
         /nix/store/vhf7b1jmqab2a4d5g1f5sdkjix7gjvgm-vykar-gui-0.20.1
       Last 25 log lines:
       >    Compiling accesskit_atspi_common v0.19.1
       >    Compiling atspi v0.29.0
       >    Compiling accesskit_unix v0.22.1
       >    Compiling accesskit_winit v0.33.2
       >    Compiling i-slint-backend-winit v1.17.1
       >    Compiling i-slint-backend-selector v1.17.1
       >    Compiling slint v1.17.1
       > error[E0599]: no method named `with_icon_templated` found for struct `TrayIconBuilder` in the current scope
       >   --> crates/vykar-gui/src/tray.rs:81:10
       >    |
       > 78 |       let tray = TrayIconBuilder::new()
       >    |  ________________-
       > 79 | |         .with_menu(Box::new(menu))
       > 80 | |         .with_tooltip(APP_TITLE)
       > 81 | |         .with_icon_templated(icon)
       >    | |_________-^^^^^^^^^^^^^^^^^^^
       >    |
       > help: there is a method `with_icon_as_template` with a similar name
       >    |
       > 81 -         .with_icon_templated(icon)
       > 81 +         .with_icon_as_template(icon)
       >    |
       >
       > For more information about this error, try `rustc --explain E0599`.
       > error: could not compile `vykar-gui` (bin "vykar-gui") due to 1 previous error
       For full logs, run:
         nix log /nix/store/y735fgjmwhb65zacwq3jk3vpdlwa940k-vykar-gui-0.20.1.drv

Not in use since `db89109` and keeping it breaks the nix build.
@jonknapp

jonknapp commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Ignore this for now. I ran build locally but not specifically for vykar-gui. I'll track down the issue and submit a fix.

@jonknapp

jonknapp commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Additional context while working on a fix:

In tray-icon 0.26.0 and the repository’s main branch:

  • with_icon_templated(Icon) exists, but only on macOS.
  • Linux and Windows should use with_icon(Icon).
  • with_icon_as_template(bool) is deprecated in 0.26.

Updated tray.rs with target-specific builder selection so the Nix/Linux build uses .with_icon(icon), while macOS uses .with_icon_templated(icon).

from the tray-icon changelog, [0.26.0]

930505e (#377 by @amrbashir) Add TrayIcon::set_icon_templated and TrayIconBuilder::with_icon_templated on macOS, which set the icon and draw it as a template image in one call, so the template flag can never be left describing an icon that has since been replaced. Also add TrayIcon::icon_is_template to read that state back.

Deprecate TrayIcon::set_icon_as_template, TrayIcon::set_icon_with_as_template and TrayIconBuilder::with_icon_as_template in favour of them. TrayIcon::set_icon now also clears TrayIconAttributes::icon_is_template, which used to keep saying true for an icon it no longer described. 
  • with_icon_templated(icon) is the new API, but macOS-only.
  • with_icon_as_template(bool) is deprecated.
  • On Linux, use plain with_icon(icon)

The target-specific implementation now follows the changelog and avoids the deprecated API.

@jonknapp jonknapp changed the title Remove xdotool from nix install fix(nix/linux): allow tray-icon to compile on linux Oct 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant