slgobinath / gcalendar Goto Github PK
View Code? Open in Web Editor NEWRead-only Google Calendar utility for Linux
License: GNU General Public License v3.0
Read-only Google Calendar utility for Linux
License: GNU General Public License v3.0
Google Calendar Desklet users keep asking for reminder support. However, I have noticed that Google Calendar API does not support reading reminders and there is a feature request added on Apr 7 2016 but not resolved yet.
I am not sure if the famous tool gcalcli
supports reminders or not. According to the GitHub issue insanum/gcalcli#337 it looks like a NO. Therefore I leave this feature request open until Google introduces a new API to retrieve reminders.
I have been using the Google Calendar deskjet in Cinnamon without any problem for a long time. It has stopped working a few months ago. This morning I am trying to make it work again.
issuing the command gcalendar gives me the answer ''Failed to connect Google calendar''
I have tried issuing gcalendar --reset and then going through the authorization procedure again. This procedure completes but when I issue the command gcalendar again I still get ''Failed to connect Google calendar''
looking to other old posts with similar problem I have run
git clone https://github.com/slgobinath/gcalendar.git
cd gcalendar
python3 -m gcalendar --debug
The output is the following
Failed to connect Google Calendar
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/gabriele/gcalendar/gcalendar/main.py", line 219, in
main()
File "/home/gabriele/gcalendar/gcalendar/main.py", line 213, in main
handle_error(ex, "Failed to connect Google Calendar", args.output, args.debug)
File "/home/gabriele/gcalendar/gcalendar/main.py", line 86, in handle_error
raise error
File "/home/gabriele/gcalendar/gcalendar/main.py", line 187, in main
calendar_events = g_calendar.list_events(selected_calendars, start_time, end_time, time_zone)
File "/home/gabriele/gcalendar/gcalendar/gcalendar.py", line 90, in list_events
start_time, end_time, time_zone)
File "/home/gabriele/gcalendar/gcalendar/gcalendar.py", line 113, in retrieve_events
start_date_time = parser.isoparse(event["start"]["dateTime"]).astimezone(time_zone)
AttributeError: module 'dateutil.parser' has no attribute 'isoparse'
Thanks for any help.
Gabriele
I am running Debian 11 with the Cinnamon desktop, and am using the Google Calendar desklet. This used to work fine, but at some point (I don't really remember when), the desklet began displaying times in UTC. While troubleshooting, I discovered that gcalendar seems to be the culprit. I've not made any time related tweaks to my system, and the times displayed in Google Calendar (web based on this computer and app based on my phone) show the times in the proper time zone.
Any help is greatly appreciated.
jim@debian:~$ cat /etc/timezone
America/New_York
jim@debian:~$ gcalendar
2023-06-15:00:00 - 2023-06-16:00:00 Forecast for 01507 (75° | 55°)
2023-06-16:00:00 - 2023-06-17:00:00 Forecast for 01507 (78° | 58°)
2023-06-16:15:30 - 2023-06-16:16:30 Haircut
2023-06-16:23:10 - 2023-06-17:02:10 ⚾️ New York Yankees @ Boston Red Sox Watch on NESN (Ch 037, 304), NESNHD (Ch 774)
2023-06-17:00:00 - 2023-06-18:00:00 Forecast for 01507 (63° | 55°)
2023-06-17:23:15 - 2023-06-18:02:15 ⚾️ New York Yankees @ Boston Red Sox Watch on NESN (Ch 037, 304), NESNHD (Ch 774), NESNPLD (Ch 760), NESNPL (Ch 340), FXDEP (Ch 321), WFXTDT (Ch 786), WFXT (Ch 006), FXDEPHD (Ch 873)
2023-06-17:23:30 - 2023-06-18:01:15 New England Revolution - Orlando City SC
2023-06-18:00:00 - 2023-06-19:00:00 Forecast for 01507 (69° | 52°)
2023-06-18:00:00 - 2023-06-19:00:00 New moon 12:37am
2023-06-18:00:00 - 2023-06-19:00:00 Father's Day
2023-06-18:23:10 - 2023-06-19:02:10 ⚾️ New York Yankees @ Boston Red Sox Watch on FS1HD (Ch 763), FS1 (Ch 039, 305), ESPNHD (Ch 773), ESPND (Ch 272), ESPN (Ch 034, 301), ESPNDHD (Ch 872)
2023-06-19:00:00 - 2023-06-20:00:00 Juneteenth
2023-06-19:23:40 - 2023-06-20:02:40 ⚾️ Boston Red Sox @ Minnesota Twins Watch on NESN (Ch 037, 304), NESNHD (Ch 774)
2023-06-20:23:40 - 2023-06-21:02:40 ⚾️ Boston Red Sox @ Minnesota Twins Watch on NESN (Ch 037, 304), NESNHD (Ch 774), NESNPLD (Ch 760), NESNPL (Ch 340)
2023-06-21:23:40 - 2023-06-22:02:40 ⚾️ Boston Red Sox @ Minnesota Twins Watch on NESN (Ch 037, 304), NESNHD (Ch 774), NESNPLD (Ch 760), NESNPL (Ch 340)
jim@debian:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
jim@debian:~$
gcalendar --debug
Failed to connect Google Calendar
Traceback (most recent call last):
File "/usr/bin/gcalendar", line 11, in
load_entry_point('gcalendar==0.4', 'console_scripts', 'gcalendar')()
File "/usr/lib/python3/dist-packages/gcalendar/main.py", line 213, in main
handle_error(ex, "Failed to connect Google Calendar", args.output, args.debug)
File "/usr/lib/python3/dist-packages/gcalendar/main.py", line 86, in handle_error
raise error
File "/usr/lib/python3/dist-packages/gcalendar/main.py", line 187, in main
calendar_events = g_calendar.list_events(selected_calendars, start_time, end_time, time_zone)
File "/usr/lib/python3/dist-packages/gcalendar/gcalendar.py", line 90, in list_events
start_time, end_time, time_zone)
File "/usr/lib/python3/dist-packages/gcalendar/gcalendar.py", line 113, in retrieve_events
start_date_time = parser.isoparse(event["start"]["dateTime"]).astimezone(time_zone)
AttributeError: module 'dateutil.parser' has no attribute 'isoparse'
Hi,
Really love the effort you have put into this desklet. This should be a relatively simple feature request. I would like to display two different calendars on two different locations. This would display the information in an organized manner and decrease the clutter. Thanks.
Gcalendar in terminal is working, but desklet not.
Hello, I have toggled "show calendar week" off in my Google Calendar settings, but it still gets pulled even after gcalendar --reset. Is there a way to turn this off?
I have a dedicated machine that I leave running all the time, and stay logged in all the time. After a day or three of running gcalendar will show only "GLib.Error g-unix-error-quark: Too many open files". I noticed that this is referenced as far back as four months at: https://cinnamon-spices.linuxmint.com/desklets/view/35.
I haven't checked your source, but it seems that the applet might have a file handle cleanup issue?? This is the only app that does this. No errors noted in the .xsessions-errors file.
Hi,
I'm using Manjaro cinnamon. After the last update gcalendar disapperead from the desktop.
Now if I launch gcalendar in a terminal, I have the following errors:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 582, in _build_master
ws.require(requires)
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 899, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 790, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.6 (/usr/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'gcalendar'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/gcalendar", line 33, in
sys.exit(load_entry_point('gcalendar==0.3', 'console_scripts', 'gcalendar')())
File "/usr/bin/gcalendar", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/usr/lib/python3.8/site-packages/gcalendar/main.py", line 30, in
from gcalendar.gcalendar import GCalendar
File "/usr/lib/python3.8/site-packages/gcalendar/gcalendar.py", line 22, in
from googleapiclient import discovery
File "/usr/lib/python3.8/site-packages/googleapiclient/discovery.py", line 49, in
import google.api_core.client_options
File "/usr/lib/python3.8/site-packages/google/api_core/init.py", line 20, in
from pkg_resources import get_distribution
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 3257, in
def _initialize_master_working_set():
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 3240, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 3269, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 584, in _build_master
return cls._build_from_requirements(requires)
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 597, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.8/site-packages/pkg_resources/init.py", line 785, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'rsa<4.1,>=3.1.4' distribution was not found and is required by gcalendar
What can I do?
Thanks a lot in advance
Roberto
gcal version: 0.4.1
Kernel: 5.4.0-89-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 5.0.6
wm: muffin dm: LightDM Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal
I have the desklet setup for myself on my computer, as well as for other family members on theirs.. And in each case, this app doesn't seem to be updating it's displayed information automatically, as time passes. I have to manually go into the desklet's configuration window, and select "Reload [email protected]" from the option menu in there, in order to have it correctly update/display schedules.. Otherwise, after a day goes by, it will still show yesterday's date as "Today", and displays outdated information.
I can type gcalendar into the terminal, and that outputs the correct info there, but for some reason the desklet itself just won't automatically update without entirely reloading.
I want to create a fork with some code that highlights the text on the desklet
It seems multi day events are shown on the desklet display only on the day they begin, even if that day is prior to the current day, and with no indication of their continuation to other days.
This makes it impossible to tell on what days they actually occur, and it clutters the display by showing the past dates they started.
Google Calendar showing multi day events extending to and past today:
Desklet showing only start dates:
Request: List multi day events on every day they occur. Maybe add something like "start" on the first day, "continued" on subsequent days, and "end" on the last day. Do not, or add an option to not, show their start day or other days during the event prior to the current day (or past the end of the number of days the desklet is set to include).
I guess another option would be to list the event only on the start day, or the current day if the event started before the current day, with "until <end date>" or maybe "<start date> to <end date>" displayed on the right (where the time would be for a non all day event). This would be less cluttered though maybe less easy to interpret at a glance, and would have the advantage of indicating the end date even if it is beyond the desklet's limit, but the utility of the latter may be limited.
The following error occurred while running gcalendar
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 791, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (rsa 4.6 (/usr/lib/python3.8/site-packages), Requirement.parse('rsa<4.1,>=3.1.4'), {'gcalendar'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/gcalendar", line 33, in <module>
sys.exit(load_entry_point('gcalendar==0.2', 'console_scripts', 'gcalendar')())
File "/usr/bin/gcalendar", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3.8/site-packages/gcalendar/__main__.py", line 30, in <module>
from gcalendar.gcalendar import GCalendar
File "/usr/lib/python3.8/site-packages/gcalendar/gcalendar.py", line 22, 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
File "/usr/lib/python3.8/site-packages/google/api_core/__init__.py", line 20, in <module>
from pkg_resources import get_distribution
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3261, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3244, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3273, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'rsa<4.1,>=3.1.4' distribution was not found and is required by gcalendar
Related to linuxmint/cinnamon-spices-desklets#540
Hi there i frequently get an error - Unknown Error Glib.error g-unix-error-quark: Too many open files.
Reloading the desklet does nothing, and the only way to resolve is to restart the desktop.
When I run gcalendar, the browser window comes up and I log in, click Allow, etc. After the process is over, the terminal window says the following:
/usr/lib/python3/dist-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/mike/.config/gcalendar/mikefreeman1972_v1.dat: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?client_id=1097830982036-5opi3qc4lje5ak0so1mjg0icktiiu289.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A48935%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar.readonly&access_type=offline&response_type=code
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
--noauth_local_webserver
Authentication successful.
Failed to connect Google Calendar
After this, if I activate the Google Calendar desklet, nothing appears on the screen. Looking in the configuration window for the desklet, everything that looks like it should have some value or information in it is blank. This is on Linux Mint 20.
It would be useful to be able to list past events with the terminal client. By making the change
# start_time = str(current_time.isoformat())
start_time = str((current_time - relativedelta(days=no_of_days)).isoformat())
in main.py
the terminal client outputs past events, so there is no API restriction to doing this. I would try to add this myself, but I do not know enough python to understand the command line argument parsing.
Hi! I love gcalendar and have been using it for quite a while. I would love to see a similar to-do list desklet that shows up on the desktop all the time. Really appreciate the work that you're doing. Thanks.
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.