AppImage executing Yad GUI and gnome-terminal child process sudo authority #1387
Replies: 3 comments
-
https://www.youtube.com/watch?v=AB1_KBxtKeU Video of yad-Portablae-x86_64.AppImage --> yad + bash running the below code. |
Beta Was this translation helpful? Give feedback.
-
Summary Process for below code: yad-Portable-x86_64-yad.AppImage --> Parent YadBash Shell Script (Absolute Path must be used to access host files) --> Child YadBash Shell Script:
2a. YadBash Child Shell Script (executed by Parent in AppImage --> Child Shell Process - yad script --> /tmp/yad/yad-binimage-vfiles.sh <--. /tmp/yad/source/yad-binary.source (symlinked from Host location to /tmp/yad//usr/local/bin/yad Currently, I have only resolved enough library files using symlinks to allow the yad --html widget to be fully functional. There are 357 library files used by yad gui --html --sourceview --standalone. As I test more yad functions, ie --sourceview, --picture, --file, etc., more of the 357 files will be sourced to /tmp/yad/yad-binimage-vfiles.sh. 2b. Example dependicy symlink shell code used in : /tmp/yad/yad-binimage-vfiles.sh ------- START /tmp/yad/source/yad-binary.source ------------------------
-------- END /tmp/yad/source/yad-binary.source ---------------------- |
Beta Was this translation helpful? Give feedback.
-
All Code include below (Exept that Only 1 source code file example is include here) /////////////////////////////////////////////////////////////////////////////////////////////////////
2a. Child Shell Process - yad script --> /tmp/yad/yad-binimage-vfiles.sh These below are the libary / helper files that I have resolved currently for --html widget out of the 357 files.As more functions are tested, ie --sourceview, more of the 357 files will be sourced.##################################################################### 2b. Example dependicy symlink shell code: yad-binimage-vfiles.sh <--. /tmp/yad/source/yad-binary.source /////////////////////////////////////////////////////////////////////////////////////////////////////1. ===== START AppImage Files ==============-------------------- AppDir/AppRun ------------------------------#!/bin/bash ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ /AppDir/yad14-portable.desktop -------------#!/usr/bin/env xdg-open ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- AppDir/yad-app.png -------------------------------This will be your icon image for above /AppDir/yad14-portable.desktop---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- AppDir/AppImageBuilder.yml -----------------app: yad ingredients: ----------------------------------------------------------------------------------------------------- AppDir/usr/bin/yad-portable.sh ---------------#!/bin/bash key=$RANDOM /usr/bin/mkdir /tmp/yad clear /usr/bin/echo "" /usr/bin/echo "░▒▓█▓▒░░▒▓█▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓████████▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓█▓▒░ ░▒▓████████▓▒░" /usr/bin/echo "" export yadDir="/tmp/yad/usr/bin" PATH="/usr/bin:/usr/local/bin:/bin:/usr/lib/x86_64-linux-gnu/gnome-terminal:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0:/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/injected-bundle/" apt_update () { fdisk_l () { appimage_tool () { xdg-open 'https://github.com/AppImage/appimagetool/blob/main/README.md' yad_bash () { yad --width=1200 --height=700 --title="yadbash.com" --center --html --browser --uri="https://yadbash.com" exit } sleep 1 echo "" cp /tmp/yad/yad14-portable.desktop /home/$USER/Desktop/yad14-portable.desktop cp /tmp/yad/appimagetoo /usr/bin/appimagetool sudo ./yad-binimage-vfiles.sh yad --plug=$key --tabnum=1 --html --uri="https://github.com/AppImage" & yad --plug=$key --tabnum=2 --html --browser --uri="https://appimageshell.com/files/html/appimage.html" & yad --plug=$key --tabnum=3 --html --browser --uri="https://github.com/orgs/AppImageCommunity/repositories" & yad --plug=$key --tabnum=4 --html --uri="https://github.com/orgs/AppImage/discussions" & yad --plug=$key --tabnum=5 --html --browser --uri="https://docs.appimage.org/" & yad --key=$key --notebook --tab-pos=left --width=1200 --height=700 --title="AppImage Yad Bash Child Process Example" --center --tab="AppImage Github" --tab="Videos html page" --tab="Community" --tab="Discussion" --tab="Documentation" --button="Appimagetool":"bash -c 'appimage_tool'" --button="update apt":"bash -c 'apt_update'" --button="fdisk -l":"bash -c 'fdisk_l'" --button="yad GUI Info":"bash -c 'yad_bash'" --button="Exit:1" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------========== END AppImage Files===== START 2. Child Shell Process - yad script ====------------- /tmp/yad/yad-binimage-vfiles.sh -----------------#!/bin/bash clearexport yadDir="/usr/local/bin" clear echo "░▒▓█▓▒░░▒▓█▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓████████▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░ ░▒▓█▓▒░ ░▒▓████████▓▒░" echo "" clear if [ -d "$yadTmpWebkitInjectDir" ]; then if [ -f "/tmp/yad/remove_yad-libfile-symlinks.sh" ]; then
else clearcd /tmp/yad
##################################################################### These below are the libary / helper files that I have resolved currently for --html widget out of the 357 files.As more functions are tested, ie --sourceview, more of the 357 files will be sourced.##################################################################### . /tmp/yad/source/lib/libgstdsd.so.source # Can nof located this file in Deb Repos. /tmp/yad/source/lib/libgstfft-1.0.so.0.source ------------- /tmp/yad/yad-binimage-vfiles.sh ---------------------------- START 2b. example symlink source file /tmp/yad/source/yad-binary.source -----------################################################################## all symlink code using "souced in to the parent shell script /tmp/yad/yad-binimage-vfiles.sh using = dot --> space --> /path/source-filenameexample ----> . /yad/tmp/yad-binary.source################################################################## ------- START /tmp/yad/source/yad-binary.source ------------------------
-------- END /tmp/yad/source/yad-binary.source ---------------------- |
Beta Was this translation helpful? Give feedback.
-
This would not have been possible without the help from @probonopd and @TheAssassin as I was stuck in a rut with a conflicting host system. Please check out the 6 minute youtube video, link below for visual demonstration of GUI / terminal functions from shell script from within an AppImage.
As seen in the linked video, it is possible to do more than just 1 app - 1 file, you can also do unlimited bash commands (sh for those not using bash) with elevated root permissions too by executing a shell script that:
I am sure you are thinking about security risks, well, no more than a terminal in the normal sense.
Using a GUI prohibts a user from executing commands that can damage their system. The developer controls the actions via the GUI.
In the video you will see sudo password typed in to terminal. Every GUI is possible of handling this graphically at which point the command output can be saved to a /tmp/command.log and displayed in to a text-info window using --tail command.
Anyone interested in the yad GUI (yad + bash) code, I will gladly place it on my github repo or in pastebin . com
https://www.youtube.com/watch?v=Au7YnsQ-6zA
Beta Was this translation helpful? Give feedback.
All reactions