-
Notifications
You must be signed in to change notification settings - Fork 28
Home
EasyBashGUI is a Bash functions library for *BSD and GNU/Linux that aims to give simple GUI functions using yad, gtkdialog, kdialog, zenity, Xdialog, (c)dialog, whiptail or bash builtins depending on desktop running or not, Yad/Gtkdialog/Xdialog installed or not and, eventually, X server running or not.
So, if bash programmer writes:
message 'Thanks for using this program'.. has not to worry in which environment his program runs, and which dialog is more appropriate.
You can use as system-wide module lib or as built-in quick start module embedded!
Let's assume you have the EBG installed on system-wide, then there are only few steps :
echo -e "source easybashgui\nmessage hola" > newprogram
bash newprogramThat's it !!!!! Easy! of course this assumed you already global installed EBG!
But what if we want everything to be within our project, as developers or embedding the EBG?, to make our program independent of the installation:
mkdir ~/Devel && cd ~/Devel && git clone https://github.com/BashGui/easybashgui
cd ~/Devel/easybashgui
ln -s lib/easybashlib easybashlib && ln -s lib/easybashgui.lib easybashgui.lib
echo -e "source src/easybashgui\nmessage hola" > ~/Devel/easybashgui/newprogram
bash ~/Devel/easybashgui/newprogramThat's it !!!!! You develop your first GUI script!
Simplified way to code bash made GUI frontend dialogs! - Installation document!
IMPORTANT there are packages ready to use at just visit and use with your Linux distribution package manager!
- Dialog backend that will act as frontend GUI:
- Console:
-
gum0.13.0+ https://github.com/charmbracelet/gum (selectable) -
cdialog/dialog1.2-20120230+ https://invisible-island.net/dialog (required) -
whiptail0.52+ https://pagure.io/newt (used as falback, not selectable!)
-
- Graphical:
-
yad0.20+ https://github.com/v1cont/yad (GTK2 branch available) -
gtkdialog0.8.3+ https://code.google.com/p/gtkdialog (limited support) -
kdialog1.0+ https://invent.kde.org/utilities/kdialog (was part of kdebin) -
zenity2.30+ https://wiki.gnome.org/Projects/Zenity (may work with 2.X) -
xdialog1.0+ http://xdialog.free.fr/ (new support for https://wdlkmpx.github.io/Xdialog/ comming)
-
- Console:
- Interpreter runtime programs:
-
xwininfo1.0.2+ from Xorg https://gitlab.freedesktop.org/xorg/app/xwininfo -
coreutils8.0+ https://www.gnu.org/software/coreutils/ -
bash3.0+ https://tiswww.case.edu/php/chet/bash/bashtop.html -
bc6.1+ https://www.gnu.org/software/bc/
-
This way you will use it inside your new project "newprj" program, first download and decompress, later echoes the required minimal files and start your code:
This will download the EBG version 12.0.5 but you must check the last versions at the release page: https://github.com/BashGui/easybashgui/releases
wget https://github.com/BashGui/easybashgui/archive/refs/tags/12.0.5.tar.gz
mkdir -p ~/Devel/newprj && tar -zxvf 12.0.5.tar.gz -C ~/Devel/newprj
cd ~/Devel/newprj && ln -s lib/easybashlib easybashlib && ln -s lib/easybashgui.lib easybashgui.lib
echo -e "source src/easybashgui\nmessage hola" > ~/Devel/newprj/newprogram
bash ~/Devel/newprj/newprogramThis way you will use it in any project by only sourced one standard line, because will be available for all the system:
- Install the requirements (check first part of this document)
- download EBG from https://github.com/BashGui/easybashgui/releases
- extract all files, you will have a directory with
libandsrcdirs! - inside the new extracted dir
EasyBashGuidomake installas root!
But beware that if you assumed system wide install, the target system of your new script will already have installed the EBG package/programs, check paths in next section.
| Component | System wide path | User mode path |
|---|---|---|
easybashgui |
$(DESTDIR)/usr/bin |
$(USERDIR)/ or ./
|
easybashgui-debug |
$(DESTDIR)/usr/bin |
$(USERDIR)/ or ./
|
easybashgui.lib |
$(DESTDIR)/usr/lib/easybashgui |
$(USERDIR)/lib/ or ./lib
|
easydialog-legacy |
$(DESTDIR)/usr/bin |
$(USERDIR)/ or ./
|
easybashlib |
$(DESTDIR)/usr/lib/easybashgui |
$(USERDIR)/lib/ or ./lib
|
easybashgui.1.gz |
$(DESTDIR)/usr/share/man/man1 |
Not necesary |
icons/*xpm |
$(DESTDIR)/usr/share/easybashgui |
$(USERDIR)/icons/ |
Just after install read full documentation README.md, the only difference is the source endpoint line and the clean final line.
Explanation is on README.md System wide usage vs module user usage section.
In summary; you should get the endpoint like:
- If you installed system wide:
source easybashguiand EBG will clean automatically - If you are using from path:
source ./easybashguiand last line must beclean_temp
And... enjoy !! :-)
Before read, there are already made package at ! you can visit and check it for starting point!
For distro maintainers EBG are a simple and easy to maintain project, but due it relies on backend and coreutils programs there are some directions:
-
Minimalist people should depends on coreutils! we used some command
like
wc,type,cutandbashand we relies on their important features thatbusyboxneitherdash/shcan provide it! -
backends (frontends) are not dependencies, but (c)dialog it is!, we are
aware that we need a backend, but
dialogis the backend that must be placed as a dependency, but since not only, becausecdialogits the best dependency! from its own but it has fewer functionalities in itself, "dialog" is by far compatible with everything created since the beginning of times. - don't recommend any backend (frontend), it's not necessary!, not so much package managers have the suggestion part like Debian, but please don't recommend any backend, the EBG must use the already provided one and present in your env ! your project that will implement EBG will manage those depends and recommends!
- follows installation paths the EBG does not put any file outside of the right place, so please don't change anything!
- none of the requirements are build requirements! yeah, EBG it's fully runtime script!
Projects that already uses EBG must depends on it, and must not depends on specific frontend GUI (by example, kdialog or zenity), unless will have a detection way or specific feature.
Bash!Karaoke or LXDE Menu Manager is an idea of what you can achieve with this library... ( you would take a look at my scripts page here, also... )
If you want something similar for the web, please, take a look at EasyBashWEB (http://sites.google.com/site/easybashweb) EasyBashWEB aims to be for Web what EasybashGUI is for local machine.
This to make bash programmer life... easy !
Vittorio Cagnetta