diff options
author | Bernhard Guillon <Bernhard.Guillon@opensimpad.org> | 2008-12-06 19:51:58 +0100 |
---|---|---|
committer | Bernhard Guillon <Bernhard.Guillon@opensimpad.org> | 2008-12-06 19:51:58 +0100 |
commit | 35805dbc9be008b6849a26061a7c1a3aa227886f (patch) | |
tree | 31f7d63bcd4bcc70a5a16959c23455f50ad35b6b /packages | |
parent | d696906d5fe25469ec9be2247e7dba5df052e534 (diff) |
xqtlauncher: added convert and cleanup scripts and .desktop files for them
- convert and cleanup now parses /usr/share/applications for .desktop files
and convert them to opie compliant files
Diffstat (limited to 'packages')
-rw-r--r-- | packages/xqtlauncher/xqtlauncher.bb | 16 | ||||
-rw-r--r-- | packages/xqtlauncher/xqtlauncher/cleanup.desktop | 5 | ||||
-rw-r--r-- | packages/xqtlauncher/xqtlauncher/convert.desktop | 5 | ||||
-rwxr-xr-x | packages/xqtlauncher/xqtlauncher/xqtlauncher-cleanup.sh | 21 | ||||
-rwxr-xr-x | packages/xqtlauncher/xqtlauncher/xqtlauncher-convert.sh | 23 |
5 files changed, 68 insertions, 2 deletions
diff --git a/packages/xqtlauncher/xqtlauncher.bb b/packages/xqtlauncher/xqtlauncher.bb index 0897ddb862..043ee566e3 100644 --- a/packages/xqtlauncher/xqtlauncher.bb +++ b/packages/xqtlauncher/xqtlauncher.bb @@ -1,13 +1,17 @@ DESCRIPTION = "xqtlauncher integrates X/Qt2 nicely into opie. You can launch applications with it from opies menue" HOMEPAGE = "http://angstrom-distribution.org/" LICENSE = "GPL" -PR = "r0" +PR = "r1" RDEPENDS = "xqt2 xorg-minimal-fonts" SRC_URI = "file://dot.directory \ file://startxqt \ file://startxqt-wrapper \ + file://xqtlauncher-convert.sh \ + file://xqtlauncher-cleanup.sh \ + file://convert.desktop \ + file://cleanup.desktop \ file://xqtlauncher " do_install() { @@ -15,8 +19,16 @@ do_install() { install -d ${D}${bindir} install -m 0755 startxqt startxqt-wrapper xqtlauncher ${D}${bindir} install -d ${D}${palmtopdir}/apps/XQt2/ - install -m 0644 dot.directory ${D}${palmtopdir}/apps/XQt2 + install -m 0644 dot.directory ${D}${palmtopdir}/apps/XQt2/.directory + install -m 0644 convert.desktop cleanup.desktop ${D}${palmtopdir}/apps/XQt2/ + install -d ${D}${sysconfdir}/init.d/ + install -m 0755 startxqt startxqt-wrapper xqtlauncher xqtlauncher-cleanup.sh xqtlauncher-convert.sh ${D}${sysconfdir}/init.d/ + install -d ${D}${sysconfdir}/rc5.d/ + ln -sf ../init.d/xqtlauncher-convert.sh ${D}${sysconfdir}/rc5.d/S98xqtlauncher-convert + ln -sf ../init.d/xqtlauncher-cleanup.sh ${D}${sysconfdir}/rc5.d/S98xqtlauncher-cleanup } FILES_${PN} += "${palmtopdir}/apps/XQt2 \ + ${palmtopdir}/apps/XQt2/convert.desktop \ + ${palmtopdir}/apps/XQt2/cleanup.desktop \ ${palmtopdir}/apps/XQt2/.directory " diff --git a/packages/xqtlauncher/xqtlauncher/cleanup.desktop b/packages/xqtlauncher/xqtlauncher/cleanup.desktop new file mode 100644 index 0000000000..d0436178ad --- /dev/null +++ b/packages/xqtlauncher/xqtlauncher/cleanup.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Exec=/etc/init.d/xqtlauncher-cleanup.sh +Icon=Xqt.png +Type=Application +Name=Cleanup Icons diff --git a/packages/xqtlauncher/xqtlauncher/convert.desktop b/packages/xqtlauncher/xqtlauncher/convert.desktop new file mode 100644 index 0000000000..ca70c43bdb --- /dev/null +++ b/packages/xqtlauncher/xqtlauncher/convert.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Exec=/etc/init.d/xqtlauncher-convert.sh +Icon=Xqt.png +Type=Application +Name=Create Icons diff --git a/packages/xqtlauncher/xqtlauncher/xqtlauncher-cleanup.sh b/packages/xqtlauncher/xqtlauncher/xqtlauncher-cleanup.sh new file mode 100755 index 0000000000..3ccf333237 --- /dev/null +++ b/packages/xqtlauncher/xqtlauncher/xqtlauncher-cleanup.sh @@ -0,0 +1,21 @@ +#!/bin/ash +#This program cleans up the mess which convert.sh leaves if you remove a package +for i in `find /usr/lib/opie/apps/XQt2 -name *.desktop`; do + export name=$(echo $i | awk 'BEGIN {FS="."} {gsub("/",".")} {print $(NF-1)}') + #don't delete convert and cleanup icons + if [ $i != "/usr/lib/opie/apps/XQt2/convert.desktop" ] && [ $i != "/usr/lib/opie/apps/XQt2/cleanup.desktop" ] ; then + newfile=$(find /usr/share/applications/ -name $name.desktop) + else + newfile="donotdelete" + fi + if [ -z $newfile ] ; then + echo $name + echo $i + icon=$(cat $i | awk 'BEGIN {FS="="} {if ($1 == "Icon") {print $2} }') + rm -f /usr/lib/opie/bin/run$name + find /usr/lib/opie/pics/ -name $icon.* -exec rm -f {} \; + rm -f $i + fi +done +#update the icons +/usr/bin/icon-reload.sh diff --git a/packages/xqtlauncher/xqtlauncher/xqtlauncher-convert.sh b/packages/xqtlauncher/xqtlauncher/xqtlauncher-convert.sh new file mode 100755 index 0000000000..0356d332ff --- /dev/null +++ b/packages/xqtlauncher/xqtlauncher/xqtlauncher-convert.sh @@ -0,0 +1,23 @@ +#!/bin/ash +#This program converts /usr/share/applications/*.desktop in /usr/lib/opie/apps/XQt2/*.desktop files. +for i in `find /usr/share/applications -name *.desktop`; do + export name=$(echo $i | awk 'BEGIN {FS="."} {gsub("/",".")} {print $(NF-1)}') + newfile=/usr/lib/opie/apps/XQt2/$name.desktop + if [ ! -f $newfile ] ; then + #cat $i | awk 'BEGIN {FS="="} {if ($1 == "Exec") {print "Exec=run"ENVIRON["name"]" " $2} else if ($1 == "Icon") {print "Icon=/usr/share/pixmaps/"$2} else {print $0} }' > $newfile + cat $i | awk 'BEGIN {FS="="} {if ($1 == "Exec") {print "Exec=run"ENVIRON["name"]" " $2} else {print $0} }' > $newfile + icon=$(cat $i | awk 'BEGIN {FS="="} {if ($1 == "Icon") {print $2} }') + ln -sf /usr/bin/xqtlauncher /usr/lib/opie/bin/run$name + #We need to make symlinks for the pics because opie can not handle pics with paths :( + #Check if it has a leading /! + if expr $icon : />/dev/null ; then + echo $icon + ln -sf $icon /usr/lib/opie/pics/$(echo $icon | awk 'BEGIN {FS="/"} {print $NF}') + else + echo $icon + ln -sf $(find /usr/share/pixmaps -name $icon) /usr/lib/opie/pics/$(echo $icon | awk 'BEGIN {FS="/"} {print $NF}') + fi + fi +done +#update the icons +/usr/bin/icon-reload.sh |