首页 > 系统相关 >为 Linux 下 .AppImage 运行文件快速生成桌面和任务栏图标 .sh 文件

为 Linux 下 .AppImage 运行文件快速生成桌面和任务栏图标 .sh 文件

时间:2023-03-23 10:44:44浏览次数:52  
标签:文件 AppImage basename appImage sh file 任务栏 app

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的回答

标签:文件,AppImage,basename,appImage,sh,file,任务栏,app
From: https://www.cnblogs.com/xiamuguizhi/p/17246582.html

相关文章

  • C#常见的文件路径Api
    C#常见的文件路径Api 我们经常有遇到要处理文件路径的需求,那么一般我们常见的有几种:程序下面的文件临时目录下的文件获取程序下面的文件#首先我们创建了实例解......
  • json文件转换xml
    //定义树形节点类publicclassTreeNode{publicstringName{get;set;}publicList<TreeNode>Children{get;set;}//重载ToString方法,返回该......
  • vba校验文件是否存在
    DimfsoAsFileSystemObjectSetfso=NewFileSystemObjectIfNotfso.FileExists(sPath&sFile)ThenIfbRetryThenBeep......
  • Mybatis配置映射文件中parameterType的用法小结
    原创:在mybatis映射接口的配置中,有select,insert,update,delete等元素都提到了parameterType的用法,parameterType为输入参数,在配置的时候,配置相应的输入参数类型即可。param......
  • HTML+JS+CSS实现图片文件上传界面设计的例子
    在JavaWeb应用程序设计中文件上传功能的实现是一项非常重要的工作,本文中的例子程序实现了文件上传功能的界面设计。在JavaWeb应用程序设计中涉及到上传图片文件功能......
  • sql server使用bcp导出txt文件然后导入到mysql
     1.导出表bcp"select*fromtryine_kjzx.dbo.tb_test01"queryoutc:\my.txt-S192.168.1.39-U"test"-P"test"-c-t"€"-r"\n" 2.ue打开文件转换dos转unix转......
  • Linux 查询文件夹名称命令(全称&模糊)
    全称查询如pdf全称文件名查询find-namefilename.pdf举例txt文件名查询find-namefilename.txtfinalshell中使用Linux命令操作模糊查询find-name'//文件名关......
  • 上传文件至阿里云
    UploadUtils(对象存储OSS/阿里云的代码上传网络流)packagecom.javasm.common.utils;importcom.aliyun.oss.ClientException;importcom.aliyun.oss.OSS;importcom......
  • ctf-文件执行漏洞(绕过)
    考察知识点:文件执行漏洞空格特殊字符、flag字符绕过空格绕过 ${IFS} ${IFS}$1 $IFS$1 <和<> {cat,flag} %20替换 %0a(换行) %0d(回车) %09(tab黑名单(关键字)绕......
  • Linux文件操作
    Linux文件操作Linux的文件Linux中对目录和设备的操作都是文件操作,文件分为普通文件,目录文件,链接文件和设备文件普通文件:也称磁盘文件,并且能够进行随机的数据存储(能够......