Skip to content

Commit 28c6c6e

Browse files
committed
tuning of docs and a bugfix in adjust()
1 parent be455e3 commit 28c6c6e

7 files changed

Lines changed: 29 additions & 48 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ transparently, based on the availability of the backends (frontends).
2424

2525
* Console mode:
2626
* dialog
27-
* cdialog
2827
* Graphical mode:
2928
* yad
3029
* gtkdialog

docs/README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ transparently, based on the availability of the widget backends (frontends).
147147

148148
* Console mode:
149149
* dialog
150-
* cdialog
151150
* whiptail (not selectable, just fall back)
152151
* Graphical mode:
153152
* yad
@@ -163,12 +162,12 @@ If there is no dialog/cdialog support installed. Check next section about `super
163162
The backends for frontends (the widgets to use to display boxes) are selectable
164163
by the `supermode` environment variable.
165164

166-
The `supermode` environment variable its only used to force or manually select
167-
an specific widget , by example using `kdialog` under GTK desktop, or by example
168-
using `zenity` under KDE environment. Also when EBG fails to detect widget usage!
165+
The `supermode` environment variable is only used to force or manually select
166+
a specific widget , by example using `kdialog` under GTK desktop, or by example
167+
using `zenity` under KDE environment.
169168

170169
There is no `whiptail` mode because is used only as fallback! when dialog/cdialog
171-
is missing, simply just use `supermode=dialog` for!
170+
is missing, if whiptail is present, just use `supermode=dialog` for!
172171

173172
#### System wide usage vs module user usage
174173

@@ -290,7 +289,7 @@ box with confirmation.
290289
```bash
291290
source easybashgui
292291

293-
question "Do you like Contry music ?"
292+
question "Do you like Country music ?"
294293
answer="${?}"
295294
if [ ${answer} -eq 0 ]
296295
then
@@ -385,7 +384,8 @@ You can piped the progress count to a text of a box:
385384
```bash
386385
source easybashgui
387386

388-
for i in 10 20 30 40 50 60 70 80 90 100 do
387+
for i in 10 20 30 40 50 60 70 80 90 100
388+
do
389389
echo "${i}"
390390
sleep 1
391391
done | progress "This is a test progress..."
@@ -425,7 +425,7 @@ choice_list="$(0< "${dir_tmp}/${file_tmp}" )"
425425
IFS=$'\n' ; choice_array=( $(0< "${dir_tmp}/${file_tmp}" ) ) ; IFS=$' \t\n'
426426
```
427427

428-
#### A more complex example
428+
#### A more complex example: progress bar by steps
429429

