GNOME Bugzilla – Bug 79498
gnome-vfs-based version of OS X's "open" command
Last modified: 2004-12-22 21:47:04 UTC
In OS X, there's a simple command-line util called "open" that just opens the given file in the correct application. So if you're browsing around in a terminal and come across a file you want to look at where "less" isn't the right tool, you can just say "open foo", and it opens it in your web browser, or the PDF Preview app, or TextEdit, or whatever. This should be pretty trivial to write using gnome-vfs. I don't know if the OS X open handles URLs too, but that would be easy too (using gnome_url_show). (Contrariwise, "open" could be registered as the default handler for "file:" URLs.)
I like the idea, and it would be pretty easy to write. Dunno if it should be actually shipped as part of GnomeVFS itself though...
i suggested gnome-vfs because it would be a pretty small program, so it probably wants to ship with *something* rather than being separate. i noticed yesterday that you can do "open ." too to open the current directory in the finder. so maybe it should be part of nautilus. although it would be nice if it wasn't since it's more useful to people who don't use nautilus at all than it is to people who do.
That's really easy to do (ie a 10 lines program) with the gnome_vfs_url_show function added in the 2.3 series
Created attachment 16799 [details] program to open an uri with the associated app
Looks good. Not sure about the name though. I asked some people, and most people seemed to like gnome-open. Also, it should probably use gnome_vfs_make_uri_from_input_with_dirs(uri, GNOME_VFS_MAKE_URI_DIR_CURRENT) so that files in the current dir works with "gnome-open <filename>".
Actually, I only wrote this 3 lines of code because I needed them for testing purpose, I attached them here when I remembered about that bug. Apart from the name issue, I think it would be a bit weird if gnome-vfs installed binary files by itself (though the stuff in the programs/ dir may be installed by default now ?)
Yeah, we install a set of command line utils by default now. I don't see that as strange though. They add no dependencies and can be useful to people. However, maybe a gnome-open app should be on another level so that it could e.g. open the open-with dialog if there is no app specified for the type etc.
I've added this to libgnome. Should we keep this bug open? Perhaps about moving the binary to somewhere else in order to do the open with stuff (Which I don't believe will happen until 2.6 but anyway)
Nah, i'll close it.