17 |
local id |
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) |
21 |
|
id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';") |
22 |
id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';") |
if [[ -n ${id} ]] |
23 |
if [[ -n ${id} ]] |
then |
24 |
then |
mysqldo "update cfg_fluxbox_menuitem set name='${name}', exec='${exec}', workdir='${workdir}', icon='${icon}' where id=${id};" |
25 |
mysqldo "update cfg_fluxbox_menuitem set name='${name}', exec='${exec}', workdir='${workdir}', icon='${icon}' where id=${id};" |
else |
26 |
else |
mysqldo "insert into cfg_fluxbox_menuitem(serial,name,exec,workdir,icon) values('${serial}','${name}','${exec}','${workdir}','${icon}');" |
27 |
mysqldo "insert into cfg_fluxbox_menuitem(serial,name,exec,workdir,icon) values('${serial}','${name}','${exec}','${workdir}','${icon}');" |
fi |
28 |
fi |
;; |
|
|
|
29 |
del) |
del) |
30 |
if [[ -n ${name} ]] |
if [[ -n ${name} ]] |
31 |
then |
then |
57 |
eecho "Exec must not be empty id->'${id}'" |
eecho "Exec must not be empty id->'${id}'" |
58 |
continue |
continue |
59 |
fi |
fi |
60 |
control fluxbox.menitem "${serial}" "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}" |
control_client "${serial}" set fluxbox.menuitem add "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}" |
61 |
done |
done |
62 |
} |
} |
63 |
|
|