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 |
*) |
*) |
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]" |
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 |
83 |
|
mecho " If no [name] given, all entries will be deleted." |
84 |
|
} |
85 |
|
|
86 |
|
# set_fluxbox_autostart $name $exec |
87 |
|
set_fluxbox_autostart() |
88 |
|
{ |
89 |
|
local action="${CLASS_ARGV[0]}" |
90 |
|
local name="${CLASS_ARGV[1]}" |
91 |
|
local exec="${CLASS_ARGV[2]}" |
92 |
|
local CONFIG |
93 |
|
|
94 |
|
[[ -z ${action} ]] && help_fluxbox_autostart && return 1 |
95 |
|
|
96 |
|
case "${action}" in |
97 |
|
add) |
98 |
|
[[ -z ${name} ]] && help_fluxbox_autostart && return 1 |
99 |
|
[[ -z ${exec} ]] && help_fluxbox_autostart && return 1 |
100 |
|
${MCORE_LIBDIR}/fluxbox-autostart --add --name "${name}" --exec "${exec}" |
101 |
|
;; |
102 |
|
del) |
103 |
|
if [[ -n ${name} ]] |
104 |
|
then |
105 |
|
${MCORE_LIBDIR}/fluxbox-autostart --del --name "${name}" |
106 |
|
else |
107 |
|
# delete all items |
108 |
|
${MCORE_LIBDIR}/fluxbox-autostart --del |
109 |
|
fi |
110 |
|
;; |
111 |
|
*) |
112 |
|
help_fluxbox_autostart && return 1 |
113 |
|
;; |
114 |
|
esac |
115 |
|
|
116 |
|
# rebuild the autostart now |
117 |
|
${MCORE_LIBDIR}/fluxbox-rebuild-autostart |
118 |
|
} |
119 |
|
|
120 |
|
# get_fluxbox_autostart |
121 |
|
get_fluxbox_autostart() |
122 |
|
{ |
123 |
|
${MCORE_LIBDIR}/fluxbox-autostart --print |
124 |
} |
} |
125 |
|
|
126 |
help_fluxbox_theme() |
help_fluxbox_theme() |