What I’ve got open

Rather a lot, I find myself having to save a file somewhere temporary like my desktop just in order that I can immediately upload it to some website, or attach it to an email, or something similar. It’s irritating. I have to explicitly save it; I have to think up a name for it; then I have to switch to my mail client or my web browser and browse back to the file I’ve just saved and choose it by name to upload/attach it; then I have to browse to it again in the file manager and delete it. Now, there’s lots of talk about draggable icons for files and so forth, so I can just drag the save icon out of, say, the Gimp directly into the browser. The ROX apps do this; Risc OS did it too. That’s a nice long-term goal, but it requires touching every app in the universe, and it’s hard. I had a thought about a workaround. It’d be quite cool to have a folder called “Open Documents” which, when opened, showed an icon for each document available in each application. Then, when you pick a “file” from this “folder”, it tells the relevant application “save it as some random temporary name” and then attaches/uploads some random temporary name. So you don’t ever have to manually do the save/delete thing. I only really strictly need this for the Gimp, to be honest; I don’t upload textual files, I cut-and-paste them. So, a rather crufty approach:

  1. Download gimpdbusapi.py and put it in $HOME/.gimp-2.6/plug-ins/ and mark it executable. It’s a Gimp extension which makes two functions available over D-Bus: image_list and save_as. (This could be the starter for making all Gimp functions available over D-Bus, with a __getattr__ hook, the gimp.pdb object, and a bit of introspection.)
  2. Download gimpfs.py, a Fuse filesystem in Python, which talks to the Gimp extension via D-Bus to get the list of currently open images in the Gimp (even if they haven’t been saved).
  3. Create an empty folder ($HOME/Open?) and python gimpfs.py $HOME/Open to mount the view of Gimp open documents on that folder.

There might be better ways to do this, with gvfs and so on, and it would be way better if it didn’t have to use tempfiles, and so forth, but this is a proof of concept. What would need to happen to have all Gnome apps’ currently open documents automatically appear in a folder ready for choosing?

More in the discussion (powered by webmentions)

  • (no mentions, yet.)