Ubuntu Touch:添加联系人列表和日历

我基于这个askubuntu线程成功设置了我的Owncloud服务器的默认日历和默认联系人列表的同步 。 我的Owncloud服务器上有多个日历和联系人列表。 我已检查日历并联系应用程序以了解添加新联系人列表和日历的方法。 联系人应用程序似乎不提供此function。 日历应用程序可以选择添加新日历,但是当我按下相应的按钮时,我会转到系统设置页面。 感谢您的提示! M.

(我的设备是带有Ubuntu 14.10-r21的BQ Aquaris E4.5)

我可以根据alexandre_payet答案分享此脚本,该答案将从您自己的云服务器添加1个联系人地址簿和1个日历,以与您的手机同步。

脚本

#!/bin/bash # --------------------------------------------------------------------------- # Ubuntu Phone - Sync Owncloud Contacts & Calendar Account # Carddav & Caldav. # Tested on : Ubuntu-touch vivid - ubuntu-touch/rc-proposed/bq-aquaris.en/vegetahd/ # Last edit : 2015/08/23. # Author : Romain Fluttaz, boTux.fr,  # ============= [ Configuration ] ============= # # --------------- [ OwnCloud ] ---------------- # # Server and user informations HTTP_PROTOCOL="https" # "http" or "https". It's recommended to use an $HTTP_PROTOCOL connection OWNCLOUD_URL="cloud.domain.com" # Without the last /. USERNAME="owncloud-user" # Your OwnCloud username PASSWORD="owncloud-password" # Your OwnCloud password # Contact addressbooks CONTACT_ADDRESSBOOK_NAME="contacts" # Check in the contact setting page. # Calendar CALENDAR_NAME="personnel" # Check in the calendar setting page. # Database OC_DATABASE_NAME="owncloud" # ----------------- [ Phone ] ----------------- # # Database name : CONTACT_DB_NAME="Contacts-name" # Contact addressbook name on the phone CALENDAR_DB_NAME="Calendar-name" # Calendar name on the phone # CRON job CRON_FREQUENCY="hourly" # Cronjob frequency. "hourly", "dayly", "weekly", "monthly". See $HTTP_PROTOCOL://help.ubuntu.com/community/CronHowto#Advanced_Crontab # ============= [ /Configuration ] ============ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License at  for # more details. # Thanks to : # alexandre_payet @ https://askubuntu.com/questions/616081/ubuntu-touch-add-contact-list-and-calendars # alexandre_payet @ https://askubuntu.com/questions/611761/syncevolution-in-cronjob-to-sync-the-ubuntu-phone-via-caldav-arddav # alexandre_payet @ https://askubuntu.com/questions/629219/automatically-sync-calendar-on-ubuntu-phone/629728#629728 # Usage: Edit the config section and run the script. # Revision history: # 2015-08-22 Adding 1 Contact & 1 Calendar. # 2015-08-22 Add cronjob support. # --------------------------------------------------------------------------- echo "\e[4mAdding OwnCloud account : **$OWNCLOUD_URL**\e[0m" echo "" # Contact echo -e "[\e[0;34m Contacts \e[m] $CONTACT_ADDRESSBOOK_NAME @ $OC_DATABASE_NAME" syncevolution --create-database backend=evolution-contacts database=$CONTACT_DB_NAME syncevolution --configure --template webdav username=$USERNAME password=$PASSWORD syncURL=$HTTP_PROTOCOL://$OWNCLOUD_URL/remote.php/ keyring=no target-config@$OC_DATABASE_NAME syncevolution --configure backend=evolution-contacts database=$CONTACT_DB_NAME @default $CONTACT_DB_NAME syncevolution --configure database=$HTTP_PROTOCOL://$OWNCLOUD_URL/remote.php/carddav/addressbooks/$USERNAME/$CONTACT_ADDRESSBOOK_NAME backend=carddav target-config@$OC_DATABASE_NAME $CONTACT_DB_NAME syncevolution --configure --template SyncEvolution_Client Sync=None syncURL=local://@$OC_DATABASE_NAME username= password= $OC_DATABASE_NAME $CONTACT_DB_NAME syncevolution --configure sync=two-way backend=evolution-contacts database=$CONTACT_DB_NAME $OC_DATABASE_NAME $CONTACT_DB_NAME echo " +--> $CONTACT_DB_NAME @ local" syncevolution --sync refresh-from-remote $OC_DATABASE_NAME $CONTACT_DB_NAME syncevolution --sync slow $OC_DATABASE_NAME $CONTACT_DB_NAME echo -e "[\e[0;34m Contacts \e[m] +--> Done." echo "" # Calendar echo -e "[\e[33m Calendar \e[m] $CALENDAR_NAME @ $OC_DATABASE_NAME" syncevolution --create-database backend=evolution-calendar database=$CALENDAR_NAME syncevolution --configure --template webdav username=$USERNAME password=$PASSWORD syncURL=$HTTP_PROTOCOL://$OWNCLOUD_URL/remote.php/ keyring=no target-config@$OC_DATABASE_NAME syncevolution --configure backend=evolution-calendar database=$CALENDAR_NAME @default $CALENDAR_NAME syncevolution --configure database=$HTTP_PROTOCOL://$OWNCLOUD_URL/remote.php/caldav/calendars/$USERNAME/$CALENDAR_DB_NAME backend=caldav target-config@$OC_DATABASE_NAME $CALENDAR_NAME syncevolution --configure --template SyncEvolution_Client syncURL=local://@$OC_DATABASE_NAME username= password= $OC_DATABASE_NAME $CALENDAR_NAME syncevolution --configure sync=two-way database=$CALENDAR_NAME $OC_DATABASE_NAME $CALENDAR_NAME echo " +--> $CALENDAR_DB_NAME @ local" syncevolution --sync refresh-from-remote $OC_DATABASE_NAME $CALENDAR_NAME echo -e "[\e[33m Calendar \e[m] +--> Done." echo "" # Cron echo -e "[\e[0;36m Cron \e[m]" echo -e " +--> \e[0;31mGranting SuperUser Access\e[m" sudo mount /dev/loop0 / -o remount,rw CRON_LINE="@$CRON_FREQUENCY export DISPLAY=:0.0 && export DBUS_SESSION_BUS_ADDRESS=$(ps -u phablet e | grep -Eo 'dbus-daemon.*address=unix:abstract=/tmp/dbus-[A-Za-z0-9]{10}' | tail -c35) && /usr/bin/syncevolution $OC_DATABASE_NAME" (crontab -u phablet -l; echo "$CRON_LINE" ) | crontab -u phablet - sudo service cron restart crontab -l | grep "$CRON_LINE" echo -e "[\e[0;36m Cron \e[m] +--> Added." echo "" # First Normal Sync echo -e "[\e[0;32m Syncronisation \e[m]" syncevolution $OC_DATABASE_NAME echo -e "[\e[0;32m Syncronisation \e[m] +--> Done." # Print information echo "" echo "" echo "" echo "# To manually sync your accounts, use the command below :" echo "" echo -e " syncevolution $OC_DATABASE_NAME \e[m" echo " or" echo -e "\e[0;34msyncevolution $OC_DATABASE_NAME $CONTACT_DB_NAME\e[m | \e[33msyncevolution $OC_DATABASE_NAME $CALENDAR_NAME\e[m" echo "" echo "See 'syncevolution --help' to get more information." 

