title: How can I monitor the "trash:///" directory using Vala?
body: <p>I am trying to convert <a href="https://github.com/UbuntuBudgie/experimental/blob/master/budgie-trash/src/budgie-trash/TrashApplet.py" rel="nofollow noreferrer">budgie-trash python applet</a> to Vala and I am trying to monitor the "trash:///" directory according to the <a href="https://valadoc.org/gio-2.0/GLib.File.monitor_directory.html" rel="nofollow noreferrer">Vala documentation</a> I can monitor the home correctly. but I can't monitor the the "trash:///". The python applet working correctly for all directories.</p>
  
  <h1>initialiseTrashFileMonitor V1:</h1>
  
  <pre><code>public void initialiseTrashFileMonitor(){
      try {
  
          GLib.File file = GLib.File.new_for_uri("trash:///");
          GLib.FileMonitor monitor = file.monitor_directory(0, null);
  
          print ("\n initialiseTrashFileMonitor Monitoring: %s\n", file.get_path ());
  
          monitor.changed.connect ((src, dest, event) =&gt; {
  
              print ("\n initialiseTrashFileMonitor monitor.changed.connect \n");
  
              if (dest != null) {
                  print ("%s: %s, %s\n", event.to_string (), src.get_path (), dest.get_path ());
              } else {
                  print ("%s: %s\n", event.to_string (), src.get_path ());
              }
          });
  
      } catch (Error err) {
          print ("\n initialiseTrashFileMonitor Error: %s\n", err.message);
      }
  }
  </code></pre>
  
  <h3>terminal output(no error, no monitoring):</h3>
  
  <pre><code>initialiseTrashFileMonitor Monitoring: (null)
  </code></pre>
  
  <p>I also asked that question here for this purpose : <a href="https://stackoverflow.com/questions/51177265/how-can-i-monitor-the-local-directory-using-vala">How can I monitor the ~/.local directory using Vala?</a></p>