Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox.control.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2541 - (hide annotations) (download)
Wed Sep 16 10:28:47 2015 UTC (8 years, 7 months ago) by niro
File size: 2284 byte(s)
-fixed whitespaces
1 niro 2532 # $Id$
2    
3     help_fluxbox_menuitem()
4     {
5     local serial="${CLASS_ARGV[0]}"
6     control_client "${serial}" help fluxbox.menuitem
7     }
8    
9     set_fluxbox_menuitem()
10     {
11     local serial="${CLASS_ARGV[0]}"
12     local action="${CLASS_ARGV[1]}"
13     local name="${CLASS_ARGV[2]}"
14     local exec="${CLASS_ARGV[3]}"
15     local workdir="${CLASS_ARGV[4]}"
16     local icon="${CLASS_ARGV[5]}"
17 niro 2535 local id
18 niro 2532
19     case "${action}" in
20 niro 2541 add)
21     id=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';")
22 niro 2536 if [[ -n ${id} ]]
23     then
24     mysqldo "update cfg_fluxbox_menuitem set name='${name}', exec='${exec}', workdir='${workdir}', icon='${icon}' where id=${id};"
25     else
26     mysqldo "insert into cfg_fluxbox_menuitem(serial,name,exec,workdir,icon) values('${serial}','${name}','${exec}','${workdir}','${icon}');"
27     fi
28     ;;
29 niro 2532 del)
30     if [[ -n ${name} ]]
31     then
32     mysqldo "delete from cfg_fluxbox_menuitem where serial='${serial}' and name='${name}';"
33     else
34     mysqldo "delete from cfg_fluxbox_menuitem where serial='${serial}';"
35     fi
36     ;;
37     esac
38     }
39    
40     control_fluxbox_menuitem()
41     {
42     local serial="${CLASS_ARGV[0]}"
43     local values
44     local id
45    
46     values=$(mysqldo "select id from cfg_fluxbox_menuitem where serial='${serial}';")
47     for id in ${values}
48     do
49     evaluate_table_xml cfg_fluxbox_menuitem "where serial='${serial}'"
50     if [[ -z ${cfg_fluxbox_menuitem_name} ]]
51     then
52     eecho "Name must not be empty id->'${id}'"
53     continue
54     fi
55     if [[ -z ${cfg_fluxbox_menuitem_exec} ]]
56     then
57     eecho "Exec must not be empty id->'${id}'"
58     continue
59     fi
60 niro 2540 control_client "${serial}" set fluxbox.menuitem add "${cfg_fluxbox_menuitem_name}" "${cfg_fluxbox_menuitem_exec}" "${cfg_fluxbox_menuitem_workdir}" "${cfg_fluxbox_menuitem_icon}"
61 niro 2532 done
62     }
63    
64     help_fluxbox_theme()
65     {
66     local serial="${CLASS_ARGV[0]}"
67     control_client "${serial}" help fluxbox.menuitem
68     }
69    
70     set_fluxbox_theme()
71     {
72     local serial="${CLASS_ARGV[0]}"
73     local theme="${CLASS_ARGV[1]}"
74    
75     import_resource cfg_fluxbox_theme "${serial}" theme "${theme}"
76     }
77    
78     control_fluxbox_theme()
79     {
80     local serial="${CLASS_ARGV[0]}"
81     local value
82    
83     value=$(mysqldo "select theme from cfg_fluxbox.menuitem where serial='${serial}'")
84     if [[ -z ${value} ]] || [[ ${value} = NULL ]]
85     then
86     decho "No theme retrieved"
87     else
88     control_client "${serial}" set fluxbox.theme "${value}"
89     fi
90     }