Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1 KiB

  1. #!/bin/bash
  2. #pidof emacs && emacsclient -e '(org-caldav-sync)' # Sync emacs-caldav as well
  3. eval "$(grep -h -- \
  4. "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\)=" \
  5. "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
  6. "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)"
  7. export CALCURSE_CALDAV_PASSWORD=$(pass show Server/drive.yigitcolakoglu.com/yigitcolakoglu)
  8. calcurse-caldav
  9. tmpfile=$(mktemp)
  10. destfile=$(mktemp)
  11. wget -q 'https://drive.yigitcolakoglu.com/remote.php/dav/addressbooks/users/yigitcolakoglu/contacts/?export' \
  12. --user yigitcolakoglu \
  13. --password "$(pass show Server/drive.yigitcolakoglu.com/yigitcolakoglu)" \
  14. -O $tmpfile
  15. abook --convert \
  16. --informat vcard \
  17. --infile $tmpfile \
  18. --outformat abook \
  19. --outfile $destfile
  20. rm $tmpfile
  21. chmod 600 $destfile
  22. sed -Ei 's/([0-9]) ([0-9])/\1\2/g' $destfile
  23. sed -Ei 's/\+([0-9])/\1/g' $destfile
  24. mv $destfile "$XDG_DATA_HOME"/abook/addressbook