1 |
# $Id$ |
# $Id$ |
2 |
|
|
3 |
# control_input_keymap $serial |
push_config 80_idesk_icon |
|
control_input_keymap() |
|
|
{ |
|
|
local serial="${CLASS_ARGV[0]}" |
|
|
push_config_input_keymap "${serial}" |
|
|
} |
|
|
|
|
|
push_config_input_keymap() |
|
|
{ |
|
|
local serial="$1" |
|
|
local value |
|
|
|
|
|
value=$(mysqldo "select keymap from cfg_input where serial='${serial}'") |
|
|
control_client "${serial}" set input.keymap "${value}" |
|
|
} |
|
4 |
|
|
5 |
help_idesk_icon() |
help_idesk_icon() |
6 |
{ |
{ |
7 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
8 |
control_client "${serial}" help idesk.icon |
control_client "${serial}" help idesk.icon |
|
|
|
|
mecho "get idesk.icon" |
|
|
mecho " Shows all configured icons." |
|
|
mecho |
|
|
mecho "set idesk.icon [action] [name] [command] [icon] [filename] [x,y] [width,height] [default-icon]" |
|
|
mecho " Adds or deletes an desktop icon." |
|
|
mecho " [actions]:" |
|
|
mecho " add - adds an icon" |
|
|
mecho " del - deletes an icon" |
|
|
mecho " if no [name] given, all desktop icons will be deleted" |
|
|
mecho |
|
|
mecho " name - Name of the icon" |
|
|
mecho " command - command which will be run" |
|
|
mecho " icon - icon pixmap [optional]" |
|
|
mecho " filename - filename of the icon [optional]" |
|
|
mecho " x,y - x,y position of the icon on the desktop [optional]" |
|
|
mecho " width,height - width and height of the icon [optional]" |
|
|
mecho " default-icon - default icon which will be selected if the icon pixmap was not found [optional]" |
|
9 |
} |
} |
10 |
|
|
11 |
set_idesk_icon() |
set_idesk_icon() |
49 |
;; |
;; |
50 |
esac |
esac |
51 |
|
|
52 |
|
if [[ -z ${name} ]] |
53 |
|
then |
54 |
|
eecho "No name given" |
55 |
|
return 1 |
56 |
|
fi |
57 |
|
|
58 |
id=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}' and name='${name}';") |
id=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}' and name='${name}';") |
59 |
if [[ -n ${id} ]] |
if [[ -n ${id} ]] |
60 |
then |
then |
68 |
control_idesk_icon() |
control_idesk_icon() |
69 |
{ |
{ |
70 |
local serial="${CLASS_ARGV[0]}" |
local serial="${CLASS_ARGV[0]}" |
71 |
|
push_config_80_idesk_icon "${serial}" |
72 |
|
} |
73 |
|
|
74 |
|
push_config_80_idesk_icon() |
75 |
|
{ |
76 |
|
local serial="$1" |
77 |
local values |
local values |
78 |
local id |
local id |
79 |
|
local xypos |
80 |
|
local widthheight |
81 |
|
|
82 |
values=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}';") |
values=$(mysqldo "select id from cfg_idesk_icon where serial='${serial}';") |
83 |
for id in ${values} |
for id in ${values} |
84 |
do |
do |
85 |
evaluate_table_xml cfg_idesk_icon "where serial='${serial}'" |
evaluate_table_xml cfg_idesk_icon "where id='${id}'" |
86 |
if [[ -z ${cfg_idesk_icon_name} ]] |
if [[ -z ${cfg_idesk_icon_name} ]] |
87 |
then |
then |
88 |
eecho "Name must not be empty id->'${id}'" |
eecho "Name must not be empty id->'${id}'" |
89 |
continue |
continue |
90 |
fi |
fi |
|
if [[ -z ${cfg_idesk_icon_command} ]] |
|
|
then |
|
|
eecho "Command must not be empty id->'${id}'" |
|
|
continue |
|
|
fi |
|
91 |
if [[ -z ${cfg_idesk_icon_enabled} ]] |
if [[ -z ${cfg_idesk_icon_enabled} ]] |
92 |
then |
then |
93 |
eecho "Enabled must not be empty id->'${id}'" |
eecho "Enabled must not be empty id->'${id}'" |
95 |
fi |
fi |
96 |
if [[ ${cfg_idesk_icon_enabled} = 1 ]] |
if [[ ${cfg_idesk_icon_enabled} = 1 ]] |
97 |
then |
then |
98 |
control_client "${serial}" set idesk.icon add "${cfg_idesk_icon_name}" "${cfg_idesk_icon_command}" "${cfg_idesk_icon_icon}" "${cfg_idesk_icon_filename}" "${cfg_idesk_icon_xpos},${cfg_idesk_icon_ypos}" "${cfg_idesk_icon_width},${cfg_idesk_icon_height}" "${cfg_idesk_icon_default_icon}" |
if [[ -n ${cfg_idesk_icon_xpos} ]] && [[ -n ${cfg_idesk_icon_ypos} ]] |
99 |
|
then |
100 |
|
xypos="${cfg_idesk_icon_xpos},${cfg_idesk_icon_ypos}" |
101 |
|
fi |
102 |
|
if [[ -n ${width} ]] && [[ -n ${height} ]] |
103 |
|
then |
104 |
|
widthheight="${cfg_idesk_icon_width},${cfg_idesk_icon_height}" |
105 |
|
fi |
106 |
|
control_client "${serial}" set idesk.icon add "${cfg_idesk_icon_name}" "${cfg_idesk_icon_command}" "${cfg_idesk_icon_icon}" "${cfg_idesk_icon_filename}" "${xypos}" "${widthheight}" "${cfg_idesk_icon_default_icon}" |
107 |
elif [[ ${cfg_idesk_icon_enabled} = 0 ]] |
elif [[ ${cfg_idesk_icon_enabled} = 0 ]] |
108 |
|
then |
109 |
control_client "${serial}" set idesk.icon del "${cfg_idesk_icon_name}" |
control_client "${serial}" set idesk.icon del "${cfg_idesk_icon_name}" |
110 |
# remove from database too |
# remove from database too |
111 |
mysqldo "delete from cfg_idesk_icon where id='${id}';" |
mysqldo "delete from cfg_idesk_icon where id='${id}';" |
112 |
else |
else |
113 |
eecho "unknown enabled value id->'${id}', cfg_idesk_icon_enabled -> '${cfg_idesk_icon_enabled}'" |
eecho "unknown enabled value id->'${id}', cfg_idesk_icon_enabled -> '${cfg_idesk_icon_enabled}'" |
114 |
return 1 |
return 1 |
115 |
|
fi |
116 |
done |
done |
117 |
} |
} |