Merge branch 'testing' into 'master'
added all tha components for it to work See merge request joao.azevedo/diy-contacts-importer!2
This commit is contained in:
commit
4eb19b5c83
|
@ -17,6 +17,7 @@ This issue is common to all projects that used Evolution (the database backend o
|
|||
- `syncevolution`
|
||||
- `sed`
|
||||
- `awk`
|
||||
- `libnotify-bin`
|
||||
|
||||
**logic:** This script breaks down a vcf file with multiple contacts into multiple files. One vcard file per contact entry and imports them one by one.
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=Contacts Importer
|
||||
Type=Application
|
||||
Icon=system-shutdown
|
||||
Exec=importer
|
||||
Categories=Utility;
|
|
@ -13,11 +13,11 @@ MIMETYPE=$(file --mime-type -b $@)
|
|||
CONTROL="text/vcard"
|
||||
|
||||
if [[ "$MIMETYPE" == "$CONTROL" ]]; then
|
||||
echo "File is a vcard. Ok importing..." && sleep 2s
|
||||
notify-send "File is a vcard. Ok importing..." && sleep 2s
|
||||
else
|
||||
clear
|
||||
echo "File is not a vcard! ABORT NOW!!"
|
||||
sleep 5s && exit 0
|
||||
clear
|
||||
`yad --title "Import Contacts" --text= "File is not a vcard! ABORT NOW!!"`
|
||||
sleep 5s && exit 0
|
||||
fi
|
||||
|
||||
#Begin importing contacts
|
||||
|
@ -28,6 +28,8 @@ for f in card_import_L5*
|
|||
do syncevolution --import ${f%} backend=evolution-contacts database=${CONTACTDB}
|
||||
done
|
||||
|
||||
notify-send "Contacts have been imported"
|
||||
|
||||
rm card_import_L5*
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
FILE=`yad --title "Import Contacts" --text="Select a VCF file to import" --file=`
|
||||
|
||||
if [ "$FILE" == "" ]; then
|
||||
`yad --title "Import Contacts" --text="You did not selected any file"` exit
|
||||
fi
|
||||
|
||||
notify-send "Import Contacts" "Importing Contacts from $FILE"
|
||||
./contacts-importer.sh $FILE
|
|
@ -0,0 +1,8 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1.1" viewBox="0 0 64 64">
|
||||
<path style="opacity:0.2" d="m 10,56 0,2 c 0,1.662 1.338,3 3,3 l 38,0 c 1.662,0 3,-1.338 3,-3 l 0,-2 c 0,1.662 -1.338,3 -3,3 l -38,0 c -1.662,0 -3,-1.338 -3,-3 z"/>
|
||||
<path style="fill:#009587" d="m 13,4 c -1.662,0 -3,1.338 -3,3 l 0,50 c 0,1.662 1.338,3 3,3 l 38,0 c 1.662,0 3,-1.338 3,-3 L 54,7 C 54,5.338 52.662,4 51,4 L 13,4 Z"/>
|
||||
<path style="opacity:0.2" d="m 13,4 c -1.662,0 -3,1.338 -3,3 l 0,50 c 0,1.662 1.338,3 3,3 l 5,0 0,-56 z"/>
|
||||
<path style="opacity:0.2" d="m 38,5 0,28 4,-4 4,4 0,-28 -8,0 z"/>
|
||||
<path style="fill:#d8d8d8" d="m 38,4 0,28 4,-4 4,4 0,-28 -8,0 z"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="M 13 4 C 11.338 4 10 5.338 10 7 L 10 8 C 10 6.338 11.338 5 13 5 L 51 5 C 52.662 5 54 6.338 54 8 L 54 7 C 54 5.338 52.662 4 51 4 L 13 4 z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 864 B |
Loading…
Reference in New Issue