Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/daemon/client/include/fluxbox.client.class

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1257 by niro, Fri Feb 4 19:55:56 2011 UTC revision 2013 by niro, Mon Aug 13 10:00:31 2012 UTC
# Line 12  helper_rebuild_fluxbox_menu() Line 12  helper_rebuild_fluxbox_menu()
12   local CONFIG   local CONFIG
13    
14   MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include"   MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include"
15   CONFIG="${MMINCLUDE}"   CONFIG="${MROOT}/${MMINCLUDE}"
16   clearconfig   clearconfig
17    
18   for file in ${MCORE_CONFIG_PATH}/fluxbox/menu/*   for file in ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/*
19   do   do
20     [[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::")
21   addconfig "[include] (${file})"   addconfig "[include] (${file})"
22   done   done
23    
24   # rebuild the user menu too atm   # rebuild the user menu too atm
25   CONFIG="${MCORE_UNPRIV_HOME}/.fluxbox/menu"   CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/menu"
26   if [[ ! -d ${MCORE_UNPRIV_HOME}/.fluxbox ]]   if [[ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ]]
27   then   then
28   install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MCORE_UNPRIV_HOME}/.fluxbox   install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox
29   fi   fi
30    
31   # fluxbox menu header   # fluxbox menu header
32   clearconfig   clearconfig
33   local ver="$(< /etc/mageversion)"   local ver="$(< ${MROOT}/etc/mageversion)"
34   addconfig "[begin] (mCore-${ver}  #${MCORE_SERIAL})"   addconfig "[begin] (mCore-${ver}  #${MCORE_SERIAL})"
35    
36   # add a newline (maybe there is no crlf in the header)   # add a newline (maybe there is no crlf in the header)
# Line 39  helper_rebuild_fluxbox_menu() Line 40  helper_rebuild_fluxbox_menu()
40   addconfig "[include] (${MMINCLUDE})"   addconfig "[include] (${MMINCLUDE})"
41    
42   # fluxbox menu footer   # fluxbox menu footer
43   addconfig '[nop]  (__________)'   addconfig '[separator]'
44   addconfig '[exec] (Neustarten) {sudo reboot}'   addconfig '[exit] (Abmelden)'
45   addconfig '[exec] (Herunterfahren) {sudo halt}'   addconfig '[exec] (Neustarten) {sudo /sbin/reboot}'
46     addconfig '[exec] (Herunterfahren) {sudo /sbin/halt}'
47   addconfig '[end]'   addconfig '[end]'
48    
49   # add a newline (maybe there is no crlf in the footer)   # add a newline (maybe there is no crlf in the footer)
50   addconfig   addconfig
51  }  }
52    
53    helper_rebuild_fluxbox_autostart()
54    {
55     local CONFIG
56    
57     CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/apps"
58     clearconfig
59     for file in ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/autostart/*
60     do
61     addconfig "$(< ${file})"
62     done
63    
64     # add a newline (maybe there is no crlf in the footer)
65     addconfig
66    }
67    
68  help_fluxbox_menuitem()  help_fluxbox_menuitem()
69  {  {
70   mecho "get fluxbox.menuitem"   mecho "get fluxbox.menuitem"
# Line 83  set_fluxbox_menuitem() Line 100  set_fluxbox_menuitem()
100   add)   add)
101   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1
102   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1
103   CONFIG="${MCORE_CONFIG_PATH}/fluxbox/menu/${name}"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name}"
104   clearconfig   clearconfig
105   addconfig "[exec] (${name}) {${exec}}"   addconfig "[exec] (${name}) {${exec}}"
106   ;;   ;;
107   del)   del)
108   if [[ -f ${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]]   if [[ -f ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]]
109   then   then
110   rm ${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}"   rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}"
111   elif [[ -z ${name} ]]   elif [[ -z ${name} ]]
112   then   then
113   # delete all items   # delete all items
114   rm ${MCORE_CONFIG_PATH}/fluxbox/menu/*   rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/*
115   fi   fi
116   ;;   ;;
117   *)   *)
# Line 112  get_fluxbox_menuitem() Line 129  get_fluxbox_menuitem()
129   local i   local i
130   local item   local item
131    
132   for i in $(find ${MCORE_CONFIG_PATH}/fluxbox/menu -type f | sort)   for i in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f | sort)
133   do   do
134   item="${item} $(basename ${i})"   item="${item} $(basename ${i})"
135   done   done
136    
137   mecho "${item}"   rvecho "${item}"
138  }  }
139    
140  help_fluxbox_theme()  help_fluxbox_theme()
# Line 159  get_fluxbox_theme() Line 176  get_fluxbox_theme()
176    
177   case "${method}" in   case "${method}" in
178   system)   system)
179   for i in $(find ${stylesdir} -mindepth 1 -maxdepth 1 | sort)   for i in $(find ${MROOT}/${stylesdir} -mindepth 1 -maxdepth 1 | sort)
180   do   do
181   value="${value} $(basename ${i})"   value="${value} $(basename ${i})"
182   done   done
183   mecho "${value}"   rvecho "${value}"
184   ;;   ;;
185    
186   current)   current)
187   value=$(grep -i '^session.stylefile' ${MCORE_UNPRIV_HOME}/.fluxbox/init | sed 's:.*/\(.*\):\1:')   value=$(grep -i '^session.stylefile' ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/init | sed 's:.*/\(.*\):\1:')
188   mecho "${value}"   rvecho "${value}"
189   ;;   ;;
190   *) help_fluxbox_theme && return 1 ;;   *) help_fluxbox_theme && return 1 ;;
191   esac   esac

Legend:
Removed from v.1257  
changed lines
  Added in v.2013