forked from Zren/plasma-applet-eventcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·34 lines (28 loc) · 804 Bytes
/
install
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
#!/bin/bash
# Version 3
# This script detects if the widget is already installed.
# If it is, it will use --upgrade instead and restart plasmashell.
packageNamespace=`kreadconfig5 --file="$PWD/package/metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
restartPlasmashell=false
for arg in "$@"; do
case "$arg" in
-r) restartPlasmashell=true;;
--restart) restartPlasmashell=true;;
*) ;;
esac
done
isAlreadyInstalled=false
kpackagetool5 --type="Plasma/Applet" --show="$packageNamespace" &> /dev/null
if [ $? == 0 ]; then
isAlreadyInstalled=true
fi
if $isAlreadyInstalled; then
kpackagetool5 -t Plasma/Applet -u package
restartPlasmashell=true
else
kpackagetool5 -t Plasma/Applet -i package
fi
if $restartPlasmashell; then
killall plasmashell
kstart5 plasmashell
fi