Annotation of /alx-src/branches/alxconf-060/plugins/terminal/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: 936 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: 936 byte(s)
-added rudimentary plugin support
1 | niro | 2749 | # this script gets included by config_sessions |
2 | |||
3 | PLUGIN_NAME="terminal" | ||
4 | PLUGIN_MENUITEM_NAME="${PLUGIN_NAME}" | ||
5 | PLUGIN_MENUITEM_EXEC="rxvt" | ||
6 | PLUGIN_MENUITEM_PARAM="" | ||
7 | PLUGIN_MENUITEM_WORKDIR="" | ||
8 | PLUGIN_MENUITEM_ICON="" | ||
9 | |||
10 | install_plugin() | ||
11 | { | ||
12 | if [[ -z $(magequery -n rxvt) ]] | ||
13 | then | ||
14 | MAGE_BOOTSTRAP=true mage install rxvt | ||
15 | mage clean | ||
16 | fi | ||
17 | } | ||
18 | |||
19 | # create desktop buttons | ||
20 | create_menuitem() | ||
21 | { | ||
22 | # don't touch these echo, define variables above | ||
23 | echo "PLUGIN_MENUITEM_NAME=\"${PLUGIN_MENUITEM_NAME}\"" | ||
24 | echo "PLUGIN_MENUITEM_EXEC=\"${PLUGIN_MENUITEM_EXEC}\"" | ||
25 | echo "PLUGIN_MENUITEM_PARAM=\"${PLUGIN_MENUITEM_PARAM}\"" | ||
26 | echo "PLUGIN_MENUITEM_WORKDIR=\"${PLUGIN_MENUITEM_WORKDIR}\"" | ||
27 | echo "PLUGIN_MENUITEM_ICON=\"${PLUGIN_MENUITEM_ICON}\"" | ||
28 | } | ||
29 | |||
30 | uninstall_plugin() | ||
31 | { | ||
32 | # keep rxvt | ||
33 | return | ||
34 | } | ||
35 | |||
36 | case $1 in | ||
37 | install) install_plugin ;; | ||
38 | menuitem) create_menuitem ;; | ||
39 | uninstall) uninstall_plugin ;; | ||
40 | *) echo "PLUGIN '${PLUGIN_NAME}': unkown operation '$1'" ;; | ||
41 | esac |