<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>FYI, The proposed <a
        href="https://github.com/Vladimir-csp/xdg-terminal-exec/">xdg-terminal-exec</a>
      now relies on stock desktop entries, the shell implementation is
      optimized, experimental cache support is in the works.</p>
    <p>The spec proposal is <a
href="https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/3">updated</a>.<br>
    </p>
    <div class="moz-cite-prefix">On 14/10/2023 23.33, Vladimir Kudrya
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:d17629d8-8b9d-4b38-84ff-d1e71a4ba16f@yandex.ru">Hi.
      Let's dust off this thread.
      <br>
      <br>
      I'm starting to transition xdg-terminal-exec to use stock entries
      filtered by "TerminalEmulator" in Categories key.
      <br>
      <br>
      On 31/08/2018 16.35, Jan Tojnar wrote:
      <br>
      <blockquote type="cite">Reusing `Categories` key would be nice,
        but we would still need `category-defaults.list` for actually
        choosing the default representant for each category, would not
        we?
        <br>
        <br>
        Caching is a good point, we would need to create some mechanism
        no matter which solution we choose – for instance, if some of
        the actions were optional, they would probably need to be cached
        as well.
        <br>
        <br>
        On Fri, 31 Aug, 2018 at 2:54 PM, PCMan
        <a class="moz-txt-link-rfc2396E" href="mailto:pcman.tw@gmail.com"><pcman.tw@gmail.com></a> wrote:
        <br>
        <blockquote type="cite">Hi again,
          <br>
          There is another way to make this xdg terminal exec stuff more
          <br>
          standard compliant by reusing XDG menu spec.
          <br>
