这个问题以前已经被问过了,但是之前提供的答案现在不再有效。
chmod 755 your-AppImage-file
另一个部分是告诉系统在哪里找到AppImage文件。 当您从图形用户界面运行时,请不要假设环境设置与从终端运行时相同。特别是,KDE不会首先运行.bashrc,因此它所做的任何自定义操作,例如将$HOME/bin添加到PATH中,都未完成。
我将所有的AppImage文件存储在$HOME/Containers中,该路径不在我的PATH中,默认情况下Linux无法找到它们。因此,我可以将该目录添加到我的PATH中,或者在运行AppImage时指定它。我选择后者。
解决了这个问题之后,你只需要在启动器中添加一个条目来运行AppImage。它应该设置为运行指向您的AppImage文件的绝对路径。
第二个问题是,我使用的一堆AppImage在其文件名中包含版本号。当这些文件被更新(有时会自动更新)时,菜单项指向旧名称的入口就会失效。为了避免每次发生这种情况时手动编辑我的菜单,我编写了一个辅助脚本来为我找到AppImage。
这应该保存在您的PATH目录中的文件中,例如$HOME/bin
,并设置为可执行文件。#!/bin/bash
## app_launch
## Launch an AppImage with a variable name
## Copyleft 06/10/2019 - Joseph J Pollock - JPmicrosystems
## Usage: app_launch <unique-name-substring>
## FIXME: arg may not have embedded blanks
##source $HOME/bin/bash_trace
cd "$HOME/Containers" ## Where all my AppImages live
##find . -iname \*$1\*.AppImage ## debug
real_name="$(find . -iname \*$1\*.AppImage)"
##echo "real_name = [$real_name]"
count="$(echo "$real_name" | wc -l)"
if (( count > 1 ))
then
echo "Found more than one possible AppImage"
exit 1
fi
if [[ ! -x "$real_name" ]]
then
echo "Can't find an executable AppImage for [$1]"
exit 1
fi
./"$real_name"
app_launch electrum %U
%f - a single file name
%F - a list of files; use for applications that can open several local files at once
%u - a single URL
%U - a list of URLs
%d - the folder of a file to open
%D - a list of folders
%i - the icon
%m - the mini icon
%c - the caption
我找到了一个快速的方法来完成这个任务,按照这篇文章中的建议:linuxconfig.org
简而言之,一旦你拥有了你的 .AppImage
文件(如果它还没有可执行权限,请给予其可执行权限),以及应用程序的标志(可以是 png、svg 等格式),你可以创建一个以 .desktop
结尾的文件,例如:fancy_app.desktop
,并包含以下内容:
[Desktop Entry]
Name=Fancy App
Comment=Does this and that
Exec=/home/username/path/to/the/fancy_app.appimage
Icon=/home/username/path/to/the/app-logo.png
Terminal=false
Type=Application
Categories=Something;
Keywords=something;more;