3535# ####################################
3636# ####################################
3737#
38- LIB_VERSION=" 13.0.0 "
38+ LIB_VERSION=" 13.0.1 "
3939LIB_NAME=" easybashgui.lib"
4040LIB_URL=" https://github.com/BashGui/easybashgui"
4141LIB_AUTHOR=" Vittorio Cagnetta"
@@ -1436,11 +1436,37 @@ elif [ "${mode}" = "gum" ]
14361436 #
14371437 testo=" ${@ } "
14381438 #
1439+ # which_terminal="$(ps -o comm= -p $(ps -o ppid= -p $(ps -o ppid= -p $$ )))"
1440+ which_terminal=" $( ps -o comm= -p $( ps -o ppid= -p $$ ) ) "
1441+ #
14391442 # ########################################
14401443 #
14411444 frame " ${widget_color} " " please confirm"
1442- gum confirm --affirmative=" Ok" --negative=" Cancel" " $( echo -e " ${testo} " ) "
1443- exit_code=" ${?} "
1445+ #
1446+ if [ " ${which_terminal} " = " mate-terminal" -o " ${which_terminal} " = " qterminal" -o " ${which_terminal} " = " lxterminal" ]
1447+ then
1448+ #
1449+ gum confirm --affirmative=" Ok" --negative=" Cancel" " $( echo -e " ${testo} " ) "
1450+ exit_code=" ${?} "
1451+ echo -e " \n\t${testo} "
1452+ #
1453+ else
1454+ #
1455+ echo -e " \n\t${testo} "
1456+ gum choose --item.foreground 250 " Ok" " Cancel" 1> " ${dir_tmp} /${file_tmp} "
1457+ answer=$( 0< " ${dir_tmp} /${file_tmp} " )
1458+ exit_code=$( if [ " ${answer} " = " Ok" ]
1459+ then
1460+ echo 0
1461+ elif [ " ${answer} " = " Cancel" ]
1462+ then
1463+ echo 1
1464+ else
1465+ echo 1
1466+ fi )
1467+ #
1468+ fi
1469+ #
14441470 echo
14451471 # ########################################
14461472 #
@@ -1551,6 +1577,35 @@ elif [ "${notify_send}" = "NO" ]
15511577 #
15521578 notify_message_alt ()
15531579 {
1580+ local FUNCT_NAME=" notify_message_alt"
1581+ local IFS=$' \t\n '
1582+ #
1583+ # ########################################
1584+ # Begin check for user custom geometry (and let's remove icon option)...
1585+ while [ " ${1} " = " --width" -o " ${1} " = " -w" -o " ${1} " = " --height" -o " ${1} " = " -h" -o " ${1} " = " --icon" -o " ${1} " = " -i" ]
1586+ do
1587+ if [ " ${1} " = " --icon" -o " ${1} " = " -i" ]
1588+ then
1589+ icon_parameter=" ${2} " ; [ -e " ${icon_parameter} " ] && shift 2 || shift 1
1590+ continue
1591+ fi
1592+ w_or_h=" $( if [ " ${1} " = " --width" -o " ${1} " = " -w" ]
1593+ then
1594+ echo " width"
1595+ elif [ " ${1} " = " --height" -o " ${1} " = " -h" ]
1596+ then
1597+ echo " height"
1598+ fi ) "
1599+ parameter=$( echo -n " ${2} " | tr -dc ' [[:digit:]]' ) ; [ ${# parameter} -eq 0 ] && break
1600+ reset_geometry=" YES" && eval " local ${w_or_h} =${parameter} " && shift 2
1601+ done
1602+ # End check for user custom geometry (and let's remove icon option)...
1603+ # ########################################
1604+ #
1605+ : notify_send_seconds
1606+ notify_message_text=" ${@ } "
1607+ #
1608+ # ########################################
15541609 wait_for " \n\n${notify_message_text} \n\n\n\n(Please, install \" kdialog\" or \" notify-send\" for a nicer notification)\n\n."
15551610 sleep ${notify_send_seconds}
15561611 terminate_wait_for
@@ -1565,31 +1620,36 @@ elif [ "${notify_send}" = "NO" ]
15651620 local widget_color=" yellow"
15661621 #
15671622 # ########################################
1568- # Begin check for user custom geometry...
1569- while [ " ${1} " = " --width" -o " ${1} " = " -w" -o " ${1} " = " --height" -o " ${1} " = " -h" ]
1623+ # Begin check for user custom geometry (and let's remove icon option) ...
1624+ while [ " ${1} " = " --width" -o " ${1} " = " -w" -o " ${1} " = " --height" -o " ${1} " = " -h" -o " ${1} " = " --icon " -o " ${1} " = " -i " ]
15701625 do
1626+ if [ " ${1} " = " --icon" -o " ${1} " = " -i" ]
1627+ then
1628+ icon_parameter=" ${2} " ; [ -e " ${icon_parameter} " ] && shift 2 || shift 1
1629+ continue
1630+ fi
15711631 w_or_h=" $( if [ " ${1} " = " --width" -o " ${1} " = " -w" ]
1572- then
1573- echo " width"
1574- elif [ " ${1} " = " --height" -o " ${1} " = " -h" ]
1575- then
1576- echo " height"
1577- fi ) "
1632+ then
1633+ echo " width"
1634+ elif [ " ${1} " = " --height" -o " ${1} " = " -h" ]
1635+ then
1636+ echo " height"
1637+ fi ) "
15781638 parameter=$( echo -n " ${2} " | tr -dc ' [[:digit:]]' ) ; [ ${# parameter} -eq 0 ] && break
15791639 reset_geometry=" YES" && eval " local ${w_or_h} =${parameter} " && shift 2
15801640 done
1581- # End check for user custom geometry...
1641+ # End check for user custom geometry (and let's remove icon option) ...
15821642 # ########################################
15831643 #
1584- num_secondi=4
1585- testo =" ${@ } "
1644+ : notify_send_seconds
1645+ notify_message_text =" ${@ } "
15861646 #
15871647 # ########################################
15881648 frame " ${widget_color} " " notification"
1589- # bare_msg "${widget_color}" "${testo}"
1649+ #
15901650 echo -e " ############################\n############################\n\n"
1591- gum spin -s pulse --title " $( echo -e " ${testo } " ) " -- sleep ${num_secondi }
1592- echo -e " ${testo } "
1651+ gum spin -s pulse --title " $( echo -e " ${notify_message_text } " ) " -- sleep ${notify_send_seconds }
1652+ echo -e " ${notify_message_text } "
15931653 echo -e " \n\n############################\n############################"
15941654 #
15951655 echo
0 commit comments