Re: Spec to define the default terminal?

2015-10-20 Thread Thomas Gläßle

Jerome Leclanche wrote on 10/20/2015 01:21 PM:
> This is something I tried solving quite a few times. There was an
> intents spec (a la android) in the works

I assume you are referring tot (sorry, I didn't do my homework earlier):

http://lists.freedesktop.org/archives/xdg/2014-January/013068.html

I didn't have time to read the whole thread so far, I'll have to go
through it in more depth tonight.


> which was subsequently picked
> up by GNOME, I don't know where it's at now but it's the more correct
> fix.

All I was able to find In terms of actual implementation for gnome was a
section in the glib sources using a hardcoded list of terminals:

https://git.gnome.org/browse/glib/tree/gio/gdesktopappinfo.c#n2434

(but I admit, I didn't look too long, so I'm not entirely sure that's
the code being used for gvfs-open)






signature.asc
Description: OpenPGP digital signature
___
xdg mailing list
xdg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg


Re: Spec to define the default terminal?

2015-10-20 Thread Thomas Gläßle

Thomas Gläßle wrote on 10/20/2015 12:23 PM:
> 1 a) invent a new variable e.g. $TERMINAL or similar that works like
> $BROWSER, i.e. something of the form TERMINAL=urxvt:gnome-terminal:xterm
>
> 1 b) invent a new variable e.g. $TERMINAL or similar that works like the
> one used by mimeopen, i.e. TERMINAL="xterm -e"
>
> 2) encourage the use of (and possibly semi-mandatory dependency on)
> gvfs-open/kde-open
>
> 3). invent a mimetype for terminal applications so available terminals
> can be iterated via .desktop files and a default can be requested in the
> mimeapps.list file, e.g.:

I forgot to mention option 4 which I saw lurking around:

4) use the binary x-terminal-emulator which is to be symlinked to
whatever terminal one wants to use.

  - [+] nice and simple
  - [+] possibly already supported by several subsystems?
  - [-] system-wide config (you have to modify PATH in order to change
it for users)



> concerning 1 a)
>
>   - [+] nice and simple
>   - [-] have to hardcode command line options, e.g. terminator uses "-x"
> rather than "-e"
>   - considering $TERMINAL is already used in a different fashion by
> mimeopen (and mimeopen is used as fallback by xdg-open), I'd rather tend
> towards a different name for the variable, e.g. $TERMCMD which would be
> upward compatible to how its used by terminator
>
>
> concerning 1 b)
>
>   - [+] no need to hardcode command line options
>   - [+] compatible with existing mimeopen behaviour
>   - [-] contains more than just a executable name, may be less simple to
> analyze
>
>
> concerning 2)
>
>   - [+] easy out without much coding for xdg-open
>   - [-] doesn't really solve the problem that "everyone uses their own
> mechanism"
>   - [-] I didn't look at gvfs-open/kde-open so far, but I'm afraid, they
> don't allow the user to specify their preferred terminal as easily
>   - [-] seems like a heavy dependency
>
>
> concerning 3)
>
>   - [+] uses an established config format
>   - [+] can configure multiple terminals with correct command line
> options and the default
>   - [-] not sure if the mimetype concept applies to this problem very well
>   - [-] maybe too complex for such a simple goal




signature.asc
Description: OpenPGP digital signature
___
xdg mailing list
xdg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg


Spec to define the default terminal?

2015-10-20 Thread Thomas Gläßle
Hello freedesktop.org,

This is a follow up on a bug to xdg-utils about xdg-open not spawning
terminals for .desktop files with Terminal=true entry [1]. Rex Dieter
suggested to start a discussion here before taking further steps.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=92514


To summarize the issue:

There is currently no uniform way to set the default terminal across the
system and so everyone seems to be doing their own thing:

- xdg-open does not know how to spawn terminals (leading to the
application aborting or even worse: suppressed output)
- mimeopen uses an environment variable $TERMINAL in the form
TERMINAL="xterm -e"
- rifle (file opener, part of the ranger file manager) uses an
environment variable $TERMCMD in the form TERMCMD="xterm"
- in awesome (window manager), you usually configure the terminal in
your lua.rc file
- not sure what desktop environments are doing in their code base, maybe
hardcoding their own terminals
- xdg-terminal (unreleased, part of xdg-utils) currently even looks at
$TERM and uses xterm as hardcoded fallback
- probably tons of others...


In the thread attached to the bug report we had several (not necessarily
exclusive) thoughts about how to tackle the issue:

1 a) invent a new variable e.g. $TERMINAL or similar that works like
$BROWSER, i.e. something of the form TERMINAL=urxvt:gnome-terminal:xterm

1 b) invent a new variable e.g. $TERMINAL or similar that works like the
one used by mimeopen, i.e. TERMINAL="xterm -e"

2) encourage the use of (and possibly semi-mandatory dependency on)
gvfs-open/kde-open

3). invent a mimetype for terminal applications so available terminals
can be iterated via .desktop files and a default can be requested in the
mimeapps.list file, e.g.:

[Desktop Entry]
name=terminator
GenericName=X Terminal Emulator
Exec=terminator -x %F
MimeType=x-terminal-emulator



My personal opinions:

concerning 1 a)

  - [+] nice and simple
  - [-] have to hardcode command line options, e.g. terminator uses "-x"
rather than "-e"
  - considering $TERMINAL is already used in a different fashion by
mimeopen (and mimeopen is used as fallback by xdg-open), I'd rather tend
towards a different name for the variable, e.g. $TERMCMD which would be
upward compatible to how its used by terminator


concerning 1 b)

  - [+] no need to hardcode command line options
  - [+] compatible with existing mimeopen behaviour
  - [-] contains more than just a executable name, may be less simple to
analyze


concerning 2)

  - [+] easy out without much coding for xdg-open
  - [-] doesn't really solve the problem that "everyone uses their own
mechanism"
  - [-] I didn't look at gvfs-open/kde-open so far, but I'm afraid, they
don't allow the user to specify their preferred terminal as easily
  - [-] seems like a heavy dependency


concerning 3)

  - [+] uses an established config format
  - [+] can configure multiple terminals with correct command line
options and the default
  - [-] not sure if the mimetype concept applies to this problem very well
  - [-] maybe too complex for such a simple goal




signature.asc
Description: OpenPGP digital signature
___
xdg mailing list
xdg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg