GNOME Bugzilla – Bug 704218
New gapplication(1) tool
Last modified: 2013-10-17 14:12:55 UTC
This is essentially a commandline implementation of the client-side of the org.freedesktop.Application D-Bus interface. It includes support for tab-completion based on desktop files and their contents.
Created attachment 249149 [details] [review] New app(1) tool
I would be happier if this had a g-prefixed name, say gapplication, to go along with gsettings, gdbus, gresource. It would also be nice if it would follow the other tools in expecting commands, instead of options: gapplication list gapplication activate org.example.app gapplication open org.example.app url://foo /bar gapplication list-actions org.example.app gapplication invoke org.example.app frob 123
Created attachment 249157 [details] [review] New app(1) tool vs. the previous patch, this fixes a trivial error in a string and adds a manpage.
Review of attachment 249157 [details] [review]: While eventually I like the idea of an "app" binary...I don't think we should jump the gun here in GLib and start shipping non-namespaced binaries. This tool should not be built for Windows targets. At a high level too...who is the audience for this tool? It feels like it's more of an "automation" thing. In that case, we have language bindings too, although getting all the details right about launching apps is fairly tedious. Were I to see an "app" tool I'd expect it to have stuff useful for system administrators like installation/uninstallation. But we can't really do that in GLib.
Created attachment 249235 [details] [review] New app(1) tool A new patch with a command-based syntax: app help [command] app version app list-apps app launch appid [files...] app list-actions appid app action appid action [parameter] I didn't update the manpage yet, for want of review on the new syntax.
The syntax looks good to me. Only sticking point now is the name. I really don't want to install unprefixed very generic names like 'app' into /usr/bin. Your options are a) take it out of glib and call it xdg-app or b) rename it to gapp or gapplication. I'm very much in favor of b), of course.
gapp is just an awful name. gapplication is too long. xdg-app might be better, but that would sort of suggest that we don't bundle it with glib...
gapplication is a little long, but with commandline completion, is that really an issue ? It would nicely follow and established pattern: Class name Binary GSettings gsettings GResource gresource GDBus gdbus GApplication gapplication
Indeed... I think I settled on gap<tab> as being acceptable. Only problem is that this binary has absolutely nothing to do with GApplication other than implementing the same spec. Any other review comments or should I rename it, update the manpage and push?
Go for it. We could add stuff that _is_ about GApplication, of course. Although there is not that much there currently, other than showing if the app is busy... Are there any other implementations of org.freedesktop.Application at this time ?
(In reply to comment #10) > We could add stuff that _is_ about GApplication, of course. Although there is > not that much there currently, other than showing if the app is busy... There is also launch-by-commandline. I think I want to add that too, and now it's a better fit if the tool is called gapplication. > Are there any other implementations of org.freedesktop.Application at this time > ? I know that David was already working on one for KDE because he ran into some issues with qt-dbus that we had to workaround by renaming some variables in the spec...
(In reply to comment #9) > Any other review comments or should I rename it, update the manpage and push? Did we loose momentum on this ?
yup :)
Created attachment 257538 [details] [review] New gapplication(1) tool This is essentially a commandline implementation of the client-side of the org.freedesktop.Application D-Bus interface. It includes support for tab-completion based on desktop files and their contents.
Review of attachment 257538 [details] [review]: Looks great, in general ::: docs/reference/gio/gapplication.xml @@ +154,3 @@ + + <varlistentry> + <term><option>action</option></term> You could get fancy and make this <command>action <arg choice="plain">APPID</arg> <arg choice="plain">ACTION</arg> <arg choice="opt" rep="norepeat">ARGUMENT</arg></command> I've done that in some man pages for command-style interfaces and I've been happy with the results @@ +159,3 @@ + Invokes the named action (in the same way as would occur when activating an action specified in + the <filename class='extension'>.desktop</filename> file). The name of the action must directly + follow <option>--action</option>. leftover -- here: it is just <option>action</option> now but anyway, the name of the action must not directly follow - the appid that comes first @@ +323,3 @@ + <citerefentry> + <refentrytitle>desktop-file-validate</refentrytitle> + <manvolnum>1</manvolnum> I also like to include ulinks to the relevant fdo specs in this section, but up to you
Attachment 257538 [details] pushed as 9defb6b - New gapplication(1) tool Committed with all suggested changes.