Skip to main content

适用于 Linux 的简单轻量级 GoogleCalendar 通知程序

项目描述

SimpleGCalendarNotifier

适用于 Linux 的简单轻量级 GoogleCalendar 通知程序

这个应用程序专注于提供多功能性和简单性,并提供一个非常轻量级的命令行应用程序,可以提醒您在 Google 日历中的活动。

该项目受到gcalcli的启发,并寻找更多基本功能并且可以处理多个 Google 帐户和日历。

安装

目前,这个包只能通过PyPi

从 PyPi 安装

pip install gcal_notifier

特征

  • 从所有帐户中获取 Google 事件
  • 通知事件
  • 使用 Cron 作业来尽可能减少一切

用法

gcal_notifier --help
usage: gcal_notifier [-h] {get,notify,print} ...

A simple and lightweight GoogleCalendar notifier for Linux.

positional arguments:
  {get,notify,print}  Invoking a subcommand with --help prints subcommand usage.
    get               fetch events from Google Calendar and save them in cache.
    notify            run reminders with cached events.
    print             print events to the console.

options:
  -h, --help          show this help message and exit

证书

要使所有这些工作,您必须为要使用的每个帐户创建凭据。注意:这部分是从gcsa README 复制和粘贴的。

  1. 创建一个新的Google Cloud Platform (GCP) 项目

  2. 配置OAuth 同意屏幕

  3. 创建 OAuth 客户端 ID 凭据 并下载credentials.json文件

  4. 将下载credentials.json的文件放入~/.config/gcal_notifier/default

在Authentication中查看更多选项。

笔记:

在第一次运行时,您的应用程序将提示您进入默认浏览器以获取您使用日历的权限。这将在同一文件夹中创建 token.pickle 文件。

配置

获得文件后credentials.json,您可以运行gcal_notifier get 以查看是否一切正常。

如果是这样,是时候设置你的 cron 作业了。

  1. 运行crontab -e以编辑您的 cron 作业。

  2. 选择您要运行的间隔getremind。这意味着您可以在检查提醒的不同时间间隔内获取事件。例如,我个人的偏好是:

*/10 * * * *  gcal_notifier get
* * * * *  gcal_notifier remind

因此,它每 10 分钟运行一次以获取事件,但每分钟查找一次提醒。

而已!你都准备好了!

配置

您现在可以配置一些东西(希望以后更多),所有配置都在一个文件中完成~/.config/gcal_notifier/config.ini

支持的每个配置的示例是:

[GENERAL]
# Returns only one event for recurrent events. Default is true
single_events = true
# How to order the events. Default (and recommended) is startTime
order_by = startTime
# Custom notification sound, if you would like to choose (it has to be a wav file).
notification_sound = ~/Music/my_notification.wav

[CALENDAR1]
# Name given to the calendar. Default is 'Calendar'
name = NAME1
# Name or ID of the calendar. Required.
calendar = example@gmail.com
# Reminders to your events, up to 5 integers separated by commas. Default is None
default_reminders = 10,0
# Path to the credentials file. Default is ~/.config/gcal_notifier/credentials.json
# credentials = ~/.config/gcal_notifier/credentials_file.json

[CALENDAR2]
name = NAME2
calendar = xxxxxxxxxxxxxxxxxxxxxxxx@group.calendar.google.com
default_reminders = 10,0
credentials = ~/.config/gcal_notifier/credentials_other_account.json

[CALENDAR3]
name = NAME3
calendar = other@gmail.com
.
.
.

把招工广告!

如果您发现此项目有用,请随时贡献或报告问题。你可以随时给我发电子邮件thalesaknunes22@gmail.com

快乐编码!

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

gcal_notifier-1.1.3.tar.gz (210.6 kB 查看哈希

已上传 source

内置分布

gcal_notifier-1.1.3-py3-none-any.whl (209.8 kB 查看哈希

已上传 py3