Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

吐槽一下,能不能规范修改一下gopeed.dekstop文件? #236

Closed
zxp19821005 opened this issue Oct 18, 2023 · 11 comments
Closed

吐槽一下,能不能规范修改一下gopeed.dekstop文件? #236

zxp19821005 opened this issue Oct 18, 2023 · 11 comments

Comments

@zxp19821005
Copy link

我已经将该项目移植到了ArchLinux的AUR上,详见 https://aur.archlinux.org/packages/gopeed-bin 。每次都需要对gopeed.dekstop进行修改完善。所以我建议咱们能不能官方修改一下?

图标修改

如题。
当前的gopeed.dekstop属实是有一点糟糕。建议修改如下:

[Desktop Entry]
Version=1.4.1
Name=Gopeed
GenericName=Gopeed
Comment=High speed downloader that supports all platforms.
Terminal=false
Type=Application
Categories=Network;Utility;
Keywords=Flutter;Downloader;
Exec=gopeed
TryExec=gopeed
Icon=gopeed

其中,需要做两处改动:

  1. /usr/bin中创建一个指向'/usr/local/lib/gopeed'的链接:ln -sf /usr/local/lib/gopeed /usr/bin/gopeed。当然,我是将其迁移到了/opt/gopeed目录。
  2. 将图标文件安装目录改为: /usr/share/pixmaps

其他

不知道程序后面是否需要带参数运行?如果需要,官方建议使用什么参数呢? %f ? %u ?

@monkeyWie
Copy link
Member

吐槽不如来个PR啊,我对linux生态不太熟哦,相关的代码在这:https://github.com/GopeedLab/gopeed/blob/28da89f08c9d3b4ea2b2b755a291ff10e1f3166f/.github/workflows/build.yml#L199C11-L199C11

@zxp19821005
Copy link
Author

Debian/Ubuntu的打包规则我不太懂,建议修改以下内容:

          cat>debian/gui/gopeed.desktop<<EOF
          [Desktop Entry]
          Version=${VERSION:1}
          Name=Gopeed
          GenericName=Gopeed
          Comment=High speed downloader that supports all platforms.
          Terminal=false
          Type=Application
          Categories=Utility
          Keywords=Flutter;Downloader;
          EOF

          cat>debian/gui/gopeed.desktop<<EOF
          [Desktop Entry]
          Version=${VERSION:1}
          Name=Gopeed
          GenericName=Gopeed
          Comment=High speed downloader that supports all platforms.
          Terminal=false
          Type=Application
          Categories=Network;Utility;
          Keywords=Flutter;Downloader;
          Icon=gopeed
          EOF

@monkeyWie
Copy link
Member

@zxp19821005 看起来就多加了一行配置?

@zxp19821005
Copy link
Author

zxp19821005 commented Oct 19, 2023

  1. 在/usr/bin中创建一个指向/usr/local/lib/gopeed的链接:ln -sf /usr/local/lib/gopeed /usr/bin/gopeed
  2. 将图标文件安装目录改为: /usr/share/pixmaps

@monkeyWie
Copy link
Member

我需要确定问题是:

  1. 为什么bin路径和图标路径需要调整,是因为AUR的规范问题强制需要调整吗?
  2. 调整之后会不会对正常.deb安装照成影响?

我对于AUR不熟悉,目前也没有时间去了解它,另外如果.debAUR两边真的要做差异化构建的话,欢迎提交PR来添加一个专门的AUR Github Action来做自动化构建。

@zxp19821005
Copy link
Author

zxp19821005 commented Oct 19, 2023

  1. bin路径不调整也没关系,主要是可以方便的在命令行进行调用,在/usr/local/bin创建也是异样的,这样在desktop文件中的Exec=部分就可以只写gopeed
  2. 图标文件的路径,Debian/Ubuntu/Deepin之类的应该都差不多,一般单个位图是在/usr/share/pixmaps,多像素应该是属于一个由Freedesktop.org提供的hicolor-icon-theme的包,是在/usr/share/hicolor/16x16/apps/或者/usr/share/hicolor/512x512/apps/之类的目录,而不管在哪个目录,其文件名都是和desktop中Icon=中的文件名一致,不需要后缀名。如果是矢量图标文件(.svg文件),则是在/usr/share/hicolor/scalable/apps/目录。

@monkeyWie
Copy link
Member

@zxp19821005 打包工具是支持自定义bin目录的,所以bin路径可以调整成/usr/local/bin,但是icon不支持调整,具体可以看看文档:https://github.com/jeffrey0606/flutter_to_debian#desktop-file-and-icon-%EF%B8%8F

反正我在Ubuntu上测试是能显示icon的,在AUR不处理不能正常显示吗?

@zxp19821005
Copy link
Author

zxp19821005 commented Oct 19, 2023

不处理也能够正常显示,只是感觉违反了约定俗成的一些配置,可能是我强迫症犯了 ^_^
刚看到了这个,其实图标文件的限制也没有那么严格,是我着相了~
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

@monkeyWie
Copy link
Member

嗯 你要不要提交一个PR,改下bin路径

@zxp19821005
Copy link
Author

说实话,这个真的是不太会,要不还是就这样把,我自己在AUR的PKGBUILD里面修改就好。

@monkeyWie
Copy link
Member

很简单的,你直接在这个链接编辑提交,后面github会引导你提交pr的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants