lxqt/lxqt

Default terminal in lxqt-config-session

drzisga opened this issue · 24 comments

The lxqt-config-session tool currently uses the TERM environment variable in order to save the default terminal application. Unfortunately this is not right since this variable is reserved for the currently used terminal name as it is stated here: term(7)

Some other variable name or method should be used for saving the default applications in LxQt.

Pcmanfm-qt actually has its own settings for this.
Maybe it's time to standardize this? An xdg spec is good.
The problem of just recording the command is obvious.
Different teminals uses different arguments.
For example, not all of them support -e or -x.
2015/1/13 上午8:05 於 "dshizzle" notifications@github.com 寫道:

The lxqt-config-session tool currently uses the TERM environment variable
in order to save the default terminal application. Unfortunately this is
not right since this variable is reserved for the currently used terminal
name as it is stated here: term(7) http://linux.die.net/man/7/term

Some other variable name or method should be used for saving the default
applications in LxQt.


Reply to this email directly or view it on GitHub
#433.

Maybe we can create a separate tool: xdg-terminal, which is a wrapper for all famous terminal emulators. The tool has its own config file to set which terminal emulator to use. Other program which wishes to support this tool only need to call xdg-terminal program and we can handle the rest.

Wouldn't that be swell.

But I don't believe it will happen. The xdg project is just too dead.

I wonder whether it wouldn't be good to handle this according to freedesktop.org's "MIME Applications specification", http://www.freedesktop.org/wiki/Specifications/mime-apps-spec, introduced recently as successor of so-called run actions.

Regarding the actual question of this issue, some tweaking like introducing a vnd.* MIME type may get necessary. But it allowed for unifying the way default applications are handled.
As of now, e. g. Browser can be set from both "Default Applications" in lxqt-config-session which is setting $BROWSER and lxqt-config-file-associations which is implementing run actions by writing into $XDG_DATA_HOME/applications/mimeapps.list. But tweaking one setting at two places doesn't make sense and e. g. Thunderbird is considering mimeapps.list only, $BROWSER not at all.
So I wonder whether it wouldn't make sense to stop using $TERM and $BROWSER but handle all that stuff by the said specification. lxqt-config-file-associations could e. g. be pimped a little so as to allow for setting default applications as well by writing into $XDG_CONFIG_HOME/lxqt-mimeapps.list.

2015-02-01 18:01 GMT+01:00 Peter Mattern notifications@github.com:

I wonder whether it wouldn't be good to handle this according to
freedesktop.org's "MIME Applications specification",
http://www.freedesktop.org/wiki/Specifications/mime-apps-spec, introduced
recently as successor of so-called run actions.

Regarding the actual question of this issue, some tweaking like
introducing a vnd.* MIME type may get necessary. But it allowed for
unifying the way default applications are handled.
As of now, e. g. Browser can be set from both "Default Applications" in
lxqt-config-session and lxqt-config-file-associations which is implementing
run actions by writing into $XDG_DATA_HOME/applications/mimeapps.list. But
tweaking one setting at two places doesn't make sense and e. g. Thunderbird
is only considering mimeapps.list, not $BROWSER as set by
lxqt-config-session.
So I wonder whether it wouldn't make sense to stop using $TERM and
$BROWSER but handle all that stuff by the said specification.
lxqt-config-file-associations could e. g. be pimped a little so as to allow
for setting default applications as well by writing into
$XDG_CONFIG_HOME/lxqt-mimeapps.list.


Reply to this email directly or view it on GitHub
#433 (comment).

I'd agree with this. I think lxqt-config-file-associaations could have 2
tabs: One tab with the current functionality (list of mimetypes with the
possibility to associate an application with each mimetype), and another
tab called something like 'Default applications', where the user can set
5-10 default applications. Taking inspiration from ubuntu/unity the default
applications to set could be (at least): browser, mail client, news reader,
video player, audio player, terminal. With the exception of terminal I
think it could be implemented with the mimetype functionality we have. E.g:
If the user sets default videoplayer to VLC, we should associate all known
video mimetypes to VLC. If the user wants specific video codecs handled by
other applications, he/she can use the mite-type tab to do that.

Oh, and btw: I think lxqt-config-file-associations should then be renamed
to lxqt-config-default-applications or perhaps lxqt-config-default-apps.

br. Chr.

Actually, this is handled with "fake" mimetype "x-scheme-handler/http" and "x-scheme-handler/https" in Gnome and all gtk+ programs. I personally like the idea. Many existing programs support these types already. I'd suggest that we do the same.

