Need a KDialog Wrapper for Yad (Bash Gui Linux) Open Source project!
$30-250 USD
Closed
Posted almost 11 years ago
$30-250 USD
Paid on delivery
[Yad][1] is a utility that displays graphical dialogs from shell scripts or the command line. I need a simple shell script (bash) that wraps some Yad functionality. I will contribute the completed code to Yad and license it under the GNU GPL v3 (same as Yad).
Someone has contributed a [ZenityWrapper][2] to Yad. This is similar to what I need. ZenityWrapper consists of this very simple code:
function zenity ()
{
local ARGS
ARGS=
for a in "$@"; do
case $a in
--info) ARGS="$ARGS --image=gtk-dialog-info" ;;
--question) ARGS="$ARGS --image=gtk-dialog-question" ;;
--warning) ARGS="$ARGS --image=gtk-dialog-warning" ;;
--error) ARGS="$ARGS --image=gtk-dialog-error" ;;
*) ARGS="$ARGS $a"
esac
done
eval set -- $ARGS
yad $@
}
export -f zenity
As stated at the link, "This is just a proof of concept, not a fully-worked solution!"
I need something similar for KDialog, but complete and fully tested.
I have considered using [easybashgui][3], which is a project I like and support. But the current version of easybashgui does not support input dialogs that contain:
- a prompt or other descriptive text
- an input field
- a default value that is pre-populated and pre-selected (so that it would be replaced easily by starting to type or that can be accepted simply by hitting enter)
Yad and KDialog do offer the needed functionality. easybashgui may offer it in the future, but I cannot use easybashgui for the current project. For now, I need a simple wrapper in the spirit of the above code (but complete) that will wrap all KDialog functions and pass them to Yad.
At the minimum, these are the KDialog types that need to be supported:
- --yesno
- --sorry
- --error
- --msgbox
- --inputbox
- --combobox
- --warningcontinuecancel
- --getopenfilename
- --progressbar
As just one example, the following code should run and it should call Yad through the KDialog wrapper:
PROMPTUSERN=`whoami`
if [ $(id -u) = "0" ] ; then
PROMPTUSERN=$SUDO_USER
fi
USERFINAL=$(kdialog --title="Enter computer username" --inputbox="What is your user's Linux username on this computer?" $PROMPTUSERN);
Here's another example of code that should work with the wrapper:
ARCHIVEFILE=$(kdialog --getopenfilename $DWNLDFOLDER/ '*.[login to view URL] | Archive Files' );
Here's yet another example of code that the wrapper should handle:
export dbusRef=$(kdialog --progressbar "Installing software ...Please be patient while the software is installed. This process can require up to 30 minutes or more...." 100);
Then there should be a wrapper function to update the progress bar percentage. It could be called like this (to show 3% progress):
updateProgress 3
I will contribute the completed code to Yad and license it under the GNU GPL v3 (same as Yad).
[1]: [login to view URL]
[2]: [login to view URL]
[3]: [login to view URL]
I have experience in kdialog, I have worked with in this automation to users of a system that needed to change some settings of a server. I also have one year working 100% applied to Shell Scripting, awk and sed.