cinny-desktop
cinny-desktop copied to clipboard
System Tray for Cinny Desktop
Describe the problem
Currently Cinny Desktop doesn't have tray system, it would be a great addition if it had.
Describe the solution you'd like
Implement tray system.
Alternatives considered
No response
Additional context
https://tauri.studio/guides/examples/system-tray
Hey everyone, is anybody working on a sys-tray icon for the desktop app ? I'm looking at the tauri doc, and since I'm not familiar with rust and Tauri, i'm wondering if I need to make a new .rs file in the tauri src folder, following the doc ? I'm not sure if that's how it works.
Okay, getting some progress, I now have a tray icon, with hide and quit sub-menus.
i still don't know how to make a seperate .rs file for the systray, and still build though.
(EDIT: okay, mod somthing
imports the systray )
We'll have to bundle in the flatpak libayatana-appindicator
or libappindicator3
for linux, according system-tray setup.
We'll have to bundle in the flatpak
libayatana-appindicator
orlibappindicator3
for linux, according system-tray setup.
This could be a blocker for it. Last time someone tried to implement system-tray and building flatpak from source, it failed.
@kfiven Oh dear. Any thread I can look at about that ?
Join #flatpak:matrix.org matrix room and search for "appindicator".
Any way to call an tauri API but have the parameters in another .rs file ?
builder
.on_system_tray_event(|app, event| match event {
some parameters and logic that I don't want in main.rs
})
I have written some code for a tray icon, currently works to just hide and show it. I am currently looking into bundling libayatana-appindicator
into the flatpak, if anyone wants to help with that it would be appreciated.
@serxka i'd love to have a look at your code :D I was also stuck at hide | show. I don't know what else needs to be included in the tray menu ? Have you asked on the flatpak matrix channel ?
@hollisticated-horse Sure, here's my fork. Also not sure what else needs to be added. I think most other feature full stuff would require communicating with Cinny to some degree, I'm not sure if the main contributors have a way they would like to do that.
No, I haven't asked in the flatpak channel yet. I was trying to get it to just build at all :P I'm not familiar with flatpak one bit.
@serxka are you planning to make it a PR?
BTW I suggest separating tray related code into another mod
, and maybe mark it with #[cfg(target_os = "windows")]
to not worry about flatpak shenanigans for now (someone else can make another PR to make it work in Linux).
I might work on this, but I have not used tauri before, do you mind if I reference your code?
Ah sorry I had completely forgotten about this. I don't see any point in splitting it into another module to fence it to certain platforms. I've tested it on both Linux and Windows, and they both work as expected.
If you don't want to add anything I'll make a PR. You are free to reference the code, it's mostly adapted from the example code if I remember correctly.
Splitting is to make the file clean, not necessarily platform fencing.
The menu
code lives in a module right now, if anything, splitting makes it consistent.
Does this look acceptable?
Looks good to me 👍
Real, I need this feature. I got into an argument about a missed notification.