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 2016 by niro, Mon Aug 13 10:06:21 2012 UTC
# Line 10  helper_rebuild_fluxbox_menu() Line 10  helper_rebuild_fluxbox_menu()
10  {  {
11   local MMINCLUDE   local MMINCLUDE
12   local CONFIG   local CONFIG
13     local file
14     local ver
15    
16   MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include"   MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include"
17   CONFIG="${MMINCLUDE}"   CONFIG="${MROOT}/${MMINCLUDE}"
18   clearconfig   clearconfig
19     for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f)
  for file in ${MCORE_CONFIG_PATH}/fluxbox/menu/*  
20   do   do
21     [[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::")
22   addconfig "[include] (${file})"   addconfig "[include] (${file})"
23   done   done
24    
25   # rebuild the user menu too atm   # rebuild the user menu too atm
26   CONFIG="${MCORE_UNPRIV_HOME}/.fluxbox/menu"   CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/menu"
27   if [[ ! -d ${MCORE_UNPRIV_HOME}/.fluxbox ]]   if [[ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ]]
28   then   then
29   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
30   fi   fi
31    
32   # fluxbox menu header   # fluxbox menu header
33   clearconfig   clearconfig
34   local ver="$(< /etc/mageversion)"   ver="$(< ${MROOT}/etc/mageversion)"
35   addconfig "[begin] (mCore-${ver}  #${MCORE_SERIAL})"   addconfig "[begin] (${MCORE_DISTRIBUTION}-${ver}  #${MCORE_SERIAL})"
36    
37   # add a newline (maybe there is no crlf in the header)   # add a newline (maybe there is no crlf in the header)
38   addconfig   addconfig
# Line 39  helper_rebuild_fluxbox_menu() Line 41  helper_rebuild_fluxbox_menu()
41   addconfig "[include] (${MMINCLUDE})"   addconfig "[include] (${MMINCLUDE})"
42    
43   # fluxbox menu footer   # fluxbox menu footer
44   addconfig '[nop]  (__________)'   addconfig '[separator]'
45   addconfig '[exec] (Neustarten) {sudo reboot}'   addconfig '[exit] (Abmelden)'
46   addconfig '[exec] (Herunterfahren) {sudo halt}'   addconfig '[exec] (Neustarten) {sudo /sbin/reboot}'
47     addconfig '[exec] (Herunterfahren) {sudo /sbin/halt}'
48   addconfig '[end]'   addconfig '[end]'
49    
50   # add a newline (maybe there is no crlf in the footer)   # add a newline (maybe there is no crlf in the footer)
51   addconfig   addconfig
52  }  }
53    
54    helper_rebuild_fluxbox_autostart()
55    {
56     local CONFIG
57    
58     CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/apps"
59     clearconfig
60     for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/autostart -type f)
61     do
62     addconfig "$(< ${file})"
63     done
64    
65     # add a newline (maybe there is no crlf in the footer)
66     addconfig
67    }
68    
69  help_fluxbox_menuitem()  help_fluxbox_menuitem()
70  {  {
71   mecho "get fluxbox.menuitem"   mecho "get fluxbox.menuitem"
# Line 83  set_fluxbox_menuitem() Line 101  set_fluxbox_menuitem()
101   add)   add)
102   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1
103   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1
104   CONFIG="${MCORE_CONFIG_PATH}/fluxbox/menu/${name}"   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name}"
105   clearconfig   clearconfig
106   addconfig "[exec] (${name}) {${exec}}"   addconfig "[exec] (${name}) {${exec}}"
107   ;;   ;;
108   del)   del)
109   if [[ -f ${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]]   if [[ -f ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]]
110   then   then
111   rm ${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}"   rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}"
112   elif [[ -z ${name} ]]   elif [[ -z ${name} ]]
113   then   then
114   # delete all items   # delete all items
115   rm ${MCORE_CONFIG_PATH}/fluxbox/menu/*   rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/*
116   fi   fi
117   ;;   ;;
118   *)   *)
# Line 109  set_fluxbox_menuitem() Line 127  set_fluxbox_menuitem()
127  # get_fluxbox_menuitem  # get_fluxbox_menuitem
128  get_fluxbox_menuitem()  get_fluxbox_menuitem()
129  {  {
130   local i   list_files_in_directory ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu
  local item  
   
  for i in $(find ${MCORE_CONFIG_PATH}/fluxbox/menu -type f | sort)  
  do  
  item="${item} $(basename ${i})"  
  done  
   
  mecho "${item}"  
131  }  }
132    
133  help_fluxbox_theme()  help_fluxbox_theme()
# Line 159  get_fluxbox_theme() Line 169  get_fluxbox_theme()
169    
170   case "${method}" in   case "${method}" in
171   system)   system)
172   for i in $(find ${stylesdir} -mindepth 1 -maxdepth 1 | sort)   list_files_in_directory -type d -mindepth 1 -maxdepth 1 ${MROOT}/${stylesdir}
  do  
  value="${value} $(basename ${i})"  
  done  
  mecho "${value}"  
173   ;;   ;;
174    
175   current)   current)
176   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:')
177   mecho "${value}"   rvecho "${value}"
178   ;;   ;;
179   *) help_fluxbox_theme && return 1 ;;   *) help_fluxbox_theme && return 1 ;;
180   esac   esac

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