crabvk / bar-gmail Goto Github PK
View Code? Open in Web Editor NEWA Polybar module to show unread messages from Gmail
License: MIT License
A Polybar module to show unread messages from Gmail
License: MIT License
There should be a '&' after the click-left command.
[module/gmail]
type = custom/script
exec = ~/.config/polybar/gmail/launch.py
tail = true
click-left = xdg-open https://mail.google.com &
I'm on Arch Linux and am using i3wm-gaps. Everything works ok aside from the sounds. I get "Failed to play sound: IO Error" (appears where the module is in polybar) when I get an email.
I get the following errors when running launch.py after the update -
Traceback (most recent call last): File "/home/ashish/.config/polybar/scripts/gmail/launch.py", line 7, in <module> from apiclient import discovery, errors File "/usr/lib/python3.8/site-packages/apiclient/__init__.py", line 8, in <module> from googleapiclient import discovery File "/usr/lib/python3.8/site-packages/googleapiclient/discovery.py", line 49, in <module> import google.api_core.client_options
I use arch linux and i installed python-google-api-python-client and python-oauth2client packages from its official repository.
It looks like it's (maybe?) pulling the unread count from the session.json
file, which is being written by both instances, so when I have 1 email in "home" is is also showing 1 email in "work"
I have generated two credentials files and configured my polybar modules like this (edited to remove styling)
[module/gmail-home]
type = custom/script
interval = 60
exec = bar-gmail -f polybar -b "" -cr home/credentials.json
click-left = ~/.config/i3/scripts/open_gmail_home
[module/gmail-work]
type = custom/script
interval = 60
exec = bar-gmail -f polybar -b "" -cr work/credentials.json
click-left = ~/.config/i3/scripts/open_gmail_work
After running auth.py
, where should I store the credentials key?
Upon executing auth.py I am greeted with the message:
Authentication Disabled Temporarily for this Application in my web browser.
Hello,
I've started using your module in Polybar and it works great.
The only thing is that it tells me that I have 5525 emails which is true if I count the "Social" and "Promotions" emails that I never look into.
Would there be an option in Gmail API to select only the Primary content so it tells me I have 4 unread instead of 5524 ?
Thank you.
EDIT : I've looked into Gmail API and found that you can use Labels to search you're emails, including CATEGORY_PERSONAL
which is the category I would like to search. I think that is a good start to what I'm looking for. I will look into the code tomorrow to try it.
Hello,
I'm using your plugin. However, it notifies every new spam mail. Seems a bug.
Thanks.
Traceback (most recent call last):
File "/home/tadec/.config/polybar/gmail/auth.py", line 25, in
with open(CREDENTIALS_PATH, 'w') as creds_file:
PermissionError: [Errno 13] Permission denied: '/home/tadec/.config/polybar/gmail/credentials.json'
Hi, I have trouble going through with the google verification, this is the message I get after pasting the verif code into my terminal. I suppose it's something trivial, but I have no clue how to solve this.
Thanks!
I have switched from Polybar to Waybar since I moved to Hyprland and Wayland. I was wondering if you have any plans on making this available as a Waybar module too (like the protonmail one is). Would love to use it on Waybar as well. :)
I was trying to add the enhancement
label to this, but couldn't figure out how to add it. LOL
Hi,
Google just forced me to change my password for some reason so the credentials.json file I had is now invalid.
Trying to re-generate it, the request link it gives me returns this :
Access blocked: Polybar Gmail’s request is invalid
my email
You can’t sign in because Polybar Gmail sent an invalid request. You can try again later, or contact the [developer](https://accounts.google.com/) about this issue. [Learn more about this error](https://support.google.com/accounts/answer/12379384)
If you are a developer of Polybar Gmail, see [error details](https://accounts.google.com/).
Error 400: invalid_request
Clicking on that link gives this :
The out-of-band (OOB) flow has been blocked in order to keep users secure. Follow the Out-of-Band (OOB) flow migration guide linked in the developer docs below to migrate your app to an alternative method.
Request details: redirect_uri=urn:ietf:wg:oauth:2.0:oob
I tried updating some pip packages in case it might be an old library issue but no changes, not sure what I may be missing.
Or has there been an actual change to this on Google's side recently ?
Hello everyone,
I have 3 gmail accounts that I use daily for different purposes, and I'd like to show a counter of the unread emails on every account.
Is it possible to run 3 different instances of this module with polybar?
Thanks a lot in advance
I found your module nice, but I have a lot of unread and old emails. I had to make a small edit in launch.py to show the emails that were not read, but more recent. I simply added "newer_than: 5d" to the value that the "list" variable will receive. If it could be interesting to change the time as an argument to the script.
My source: https://support.google.com/mail/answer/7190?hl=en
In my dotfile: https://github.com/SeraphyBR/DotFiles/blob/master/config/polybar/gmail/launch.py
Is it possible to remove the message the module shows when the system is offline? I always get the following error
google.auth.exceptions.TransportError: Unable to find the server at oauth2....
and i cannot seem to disable it
For some unknown reason, my credentials.json
file emptied itself. This results in storage.get()
failing. To solve the problem i've added another condition to the if statement
if pathlib.Path(CREDENTIALS_PATH).is_file() and os.stat(CREDENTIALS_PATH).st_size != 0:
Don't know if that's an appropriate solution.
Can you please explain how to use the stuff in the last section "Get list of all your mailbox labels"?
I got an error in the launch.py:32 called invalid syntax
I installed the Dependencies with no error.
Hello,
I received the following message from google:
Although you don’t need to do anything, we wanted to let you know that the following apps may no longer be able to access some data in your Google Account, including your Gmail content. If these apps are unable to meet the deadline to comply with our updated data policy requirements, they'll lose access to your Account starting July 15th, 2019.
Polybar Gmail
We are making this change as part of ongoing efforts to make sure your data is protected and private.
You can always view, manage and remove apps you’ve given access to your account by visiting your Google Account.
How should I proceed?
Hello!
It's not a bug, just a suggestion. I'm using your plugin to display a counter of unread emails in my Polybar. I also use Dunst and would appreciate an option to enable or disable notifications in it. I attempted to modify the Dunst config file by adding 'bar-gmail' to suppress notifications, but I suspect I might not be using the correct 'appname' as it didn't work.
Thanks!
I'm trying to run this, but it doesn't work.
This is the exact code I'm using: https://github.com/vyachkonovalov/polybar-gmail#module
My whole polybar config I added that code to: https://github.com/electro7/dot_arch/blob/master/.config/polybar/config
Credentials are ok, and other, but it just doesn't show up with Polybar. I also don't understand how it should work, I'm trying to launch this on my terminal, ~/.config/polybar/gmail/launch.py
and I get this:
~
%{F#e06c75} %{F-}16266
~
in loop which should be used for updating gmail incoming mails. But I also tried to send myself a mail and it just keeps printing those strings, but not something different which should let me understand that I got new message.
Hi,
Is it possible to change the interval time of checking the mail? I think it's not working properly..
Basically sometimes whole day I've mail but not see any info from your module, now I just restart polybar and unfortunately, it did not catch my mails as well ;/
Thanks in advance!
A feature request:
It would be really nice if notifications could be clicked, and clicking them opened a browser to the specific message.
For my use case, since I use multiple emails with different browser profiles, I'd like to be able to customize the browser used, instead of just using the default browser.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.