Reference: http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html
Just add "x-scheme-handler/http=xxxx.desktop" to the "[Default Applications]" section and it works.

Also see #116 and #7

Given this issue turned into one about default applications in general #35 and #11 are associated as well.

Some additional info:
At least in Debian, desktop entries for terminal emulators have 'TerminalEmulator' category associated with them. Might be of help.

The lxqt-config-session tool currently uses the TERM environment variable in order to save the default terminal application. Unfortunately this is not right since this variable is reserved for the currently used terminal name as it is stated here: term(7)

Right, we should use TERM only for its original meaning - setting TERM. So a renaming might make sense. And TERM make sense to to set TERM to xterm or xterm-256colors at wish for the session. I might be mistaken, i'm not so much into terminals and terminal settings.

TERM should only be set to something that present in terminfo database and actualy makes sense, otherwise CLI applications that rely on checking for certain teminal features will fail.

At least in Debian terminfo is located in /usr/share/terminfo/, and xterm-256colors is a good default for GUI sessions. Some terminal emulators will set it themselves, at least if value was not set before.

+1 - the values was only possible examples - but TERM=qterminal or so is clearly a misuse and fortunately ignored in the environment

I'm working on fixing default applications in libqtxdg. After that goes in, the TERM usage will be dropped.

I'm working on fixing default applications in libqtxdg. After that goes in, the TERM usage will be dropped.

+1, looking forward for this to land...

On a side note it seems the settings at lxqt-config-session - Default Applications - Terminal Emulation don't get taken into account at all right now.
What ever setting is made ends up in $TERM value "xterm" (which is of course correct).

I'm working on fixing default applications in libqtxdg.

Couldn't we eventually address handling of default applications as a whole on this occasion?
From a user's point of view this is one of the not so numerous larger issues which remain to be fixed in LXQt, IMO. Configuring environment variables in lxqt-config-session and tweaking settings according to the MIME Applications Specification in /usr/bin/lxqt-config-file-associations in parallel doesn't make sense, the UI of the latter isn't exactly user-friendly.

Until XDG comes with the way of selecting the default terminal properly (which may take very long time), the best way to address this IMHO is via environment variable. That is because:

  1. exec arguments and quoting should be addressed.
  2. default terminal currently does not fit into MIME stuff.

LXQT_TERMINAL_EMULATOR=qterminal -e %a

Another quoting-related hurdle: How do I properly exec qterminal -e nano '/tmp/file with whitespaces' ? and how to properly describe emulator exec in any default terminal selection mechanism?

I made a proposal for a default terminal standard to XDG in form of a reference script. The principle is similar to MIME Applications Spec and Desktop Entry Spec.
I introduced this on xdg mailing list thread Re: Spec to define the default terminal?

Please test, leave comments and consider implementing.

The principle is similar to MIME Applications Spec and Desktop Entry Spec.

Isn't usage of "Desktop spec" a bit too much? You can get into infinite recursion if the terminal .desktop file has Terminal=true :)

The similarity is in the way terminal entries under prefix xdg-terminals are treated, that is similar to application entries under prefix applications. With priorities, ID's, overrides, etc.

Terminal= has no meaning for terminal entry. Script does not touch it.

IMO, konsole should just be the default. It only requires like 2 or 3 extra packages to be installed on top of the base LXQt install. qterminal definitely needs to be pulled out for now; it's not stable really. qterminal has a pretty bad memory leak problem going on. If I leave it open for a day or two, it's easily using a GB or two of RAM.

I think the default setting should be Qterminal. When a user installs LXQt, the user generally wants to use Qterminal. If not, the setting is easy to change in the GUI, but it should not be left unpopulated by default in my opinion.

My default browser is QupZilla, and I am very satisfied with it for the most part in LXQt, except that "mailto" links do not work. I would like to have them open "Claws-Mail," my usual mail client. Browsing the above posts, I am postulating something more or less like this:

x-scheme-handler/mailto = "/usr/bin/claws-mail --compose"

So when I visit a link to the URL:

mailto:justina@colmena.biz?subject=How%20do%20I%20do%20this%3f

what I want to execute on the command line is this

/usr/bin/claws-mail --compose "mailto:justina@colmena.biz?subject=How%20do%20I%20do%20this%3f"

I am not sure where to specify this in the configuration options, because those mimetype are not available in the dialog box, and I do not know where to add additional mimetypes.

@justinacolmena I think your issue is covered by #1004