hotime
deepin
2025-03-10 21:10 一、确保这个文件JTPrint.desktop
在相应的桌面入口文件目录:~/.local/share/applications/
或/usr/share/applications/
二、确保~/.config/mimeapps.list
中存储了这个类型的默认打开方式,例如:
x-scheme-handler/jtprint=JTPrint.desktop;
注意在~/.config/mimeapps.list
中,x-scheme-handler/
后面的类型似乎不接受大写字母,例如:x-scheme-handler/JTPrint
。
如果有这种情形,在使用xdg-open
这个类型的时候就会得到上面的结果: main.go:75: open failed: failed to get appInfo
(当然,没有这行配置,也会是这个结果)
Reply Like 0 View the author
root: cat JTPrint.desktop
[Desktop Entry]
Name=FastReport Application
Exec=/data/home/jtzx/Program/fastreport/linux-arm64/linux-arm64/FastreportRegister %u
Terminal=true
Type=Application
Icon=/data/home/jtzx/Program/fastreport/linux-arm64/linux-arm64/source/img/report.png
MimeType=x-scheme-handler/JTPrint;
StartupNotify=true
Categories=Utility
root:
xdg-open JTPrint://actionroot:open failed: failed to get appInfo
手动点击FastreportRegister没问题,路劲调用也没问题,用这.desktop走xdg一直都是 main.go:63: open failed: failed to get appInfo
尝试调用了一下普通的.sh文件,也不行。