-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Calendar block #2056
Add Calendar block #2056
Conversation
I'd suggest making this a calendar block and letting google be one of several providers, or perhaps use CalDAV by default since most calendars (including Google) support that. |
Hey @bim9262, thanks for the suggestion. I did not know the CalDav protocol. I'll try to push an implementation for that. |
824ee49
to
247513b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to be able to leverage https://crates.io/crates/caldav-utils, which seems to be the most used async caldav library, but it's missing oauth.
//! token_url = "https://oauth2.googleapis.com/token" | ||
//! auth_token = "~/.config/i3status-rust/calendar.auth_token" | ||
//! redirect_port = 8080 | ||
//! scopes = ["https://www.googleapis.com/auth/calendar", "https://www.googleapis.com/auth/calendar.events"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I would have thought that the readonly versions of the scopes would be valid. However that doesn't seem to be the case. I opened an issue about it: https://issuetracker.google.com/issues/342730758
That would be nice. Unfortunately, I did not find Rust clients that support OAuth2 or have a way to intercept HTTP errors in a usable way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of unwraps that should be handled too.
BTW good work on this, your contribution is appreciated :)
Ah yep, I forgot to properly handle those cases 😅 .
Thanks 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still seems like a lot of unwrap
s.
You'll need to rebase on master to fix the merge error.
|
I know both panic. I changed to |
Can you have more than one calendar source in the same block? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 2 little changes to Cargo.toml, and we're set. I've tested it out and everything looks good to me.
Looks like Cargo.lock didn't get updated to reflect once_cell being removed. |
Thanks @luca-iachini !! |
This PR adds a Calendar block that displays upcoming events.