Skip to content

Commit

Permalink
AppImage can now invoke HarcHardware's main routine,
Browse files Browse the repository at this point in the history
just as IrpTransmogrifier's. Cf. #464.  Silly case sensitivity fixed. see #498.
  • Loading branch information
bengtmartensson committed Dec 17, 2023
1 parent 9c2ad52 commit 4f38a12
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/main/xdocs/IrScrutinizer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
<td>2022-12-19</td>
<td>Misc. fixes and updates.</td>
</tr>
<tr>
<td>2023-12-17</td>
<td>HarcHardware support from AppImages.</td>
</tr>
</table>

<section>
Expand Down Expand Up @@ -351,7 +355,8 @@
It comes with its own Java runtime.</p>

<p>It called using the name <code>irptransmogrifier</code>, the <a href="IrpTransmogrifier.html">IrpTransmogrifier</a> program will be invoked,
taking its usual command line arguments.</p>
taking its usual command line arguments.
Similarly, if called using the name <code>harchardware</code>, the <a href="HarcHardware.html">HarcHardware</a> main routine will be invoked.</p>

<p>To uninstall, just delete.</p>

Expand All @@ -370,7 +375,7 @@
to "Anywhere".</p>

<p>To uninstall, just drag the program to the trash can.</p>
<p>The command line program <a href="IrpTransmogrifier.html">IrpTransmogrifier</a> is not supported in this mode.
<p>The command line programs <a href="IrpTransmogrifier.html">IrpTransmogrifier</a> and <a href="HarcHardware.html">HarcHardware</a> are not supported in this mode.
(For this, the <a href="#Generic+Binary">generic binary</a> distribution has to be used.)</p>
</section>

Expand Down Expand Up @@ -418,8 +423,8 @@
<code>~/.local/share/applications</code>.</p>

<p>The program can now be started either as a desktop program, or by typing <code>irscrutinizer</code> on the command line.
Also the command line program <a href="IrpTransmogrifier.html">IrpTransmogrifier</a> can be started
by the command <code>irptransmogrifier</code>. It is also possible to start IrScrutinizer by double clicking
Also the command line programs <a href="IrpTransmogrifier.html">IrpTransmogrifier</a> and <a href="HarcHardware.html">HarcHardware</a> can be started
by the command <code>irptransmogrifier</code> and <code>harchardware</code> respectively. It is also possible to start IrScrutinizer by double clicking
on the jar file. In case this brings up the archive manager, the desktop needs to be taught
to open executable jar files with the "java" application (i.e. the JVM). For this, select a jar file the file browser,
select the properties, and select "java" as the application to "open with". (The details might vary.)</p>
Expand Down
8 changes: 4 additions & 4 deletions tools/AppRun
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ export GSETTINGS_SCHEMA_DIR="${APP_ROOT}/usr/share/glib-2.0/schemas/${GSETTINGS_
export QT_PLUGIN_PATH="${APP_ROOT}/usr/lib/qt4/plugins/:${APP_ROOT}/usr/lib/i386-linux-gnu/qt4/plugins/:${APP_ROOT}/usr/lib/x86_64-linux-gnu/qt4/plugins/:${APP_ROOT}/usr/lib32/qt4/plugins/:${APP_ROOT}/usr/lib64/qt4/plugins/:${APP_ROOT}/usr/lib/qt5/plugins/:${APP_ROOT}/usr/lib/i386-linux-gnu/qt5/plugins/:${APP_ROOT}/usr/lib/x86_64-linux-gnu/qt5/plugins/:${APP_ROOT}/usr/lib32/qt5/plugins/:${APP_ROOT}/usr/lib64/qt5/plugins/${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}"

if [ ! -z "${APPIMAGE}" ] ; then
PROG_NAME=$(basename "${ARGV0}")
PROG_NAME=$(echo $(basename "${ARGV0}") | tr '[:upper:]' '[:lower:]' )
else
PROG_NAME=$(basename "$0")
PROG_NAME=$(echo $(basename "${0}") | tr '[:upper:]' '[:lower:]' )
fi

# If this called with a name that does not end with AppImage,
# consider that as a command to be invoked, otherwise extract from desktop file.
case ${PROG_NAME} in
*AppImage|*appimage|*APPIMAGE)
*appimage)
EXEC=$(grep -e '^Exec=.*' "${APP_ROOT}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
exec "${APP_ROOT}/usr/bin/${EXEC}" "$@"
;;
irscrutinizer|irptransmogrifier)
irscrutinizer|irptransmogrifier|harchardware)
exec "${APP_ROOT}/usr/bin/${PROG_NAME}" "$@"
;;
*)
Expand Down
18 changes: 18 additions & 0 deletions tools/mkappimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,23 @@ if [ "\$1" = "irptransmogrifier" ] ; then
transmogrify "\$@"
fi
harchardware()
{
exec "${JAVA_PATH}java" -classpath "\${IRSCRUTINIZERHOME}/IrScrutinizer-jar-with-dependencies.jar" \
${JAVA_QUICKSTART} org.harctoolbox.harchardware.Main "\$@"
}
# If basename \$0 equals "harchardware" invoke that program instead.
if [ "\$(basename \$0)" = "harchardware" ] ; then
harchardware "\$@"
fi
# If \$1 equals "harchardware" invoke that program instead.
if [ "\$1" = "harchardware" ] ; then
shift
harchardware "\$@"
fi
checkgroup()
{
if grep \$1 /etc/group > /dev/null ; then
Expand Down Expand Up @@ -137,6 +154,7 @@ EOF

chmod 555 ${WRAPPER}
ln -s ${MYPROG_LOWER} ${USR_BIN}/irptransmogrifier
ln -s ${MYPROG_LOWER} ${USR_BIN}/harchardware

# Invoke the builder
#wget -c "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage"
Expand Down

0 comments on commit 4f38a12

Please sign in to comment.