All Projects → rosenpin → I3 Agenda

rosenpin / I3 Agenda

Licence: unlicense
Show your next google calendar event in polybar or i3-bar

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to I3 Agenda

Daylight-Calendar-ICS
Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
Stars: ✭ 22 (-64.52%)
Mutual labels:  calendar, google-calendar
bhitte-patro
Google Calendar for Nepali Date
Stars: ✭ 25 (-59.68%)
Mutual labels:  calendar, google-calendar
taskwarrior-syncall
Synchronization between Taskwarrior tasks and services such as Google Calendar, Notion and Google Keep. Formerly taskw_gcal_sync
Stars: ✭ 151 (+143.55%)
Mutual labels:  calendar, google-calendar
aircal
Visualize Airflow's schedule by exporting future DAG runs as events to Google Calendar.
Stars: ✭ 66 (+6.45%)
Mutual labels:  calendar, google-calendar
Fb2cal
Fetch Facebook Birthdays events and create an ICS file for use with calendar apps
Stars: ✭ 335 (+440.32%)
Mutual labels:  google-calendar, calendar
datebook
📅 Generates URLs and downloadable ICS files for adding events to popular calendar apps.
Stars: ✭ 273 (+340.32%)
Mutual labels:  calendar, google-calendar
node-google-calendar
Simple node module that supports Google Calendar API
Stars: ✭ 76 (+22.58%)
Mutual labels:  calendar, google-calendar
prodcal ics
Производственный календарь в формате ics
Stars: ✭ 23 (-62.9%)
Mutual labels:  calendar, google-calendar
calendar-link
📅 Calendar link generator for popular services
Stars: ✭ 193 (+211.29%)
Mutual labels:  calendar, google-calendar
weather-calendar-feed
Display yr.no weather (supports the entire Earth) forecasts with highly customizable Event titles in your Google Calendar, Android phone, iPhone, Outlook or other iCalendar app
Stars: ✭ 16 (-74.19%)
Mutual labels:  calendar, google-calendar
Add Event To Calendar Docs
📅 Docs how to generate links to add events to online calendar services
Stars: ✭ 193 (+211.29%)
Mutual labels:  google-calendar, calendar
Laravel Google Calendar
Manage events on a Google Calendar
Stars: ✭ 787 (+1169.35%)
Mutual labels:  google-calendar, calendar
Alfred Gcal
View Google Calendar events in Alfred
Stars: ✭ 147 (+137.1%)
Mutual labels:  google-calendar, calendar
infocenter
Raspberry Pi weather, calendar, and internet radio with graphical, touch-based interface.
Stars: ✭ 18 (-70.97%)
Mutual labels:  calendar, google-calendar
Calendar.vim
A calendar application for Vim
Stars: ✭ 1,675 (+2601.61%)
Mutual labels:  google-calendar, calendar
google-calendar-api
Demo Project for Google Calendar API Using Spring Boot Rest API with OAuth2
Stars: ✭ 25 (-59.68%)
Mutual labels:  calendar, google-calendar
Outlookcaldavsynchronizer
Sync Outlook with Google, SOGo, Nextcloud or any other CalDAV/CardDAV server
Stars: ✭ 560 (+803.23%)
Mutual labels:  google-calendar, calendar
Phpcalfeed
A simple PHP script for providing calendar feeds for your website in a variety of different formats including iCalendar, RSS, JSON and XML.
Stars: ✭ 31 (-50%)
Mutual labels:  google-calendar, calendar
Fennel
Fennel is your lightweight CalDAV and CardDAV server to run-your-own
Stars: ✭ 46 (-25.81%)
Mutual labels:  calendar
Applescripts
My collection of AppleScripts created/acquired over the years. This repo is designed to provide useful AppleScripts for others and as a general resource for AppleScript education.
Stars: ✭ 56 (-9.68%)
Mutual labels:  calendar

AUR version PyPI

What is this?

It's a script that communicates with Google's calendar API, it will go through your calendars and print the next calendar event details.
You can take this output and show it on your i3-bar or polybar

example

How does it work

It will read your next 10 events from each of your calendars, then go through them all and figure out which one is closest.
It will print the time and title of the closest event.

Setup

Google API

