After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704218 - New gapplication(1) tool
New gapplication(1) tool
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-07-14 23:45 UTC by Allison Karlitskaya (desrt)
Modified: 2013-10-17 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
New app(1) tool (13.21 KB, patch)
2013-07-14 23:45 UTC, Allison Karlitskaya (desrt)
none Details | Review
New app(1) tool (23.53 KB, patch)
2013-07-15 04:49 UTC, Allison Karlitskaya (desrt)
reviewed Details | Review
New app(1) tool (25.66 KB, patch)
2013-07-15 20:00 UTC, Allison Karlitskaya (desrt)
none Details | Review
New gapplication(1) tool (26.60 KB, patch)
2013-10-17 13:29 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2013-07-14 23:45:12 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.
Comment 1 Allison Karlitskaya (desrt) 2013-07-14 23:45:14 UTC
Created attachment 249149 [details] [review]
New app(1) tool
Comment 2 Matthias Clasen 2013-07-15 03:33:48 UTC
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
Comment 3 Allison Karlitskaya (desrt) 2013-07-15 04:49:46 UTC
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.
Comment 4 Colin Walters 2013-07-15 12:16:07 UTC
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.
Comment 5 Allison Karlitskaya (desrt) 2013-07-15 20:00:32 UTC
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.
Comment 6 Matthias Clasen 2013-07-17 15:25:26 UTC
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.
Comment 7 Allison Karlitskaya (desrt) 2013-07-17 17:08:50 UTC
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...
Comment 8 Matthias Clasen 2013-07-19 23:25:36 UTC
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
Comment 9 Allison Karlitskaya (desrt) 2013-07-20 14:04:50 UTC
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?
Comment 10 Matthias Clasen 2013-07-24 18:00:56 UTC
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 ?
Comment 11 Allison Karlitskaya (desrt) 2013-07-24 23:54:53 UTC
(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...
Comment 12 Matthias Clasen 2013-10-17 02:03:22 UTC
(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 ?
Comment 13 Allison Karlitskaya (desrt) 2013-10-17 12:07:31 UTC
yup :)
Comment 14 Allison Karlitskaya (desrt) 2013-10-17 13:29:09 UTC
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.
Comment 15 Matthias Clasen 2013-10-17 13:39:12 UTC
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
Comment 16 Allison Karlitskaya (desrt) 2013-10-17 14:12:53 UTC
Attachment 257538 [details] pushed as 9defb6b - New gapplication(1) tool

Committed with all suggested changes.