diff --git a/group_vars/all.yml b/group_vars/all.yml index ba586f3..64fce98 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -2,6 +2,7 @@ font: jetbrains mono git_name: eoli3n git_mail: jonathan.kirszling@runbox.com +caldav: https://dav.runbox.com/ # Black + DarkGrey color0: '#282a36' diff --git a/install.yml b/install.yml index 9d7aa91..654e753 100644 --- a/install.yml +++ b/install.yml @@ -28,6 +28,9 @@ - role: gpg tags: gpg when: ansible_user_id != 'root' + - role: khal + tags: khal + when: ansible_user_id != 'root' - role: sway tags: sway when: ansible_user_id != 'root' diff --git a/roles/khal/tasks/main.yml b/roles/khal/tasks/main.yml new file mode 100644 index 0000000..9b740a3 --- /dev/null +++ b/roles/khal/tasks/main.yml @@ -0,0 +1,18 @@ +--- +- name: create vdirsyncer directory + file: + path: '{{ item }}' + state: directory + loop: + - ~/.vdirsyncer/ + - ~/.config/khal/ + +- name: copy vdirsyncer config + template: + src: vdirsyncer.j2 + dest: ~/.vdirsyncer/config + +- name: copy khal config + template: + src: khal.j2 + dest: ~/.config/khal/config diff --git a/roles/khal/templates/khal.j2 b/roles/khal/templates/khal.j2 new file mode 100644 index 0000000..73fe7fd --- /dev/null +++ b/roles/khal/templates/khal.j2 @@ -0,0 +1,26 @@ +[calendars] + +[[home]] +path = ~/share/docs/calendar/home +type = discover +color = light green + +[[anniversaires]] +path = ~/share/docs/calendar/anniversaires +type = discover +color = light blue + +[locale] +timeformat = %H:%M +dateformat = %d/%m/%Y +longdateformat = %d/%m/%Y +datetimeformat = %d/%m/%Y %H:%M +longdatetimeformat = %d/%m/%Y %H:%M + +[default] +timedelta = 7d + +[highlight_days] +color = light green +default_color = light green +multiple = dark green diff --git a/roles/khal/templates/vdirsyncer.j2 b/roles/khal/templates/vdirsyncer.j2 new file mode 100644 index 0000000..ee3221a --- /dev/null +++ b/roles/khal/templates/vdirsyncer.j2 @@ -0,0 +1,35 @@ +[general] +status_path = "~/.vdirsyncer/status/" + +[pair my_contacts] +a = "my_contacts_local" +b = "my_contacts_remote" +collections = ["from a", "from b"] + +[storage my_contacts_local] +type = "filesystem" +path = "~/share/docs/contacts" +fileext = ".vcf" + +[storage my_contacts_remote] +type = "carddav" +url = "{{ caldav }}" +username = "{{ git_mail }}" +password.fetch = ["command", "gopass", "-o", "app/vdirsyncer"] + +[pair my_calendars] +a = "my_calendars_local" +b = "my_calendars_remote" +collections = ["from a", "from b"] +metadata = ["color"] + +[storage my_calendars_local] +type = "filesystem" +path = "~/share/docs/calendar" +fileext = ".ics" + +[storage my_calendars_remote] +type = "caldav" +url = "{{ caldav }}" +username = "{{ git_mail }}" +password.fetch = ["command", "gopass", "-o", "app/vdirsyncer"]