diff --git a/usr/bin/jgdesktops b/usr/bin/jgdesktops
index c394258..b13e321 100755
--- a/usr/bin/jgdesktops
+++ b/usr/bin/jgdesktops
@@ -13,7 +13,7 @@ case $LANG in
ALL_DESK="Wszystkich pulpitach"
MANAGE="Pulpity"
ADD="Dodaj nowy"
- REMOVE="Usuń ostatni"
+ REMOVE_LAST="Usuń ostatni"
DESKMNGR="Menadżer sesji pulpitowych"
;;
es*)
@@ -27,7 +27,7 @@ case $LANG in
ALL_DESK="All Desktops"
MANAGE="Manage Desktops"
ADD="Add new desktop"
- REMOVE="Remove last desktop"
+ REMOVE_LAST="Remove last desktop"
DESKMNGR="Desktop session Manager"
;;
*)
@@ -41,7 +41,7 @@ case $LANG in
ALL_DESK="All Desktops"
MANAGE="Manage Desktops"
ADD="Add new desktop"
- REMOVE="Remove last desktop"
+ REMOVE_LAST="Remove last desktop"
DESKMNGR="Desktop session Manager"
;;
esac
@@ -89,7 +89,7 @@ fi
out+=("^sep($MANAGE)")
desktops=$(wmctrl -d |wc -l)
out+=(" $ADD,wmctrl -n $((desktops+1))")
-out+=(" $REMOVE,wmctrl -n $((desktops-1))")
+out+=(" $REMOVE_LAST,wmctrl -n $((desktops-1))")
out+=("^sep()")
out+=("$DESKMNGR,jgdeskmngr -s")
diff --git a/usr/bin/mbhelper b/usr/bin/mbhelper
index 07955f6..bec03ae 100755
--- a/usr/bin/mbhelper
+++ b/usr/bin/mbhelper
@@ -8,22 +8,31 @@ case $LANG in
pl*)
LNGDIR="pl"
TYPE_TO_SEARCH="pisz aby wyszukać"
-
+ ME="MB helper (to menu)"
+ EDIT="Dostosuj to menu"
+ RESET="Przywróć domyślne"
;;
es*)
LNGDIR="en"
TYPE_TO_SEARCH="type to search"
+ ME="MBhelper (this menu)"
+ EDIT="Edit this menu"
+ RESET="Reset to default"
;;
*)
LNGDIR="en"
TYPE_TO_SEARCH="type to search"
+ ME="MBhelper (this menu)"
+ EDIT="Edit this menu"
+ RESET="Reset to default"
;;
esac
-##[[ -f "$HOME/.config/mabox/mbhelper.csv" ]] && CSVFILE="$HOME/.config/mabox/mbhelper.csv" || CSVFILE="/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv"
-CSVFILE="/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv"
+[[ -f "$HOME/.config/mabox/mbhelper.csv" ]] && CSVFILE="$HOME/.config/mabox/mbhelper.csv" TODEFAULT="$RESET,mbhelper reset"|| CSVFILE="/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv" TODEFAULT=""
+
+run() {
### RUN
if [[ $1 = "-s" ]]; then
. /usr/bin/pipemenu-standalone.cfg
@@ -45,6 +54,10 @@ mkconfigfile
cat < ${MENU_ITEMS}
@search,,25,15,292,20,4,left,top,auto,#262626,""" $TYPE_TO_SEARCH"""
. $CSVFILE
+^sep($ME)
+$EDIT,mbhelper edit
+${TODEFAULT}
+
EOF
jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null
@@ -53,5 +66,24 @@ exit 0
fi
printf '%s\n' "${out[@]}"
+}
+edit() {
+if [[ -f "$HOME/.config/mabox/mbhelper.csv" ]];then
+geany "$HOME/.config/mabox/mbhelper.csv"
+else
+cp "/usr/share/mabox/lang/${LNGDIR}/.config/mabox/mbhelper.csv" "$HOME/.config/mabox/mbhelper.csv"
+geany "$HOME/.config/mabox/mbhelper.csv"
+fi
+}
+
+reset() {
+ rm "$HOME/.config/mabox/mbhelper.csv"
+}
+
+case "$1" in
+ -e|edit) edit;;
+ -r|reset) reset;;
+ *) run "$1";;
+esac