Search code examples
linuxbashshelluser-interfacezenity

Display "program splash screen" using bash script


I'm developing a program that is meant to be used in the computers of the company I work, all of them have a linux system based that we maintain. I would like to make this program more pretty by adding a screen when it starts, that contains some infos and the logo of the app, I was thinking more like a screen similar to the one libreoffice shows when you start it.

enter image description here

I tried using some of the image displays that we have on linux, like feh, imagemagick(display), but they are not what I'm looking for, even though the image will be displayed for only about 3 seconds, having the HUD that they offer, which have the option to delete the image, is not the ideal. I'm using zenity for the GUI in the rest of the script, but I don't see how I could still be using it for this functionality. In summary I need to display a splash image when I open my program, and it need to have no header no name, nothing, just the image like libreoffice. Has anyone tried this before? Thanks.


Solution

  • This page says:

    "$1-window-xid - Select the target yad window by its hexadecimal ID. If empty, it is replaced by the value of $YAD_XID, which yad automatically exports to children dialog windows."

    --uri-handler="$YAD_XID" tells webkit (I'm assuming) that this yad instance is to handle URI's returned by this window. Without it, the default browser will open. The --browser & --html flags give yad the browser behavior. Setting the --user-agent can be required when you're loading an external site's --uri.

    In the comment, --uri="http://127.0.0.1:5000" is live-server running on port 5000, which loads a website I cloned for offline use.

    yad --window-icon="favicon.png" --title="JSON Editor" --geometry="1190x500" --center --uri-handler="$YAD_XID" --browser --html --uri="http://127.0.0.1:5000"
    

    Example yad


    Here's an example of --splash. Server use is not required, you can use: --uri=index.html.