为 ubuntu 下 .AppImage 运行文件快速生成桌面和任务栏图标 .sh 文件
I had a friend make an install sh file: It seems to work well and I get an icon added to my ubuntu left app shortcut bar. Here it is below. I will deliver a zip with the app logo and sh file.
It could be modified to help others. I don’t want to recommend or use for myself the appImage installer app. I’m more comfortable with a bash script for myself and logically what I would give others too. This does not require any root privs ans will be accepted better just like appImages over deb.
Nevertheless, this is dependent on the desktop file rather than the appImage produced in contrast to kdenLive appImage that works fine.
#!/bin/bash
basename=tipitaka_pali_reader
appimages=${basename}.AppImage
icons=${basename}.png
desktopfile=${basename}.desktop
# System
# desktopdir=/usr/share/applications/
# appdir=/usr/local/bin/
# iconsdir=/usr/share/icons/
cat > $desktopfile <<EOF
[Desktop Entry]
Name=Tipitaki Pali Reader
# Name[my]=.
# Name[th]=.
# Name[zh]=.
# Name[vi]=.
Comment=A Modern Application for Reading Pali
# Comment[my]=.
# Comment[th]=.
# Comment[zh]=.
# Comment[vi]=.
Exec=${HOME}/.local/bin/tipitaka_pali_reader.AppImage
Terminal=false
Type=Application
Icon=${HOME}/.local/share/icons/tipitaka_pali_reader.png
StartupWMClass=Tipitaki Pali Reader
Categories=Utility;Education;
Keywords=Pali;Reader;Dictionary;Dhamma;Tipitaka
EOF
# User
desktopdir=~/.local/share/applications/
appdir=~/.local/bin/
iconsdir=~/.local/share/icons/
for sysdir in $desktopdir $appdir $iconsdir
do
echo "$sysdir"
if [ ! -d "$sysdir" ]; then
mkdir -p "${sysdir}";
fi
done
chmod +x $appimages $desktopfile
cp -v $appimages $appdir
cp -v $icons $iconsdir
cp -v $desktopfile $desktopdir
# application-desktop file with commands
# desktop-file-install tipitaka_pali_reader.desktop --dir=$HOME/.local/share/applications
# update-desktop-database -q
# application to menu fav bar
application="'${basename}.desktop'"
favourites="/org/gnome/shell/favorite-apps"
dconf write ${favourites} \
"$(dconf read ${favourites} \
| sed "s/, ${application}//g" \
| sed "s/${application}//g" \
| sed -e "s/]$/, ${application}]/")"
效果图
来源
转载自 : bksubhuti的回答
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异