Closed qdot closed 7 years ago
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
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.
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. :(
A minor point, but set_icon_from_stock
would be a really nice addition. The stock names can be found under GTK_STOCK_*
here.
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 :/
@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.
@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 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.
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.
From the looks of the go library implementation, this doesn't look like it's gonna be fun.