Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Add Linux core #5

Closed
qdot opened this issue Feb 23, 2017 · 10 comments
Closed

Add Linux core #5

qdot opened this issue Feb 23, 2017 · 10 comments

Comments

@qdot
Copy link
Owner

qdot commented Feb 23, 2017

From the looks of the go library implementation, this doesn't look like it's gonna be fun.

@jonhoo
Copy link

jonhoo commented Feb 24, 2017

FWIW, I really really really want to port https://github.com/jonhoo/hasmail to Rust, so I'm very excited about the prospect of getting a decent Rust systray implementation :D

@qdot
Copy link
Owner Author

qdot commented Feb 25, 2017

Ok. Step 1 is making libappindicator bindings. That'll be happening over here: https://github.com/qdot/libappindicator-sys

Once I get those done (which hopefully, using rust-bindgen, won't take too long, but it's my first time trying that), I /think/ porting this will just be a combination of using those bindings and gtk-rs.

@qdot
Copy link
Owner Author

qdot commented Mar 2, 2017

So as of right now, the linux-core branch is basically usable. It'll make a systray menu with an icon, and you can add items to it that will call closures. I'm going to work on updating the windows code to work with the new format, then merge everything back into master.

As for getting this onto crates.io, that's a little more difficult, due to #6. I'm hoping the gtk project will cut new releases of their crates soon, which will hopefully update the cvec library and fix the issue. Until then, we may be stuck with repo dependencies for linux. :(

@jonhoo
Copy link

jonhoo commented Mar 2, 2017

A minor point, but set_icon_from_stock would be a really nice addition. The stock names can be found under GTK_STOCK_* here.

@jonhoo
Copy link

jonhoo commented Mar 2, 2017

It's also unfortunate that wait_for_message takes &mut self, as it means I can't have another thread concurrently running that updates the status icon :/

@qdot
Copy link
Owner Author

qdot commented Mar 2, 2017

@jonhoo I'm trying to figure out what icon "resources" should look like, since we can load from resource on windows, from themes/stock on linux, and haven't even bothered to check what the situation on os x is. Filed #12 to follow up on that.

@qdot
Copy link
Owner Author

qdot commented Mar 2, 2017

@jonhoo Yeah just file issues for all this stuff. This bug was just to get something working on > 1 platform, so we could start solidifying the general API a bit more.

@jonhoo
Copy link

jonhoo commented Mar 2, 2017

Also, if you're curious, first user of systray-rs is now up: buzz.

@qdot
Copy link
Owner Author

qdot commented Mar 2, 2017

@jonhoo Great! Just curious, are you only supporting this on linux, or will it be on other platforms too? I'm trying to figure out what I'm going to do about branching for linux support while I wait for the gtk crate version updates.

@jonhoo
Copy link

jonhoo commented Mar 2, 2017

For now it is Linux-only since that's the platform I'm using. However, down the line I could see both macOS and Windows support. The biggest barrier to that apart from systray-rs is a) a way to do notifications cross-platform (buzz currently just invokes notify-send), and b) finding the right config file paths on those platforms.

I think having a git dependency and not pushing an updated version to crates.io for now is fine.

@qdot qdot closed this as completed in 3a013db May 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants