crabvk / bar-protonmail Goto Github PK
View Code? Open in Web Editor NEWA Waybar/Polybar module for ProtonMail
License: MIT License
A Waybar/Polybar module for ProtonMail
License: MIT License
Every time I write a message, delete a message, move a message Etc. the sound I am using for messages goes off. Including (since I have the interval set to 10) going off every 10 seconds while I am writing a new message. Is there a way (other than changing the interval) to make it only sound when you receive a new message to your inbox? I am sure it is something simple that I just haven't figured out yet, but wanted to make sure I wasn't just missing something. In case this part matters, I am using polybar with the module looking like this:
[module/protonmail]
type = custom/script
exec = bar-protonmail -f polybar -b "%{F#8A2BFF}%{T2}๏ญ%{T-}%{F-} %{T1}" -s message-new-instant
interval = 10
click-left = xdg-open https://mail.protonmail.com/u/0/inbox
Is it possible to hide the module when there are no new emails in the inbox?
Thanks!
Similar to crabvk/bar-gmail#35 in bar-gmail, I get a notification when spam is received in protonmail.
I just did a reinstall of my linux laptop and when I was grabbing this the changes here:
did not show up, it still had the old values, and I had to go in and manually edit the file to make it work. Like I said I'm not sure if it is something I did wrong or, if it isn't actually showing up when you do the pip install bar-protonmail
command. Just wanted to let ya know in case there is an issue so you can fix it. :)
auth.json
is expected to be json
and in my case it was not.
It might be useful for others to realise auth.json
should be formatted as such:
{
"UID": "your-uid",
"AccessToken": "valid access token"
}
Hi! I stumbled across this today since I recently switched to waybar and was wondering if there was a ProtonMail module for it, and found your repository. I tinkered around with it for a while, but ultimately wasn't able to find the AUTH token and refresh token mentioned in the README so I decided to make my own since it appeared that this method had been deprecated.
I did some research and found an official ProtonMail library, and used it to make mine. It works with waybar, i3blocks, polybar, and yabar, and, given your email and password, checks the amount of unread emails in your ProtonMail inbox. I just thought I'd let you know, since your work inspired me and without seeing it I wouldn't have gotten the impetus to go and look into making my own. Thank you ๐
Pip installation currently fails due to proton-client version requirements.
pip install bar-protonmail
Defaulting to user installation because normal site-packages is not writeable
Collecting bar-protonmail
Using cached bar_protonmail-1.0.0-py3-none-any.whl (8.7 kB)
ERROR: Could not find a version that satisfies the requirement proton-client>=0.7.1 (from bar-protonmail) (from versions: 0.0.4.linux-x86_64, 0.5.1.linux-x86_64, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.4.0, 0.4.1, 0.5.1)
ERROR: No matching distribution found for proton-client>=0.7.1
Hi, I was wondering where and how bar-protonmail stores my credentials (email address and password)?
I have finally found a script to show my unread emails, Thank you.
Everytime I get a new email I get the following error on polybar, it goes away with the next interval (10 seconds) and returns to the icon and number format. But it happens with every new email. I have not changed the scripts and the following is the module setup I am using in Polybar:
[module/protonmail]
type = custom/script
exec = bar-protonmail -f polybar -b "%{F#8A2BFF}%{T2}๏ญ%{T-}%{F-} %{T1}" -s message-new-instant
interval = 10
click-left = xdg-open https://mail.protonmail.com/u/0/inbox
I have tried without the font and color modifiers and it still happens, so I am not sure what else to try.
Getting the following error. On arch with sway, this had been working until a few days ago, not sure what changed yet, but guessing maybe an api change.
I'll have a look at what's going on in the next day or two, I'm assuming you would take a PR if it's something simple?
bar-protonmail auth
Username: [username]
Password:
Traceback (most recent call last):
File "/usr/bin/bar-protonmail", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3.10/site-packages/bar_protonmail/__init__.py", line 34, in cli
auth.authenticate(CACHE_DIR, SESSION_PATH)
File "/usr/lib/python3.10/site-packages/bar_protonmail/auth.py", line 17, in authenticate
scope = session.authenticate(username, password)
File "/usr/lib/python3.10/site-packages/proton/api.py", line 387, in authenticate
info_response = self.api_request("/auth/info", payload)
File "/usr/lib/python3.10/site-packages/proton/api.py", line 219, in api_request
if not self.__metadata.try_original_url(
File "/usr/lib/python3.10/site-packages/proton/metadata/textfile_metadata.py", line 37, in try_original_url
self.__get_metadata_from_file()["last_api_call_time"]
File "/usr/lib/python3.10/site-packages/proton/metadata/textfile_metadata.py", line 82, in __get_metadata_from_file
metadata = json.load(f)
File "/usr/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 340, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 106 (char 105)
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.