forked from ilius/starcal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-plasma-applet
executable file
·70 lines (54 loc) · 1.63 KB
/
install-plasma-applet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
#if [ "$UID" != "0" ] ; then
# echo "Run this script as root"
# exit 1
#fi
pkgName=starcal2
#myPath="$0"
#if [ "${myPath:0:2}" == "./" ] ; then
# myPath=$PWD${myPath:1}
#elif [ "${myPath:0:1}" != "/" ] ; then
# myPath=$PWD/$myPath
#fi
#sourceDir="`dirname \"$myPath\"`"
prefix=/usr ## FIXME
sourceDir="$prefix/share/$pkgName"
"$sourceDir/scripts/assert_python2"
version=`$sourceDir/scal2/get_version.py`
tmpDir=/tmp/starcal2-install-plasma
rm -R "$tmpDir" 2>/dev/null
mkdir -p "$tmpDir"
mkdir -p "$tmpDir/pkg"
mkdir -p "$tmpDir/pkg/contents"
mkdir -p "$tmpDir/pkg/contents/code"
cp $sourceDir/scal2/ui_qt/plasma/* "$tmpDir/pkg/contents/code/"
echo "[Desktop Entry]
Encoding=UTF-8
Name=StarCalendar $version
Name[fa]=استارکلندر $version
Type=Service
ServiceTypes=Plasma/Applet
Icon=starcal2
X-Plasma-API=python
X-Plasma-MainScript=code/main.py
X-KDE-PluginInfo-Author=Saeed Rasooli
X-KDE-PluginInfo-Email=saeed.gnu@gmail.com
X-KDE-PluginInfo-Name=starcal2
X-KDE-PluginInfo-Descrition=A Perfect and International Desktop Calendar
X-KDE-PluginInfo-Version=$version
X-KDE-PluginInfo-Website=http://starcal.sourceforge.net/
X-KDE-PluginInfo-Category=Utilities
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true" > "$tmpDir/pkg/metadata.desktop"
plasmaPkgFile="$tmpDir/$pkgName-$version.plasmoid"
#chown root "$tmpDir/pkg"
cd "$tmpDir/pkg"
zip -r "$plasmaPkgFile" .
cd - >/dev/null
rm -Rf ~/.kde4/share/apps/plasma/plasmoids/$pkgName 2>/dev/null
plasmapkg -u "$plasmaPkgFile"
#plasmapkg -g -u "$plasmaPkgFile"
#plasmoidviewer $pkgName
#plasmoidviewer -l "$plasmaPkgFile"
rm -Rf "$tmpDir"