summaryrefslogtreecommitdiff
path: root/install_widgets.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install_widgets.sh')
-rwxr-xr-xinstall_widgets.sh63
1 files changed, 34 insertions, 29 deletions
diff --git a/install_widgets.sh b/install_widgets.sh
index 84ccc7b..6376c72 100755
--- a/install_widgets.sh
+++ b/install_widgets.sh
@@ -16,40 +16,45 @@ fi
for wgt in $wgtdir/*.wgt
do
echo "installing $wgt"
- wrt-installer -i $wgt
+ if [ -x /usr/bin/wrt-installer ]; then
+ wrt-installer -i $wgt
+ else
+ xwalkctl -i $wgt
+ fi
done
-
repo=/opt/usr/apps/
chmod -R a+rw /opt/dbspace/
-wrt-launcher --list |
-awk 'NR>2{print $2, $5, $6}' |
-while read name packid appid
-do
- bin=$repo/$packid/bin/$appid
- for x in $repo/$packid/res/wgt/*[iI][cC][oO][nN]*; do
- if [[ -f $x ]]; then
- res=$(file -b $x|cut -d , -f 2|tr -d ' '|egrep '[0-9]+x[0-9]+')
- if [[ -n "$res" ]]; then
- diric=/usr/share/icons/hicolor/$res/apps
- [[ -d $diric ]] || mkdir -p $diric
- cp $x $diric/$name.png
- fi
- fi
- done
- desk=/usr/share/applications/$name.desktop
- cat << EOC > $desk
-[Desktop Entry]
-Type=Application
-Name=$name
-Exec=$bin
-Icon=$name
-Terminal=false
-Categories=WRT;Game
+if [ -x /usr/bin/wrt-launcher ]; then
+ wrt-launcher --list |
+ awk 'NR>2{print $2, $5, $6}' |
+ while read name packid appid
+ do
+ bin=$repo/$packid/bin/$appid
+ for x in $repo/$packid/res/wgt/*[iI][cC][oO][nN]*; do
+ if [[ -f $x ]]; then
+ res=$(file -b $x|cut -d , -f 2|tr -d ' '|egrep '[0-9]+x[0-9]+')
+ if [[ -n "$res" ]]; then
+ diric=/usr/share/icons/hicolor/$res/apps
+ [[ -d $diric ]] || mkdir -p $diric
+ cp $x $diric/$name.png
+ fi
+ fi
+ done
+ desk=/usr/share/applications/$name.desktop
+ cat << EOC > $desk
+ [Desktop Entry]
+ Type=Application
+ Name=$name
+ Exec=$bin
+ Icon=$name
+ Terminal=false
+ Categories=WRT;Game
EOC
-done
+ done
+fi
-update-desktop-database
-xdg-icon-resource forceupdate
+#update-desktop-database
+#xdg-icon-resource forceupdate