下载ubuntu-touch_owncloud-sync_contact-calendar.sh | Github Gist

测试了ubuntu-touch / rc-proposed / bq-aquaris.en / vegetahd频道

如何使用

编辑配置部分,然后在您的ubuntu-phone上执行。

来自Ubuntu桌面

(附:从ppa安装的phablet-tools)

  1. 添加phablet-shell
      sudo add-apt-repository ppa:phablet-team / tools
     sudo apt-get update
     sudo apt-get install phablet-tools 
  2. 激活开发者模式
  3. 下载并编辑脚本:
      wget https://gist.githubusercontent.com/boTux/069b53d8e06bdb9b9c97/raw/a03be09136c5275b2956c512accdad69b30e8074/ubuntu-touch_owncloud-sync_contact-calendar.sh
     gedit ubuntu-touch_owncloud-sync_contact-calendar.sh 
    • [配置] / [自己的云]部分
      • 输入您的OWNCLOUD_URL ,不包括最后一个/。
      • 输入您的USERNAMEPASSWORD
      • 输入您自己的地址簿和日历的名称。
    • [配置] / [电话]部分
      • 使用您选择的名称修改CONTACT_DB_NAMECALENDAR_DB_NAME
      • CRON_FREQUENCY编辑为您需要的同步间隔。
    • 保存
  4. 通过USB连接手机并复制脚本(通过nautilus,例如在Documents /中)
  5. 通过phablet-shell连接并运行脚本:
     平板手机壳
     chmod + x Documents / ubuntu-touch_owncloud-sync_contact-calendar.sh
     ./Documents/ubuntu-touch_owncloud-sync_contact-calendar.sh 

