嵌入式爱好者

3399Linux添加应用图标到桌面

2022-4-29 17:34| 发布者: 兵兵兵兵鸭| 查看: 422| 评论: 0

类目: RK3399产品系列  >  Linux     文档编号: 636

涉及到的修改文件(基于开发板文件系统):

/usr/share/matrix-gui-2.0/apps/images/forlinx/helloworld-icon.png

/usr/share/matrix-gui-2.0/apps/qt5_helloworld

/usr/share/matrix-gui-2.0/apps/qt5_helloworld /qt5_helloworld.desktop

/usr/share/matrix-gui-2.0/json.txt

/usr/bin/helloworld

 

步骤1:创建编译可以运行的helloworld qt程序,得到可在开发板上运行的bin文件helloworld

 

步骤2:将步骤1生存的helloworld拷贝到开发板/usr/bin/目录下

 

步骤3:在/usr/share/matrix-gui-2.0/apps/文件夹中建立qt5_helloworld文件夹,在qt5_helloworld文件夹中创建qt5_helloworld.desktop文件。比较简便的方法是直接copy 其他目录下的.desktop文件,然后对其进行修改。qt5_helloworld.desktop的内容如下:

#!/usr/bin/env xdg-open

[Desktop Entry]

Name=Helloworld

GenericName=Demo App

Icon=/usr/share/matrix-gui-2.0/apps/images/forlinx/helloworld-icon.png

Exec=helloworld

Type=Application

ProgramType=gui

Name[en_US]=qt5_helloworld.desktop

 

步骤4:制作一张 96x96 大小的 png 格式的图片,命名为helloworld-icon.png,然后放到qt5_helloworld.desktop文件指定的位置,即:/usr/share/matrix-gui-2.0/apps/images/forlinx/

 

步骤5:修改/usr/share/matrix-gui-2.0/json.txt文件,添加如下内容:

{"Name":"Helloworld","Order":999,"Icon":"apps\/images\/forlinx\/helloworld-icon.png","Type":"application","Exec":"helloworld","ProgramType":"gui","Description_Link":-1,"Lock":-1,"Category":-1},

该文件的修改建议拷贝出来在电脑上修改,不容易造成文件格式的错误

 

步骤6:输入sync同步保存命令,重启开发板,就可以在桌面上看到helloworld程序了。


已解决

未解决

只是看看

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-4-20 02:31

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部