<a class="moz-txt-link-freetext" href="https://specifications.freedesktop.org/menu-spec/latest/apas02.html">https://specifications.freedesktop.org/menu-spec/latest/apas02.html</a>
          <br>
          We can parse all desktop entry files and collect every one
          with
          <br>
          Category=TerminalEmulator to generate a list of terminal
          emulators.
          <br>
          This way we don't have to manually maintain a terminal.list
          file.
          <br>
          Of course parsing all of the *.desktop files is slow so we
          will need
          <br>
          something like "update-mime-database" to generate the list.
          <br>
          <br>
          To provide desktop entry files for those apps which are not
          shipped
          <br>
          with their own, we can install desktop files for them.
          <br>
          set XDG_DATA_DIRS=/usr/share/terminal-emulators:$XDG_DATA_DIRS
          <br>
          <br>
          And just add our own desktop entry files in
          <br>
          /usr/share/terminal-emulators/*.desktop for those terminals
          which do
          <br>
          not have desktop entries.
          <br>
          So we don't need to invent another spec to manage the
          terminals.
          <br>
          <br>
          Regards
          <br>
          <br>
          On Fri, Aug 31, 2018 at 8:46 PM PCMan
          <a class="moz-txt-link-rfc2396E" href="mailto:pcman.tw@gmail.com"><pcman.tw@gmail.com></a> wrote:
          <br>
          <blockquote type="cite">
            <br>
             Hello,
            <br>
             Just took a look at xdg-terminal-exec and I liked the idea.
            <br>
             Actually I figured out something similar previously but did
            not write any code.
            <br>
             There is, however, one thing I'd like to propose to make
            the spec more complete.
            <br>
             Use the Desktop Entry Actions.
            <br>
            <br>
<a class="moz-txt-link-freetext" href="https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#extra-actions">https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#extra-actions</a>
            <br>
            <br>
             Then, for each desktop entry file of a terminal emulator,
            we define
            <br>
             some standard actions:
            <br>
             * OpenDirInWindow: a command to open a dir in a new tab
            <br>
             * OpenDirInTab: a command to open a dir in a new tab
            <br>
             * ExecInWindow: a command to run a program in a new window
            <br>
             * ExecInTab: a command to run a program in a new tab
            <br>
            <br>
             When the "InTab" actions are not defined in the desktop
            entry file,
            <br>
             fallback to the "InWindow" version.
            <br>
             This should cover most of the common operations when we
            need a terminal window.
            <br>
            <br>
             For example, we can write xterm.desktop like this
            <br>
             [Desktop Entry]
            <br>
             Name=Gnome Terminal
            <br>
             Exec=gnome-terminal
            <br>
             Actions=OpenDirInWindow;
            <br>
            <br>
             [Desktop Action OpenDirInWindow]
            <br>
             Name=Open Directory in Terminal
            <br>
             Exec=gnome-terminal --window --working-directory %f
            <br>
            <br>
             [Desktop Action OpenDirInTab]
            <br>
             Name=Open Directory in Terminal
            <br>
             Exec=gnome-terminal --tab --working-directory %f
            <br>
            <br>
             [Desktop Action ExecInWindow]
            <br>
             Name=Execute in Terminal
            <br>
             Exec=gnome-terminal -e %f
            <br>
            <br>
             In this way, we reuse the existing spec and support various
            kinds of operations.
            <br>
             The only drawback is %f means a file name, but what we need
            to pass to
            <br>
             the terminal emulator is actually a full command line with
            args.
            <br>
            <br>
             Just my two cents.
            <br>
            <br>
             On Thu, Aug 30, 2018 at 3:36 PM Vladimir Kudrya
            <a class="moz-txt-link-rfc2396E" href="mailto:vladimir-csp@yandex.ru"><vladimir-csp@yandex.ru></a> wrote:
            <br>
             >
            <br>
             > Couple of notes.
            <br>
             >
            <br>
             > xdg-terminal-exec in its current form is a minimum
            intervention
            <br>
             > solution: you need to place desktop files for some
            terminals, then use
            <br>
             > xdg-terminal-exec itself as a command to launch
            terminal.
            <br>
             >
            <br>
             > ArgPrefix has a solid generic use case: there was a
            bug in Ocrfeeder:
            <br>
             > <a class="moz-txt-link-freetext" href="https://bugzilla.gnome.org/show_bug.cgi?id=767732">https://bugzilla.gnome.org/show_bug.cgi?id=767732</a> It
            required an
            <br>
             > argument to open file, but no argument to just launch
            the app. Current
            <br>
             > desktop entry spec can not handle this via single
            desktop entry.
            <br>
             >
            <br>
             >
            <br>
             > I'll try to sum up, simplify, and build upon Jan's and
            Ian's proposals.
            <br>
             >
            <br>
             > Fields for destop entries:
            <br>
             > MimeType: what app can open
            <br>
             > MimeTypeView: what app can open for viewing
            <br>
             > MimeTypeEdit: what app can open for edit
            <br>
             > Intent: what actions app represents (analogous to
            MimeType, like:
            <br>
             > x-intent/terminal, x-intent/increase-brightness.)
            Choosing goes
            <br>
             > alongside mimetypes and schemes into mimeapps.list
            hierarchy.
            <br>
             > ArgPrefix: argument(s) to be added to the beginning of
            command line if
            <br>
             > there are other arguments provided.
            <br>
             >
            <br>
             > With all above:
            <br>
             > xdg-open some.file: current behavior
            <br>
             > xdg-open --edit some.file: uses MimeTypeEdit choices.
            <br>
             > xdg-open --view some.file: uses MimeTypeView choices.
            <br>
             > xdg-intent terminal: opens terminal.
            <br>
             > xdg-intent termianl foo --bar: runs foo --bar in
            chosen terminal, using
            <br>
             > ArgPrefix if needed. IMHO one of the few intents that
            would ever require
            <br>
             > arguments.
            <br>
             >
            <br>
             > This strategy is backward-compatible, uses same data
            and config
            <br>
             > hierarchies, works without dbus (I don't want to touch
            it even with ten
            <br>
             > meter stick), 'xdg-intent terminal' can be used as
            drop in for terminal
            <br>
             > emulators. (xdg-terminal as wrapper to get rid of that
            space?).
            <br>
             > _______________________________________________
            <br>
             > xdg mailing list
            <br>
             > <a class="moz-txt-link-abbreviated" href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a>
            <br>
             > <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/xdg">https://lists.freedesktop.org/mailman/listinfo/xdg</a>
            <br>
          </blockquote>
          _______________________________________________
          <br>
          xdg mailing list
          <br>
          <a class="moz-txt-link-abbreviated" href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a>
          <br>
          <a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/xdg">https://lists.freedesktop.org/mailman/listinfo/xdg</a>
          <br>
        </blockquote>
        <br>
        <br>
      </blockquote>
    </blockquote>
  </body>
</html>