我希望这可以帮助你们中的一些人……

要使用owncloud添加和同步日历和联系人,您可以在终端中使用命令行。

我在https://lists.launchpad.net/ubuntu-phone/msg09789.html上找到了它

注意:这是一个很好的方法,它来自使用ssh连接到ubuntu手机的桌面终端(然后你可以轻松复制命令行)。 但它也应该在手机的终端应用程序中工作

日历

创建日历

 syncevolution --create-database backend=evolution-calendar database=Calendar1 

创建同行

 syncevolution --configure --template webdav username=myusername password=mypassword syncURL=https://url-to-owncloud-install/remote.php/caldav/calendars/user-name/defaultcalendar keyring=no target-config@owncloud 

创建新来源

 syncevolution --configure backend=evolution-calendar database=Calendar1 @default Calendar1 

添加远程数据库

 syncevolution --configure database=https://url-to-owncloud-install/remote.php/caldav/calendars/user-name/defaultcalendar backend=caldav target-config@owncloud Calendar1 

将远程日历与本地数据库连接

 syncevolution --configure --template SyncEvolution_Client syncURL=local://@owncloud username= password= owncloud Calendar1 

将本地数据库添加到源

 syncevolution --configure sync=two-way database=Calendar1 owncloud Calendar1 

开始同步

 syncevolution --sync refresh-from-remote owncloud Calendar1 

你可以为calendar1,然后calendar2,…

在这些命令行中,不要忘记替换:

对于命令N°2

 'myusername' by your owncloud username 'mypassword' by your owncloud password 'https://url-to-owncloud-install/remote.php/caldav/calendars/user-name/defaultcalendar' by the adress link of calendar1 or calendar2 , .... 

对于命令N°4

 'https://url-to-owncloud-install/remote.php/caldav/calendars/user-name/defaultcalendar' by the adress link of calendar1 or calendar2 , .... 

联系 :

一样的方法 :

 syncevolution --create-database backend=evolution-contacts database=Contact1 syncevolution --configure --template webdav username=myusername password=mypassword syncURL=Your_contact1_owcloud_adress keyring=no target-config@owncloud syncevolution --configure backend=evolution-contacts database=Contact1 @default Contact1 syncevolution --configure database=Your_contact1_owcloud_adress backend=carddav target-config@owncloud Contact1 syncevolution --configure --template SyncEvolution_Client Sync=None syncURL=local://@owncloud username= password= owncloud Contact1 syncevolution --configure sync=two-way backend=evolution-contacts database=Contact1 owncloud Contact1 syncevolution --sync refresh-from-remote owncloud Contact1 

与日历相同的评论。 我只用一个联系人数据库对它进行了测试,但它应该适用于Contact2,Contact3,……

如需联系,请确保使用’backend = evolution-contacts’和’backend = carddav’(日历和联系人命令行之间的差异)

重要提示:对于下一次同步,您只需执行以下操作:

 syncevolution owncloud calendar1 syncevolution owncloud contact1 

和calendar2,contact2,…

要自动同步联系人和日历,您可以使用crontab作业在需要时启动这些命令。 你可以看到这篇文章: cronjob中的Syncevolution通过caldav / arddav同步ubuntu手机

希望我的命令行没有错误。