https://developers.google.com/calendar/quickstart/python

  1. You need to create a Google API project and download your OAuth 2.0 credentials json file.
    You first need to create a project here, then add Google Calendar support, then download the credentials.json file.
    Alternatively, you can just use this link and click "Enable the Google Calendar API". This will create a project, add Google Calendar support, and let you download the file in 1 click.
    If you're having trouble, you can use this tutorial for more information https://developers.google.com/calendar/auth.
    Another great guide can be found here if you're still having trouble: https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile.
  2. Download the credentials file to somewhere on your computer.
  3. Proceed to installation phase.

Installation

After downloading the credentials file, install the package.

Pip

  1. sudo pip install i3-agenda
  2. Try running i3-agenda -c $CREDENTIALS_FILE_PATH with "$CREDENTIALS_FILE_PATH" replaced with the path to the credentials.json file you downloaded in the previous step.
  3. Add configuration to your bar (examples in the Examples section below).

Arch Linux (AUR)

  1. yay -S i3-agenda-git
  2. Try running i3-agenda -c $CREDENTIALS_FILE_PATH with "$CREDENTIALS_FILE_PATH" replaced with the path to the credentials.json file you downloaded in the previous step.
  3. Add configuration to your bar (examples in the Examples section below).

Manual

Dependencies

You need to install some python libraries first.
Make sure python3 is your default python.
Run sudo pip3 install python-bidi google-api-python-client google-auth-httplib2 google-auth-oauthlib

  1. Clone the repo to a local directory cd ~/ && git clone https://github.com/rosenpin/i3-agenda && cd i3-agenda
  2. Run the script python3 i3_agenda/__init__.py -c $CREDENTIALS_FILE_PATH with "$CREDENTIALS_FILE_PATH" replaced with the path to the credentials.json file you downloaded in the previous step. If configured correctly, it will prompt you to log in in your browser, accept everything. It should print your next event.
  3. Optional: you can run sudo python setup.py install to add the script to your path so you can run i3-agenda anywhere.
  4. Add configuration to your bar (examples in the Examples section below).

Usage

  -h, --help            show this help message and exit
  --credentials CREDENTIALS, -c CREDENTIALS
                        path to your credentials.json file
  --cachettl CACHETTL, -ttl CACHETTL
                        time for cache to be kept in minutes
  --update, -u          when using this flag it will not load previous results from cache, it will however save new results to cache. You can use this flag to refresh all the cache forcefully
  --ids IDS [IDS ...], -i IDS [IDS ...]
                        list of calendar ids to fetch, space separated. If none is specified all calendars will be fetched
  --maxres MAXRES, -r MAXRES
                        max number of events to query Google's API for each of your calendars. Increase this number if you have lot of events in your google calendar
  --today, -d           print only today events
  --no-event-text TEXT  text to display when there are no events
  --hide-event-after MINUTES
                        minutes to show events after they start before showing the next event. If not specified, the current event will be shown until it ends
  --date-format DATEFORMAT
                        the date format like %d/%m/%y. Default is %d/%m

Filter displayed calendars

To display events only from certain calendars use the --ids parameter and pass a list of calendar id, space separated.
To obtain the calendar id you can check the settings page of the calendar on Google (usually is the owner email, if it's not shared).
Leaving the list empty will fetch all calendars (default behavior).

Notes

Known issues

It might not work properly if you have more than 10 all day events, this can be fixed by increasing the maxResults variable.

Caching

It uses a caching mechanism so you won't have to contact Google servers every minute, to set the cache TTL use the -ttl flag.
Example: i3-agenda --ttl 60 to set the TTL to 60 (meaning it will contact Google again every hour).
This means that if you create a new event, it might take an hour for the script to recognize it.

Examples

Example polybar configuration:

modules-center = agenda
....
[module/agenda]
type = custom/script
; Show the next event and forget cache automatically every 60 minutes
exec = i3-agenda -c ~/.google_credentials.json -ttl 60
; left click to launch Google Calendar
click-left = chromium https://calendar.google.com/calendar/r/day
; right click force update the cache, if for example you just added a new event
click-right = notify-send "syncing..." && i3-agenda -c ~/.google_credentials.json --update && notify-send -t 2000 "sync finished"
interval = 60

Example i3block configuration:

[i3-agenda]
command=i3-agenda -c ~/.google_credentials.json -ttl 60
interval=60

Example output of the script:
10:55 Grocery shopping

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].