How to Start an AppImage via a script

Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 2790
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 835 times

How to Start an AppImage via a script

Post by mikeslr »

While mentioned, I don't think this has been extensively explained elsewhere.

AppImages are a great way to publish applications. In theory, an AppImage is 'self-contained', having within itself all the dependencies it needs. In practice, publishers only test against 3 or 4 'Major distros' and Puppys aren't among them. At least under 'Ubuntu-binary-compatible' Puppys, many will be fully functional OOTB. [Others, you'll have to install some (maybe a lot) of debs]. For more information about them see https://www.forum.puppylinux.com/viewtopic.php?t=3771.

For security reasons, AppImages are not executable when downloaded. Easily solved. Just Right-Click, select 'Properties' and put marks in the boxes in the Exec column.

Very few AppImages when started will offer to 'integrate' with your operating system. To start them you will have to file-browse to them and Left-Click them. That, however, can be very inconvenient, especially if you want them to start immediately at boot-up. Again, easily solved.

Tip: The name an AppImage bears when you download it is 'Human Readable' in part for your convenience, but mostly so that the creator/publisher can keep track of versions. You can rename them to anything. Example: an AppImage downloaded with the name "ComplexlyNamed-toCreateConfusion.glibc2.54-x86_64.AppImage" can be Right-Click>Renamed "myApp" or "Portal-to-Hell". ;) Your operating system doesn't care. :) So, having renamed an AppImage for YOUR convenience, e.g. myApp, you do this:

To create a script, Right-Click an empty space and from the pop-up menu select New>Script; give it a name 'e.g. myScript'. Right-Click the file (named myScript) you just created and from the pop-up menu select >Open as Text. You'll see this line already present:

#!/bin/bash

Press return to start a new line and type, for example,
/FULL-PATH-TO-APPIMAGE/myApp ]## Obviously, substitute the real path and name.

Note that absent from that line is "$@". Not only is that not needed, but IIRC including it prevents the script for an already executable AppImage from properly functioning.

To start the AppImage immediately on bootup, drop that script into /root/Startup.

To have a menu entry --and from thence a desktop or panel launcher-- create a desktop file in /usr/share/applications with Exec=myScript. You have a choice: (a) either locate the myScript script somewhere 'on the path' or (b) include in your Exec argument /FULL-PATH-TO-myScript/myScript.

For further information about creating menu entries, see MikeWalsh's post, viewtopic.php?t=3420

Post Reply

Return to “File Management”