probonopd / go-appimage

Go implementation of AppImage tools
MIT License
794 stars 70 forks source link

Improve "Show in File Manager" by selecting the file #12

Open probonopd opened 5 years ago

probonopd commented 5 years ago

Currently we only open the folder in which the AppImage is located, but it would be much nicer if we could select the AppImage.

Deepin has this kind of functionality, e.g, in their screenshot application. The following DBus message gets sent:

method call time=1573414337.468604 sender=:1.257 -> destination=org.freedesktop.DBus serial=26 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='com.deepin.dde.Notification'"
method call time=1573414337.469102 sender=:1.257 -> destination=org.freedesktop.Notifications serial=27 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Deepin Screenshot"
   uint32 0
   string "deepin-screenshot"
   string ""
   string "Das Bild wurde in /home/deepin/Desktop/DeepinBildschirmfoto_Bereich auswählen_20191110193217.png gespeichert"
   array [
      string "_open"
      string "Ansicht"
   ]
   array [
      dict entry(
         string "x-deepin-action-_open"
         variant             string "/usr/bin/dde-file-manager,file:///home/deepin/Desktop?selectUrl=file:///home/deepin/Desktop/DeepinBildschirmfoto_Bereich auswählen_20191110193217.png"
      )
   ]
   int32 0

Note the selectUrl= part. Is this XDG standardized or a Deepin special feature?

https://github.com/linuxdeepin/dde-file-manager/blob/22d903350007cdafd4b612ecfbd4f36006facc99/dde-desktop/dbus/filedialog/com.deepin.filemanager.filedialog.xml#L24-L26

https://github.com/linuxdeepin/dde-file-manager/blob/995ead577fbcb366e7314a1179ae3c6aa27a765b/dde-file-manager-lib/views/dfileview.cpp#L2163-L2178

If so, this totally needs to become a XDG standard so that it will work on all Linux desktops.

probonopd commented 4 years ago

Looks like GNOME and KDE use https://www.freedesktop.org/wiki/Specifications/file-manager-interface/, org.freedesktop.FileManager1 DBus name and the /org/freedesktop/FileManager1 object path.