Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox.client.class.in

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

revision 2269 by niro, Tue Jan 14 10:34:57 2014 UTC revision 2623 by niro, Fri Sep 25 13:06:52 2015 UTC
# Line 40  set_fluxbox_menuitem() Line 40  set_fluxbox_menuitem()
40   add)   add)
41   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1   [[ -z ${name} ]] && help_fluxbox_menuitem && return 1
42   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1   [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1
43   CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name}"   ${MCORE_LIBDIR}/fluxbox-menuitem --add  --name "${name}" --exec "${exec}"
  clearconfig  
  addconfig "[exec] (${name}) {${exec}}"  
44   ;;   ;;
45   del)   del)
46   if [[ -f ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]]   if [[ -n ${name} ]]
  then  
  rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}"  
  elif [[ -z ${name} ]]  
47   then   then
48     ${MCORE_LIBDIR}/fluxbox-menuitem --del  --name "${name}"
49     else
50   # delete all items   # delete all items
51   find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f | xargs --no-run-if-empty rm   ${MCORE_LIBDIR}/fluxbox-menuitem --del
52   fi   fi
53   ;;   ;;
54   *)   *)
# Line 60  set_fluxbox_menuitem() Line 57  set_fluxbox_menuitem()
57   esac   esac
58    
59   # rebuild the menu now   # rebuild the menu now
60   fluxbox-rebuild-menu   ${MCORE_LIBDIR}/fluxbox-rebuild-menu
61  }  }
62    
63  # get_fluxbox_menuitem  # get_fluxbox_menuitem
64  get_fluxbox_menuitem()  get_fluxbox_menuitem()
65  {  {
66   list_files_in_directory ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu   ${MCORE_LIBDIR}/fluxbox-menuitem --print
67    }
68    
69    help_fluxbox_autostart()
70    {
71     mecho "get fluxbox.autostart"
72     mecho " Shows all custom added autostarts of fluxbox."
73     mecho
74     mecho "set fluxbox.autostart [action] [name] [exec] [comment]"
75     mecho " Adds or deletes a fluxbox autostart entry."
76     mecho " Actions:"
77     mecho "   add     - adds an autostart entry"
78     mecho "   del     - deletes an autostart entry"
79     mecho
80     mecho "   name    - autostart entry name"
81     mecho "   exec    - executable to start"
82     mecho "   comment - comment about this autostart - optional"
83     mecho
84     mecho " If no [name] given, all entries will be deleted."
85    }
86    
87    # set_fluxbox_autostart $name $exec $comment
88    set_fluxbox_autostart()
89    {
90     local action="${CLASS_ARGV[0]}"
91     local name="${CLASS_ARGV[1]}"
92     local exec="${CLASS_ARGV[2]}"
93     local comment="${CLASS_ARGV[3]}"
94     local CONFIG
95    
96     [[ -z ${action} ]] && help_fluxbox_autostart && return 1
97    
98     case "${action}" in
99     add)
100     [[ -z ${name} ]] && help_fluxbox_autostart && return 1
101     [[ -z ${exec} ]] && help_fluxbox_autostart && return 1
102     ${MCORE_LIBDIR}/fluxbox-autostart --add  --name "${name}" --exec "${exec}" --comment "${comment}"
103     ;;
104     del)
105     if [[ -n ${name} ]]
106     then
107     ${MCORE_LIBDIR}/fluxbox-autostart --del  --name "${name}"
108     else
109     # delete all items
110     ${MCORE_LIBDIR}/fluxbox-autostart --del
111     fi
112     ;;
113     *)
114     help_fluxbox_autostart && return 1
115     ;;
116     esac
117    
118     # rebuild the menu now
119     ${MCORE_LIBDIR}/fluxbox-rebuild-autostart
120    }
121    
122    # get_fluxbox_autostart
123    get_fluxbox_autostart()
124    {
125     ${MCORE_LIBDIR}/fluxbox-autostart --print
126  }  }
127    
128  help_fluxbox_theme()  help_fluxbox_theme()

Legend:
Removed from v.2269  
changed lines
  Added in v.2623