14 |
local exec="${CLASS_ARGV[3]}" |
local exec="${CLASS_ARGV[3]}" |
15 |
local workdir="${CLASS_ARGV[4]}" |
local workdir="${CLASS_ARGV[4]}" |
16 |
local icon="${CLASS_ARGV[5]}" |
local icon="${CLASS_ARGV[5]}" |
17 |
|
local id |
18 |
|
|
19 |
case "${action}" in |
case "${action}" in |
20 |
add) import_resource cfg_fluxbox_menuitem "${serial}" name "${name}" exec "${exec}" workdir "${workdir}" icon "${icon}" ;; |
add) id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';") |
21 |
|
if [[ -n ${id} ]] |
22 |
|
then |
23 |
|
mysqldo "update cfg_fluxbox_menuitem set name='${name}', exec='${exec}', workdir='${workdir}', icon='${icon}' where id=${id};" |
24 |
|
else |
25 |
|
mysqldo "insert into cfg_fluxbox_menuitem(serial,name,exec,workdir,icon) values('${serial}','${name}','${exec}','${workdir}','${icon}');" |
26 |
|
fi |
27 |
|
;; |
28 |
del) |
del) |
29 |
if [[ -n ${name} ]] |
if [[ -n ${name} ]] |
30 |
then |
then |
56 |
eecho "Exec must not be empty id->'${id}'" |
eecho "Exec must not be empty id->'${id}'" |
57 |
continue |
continue |
58 |
fi |
fi |
59 |
control fluxbox.menitem "${serial}" "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}" |
control_client "${serial}" fluxbox.menuitem add "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}" |
60 |
done |
done |
61 |
} |
} |
62 |
|
|