• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Contacts CardDav - automatic setup and sync through this script

Scheduled Pinned Locked Moved General
18 Posts 6 Posters 1.7k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      Pingu
      last edited by 18 May 2024, 18:55

      Cool thing 😎

      UT since 2012 (also Sailfish)

      1 Reply Last reply Reply Quote 1
      • T tonton_ referenced this topic on 18 May 2024, 23:08
      • N Offline
        noahtehomas
        last edited by 26 May 2024, 13:26

        It's a great script but I think it would be helpful to add a step-by-step guide for beginners on how to run it via adb or directly on the phone.

        T 2 Replies Last reply 28 May 2024, 23:03 Reply Quote 1
        • T Offline
          tonton_ @noahtehomas
          last edited by 28 May 2024, 23:03

          @noahtehomas
          Thanks for the input, i'll add it to the github readme when i have some spare time!

          1 Reply Last reply Reply Quote 1
          • T Offline
            tonton_ @noahtehomas
            last edited by 29 May 2024, 10:25

            @noahtehomas
            Just updated the github, for info here is the git readme :

            A simple bash script to setup your carddav contact.

            The script also have the ability to setup an auto synchronisation (hourly, daily, weekly...) and to add a sync button in your launcher.

            You can use this script two ways : locally on and from your phone, or through adb (android debug tool) on your computer through a terminal.

            • First you have to put the script file on your phone storage.

              You can do it by *connecting your phone to a computer and using the file explorer.

              You can also use adb : with your phone connected to your computer (with usb debugging activated), you can use this command : adb push filepath_on_your_system destination_filepath_on_phone

            • Then you have to make your file executable and launch it.

              • If you are doing this through adb, first connect to your phone shell with this command adb shell, if you are doing this locally, ignore this last command.
              • Go into the folder you copied the script cd script_folder
              • Make it executable chmod -x ./scriptfile.
              • You can now run the script and follow its instructions ./scriptfile
            N 1 Reply Last reply 31 May 2024, 11:50 Reply Quote 2
            • N Offline
              noahtehomas @tonton_
              last edited by 31 May 2024, 11:50

              @tonton_ said in Contacts CardDav - automatic setup and sync through this script:

              Just updated the github, for info here is the git readme :

              A simple bash script to setup your carddav contact.

              The script also have the ability to setup an auto synchronisation (hourly, daily, weekly...) and to add a sync button in your launcher.

              You can use this script two ways : locally on and from your phone, or through adb (android debug tool) on your computer through a terminal.

              First you have to put the script file on your phone storage.

              You can do it by *connecting your phone to a computer and using the file explorer.

              You can also use adb : with your phone connected to your computer (with usb debugging activated), you can use this command : adb push filepath_on_your_system destination_filepath_on_phone

              Then you have to make your file executable and launch it.

              If you are doing this through adb, first connect to your phone shell with this command adb shell, if you are doing this locally, ignore this last command.
              Go into the folder you copied the script cd script_folder
              Make it executable chmod -x ./scriptfile.
              You can now run the script and follow its instructions ./scriptfile

              Yeah checked the tutorial, it's a complete guide for a beginner group. Again, thanks for the guide.

              1 Reply Last reply Reply Quote 1
              • R Offline
                Rustic
                last edited by Rustic 6 Feb 2024, 07:35 2 Jun 2024, 07:34

                Hello,
                Thanks so much for this script.
                I have a self-hosted radicale service to host my contacts and calendar.
                I run your script and it failed.
                I use this service in android with Davx5 app and works fine.
                How can I make it work in ubuntu-touch?

                T 1 Reply Last reply 2 Jun 2024, 14:22 Reply Quote 1
                • T Offline
                  tonton_ @Rustic
                  last edited by 2 Jun 2024, 14:22

                  @Rustic did not try with radicale, is it a nextcloud/owncloud variant ?
                  where did the script failed exactly ?
                  do you have the console return ?

                  R 1 Reply Last reply 5 Jun 2024, 08:19 Reply Quote 0
                  • R Offline
                    Rustic @tonton_
                    last edited by 5 Jun 2024, 08:19

                    @tonton_ I tried again, this time on my Lenovo Tab M10 HD, and it worked fine.
                    Before I tried on a RedMi Note 9 Pro and it didn't work but I cant get the console return because I went back to LineageOs 21 and on 2n mobile I have PostmarketOs gnome-mobile.
                    It would be nice to have the calendar synced as well.
                    Thanks so much.

                    T 1 Reply Last reply 5 Jun 2024, 13:13 Reply Quote 1
                    • T Offline
                      tonton_ @Rustic
                      last edited by 5 Jun 2024, 13:13

                      @Rustic
                      nice that it worked at least, don't hesitate to report the command output if it fails again 🙂
                      and concerning the calendar, i didn't implement it because it works out of the box (for me at least) with UT account system

                      R 1 Reply Last reply 5 Jun 2024, 15:07 Reply Quote 0
                      • R Offline
                        Rustic @tonton_
                        last edited by 5 Jun 2024, 15:07

                        @tonton_ Adding radicale calendar does not work. The calendar is being added but it does not sync.
                        If at least it would be possible to import a .ics from within the calendar app that would be also nice.

                        T 1 Reply Last reply 5 Jun 2024, 15:39 Reply Quote 0
                        • T Offline
                          tonton_ @Rustic
                          last edited by tonton_ 6 Jun 2024, 09:14 5 Jun 2024, 15:39

                          @Rustic don't have a lot of time for now, but you could try to use this script :
                          https://gist.github.com/vanyasem/379095d25ac350676fc70c42efe17c8c
                          after removing all contact related lines, and cron related (no more cron on focal)

                          If this works for you tell me, i could try to include it in the script (with the auto sync and sync button features) no garanty i'll have time though, sorry !

                          if you make it work, something like this should launch the sync :

                          syncevolution --sync two-way $CONTACTS_CONFIG_NAME
                          

                          with $CONTACTS_CONFIG_NAME being the input you set in the script
                          tell me if it works for you !

                          Oh and radicale calendar, if caldav, should work natively, so you can also fill a bugreport for this if you have time 🙂

                          R 1 Reply Last reply 5 Jun 2024, 17:36 Reply Quote 1
                          • R Offline
                            Rustic @tonton_
                            last edited by Rustic 6 May 2024, 17:42 5 Jun 2024, 17:36

                            @tonton_ It worked. This is the command output:

                            Synchronization successful.

                            Changes applied during synchronization (@radicale):
                            +------------------|-----------------------|-----------------------|-CON-+
                            | | @radicale | @default | FLI |
                            | Source | NEW | MOD | DEL | ERR | NEW | MOD | DEL | ERR | CTS |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
                            | personalcalendar | 0 | 0 | 0 | 0 | 79 | 0 | 0 | 0 | 0 |
                            | refresh-from-local, 54 KB sent by client, 0 KB received |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
                            | start Wed Jun 5 19:39:48 2024, duration 0:10min |
                            | synchronization completed successfully |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
                            [INFO] creating complete data backup after sync (enabled with dumpData and needed for printChanges)

                            Synchronization successful.

                            Changes applied during synchronization:
                            +------------------|-----------------------|-----------------------|-CON-+
                            | | @default | @radicale | FLI |
                            | Source | NEW | MOD | DEL | ERR | NEW | MOD | DEL | ERR | CTS |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
                            | personalcalendar | 79 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
                            | refresh-from-remote, 0 KB sent by client, 54 KB received |
                            | item(s) in database backup: 0 before sync, 79 after it |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
                            | start Wed Jun 5 19:39:46 2024, duration 0:13min |
                            | synchronization completed successfully |
                            +------------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+

                            Data modified @default during synchronization:
                            *** @default/personalcalendar ***
                            Comparison was impossible.

                            1 Reply Last reply Reply Quote 0
                            • R Offline
                              Rustic
                              last edited by 5 Jun 2024, 17:48

                              I guess in order to sync this cal I'll have to erase .cache/syncevolution and then run the script again.
                              At least it worked.
                              Thanks so much.

                              T 1 Reply Last reply 5 Jun 2024, 20:56 Reply Quote 0
                              • T Offline
                                tonton_ @Rustic
                                last edited by tonton_ 6 Jun 2024, 09:14 5 Jun 2024, 20:56

                                @Rustic
                                no you should just be able to run this command (didn't test it though) :

                                syncevolution --sync two-way $CONTACTS_CONFIG_NAME
                                

                                replace the $CONTACTS_CONFIG_NAME by the name you gave to your db, try it, if it works you can put this command in a desktop file (to have an icon to sync manually in your ut launcher) or a systemd timer to auto sync ! (you can take a look at what does my script for these)
                                line 131 to 140 for the desktop file and line 148 to 183 for the systemd timer/service files 🙂

                                1 Reply Last reply Reply Quote 0
                                • L Offline
                                  lsitongia @tonton_
                                  last edited by 11 Jun 2024, 19:34

                                  @tonton_ Thank you for this work.

                                  LINMOB says that there are improvements to CardDAV. I wonder if they are referring to your work here?

                                  https://linmob.net/weekly-update-23-2024/

                                  T 1 Reply Last reply 12 Jun 2024, 01:02 Reply Quote 1
                                  • T Offline
                                    tonton_ @lsitongia
                                    last edited by 12 Jun 2024, 01:02

                                    I dont think so, my script is merely a setup helper for the existing backend ! I think they are refering to lionel s work on the new contact backend ! Take a look at last ut q&a video where he showcased it, it looks awesome ! 🙂

                                    1 Reply Last reply Reply Quote 0
                                    • Z Offline
                                      zedr0k
                                      last edited by 27 Jun 2024, 09:49

                                      Thanks a lot for that script. It worked great for me. 👍

                                      1 Reply Last reply Reply Quote 1
                                      • First post
                                        Last post