430430
```bash
431431
source easybashgui
@@ -626,9 +626,7 @@ percent position is read from STDIN, the number can be piped or parsed from:
626626
* exit code: 0 unless its canceled externally, will be anything
627627

628628
``` bash
629-
progress "[text]" <<< 20
630-
progress "[text]" <<< 60
631-
progress "[text]" <<< 90
629+
(echo "10" ; sleep 1 ; echo "50" ; sleep 1 ; echo "100" ; sleep 1 ) | progress "Percent..."
632630
```
633631

634632
* To create a progress sequence you must have several statements with different
@@ -652,12 +650,7 @@ from the STDIN to the function to indicate to fil the progress bar in the box:
652650
* exit code: 0 unless its canceled externally, will be anything
653651

654652
``` bash
655-
progress "<text>" n <<< PROGRESS
656-
progress "<text>" n-1 <<< PROGRESS
657-
...
658-
progress "<text>" 3 <<< PROGRESS
659-
progress "<text>" 2 <<< PROGRESS
660-
progress "<text>" 1 <<< PROGRESS
653+
(echo "PROGRESS" ; sleep 1 ; echo "PROGRESS" ; sleep 1 ) | progress "Steps..." 2
661654
```
662655

663656
#### wait_for
@@ -917,7 +910,9 @@ notify_message [-i "<icon>"] "[text]"
917910

918911
#### notify_change
919912

920-
Like "message" but now as desktop systray notification to display:
913+
This function is used to change the desktop systray notification from a state (say "good" )
914+
to the other state (say: "bad" ) set previously by notify() function (see below );
915+
moreover, you can optionally change on-the-fly even the systray icon and tooltip:
921916

922917
* ARGUMENTS:
923918
* icon : optional , picture to show in the box aside

lib/easybashgui.lib

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#####################################
3636
#####################################
3737
#
38-
LIB_VERSION="12.0.5"
38+
LIB_VERSION="12.0.6"
3939
LIB_NAME="easybashgui.lib"
4040
LIB_URL="https://github.com/BashGui/easybashgui"
4141
LIB_AUTHOR="Vittorio Cagnetta"
@@ -7922,7 +7922,6 @@ elif [ "${mode}" = "dialog" ]
79227922
init_value_percent_float=$(echo "scale=2; $(( ${init_value} - ${start_value} )) / ${step}" | bc -l )
79237923
init_value_percent=$(arrotonda "${init_value_percent_float}" )
79247924
#
7925-
#
79267925
dim=10
79277926
#
79287927
{
@@ -7934,18 +7933,16 @@ elif [ "${mode}" = "dialog" ]
79347933
#
79357934
exit_success=0
79367935
value_percent=${init_value_percent} && echo ${value_percent}
7937-
#echo "INIZIO" 1> /home/cagnettav/Desktop/prova-adj.txt
7936+
#
79387937
while :
79397938
do
79407939
read -n 3 -s key
79417940
#
7942-
#echo "---${key}---" 1>> /home/cagnettav/Desktop/prova-adj.txt
7943-
#
79447941
case ${exit_success} in
79457942
"$(echo -n "${key}" | grep -E "(${up_with_X}|${up_without_X}|${right_with_X}|${right_without_X})" &> /dev/null; echo ${?} )" )
7946-
value_percent=$(( ${value_percent} + 1 )) ;;
7943+
[ ${value_percent} -lt 100 ] && ((value_percent+=1)) ;;
79477944
"$(echo -n "${key}" | grep -E "(${down_with_X}|${down_without_X}|${left_with_X}|${left_without_X})" &> /dev/null; echo ${?} )" )
7948-
value_percent=$(( ${value_percent} - 1 )) ;;
7945+
[ ${value_percent} -gt 0 ] && ((value_percent-=1)) ;;
79497946
* )
79507947
if [[ ${key} =~ .*A.* ]]
79517948
then
@@ -7959,7 +7956,6 @@ elif [ "${mode}" = "dialog" ]
79597956
elif [[ ${key} =~ .*D.* ]]
79607957
then
79617958
value_percent=$(( ${value_percent} - 1 ))
7962-
#
79637959
elif [[ ${key} =~ .*O.* ]]
79647960
then
79657961
continue 1
@@ -7980,11 +7976,11 @@ elif [ "${mode}" = "dialog" ]
79807976
} | \
79817977
\
79827978
${dialogo} --title "${supertitle:-EasyBashGUI}: adjust (use arrow keys)" ${progress} "${testo}" "${dim}" "${dimensione_finestra_2}" $(if [ "${dialogo}" = "whiptail --fb" ] ; then echo "${init_value_percent}"; fi )
7983-
#exit_if_user_closes_window
7979+
#
79847980
exit_code="${?}"
79857981
uscita="${exit_code}"
79867982
#
7987-
reset
7983+
reset -Q
79887984
#
79897985
if [ ${uscita} -eq 0 ]
79907986
then
@@ -8023,20 +8019,11 @@ elif [ "${mode}" = "dialog" ]
80238019
exit 255
80248020
#
80258021
else
8026-
if [ "${dialogo}" = "zenity" -a ${uscita} -eq 5 ]
8027-
then
8028-
# Non far niente: sembra un codice di uscita di zenity legato ai temi...
8029-
:
8030-
#
8031-
else
8032-
#
8033-
#
8034-
alert_message ":( ...Something went wrong..."
8035-
echo -e "\n:( ...Something went wrong..." 1>&2
8036-
#
8037-
exit 1
8038-
#
8039-
fi
8022+
#
8023+
alert_message ":( ...Something went wrong..."
8024+
echo -e "\n:( ...Something went wrong..." 1>&2
8025+
#
8026+
exit 1
80408027
#
80418028
fi
80428029
#
@@ -8053,4 +8040,4 @@ fi
80538040
##
80548041
#
80558042
[ "${easybashgui_debug_mode}" = "YES" ] && echo "[lib SOURCED]"
8056-
[ "${easybashgui_debug_mode}" = "NO" ] && : #This is user for getting exit code = 0 :-)
8043+
[ "${easybashgui_debug_mode}" = "NO" ] && : #This is used to get exit code = 0 :-)

lib/easybashlib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# prevent repeated inclusion
1414
if [ "${eb_incl_easybashlib__imported+defined}" = "defined" ]
1515
then
16-
echo "easybashlib: ERR: easybashlib not sourced (already sourced)."
16+
echo "easybashlib: INFO: easybashlib not sourced (already sourced)."
1717
return 0
1818
fi
1919
#

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9])
2-
VERSION=12.0.5
2+
VERSION=12.0.6
33

44
#cartelle di destinazione
55
DESTDIR ?= ""

src/easybashgui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#
7777
#
7878
###################################################################
79-
MODULE_VERSION="12.0.5"
79+
MODULE_VERSION="12.0.6"
8080
MODULE_NAME="easybashgui"
8181
libexec_dir="/usr/lib/easybashgui"
8282
###################################################################

src/easybashgui-debug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#
7777
#
7878
###################################################################
79-
MODULE_VERSION="12.0.5"
79+
MODULE_VERSION="12.0.6"
8080
MODULE_NAME="easybashgui-debug"
8181
###################################################################
8282
#

0 commit comments

Comments
 (0)