1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
|
push_config fluxbox_menuitem |
4 |
|
|
5 |
help_fluxbox_menuitem() |
help_fluxbox_menuitem() |
6 |
{ |
{ |
7 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
28 |
;; |
;; |
29 |
esac |
esac |
30 |
|
|
31 |
|
if [[ -z ${name} ]] |
32 |
|
then |
33 |
|
eecho "No name given" |
34 |
|
return 1 |
35 |
|
fi |
36 |
|
|
37 |
id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';") |
id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';") |
38 |
if [[ -n ${id} ]] |
if [[ -n ${id} ]] |
39 |
then |
then |
46 |
control_fluxbox_menuitem() |
control_fluxbox_menuitem() |
47 |
{ |
{ |
48 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
49 |
|
push_config_fluxbox_menuitem "${serial}" |
50 |
|
} |
51 |
|
|
52 |
|
push_config_fluxbox_menuitem() |
53 |
|
{ |
54 |
|
local serial="$1" |
55 |
local values |
local values |
56 |
local id |
local id |
57 |
|
|
64 |
eecho "Name must not be empty id->'${id}'" |
eecho "Name must not be empty id->'${id}'" |
65 |
continue |
continue |
66 |
fi |
fi |
|
if [[ -z ${cfg_fluxbox_menuitem_exec} ]] |
|
|
then |
|
|
eecho "Exec must not be empty id->'${id}'" |
|
|
continue |
|
|
fi |
|
67 |
if [[ -z ${cfg_fluxbox_menuitem_enabled} ]] |
if [[ -z ${cfg_fluxbox_menuitem_enabled} ]] |
68 |
then |
then |
69 |
eecho "Enabled must not be empty id->'${id}'" |
eecho "Enabled must not be empty id->'${id}'" |
73 |
then |
then |
74 |
control_client "${serial}" set fluxbox.menuitem add "${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}" |
75 |
elif [[ ${cfg_fluxbox_menuitem_enabled} = 0 ]] |
elif [[ ${cfg_fluxbox_menuitem_enabled} = 0 ]] |
76 |
|
then |
77 |
control_client "${serial}" set fluxbox.menuitem del "${cfg_fluxbox_menuitem_name}" |
control_client "${serial}" set fluxbox.menuitem del "${cfg_fluxbox_menuitem_name}" |
78 |
# remove from database too |
# remove from database too |
79 |
mysqldo "delete from cfg_fluxbox_menuitem where id='${id}';" |
mysqldo "delete from cfg_fluxbox_menuitem where id='${id}';" |
101 |
control_fluxbox_theme() |
control_fluxbox_theme() |
102 |
{ |
{ |
103 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
104 |
|
push_config_fluxbox_theme "${serial}" |
105 |
|
} |
106 |
|
|
107 |
|
push_config_fluxbox_theme() |
108 |
|
{ |
109 |
|
local serial="$1" |
110 |
local value |
local value |
111 |
|
|
112 |
value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'") |
value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'") |