1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
|
push_config 80_fluxbox_menuitem |
4 |
|
push_config 80_fluxbox_autostart |
5 |
|
|
6 |
help_fluxbox_menuitem() |
help_fluxbox_menuitem() |
7 |
{ |
{ |
8 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
29 |
;; |
;; |
30 |
esac |
esac |
31 |
|
|
32 |
|
if [[ -z ${name} ]] |
33 |
|
then |
34 |
|
eecho "No name given" |
35 |
|
return 1 |
36 |
|
fi |
37 |
|
|
38 |
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}';") |
39 |
if [[ -n ${id} ]] |
if [[ -n ${id} ]] |
40 |
then |
then |
47 |
control_fluxbox_menuitem() |
control_fluxbox_menuitem() |
48 |
{ |
{ |
49 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
50 |
|
push_config_80_fluxbox_menuitem "${serial}" |
51 |
|
} |
52 |
|
|
53 |
|
push_config_80_fluxbox_menuitem() |
54 |
|
{ |
55 |
|
local serial="$1" |
56 |
local values |
local values |
57 |
local id |
local id |
58 |
|
|
85 |
done |
done |
86 |
} |
} |
87 |
|
|
88 |
|
help_fluxbox_autostart() |
89 |
|
{ |
90 |
|
local serial="${CLASS_ARGV[0]}" |
91 |
|
control_client "${serial}" help fluxbox.autostart |
92 |
|
} |
93 |
|
|
94 |
|
set_fluxbox_autostart() |
95 |
|
{ |
96 |
|
local serial="${CLASS_ARGV[0]}" |
97 |
|
local action="${CLASS_ARGV[1]}" |
98 |
|
local name="${CLASS_ARGV[2]}" |
99 |
|
local exec="${CLASS_ARGV[3]}" |
100 |
|
local id |
101 |
|
local enabled |
102 |
|
|
103 |
|
case "${action}" in |
104 |
|
add) enabled=1 ;; |
105 |
|
del) enabled=0 ;; |
106 |
|
*) |
107 |
|
eecho "Unknown action '${action}'" |
108 |
|
return 1 |
109 |
|
;; |
110 |
|
esac |
111 |
|
|
112 |
|
if [[ -z ${name} ]] |
113 |
|
then |
114 |
|
eecho "No name given" |
115 |
|
return 1 |
116 |
|
fi |
117 |
|
|
118 |
|
id=$(mysqldo "select id from cfg_autostart where serial='${serial}' and name='${name}';") |
119 |
|
if [[ -n ${id} ]] |
120 |
|
then |
121 |
|
mysqldo "update cfg_autostart set name='${name}', exec='${exec}', enabled='${enabled}' where id=${id};" |
122 |
|
else |
123 |
|
mysqldo "insert into cfg_autostart(serial,name,exec,enabled) values('${serial}','${name}','${exec}','${enabled}');" |
124 |
|
fi |
125 |
|
} |
126 |
|
|
127 |
|
control_fluxbox_autostart() |
128 |
|
{ |
129 |
|
local serial="${CLASS_ARGV[0]}" |
130 |
|
push_config_80_fluxbox_autostart "${serial}" |
131 |
|
} |
132 |
|
|
133 |
|
push_config_80_fluxbox_autostart() |
134 |
|
{ |
135 |
|
local serial="$1" |
136 |
|
local values |
137 |
|
local id |
138 |
|
|
139 |
|
values=$(mysqldo "select id from cfg_autostart where serial='${serial}';") |
140 |
|
for id in ${values} |
141 |
|
do |
142 |
|
evaluate_table_xml cfg_autostart "where serial='${serial}'" |
143 |
|
if [[ -z ${cfg_autostart_name} ]] |
144 |
|
then |
145 |
|
eecho "Name must not be empty id->'${id}'" |
146 |
|
continue |
147 |
|
fi |
148 |
|
if [[ -z ${cfg_autostart_enabled} ]] |
149 |
|
then |
150 |
|
eecho "Enabled must not be empty id->'${id}'" |
151 |
|
continue |
152 |
|
fi |
153 |
|
if [[ ${cfg_autostart_enabled} = 1 ]] |
154 |
|
then |
155 |
|
control_client "${serial}" set fluxbox.autostart add "${cfg_autostart_name}" "${cfg_autostart_exec}" |
156 |
|
elif [[ ${cfg_autostart_enabled} = 0 ]] |
157 |
|
then |
158 |
|
control_client "${serial}" set fluxbox.autostart del "${cfg_autostart_name}" |
159 |
|
# remove from database too |
160 |
|
mysqldo "delete from cfg_autostart where id='${id}';" |
161 |
|
else |
162 |
|
eecho "unknown enabled value id->'${id}', cfg_autostart_enabled -> '${cfg_autostart_enabled}'" |
163 |
|
return 1 |
164 |
|
fi |
165 |
|
done |
166 |
|
} |
167 |
|
|
168 |
help_fluxbox_theme() |
help_fluxbox_theme() |
169 |
{ |
{ |
170 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
182 |
control_fluxbox_theme() |
control_fluxbox_theme() |
183 |
{ |
{ |
184 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
185 |
|
push_config_fluxbox_theme "${serial}" |
186 |
|
} |
187 |
|
|
188 |
|
push_config_80_fluxbox_theme() |
189 |
|
{ |
190 |
|
local serial="$1" |
191 |
local value |
local value |
192 |
|
|
193 |
value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'") |
value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'") |