步骤
同样的过程适用于其他在收藏夹又找不到命令的程序
将通过flatapk安装的qBittorrent的快捷方式添加到收藏
查看收藏夹的文件名字
gsettings get org.gnome.shell favorite-apps
得到如下内容
['firefox_firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop', 'transmission-gtk.desktop', 'pycharm-community_pycharm-community.desktop', 'org.gnome.gedit.desktop', 'blender.desktop', 'gnome-control-center.desktop', 'mediainfo-gui.desktop', 'org.qbittorrent.qBittorrent.desktop']
通过文件名查找org.qbittorrent.qBittorrent.desktop
find / -name org.qbittorrent.qBittorrent.desktop
发现他在这里
/var/lib/flatpak/app/org.qbittorrent.qBittorrent/x86_64/stable/c0885806d1d5628bf27bbf5c31f24f670fd046ce9a4e4290ed6c5030ba30a971/export/share/applications/org.qbittorrent.qBittorrent.desktop
/var/lib/flatpak/app/org.qbittorrent.qBittorrent/x86_64/stable/c0885806d1d5628bf27bbf5c31f24f670fd046ce9a4e4290ed6c5030ba30a971/files/share/applications/org.qbittorrent.qBittorrent.desktop
/var/lib/flatpak/exports/share/applications/org.qbittorrent.qBittorrent.desktop
任意打开一个文件,查看其启动命令
cat /var/lib/flatpak/exports/share/applications/org.qbittorrent.qBittorrent.desktop
显示如下内容
[Desktop Entry]
Categories=Network;FileTransfer;P2P;Qt;
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=qbittorrent --file-forwarding org.qbittorrent.qBittorrent @@u %U @@
GenericName=BitTorrent client
Comment=Download and share files over BitTorrent
Icon=org.qbittorrent.qBittorrent
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
Name=qBittorrent
Terminal=false
Type=Application
StartupNotify=false
StartupWMClass=qbittorrent
Keywords=bittorrent;torrent;magnet;download;p2p;
SingleMainWindow=true
...
将命令添加到“启动应用程序”
参考链接
https://unix.stackexchange.com/questions/405264/what-is-the-file-location-of-gnome-favorites