Git Product home page Git Product logo

caldr's Introduction

caldr

caldr

caldr, the command line calendar. It's super lightweight, yet it supports CardDAV sync!

Build

go build .

Usage

Either export all necessary variables to your ENV or set them as command line flags:

export CARDDAV_USERNAME='...'
export CARDDAV_PASSWORD='...'
export CARDDAV_ENDPOINT='...'
export CALDR_DB='...'

If you're using Baïkal for example, you would export something like this as CARDDAV_ENDPOINT:

export CARDDAV_ENDPOINT='https://my.baik.al/dav.php/'

The CALDR_DB is the local events database in order to not need to contact the CalDAV for every lookup. You might set it to something like this:

export CALDR_DB=~/.cache/caldr.db

When caldr is launched for the first time, it requires the -r flag to refresh the events and sync them locally:

caldr -r

This way you could create a cron job that refreshes caldr in the background, e.g. every three hours:

crontab -e
0 */3 * * * sh -c 'caldr -r'

You can also output contacts as JSON format using the -j flag:

caldr -j

Find more flags and info with caldr --help.

Templating

You can customize the regular output using templating. The template can either be passed using the --template <file> flag or by exporting CALDR_TEMPLATE in the in the environment.

The templating format is the Go standard text/template format.

Available property names that are available can be found by checking the CalEvent struct in store/store.go.

An example template can be found here. To make use of the template, you can copy it to e.g. ~/.config/caldr.tmpl and have CALDR_TEMPLATE=~/.config/caldr.tmpl exported in your .zshrc/.bashrc/etc.

Notifications

Check my dotfiles, especially this script for how to get notifications for events. You could either run this script on login or periodically as a cron job.

FAQ

  • Q: Does caldr write/modify any contact information? A: Nope, so far it's read-only and does not support updating iCals, hence it won't mess with your data.
  • Q: Can I use it with my local calendar? A: Nope, as of right now caldr only supports CalDAV servers to sync with.
  • Q: Does it support HTTP Digest auth? A: Nope, only HTTP Basic auth.
  • Q: The text/template stuff doesn't work for me, can I make caldr output contact data differently? A: Yes, you can use the -j flag and have it output pure JSON, which you can then process using e.g. jq.

caldr's People

Contributors

mrusme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tdpeuter

caldr's Issues

OS Identity Provider

It would be good to wrk out how to add your own identity Provider for Desktop and Mobile !!

Screenshot 2023-08-10 at 16 47 42

then CalDav, CardDav, Bookmakrs, etc etc can be unified.

Users could just run a server anywhere and then sync using NATS Leaf node.

wrong principal-url used, get "404 Not Found"

When i'm trying to start caldr -r i get error 404 Not Found.
I'm using NextCloud as a CalDav server, i looked in the access.log in the server and see this request: GET /remote.php/dav/principals/myuser HTTP/1.1" 404 31 "-" "HTTPie/3.2.1.
NextCloud uses this principal-url: /remote.php/dav/principals/users/myuser.

You should request principal-url first as described in RFC 6764.

e.g. request: <d:propfind xmlns:d="DAV:"><d:prop><d:current-user-principal /></d:prop></d:propfind>

Issues with running

~ > git clone https://github.com/mrusme/caldr && cd caldr    
Cloning into 'caldr'...
remote: Enumerating objects: 206, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 206 (delta 114), reused 171 (delta 79), pack-reused 0
Receiving objects: 100% (206/206), 4.49 MiB | 24.30 MiB/s, done.
Resolving deltas: 100% (114/114), done.
~/caldr > go build .                                           
~/caldr > ./caldr                         
open : no such file or directory
~/caldr > ls -lah
total 12M
drwxr-xr-x 1 liv liv  240 May 15 01:11 .
drwxr-xr-x 1 liv liv  884 May 15 01:11 ..
-rwxr-xr-x 1 liv liv  12M May 15 01:11 caldr
-rw-r--r-- 1 liv liv 5.1K May 15 01:11 caldr.go
-rw-r--r-- 1 liv liv 214K May 15 01:11 caldr.png
drwxr-xr-x 1 liv liv   12 May 15 01:11 dav
-rw-r--r-- 1 liv liv  316 May 15 01:11 .editorconfig
-rw-r--r-- 1 liv liv  350 May 15 01:11 example.tmpl
drwxr-xr-x 1 liv liv  122 May 15 01:11 .git
drwxr-xr-x 1 liv liv   40 May 15 01:11 .github
-rw-r--r-- 1 liv liv    7 May 15 01:11 .gitignore
-rw-r--r-- 1 liv liv 1.1K May 15 01:11 go.mod
-rw-r--r-- 1 liv liv  515 May 15 01:11 .goreleaser.yaml
-rw-r--r-- 1 liv liv 9.1K May 15 01:11 go.sum
-rw-r--r-- 1 liv liv  35K May 15 01:11 LICENSE
-rw-r--r-- 1 liv liv 2.8K May 15 01:11 README.md
drwxr-xr-x 1 liv liv   16 May 15 01:11 store
~/caldr > go version 
go version go1.22.3 linux/amd64

I am on Gentoo and just installed go. I tried both on a Framework Laptop 13 with a Ryzen 5 7640U chip and a Lenovo Ideapad S340 with an i5-8265U chip.

This is probably a user issue, but I have no clue what to do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.