cinny-desktop icon indicating copy to clipboard operation
cinny-desktop copied to clipboard

System Tray for Cinny Desktop

Open unexploredtest opened this issue 2 years ago • 1 comments

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

unexploredtest avatar May 09 '22 06:05 unexploredtest

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.

hollisticated-horse avatar Oct 18 '22 21:10 hollisticated-horse

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.

hollisticated-horse avatar Nov 03 '22 15:11 hollisticated-horse

We'll have to bundle in the flatpak libayatana-appindicator or libappindicator3 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 avatar Nov 03 '22 15:11 kfiven

@kfiven Oh dear. Any thread I can look at about that ?

hollisticated-horse avatar Nov 03 '22 15:11 hollisticated-horse

Join #flatpak:matrix.org matrix room and search for "appindicator".

kfiven avatar Nov 03 '22 15:11 kfiven

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
      })

#listening-to-system-tray-events

hollisticated-horse avatar Nov 03 '22 17:11 hollisticated-horse

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 avatar Nov 15 '22 09:11 serxka

@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 avatar Nov 15 '22 17:11 hollisticated-horse

@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 avatar Nov 15 '22 20:11 serxka

@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?

toymil avatar Jan 01 '23 10:01 toymil

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.

serxka avatar Jan 01 '23 10:01 serxka

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.

toymil avatar Jan 01 '23 10:01 toymil

Does this look acceptable?

serxka avatar Jan 01 '23 10:01 serxka

Looks good to me 👍

toymil avatar Jan 01 '23 12:01 toymil

Real, I need this feature. I got into an argument about a missed notification.

koyuawsmbrtn avatar Sep 16 '23 21:09 koyuawsmbrtn