Get mounted volumes when VFS=local

I want to know if Gio.VolumeMonitor does work when VFS environment variable is defined as “local” (and, thus, not using GVFS). If not, is there a “legal” way of getting the mounted volumes without resorting to Udisks DBus interface?

It seems to work fine currently:

$ GIO_USE_VFS=local gio mount -l
...
Drive(2): USBest Technology USB Mass Storage Device
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  Volume(0): 1.0 GB Volume
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    Mount(0): 1.0 GB Volume -> file:///run/media/oholy/25124519-d018-42a4-9a14-966efab49dd7
      Type: GProxyMount (GProxyVolumeMonitorUDisks2)
...
$ GIO_USE_VFS=local gio mount -u file:///run/media/oholy/25124519-d018-42a4-9a14-966efab49dd7
1.0 GB Volume unmounted - Filesystem has been disconnected.
$ GIO_USE_VFS=local gio mount -l
...
Drive(2): USBest Technology USB Mass Storage Device
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  Volume(0): 1.0 GB Volume
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
...
$ GIO_USE_VFS=local gio mount -d 25124519-d018-42a4-9a14-966efab49dd7
$ GIO_USE_VFS=local gio mount -l
...
Drive(2): USBest Technology USB Mass Storage Device
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  Volume(0): 1.0 GB Volume
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    Mount(0): 1.0 GB Volume -> file:///run/media/oholy/25124519-d018-42a4-9a14-966efab49dd7
      Type: GProxyMount (GProxyVolumeMonitorUDisks2)
...

However, I am thinking about disabling that (see Draft: monitor: Do not load monitors when GIO_USE_VFS=local (!193) · Merge requests · GNOME / gvfs · GitLab).

Agh! I shouldn’t have asked! :smiley: (EDIT: just joking)

That MR is not a reaction to your question, but an attempt to fix one issue reported downstream. However, I am not fully convinced about this concrete solution. Can you please tell me about your considered use-case? Wouldn’t be the unix volume monitor enough for your purpose?

You can try it by setting the GIO_USE_VOLUME_MONITOR=unix envar.

My last comment was only a joke :slight_smile: , sorry for the misunderstanding. About my use case, I need the trash object to work when the program is inside a container (and thus VFS is set as local). The trash portal isn’t enough, because I’m working on containerizing both gnome shell and nautilus, so I was considering doing a trash:/// implementation for local to allow to have both the “trash icon” correctly refreshed in the desktop, and getting access to the trash from Nautilus.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.