?? evolution-sync.sh
字號:
#!/bin/bash# Example evolution synchronization script by Nicolas Tetreault,# modified by Linus Walleij.# Define target filesSYNC_HOME=$HOME/MTP_device_sync# Define tool locationsSENDFILE=`which mtp-sendfile`# SENDFILE="$HOME/comp-apps/bin/sendfile"#EADDEXP=`which evolution-addressbook-export`# This is the location in Fedora Core 5:EADDEXP="/usr/libexec/evolution/2.6/evolution-addressbook-export"# You need to change the name of the files# that contains the calendar and contacts on your device. # You can find out by starting Gnomad2, choose the data transfer # tab, sort by size (it should be small files, extension .ics and .vcf)# On my Zen Microphoto, the calendar and contacts files are called# 6651416 with the ics and vcf extensions, respectively.CALENDAR_FILE="6651416.ics"CONTACTS_FILE="6651416.vcf"# The evolution address book. To list your addressbooks, type:# evolution-addressbook-export -l# the output for me:# "file:///home/nt271/.evolution/addressbook/local/system# ","Personal",26# "file:///home/nt271/.evolution/addressbook/local/1158600180.5386.0@sierra"# ,"MicroPhoto",24# I only want the Microphoto addressbook and the output will be# $SYNC_HOME/contacts/Evolution_contacts.vcfEVOLUTION_CONTACTS="file:///home/linus/.evolution/addressbook/local/system"# Check for sync dir, create it if neededif test -d $SYNC_HOME ; then echo "$SYNC_HOME exists, OK."else echo "$SYNC_HOME must first be created..." mkdir $SYNC_HOME # This is a working dir for contact merging, you can put # in some extra .vcf files here as well if you like. mkdir $SYNC_HOME/contacts # Here you can place some extra calendars to be sync:ed, you # can put in some extra .ics files of any kind here. mkdir $SYNC_HOME/calendarsfi# Check for prerequisitesif test -f $EADDEXP ; then echo "evolution-addressbook-export present in $EADDEXP, OK."else echo "Cannot locate evolution-addressbook-export!!" exit 0fi# Next line merges all of your tasklist, your personal calendar, # and then any saved to disk calendar you have placed in# $SYNC_HOME/calendarscat $HOME/.evolution/tasks/local/system/tasks.ics \ $HOME/.evolution/calendar/local/system/calendar.ics \ $SYNC_HOME/calendars/*.ics聽> $SYNC_HOME/$CALENDAR_FILE# Use evolution-addressbook-export (installed with Evolution) to# export your contacts to vcard.$EADDEXP --format=vcard \ --output=$SYNC_HOME/contacts/Evolution_contacts.vcf \ $EVOLUTION_CONTACTS# Repeat for each addressbook you want to upload.# The next command will then merge all the contact listscat $SYNC_HOME/contacts/*.vcf > $SYNC_HOME/$CONTACTS_FILE# The calendar and contacts files now need to be converted from unix# to DOS linefeeds (CR+LF instead of just LF)unix2dos $SYNC_HOME/$CALENDAR_FILE $SYNC_HOME/$CONTACTS_FILE# You can now upload the ics and vcf files to you My Organizer folder# on your device. Change the path to your sendfile command.# Sending the vcf file is only supported in CVS version at this time$SENDFILE -f "My Organizer" -t ics $SYNC_HOME/$CALENDAR_FILE$SENDFILE -f "My Organizer" -t vcf $SYNC_HOME/$CONTACTS_FILE
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -