Skip to content

Commit

Permalink
Micro bug fixes on 11.X.X version.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaisarger committed Jan 8, 2019
1 parent 507792f commit c7c6c7c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Project EasyBashGUI.

Intro.

EasyBashGUI is a bash function library that aims to give simple GUI functions using yad, gtkdialog, kdialog, zenity, Xdialog, dialog, or whiptail depending on KDE or GNOME running or not, Yad, Gtkdialog or Xdialog installed or not and X server running or not ( (c)dialog or whiptail is the minimum ). So, if bash programmer writes: "message 'Thanks for using this program' ", he has not to worry in which environment his program runs: it's enough there is at least (c)dialog or whiptail installed, and program will work as expected. Obviously, if user has KDE, GNOME, or gtkdialog/Xdialog also installed ( and he's in a X session ), program will have "an other look", but logical flow is exactly the same.
EasyBashGUI is a Posix compliant Bash functions library that aims to give simple GUI functions using yad, gtkdialog, kdialog, zenity, Xdialog, dialog, or whiptail depending on KDE or GNOME running or not, Yad, Gtkdialog or Xdialog installed or not and X server running or not ( (c)dialog or whiptail is the minimum ). So, if bash programmer writes: "message 'Thanks for using this program' ", he has not to worry in which environment his program runs: it's enough there is at least (c)dialog or whiptail installed, and program will work as expected. Obviously, if user has KDE, GNOME, or gtkdialog/Xdialog also installed ( and he's in a X session ), program will have "an other look", but logical flow remains exactly the same.
You can force widget usage through "supermode" variable ( possible values: "yad", "gtkdialog", "kdialog", "zenity", "Xdialog", "dialog", "none" ;
e.g.: >export supermode="kdialog" && source easybashgui && message Hello ).
NOTE on "none" mode: you have to make sure STDERR *is not* redirected, in order to see shell boxes in your terminal.

