View Single Post
Posts: 502 | Thanked: 366 times | Joined on Jun 2010 @ /dev/null
#115
I don't know if this is the right place to post patches. I have been working on an ugly hack to allow both 9 desktops and desktop activity manager to work together and I've come up with a somewhat working patch.

I've been meaning to post this but have gotten lazy. I have also tried to make a new switch inside the activity file for loading the previously saved profile should the currently edited profile does not work. However the switch does not work :| I'm trying to make it so that it ignores the previous and current profiles are the same one and to prevent one using load command which actually saves the currently modified profile before switching.

The hack requires one to have a directory multi_backgrounds setup along with a directory inside that one containing the actual activity name. For example, if you have an activity name called Default, you must have a directory inside multi_backgrounds under /home/user as Default and so the full path is: /home/user/multi_backgrounds/Default.

There are some bugs with the hack, notably when one has more than 4 desktops the gconftool will show desktop backgrounds beyond 4 to be previous activity's backgrounds. I have tried various ways to alleviate that issue without much success as you can see from the excessive commented lines and therefore redundant commands.

Here is the contents of the patch:
Code:
--- activity.old	2010-04-14 10:07:23.000000000 +1000
+++ activity	2011-01-23 11:12:23.000000000 +1000
@@ -241,8 +241,122 @@
 	echo -n "."
 
 	gconftool-2 --load $SRCDIR/views.dump
+	
+	echo -n "."
+	# hack test for modified desktop
+	rm -f /home/user/.backgrounds/*
+	cp /home/user/multi_backgrounds/$1/*.png /home/user/.backgrounds/
+	cp /home/user/multi_backgrounds/$1/cache.info /home/user/.backgrounds/
+	gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+	for i in 1 2 3 4 5 6 7 8 9
+	# do gconftool -s /apps/osso/hildon-desktop/views/$i/bg-image -t string /home/user/multi_backgrounds/$1/background-$i.png
+	do gconftool -s /apps/osso/hildon-desktop/views/$1/bg-image -t string /home/user/.backgrounds/background-$i.png
+	gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+	done
+	set_current $1
+
+	echo
+}
+
+qload()
+{
+	
+	if [ -z "$1" ] ; then
+		cat << _KOKO
+Pass the new activity as the first argument.
+_KOKO
+		exit 1
+	fi
+
+	if [ "x$1" = "x-f" ] ; then
+		ACT="$2"
+	else
+		ACT="$1"
+	fi
+
+	echo "Switching to activity: $ACT"
+
+	restore2 "$ACT"
+
+	empty
+
+	restart_hildonhome
+
+	SRCDIR="$DSTDIR0/$1"
+
+	if is_empty "$1" ; then
+		echo "Empty desktop"
+		set_current $1
+		return
+	fi
+
+	echo -n "Restoring "
+
+	# First load the views - this will be repeated at the end
+
+	gconftool-2 --load $SRCDIR/views.dump
 
 	echo -n "."
+
+	T="$SRCDIR/home-thumbnails.tar.gz"
+	if [ -e $T ] ; then
+		[ -d "$THUMBNAILS" ] || mkdir "$THUMBNAILS"
+
+		tar -zxf $SRCDIR/home-thumbnails.tar.gz -C $THUMBNAILS
+	fi
+
+	echo -n "."
+
+	gconftool-2 --load $SRCDIR/bookmarks.dump
+
+	echo -n "."
+
+	gconftool-2 --load $SRCDIR/applets.dump
+
+	sleep 3
+	echo -n "."
+
+	#cp $SRCDIR/home.plugins "$HOME/.config/hildon-desktop/home.plugins"
+	if [ -e "$SRCDIR/home.plugins" ] ; then
+		cp $SRCDIR/home.plugins "$HOMEPLUGINS"
+	else
+		rm -f $SRCDIR/home.plugins
+	fi
+
+	sleep 2
+
+	echo -n "."
+
+	gconftool-2 -s --type list --list-type string \
+		"$HHBASE/bookmark-shortcuts" \
+		"$(cat $SRCDIR/bookmark-shortcuts)"
+
+	echo -n "."
+	gconftool-2 -s --type list --list-type string \
+		"$HHBASE/task-shortcuts" \
+		"$(cat $SRCDIR/task-shortcuts)"
+	echo -n "."
+	gconftool-2 -s --type list --list-type string \
+		"$CONTACTS" \
+		"$(cat $SRCDIR/contacts)"
+	sleep 1
+
+	echo -n "."
+
+	gconftool-2 --load $SRCDIR/applets.dump
+
+	echo -n "."
+
+	gconftool-2 --load $SRCDIR/views.dump
+	
+	echo -n "."
+	# hack test for modified desktop
+	rm -f /home/user/.backgrounds/*
+	gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+	for i in 1 2 3 4 5 6 7 8 9
+	do gconftool -s /apps/osso/hildon-desktop/views/$i/bg-image -t string /home/user/multi_backgrounds/$1/background-$i.png
+	gconftool -s /apps/osso/hildon-desktop/views/active -t list --list-type int [1,2,3,4,5,6,7,8,9]
+	done
 	set_current $1
 
 	echo
@@ -500,9 +614,13 @@
 		# Just load
 		do_load "$2" "$3"
 		;;
+	qload)
+		# Just load
+		qload "$2" "$3"
+		;;
 	change)
-		# Save the current and load the next
-		do_change "$2"
+	# Save the current and load the next
+	do_change "$2"
 		;;
 	list)
 		do_list
The attached txt file is the patch file, you will need to rename it to .patch before applying the patch.

N.B.: This is an experimental patch, I do *not* condone the use of patch if you do not want undesired effects on your device. The patch was meant to be for the developer or the keen hackers in mind. USE THIS PATCH AT YOUR OWN RISK!

Last edited by tuxsavvy; 2011-07-04 at 09:14.
 

The Following User Says Thank You to tuxsavvy For This Useful Post: