Giter Club home page Giter Club logo

Comments (3)

vaisarger avatar vaisarger commented on August 18, 2024 1

Hi @mckaygerhard ! Thanks for your reply :)

Since EBG is modular, first "bare" module is "easybashgui" (it doesn't need any widget, since it simply uses bash), and, if you have not yet installed, you must set a path in your script (e.g.: source /home/me/easybashgui ), but, you know, "easybashgui" could be wherever in your system.

Once "easybashgui" is sourced, it tries to source the second module: easybashgui.lib (where are functions with all widgets ) and easybashgui.lib can be only in 5 places:

  • installed in system's PATH
  • in same script dir
  • in "includes/" subdir (of same script dir ) -I added this for more order and nicer projects -
  • in "$libexec_dir" (if this var is defined in your system )
  • in lib path (if "$SHELL_LIBRARY_PATH" is defined in your system )

=>In case all 5 options are false (that is easybashgui.lib is missing in all 5 cases), then first module easybashgui provides "bare shell" functions, and that's it.

(Well, maybe simplest way is to put easybashgui and easybashgui.lib directly into script dir... so you've done! )

About manpage and wiki, you're very kind and I really would thank you. This one is the real good Open Source spirit !
You know, an old contributor wrote time ago the old original EBG manpage (you find it in tarball ), but unfortunately it is pretty old... For instance, there aren't new "notify_*" functions, very very useful for a background desktop service.

It is really a pity, that unlike .rpm systems (like Fedora and PCLinuxOS ), those .deb systems (Debian, Ubuntu, etc. ) never had a .deb package available!

from easybashgui.

vaisarger avatar vaisarger commented on August 18, 2024

Hi mckaygerhard ! Thank you for your support.
It's true that initial variable is libexec_dir="/usr/lib/easybashgui" but the function eb_incl() manages easybashgui lib sourcing even if it's not installed in system:
`
function eb_incl() {
local module=$1

	if [ "${module:-unspecified}" = "unspecified" ]
	then
		echo "$eb_runtime_invoke_name: eb_incl: No module specified." 1>&2
		return 1
	fi

	if [ "x${eb_runtime_abs_invoke_dir:-notset}" == "xnotset" ]
	then
		echo "$eb_runtime_invoke_name: eb_incl: Error, eb_runtime_abs_invoke_dir not set."
		exit 1
	fi

	if [ "x$eb_runtime_abs_invoke_dir" == "x" ]
	then
		echo "$eb_runtime_invoke_name: eb_incl: Error, eb_runtime_abs_invoke_dir is empty."
		exit 1
	fi

	# if installed in system's PATH
	if type "$module" &>/dev/null
	then
		source "$module"
		return 0
		
	# if in same dir
	elif [ -e "$eb_runtime_abs_invoke_dir/$module" ]
	then
		source "$eb_runtime_abs_invoke_dir/$module"
		return 0
		
	# if in includes/ subdir
	elif    [ -e "$eb_runtime_abs_invoke_dir/includes" ] \
	     && [ -e "$eb_runtime_abs_invoke_dir/includes/$module" ]
	then
		source "$eb_runtime_abs_invoke_dir/includes/$module"
		return 0	
		
	# if in "libexec_dir"
	elif [ -e "$libexec_dir/$module" ]
	then
		source "$libexec_dir/$module"
		return 0	
		
	# if lib path is defined
	elif [ "${SHELL_LIBRARY_PATH:-unset}" != "unset" ]
	then
		local saved_IFS="$IFS"
		IFS=':'
		for path in $SHELL_LIBRARY_PATH
			do
			if [ -e "$path/$module" ]
			then
				source "$path/$module"
				return 0
			fi
		done
		IFS="$saved_IFS"

	fi
echo -e "$eb_runtime_invoke_name: eb_incl: Could not find requested module \"$module\" in \$PATH, $eb_runtime_abs_invoke_dir, an includes/ subdirectory, or \$SHELL_LIBRARY_PATH." 1>&2 && return 1`

So, it is possible using EBG even if it's not yet installed in your system, sourcing EBG in this way:
source [WHEREVER]/easybashgui/src/easybashgui

I have just tested it to make sure is always working:
#mv /usr/bin/easybashgui /usr/bin/PROVAeasybashguiPROVA
#mv /usr/lib/easybashgui/easybashgui.lib /usr/lib/easybashgui/PROVAeasybashgui.libPROVA
I copied "easybashgui.lib" in same script's directory, and it did work.

This is my simple test script:
`
#!/usr/bin/env bash

source ./easybashgui/src/easybashgui

message CIAOOOOOOOOOOOOOOOO
`

However, I must admit that there is no documentation about embedding (that is: using and not installing) EBG in this way... I have to update my site!
https://sites.google.com/site/easybashgui/

Please, let me know your opinion about... :)

from easybashgui.

mckaygerhard avatar mckaygerhard commented on August 18, 2024

hi @vaisarger thanks for confirmation.. i was checking such funtion but not so deep.. i was guessing that path is compatible but i prefers to confirms to you.. so the only i need to use the project is just sourcered the two files in same path of my new script so then:

  1. create a new script
  2. move easybashgui and easybashgui.lib to the same path of the new script
  3. sourcered the easybashgui and NOT easybashgui.lib from the new script

so then that's wll nright?

if such thing is right way, the rest of files must be decribed and i can make a simple manpage for you.. and also some examples on the wiki too!

from easybashgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.