Annotation of /alx-src/branches/alxconf-060/plugins/firefox/plugin.sh
Parent Directory | Revision Log
Revision 2749 -
(hide annotations)
(download)
(as text)
Thu Aug 11 19:51:21 2011 UTC (12 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1287 byte(s)
Thu Aug 11 19:51:21 2011 UTC (12 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 1287 byte(s)
-added rudimentary plugin support
1 | niro | 2749 | # this script gets included by config_sessions |
2 | |||
3 | PLUGIN_NAME="firefox" | ||
4 | PLUGIN_MENUITEM_NAME="${PLUGIN_NAME}" | ||
5 | PLUGIN_MENUITEM_EXEC="${PLUGIN_NAME}" | ||
6 | PLUGIN_MENUITEM_PARAM="" | ||
7 | PLUGIN_MENUITEM_WORKDIR="" | ||
8 | PLUGIN_MENUITEM_ICON="${PLUGIN_NAME}.png" | ||
9 | |||
10 | PLUGIN_PACKAGES="glib2 atk pango cairo gdk-pixbuf gtk2+ sqlite unzip libidl nspr nss mozilla-firefox mozilla-firefox-i18n-de" | ||
11 | |||
12 | install_plugin() | ||
13 | { | ||
14 | local i | ||
15 | for i in ${PLUGIN_PACKAGES} | ||
16 | do | ||
17 | if [[ -z $(magequery -n ${i}) ]] | ||
18 | then | ||
19 | MAGE_BOOTSTRAP=true mage install ${i} | ||
20 | mage clean | ||
21 | fi | ||
22 | done | ||
23 | } | ||
24 | |||
25 | # create desktop buttons | ||
26 | create_menuitem() | ||
27 | { | ||
28 | # don't touch these echo, define variables above | ||
29 | echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\"" | ||
30 | echo "PLUGIN_MENUITEM_EXEC=\"${PLUGIN_MENUITEM_EXEC}\"" | ||
31 | echo "PLUGIN_MENUITEM_PARAM=\"${PLUGIN_MENUITEM_PARAM}\"" | ||
32 | echo "PLUGIN_MENUITEM_WORKDIR=\"${PLUGIN_MENUITEM_WORKDIR}\"" | ||
33 | echo "PLUGIN_MENUITEM_ICON=\"${PLUGIN_MENUITEM_ICON}\"" | ||
34 | } | ||
35 | |||
36 | uninstall_plugin() | ||
37 | { | ||
38 | local i | ||
39 | for i in ${PLUGIN_PACKAGES} | ||
40 | do | ||
41 | if [[ -n $(magequery -n ${i}) ]] | ||
42 | then | ||
43 | MAGE_BOOTSTRAP=true mage uninstall ${i} | ||
44 | mage clean | ||
45 | fi | ||
46 | done | ||
47 | |||
48 | mage clean | ||
49 | } | ||
50 | |||
51 | case $1 in | ||
52 | install) install_plugin ;; | ||
53 | menuitem) create_menuitem ;; | ||
54 | uninstall) uninstall_plugin ;; | ||
55 | *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;; | ||
56 | esac |