In EasyBashGUI "suite" there are a launcher ( "easybashgui" ), a launcher that toggles some debug options ( "easybashgui-debug" ), a widget library ( "easybashgui_X.X.X.lib" ), a script to quick test it ( "easybashgui_test.sh" ), and a stand-alone script to create dialog boxes externally ( "easydialog.sh" ). Moreover there is an other library too ( "easybashlib" ) for optional ancillary functions ( thanks to it you don't need anymore to use "clean_temp" function at the end of your scripts ).
In EasyBashGUI "suite" there are a launcher ( "easybashgui" ), a launcher that toggles some debug options ( "easybashgui-debug" ), a widget library ( "easybashgui_X.X.X.lib" ), and a stand-alone script to create dialog boxes externally ( "easydialog.sh" ). Moreover there is an other library too ( "easybashlib" ) for optional ancillary functions ( thanks to it you don't need anymore to use "clean_temp()" function at the end of your EBG scripts ).



Expand Down Expand Up @@ -231,7 +231,7 @@ Thanks to Lucio Messina for "Debian policy" tips and support.



Please let me know if my work was useful for you.
Please let me know if my work has been useful for you.
Vittorio Cagnetta
vaisarger@gmail.com
https://github.com/BashGui/easybashgui
17 changes: 13 additions & 4 deletions lib/easybashgui.lib
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#####################################
#####################################
#
LIB_VERSION="11.0.0"
LIB_VERSION="11.0.1"
LIB_NAME="easybashgui.lib"
LIB_URL="https://github.com/BashGui/easybashgui"
LIB_AUTHOR="Vittorio Cagnetta"
Expand Down Expand Up @@ -204,7 +204,7 @@ if [ ${#esistenza_gtkdialog} -gt 0 ]
required_gtkdialog_second_field=7
required_gtkdialog_third_field=20
#
vers_gtkdialog="$(gtkdialog --version | cut -d ' ' -f 3 )"
vers_gtkdialog="$(gtkdialog --version | cut -d ' ' -f 3 | head -n 1 )"
if [ $(echo -n "${vers_gtkdialog}" | tr -dc '[[:digit:]]' | wc -c ) -gt 0 ]
then
vers_gtkdialog_primo_campo=$(echo "${vers_gtkdialog}" | cut -d '.' -f 1 )
Expand Down Expand Up @@ -2121,9 +2121,17 @@ elif [ "${mode}" = "gtkdialog" ]
#echo "${exit_code}" 1>&2
if [ "${exit_code}" = "0" ]
then
echo "${TEXT}" 1> "${dir_tmp}/${file_tmp}" && echo "${TEXT}" 1>&2
echo "${TEXT}" 1> "${dir_tmp}/${file_tmp}"
#
if [ "${window_title}" = "editing text" ]
then
echo "${TEXT}" 1>&2
else
echo 1>&2
fi
#
fi
#
return "${exit_code}"
#
}
Expand Down Expand Up @@ -2395,7 +2403,7 @@ elif [ "${mode}" = "dialog" ]
cat - 1> "${dir_tmp}/${file_tmp}"
if [ "${dialogo}" = "whiptail --fb" ]
then
${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} --textbox "${file}" --scrolltext "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title} (select OK by arrows)" ${icona_Ok} --textbox "${file}" --scrolltext "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
else
${dialogo} --title "${supertitle:-EasyBashGUI}: ${window_title}" ${icona_Ok} --textbox "${file}" "${dimensione_finestra_1}" "${dimensione_finestra_2}" 2> /dev/null
fi
Expand Down Expand Up @@ -7691,3 +7699,4 @@ fi
##
#
[ "${easybashgui_debug_mode}" = "YES" ] && echo "[lib SOURCED]"
[ "${easybashgui_debug_mode}" = "NO" ] && : #This is user for getting exit code = 0 :-)
9 changes: 6 additions & 3 deletions lib/easybashlib
Original file line number Diff line number Diff line change
Expand Up @@ -242,22 +242,25 @@ function eb_kill_process_tree_of_pid() {

# Define a mechanism for automatic clean up on exit, based upon the idea
# http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files
#
#declare -a eb_on_exit_commands #UNUSEFUL since causes "unbound variable" because array is set ONLY if at least element exists...
ebg_on_exit_commands=( "echo \"EBG exiting...\"" )
#echo "1) How many elements in array \${ebg_on_exit_commands[*]}: ${#ebg_on_exit_commands[*]} .........DEBUG" 1>&2
ebg_on_exit_commands=( "echo -en \"\nEBG v.${MODULE_VERSION} exiting... \" 1>&2" )
#echo "1) How many elements in array \${ebg_on_exit_commands[@]}: ${#ebg_on_exit_commands[@]} .........DEBUG" 1>&2

ebg_on_exit()
{
# evaluate ebg_on_exit_commands() in reverse order of registration ...
#
#echo "3) How many elements in array \${ebg_on_exit_commands[@]}: ${#ebg_on_exit_commands[*]} .........DEBUG" 1>&2
for (( i = $(( ${#ebg_on_exit_commands[@]} - 1 )) ; i > -1; i-- ))
do
do
#echo "ebg_on_exit $i: ${ebg_on_exit_commands[${i}]} .........DEBUG" 1>&2
eb_debug_output "ebg_on_exit ${i}: ${ebg_on_exit_commands[${i}]}"
eval "${ebg_on_exit_commands[${i}]}"
done
#
echo -e "Bye!" 1>&2
#
# Hint: Scripts that fork should start with "ebg_on_exit $0 killtree $BASHPID", to clean up child
# processes. (Also remember to kill all disowned proceses if appropriate.)
#
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9])
VERSION=11.0.0
VERSION=11.0.1

#cartelle di destinazione
DESTDIR ?= ""
Expand Down
2 changes: 1 addition & 1 deletion src/easybashgui
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ?
#
###################################################################
MODULE_VERSION="11.0.0"
MODULE_VERSION="11.0.1"
MODULE_NAME="easybashgui"
libexec_dir="/usr/lib/easybashgui"
###################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/easybashgui-debug
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ?
#
###################################################################
MODULE_VERSION="11.0.0"
MODULE_VERSION="11.0.1"
MODULE_NAME="easybashgui-debug"
###################################################################
#
Expand Down

0 comments on commit c7c6c7c

Please sign in to comment.