Linux KDE 4 Configuration

From Sw

Jump to: navigation, search

Contents

[edit] KDE 4

KDE 4 and SyncEvolution can now work together to sync KDE PIM applications with ScheduleWorld.

[edit] Installation

Assuming you already have the KDE 4 PIM applications installed you simply need to install SyncEvolution. You can find out how to install SyncEvolution here: Evolution Configuration.

[edit] Configuration

In a nutshell you will configure the KDE PIM applications and SyncEvolution to use the same filesystem directory to hold their data.

[edit] Contacts

  1. Create a directory for your contacts. For example: /full/path/to/your/dir/
  2. Tell KDE Kontact to create a new address book, format as binary and select 'directory' as the source. For example: /full/path/to/your/contacts/dir/
  3. Configure SyncEvolution 0.8 for ScheduleWorld. In ~/.config/syncevolution/scheduleworld/sources/addressbook/config.ini
sync = two-way 
type = file:text/vcard:3.0
evolutionsource = /full/path/to/your/contacts/dir/
uri = card3


Kaddressbook seems to have a problem handling edits to vCards stored in a directory. When an edit is made a new vCard is created with a random(?) file name. To prevent duplicates you will need to delete the old vCard.

--UPDATE-- This is not a bug, the file name is not random it is the uid of the vCard, same thing for the vCal files below. All we need is a simple BASH script to make sure all of the file names are the sames as their uid after each sync, syncevolution does not care what the files are named it looks at the uid inside the file. I'm working on it but I am a lousy BASH programmer. I'm sure somebody out there could do it in a few minutes. -j SEE SCRIPT BELOW


[edit] Calendar Events

Same as contacts except:

  1. Create a different directory.
  2. Tell KDE Korganizer to create a new calendar, and select 'Calendar in local directory' as the source. For example: /full/path/to/your/calendar/dir/
  3. Use a slightly different SyncEvolution config in ~/.config/syncevolution/scheduleworld/sources/calendar/config.ini
sync = two-way 
type = file:text/calendar:2.0
evolutionsource = /full/path/to/your/calendar/dir/
uri = cal2

Korganizer has a problem similar to Kaddressbook, when a vCal appointment is edited a new file is created but the old one is not deleted. This causes Korganizer to crash because it sees two appointments with the same uid. The work around is to go to the directory you created above and delete the old file by hand then relaunch Korganizer or Kontact. === fixed with script below ===


[edit] Calendar Todos / Tasks

Todo items are vCal files, they go in the same directory as your Calendar, there is no place in Kontact/Korganizer to tell it where to look for Todo items, it will look in the same directory as your Calendar above.:

  1. SyncEvolution config goes in ~/.config/syncevolution/scheduleworld/sources/todo/config.ini
sync = two-way 
type = file:text/x-todo:2.0
evolutionsource = /full/path/to/your/calendar/dir/
uri = task2

Once again Korganizer creates a new vCal file with the same uid causing itself to crash, you need to delete the old vCal todo item file and restart Korganizer/Kontact. The good news is that it crashes after it writes the file so your changes are saved. Make sure you delete the old files bfore you do a sync. --Fixed with script below--


[edit] Memos or Notes

Kontact has no tool that will use plain text notes, Kjots uses HTML and Knotes uses vCal files which syncevolution does not support for notes. All you need to do is create a directory and config file like the ones above and you can sync plain text notes to your PDA or whatever. The Kommander app I'm building is hard coded to look in ~/PIM/Memo for the notes so that is a good place to create the dir. Make sure you use the actual path in your config file. ~/.config/syncevolution/scheduleworld/sources/memo/config.ini

sync = two-way
type = file:text/plain:1.0
evolutionsource = /home/james/PIM/Memo
uri = Notes

I will put the app over at www.kde-apps.org in the Kommander section.


[edit] Script to repair filenames for Kontact

This is the ugliest BASH script in history but I am tired. Someone smarter than me can make it pretty. It has worked for me on several tests. Just discovered that when you edit an existing event Kcal makes a backup with a ~ appended to the end of the file name. The problem is that the script of course renames that file with its UID overwriting the newer file. Should be pretty simple to test for the ~ and delete those files before syncing, a one line statement should do it recursively. DONE.

#! /bin/bash
#script assumes that it is in a directory with Addresses and Calendar below it
#this line keeps it from breaking on filenames with spaces
IFS=$'\n'
# First get rid of those pesky backup files Kcal makes before they cause problems
find ./ -name '*~' | xargs rm
# Then do the Sync 
syncevolution scheduleworld #calendar addressbook todo memo
# Now move into the the Addresses Directory
cd Addresses
# Check each file
for file in `ls`
do
# make sure it is a file not a directory shouldn't be any here
if [ -f $file ]
then
	# show us the filename
	echo $file
	# get the line with the UID 
	UIDCAR=$(cat $file | grep 'UID:')
	# strip UID: and leading spaces off
	UIDCAR=${UIDCAR##*:}
	# get teh length and subtract 1
	CARLENGTH=${#UIDCAR}-1
	# strip the last character off
	UIDCAR=${UIDCAR:0:$CARLENGTH}
	# show us the UID
	echo $UIDCAR
	# See if the filename is already the UID
	if [ $file = $UIDCAR ]; then
	# tell us life is good
	echo "Filename OK"
	else
	echo "file needs to be changed"
	# change the filename to the UID
	mv $file $UIDCAR
	fi
else
	echo "this is a directory"	
fi
done
# now do the same thing for the Calendar directory
cd ..
cd Calendar
for file in `ls`
do
# make sure it is a file not a directory shouldn't be any here
if [ -f $file ]
then
	echo $file
	UIDCAR=$(cat $file | grep 'UID:') 
	UIDCAR=${UIDCAR##*:}
	CARLENGTH=${#UIDCAR}-1
	UIDCAR=${UIDCAR:0:$CARLENGTH}
	echo $UIDCAR
	if [ $file = $UIDCAR ]; then
	echo "Filename OK"
	else
	echo "file needs to be changed"
	mv $file $UIDCAR
	fi
else
	echo "this is a directory"	
fi
done
exit

Personal tools
Advertisement
Advertisement