You are not logged in.

#1 2017-10-21 19:58:53

nesk
Member
Registered: 2011-03-31
Posts: 181

[solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

I had pcmanfm installed a long time ago, now switched to pcmanfm-qt.
xdg-open seems to know that it's supposed to be opening image/png with viewnior, but tries to use pcmanfm for some reason:

[username@arch ~]$ xdg-mime query filetype f.png 
image/png
[username@arch ~]$ xdg-mime query default image/png
viewnior.desktop
[username@arch ~]$ xdg-open f.png 
/usr/bin/xdg-open: line 922: pcmanfm: command not found
[username@arch ~]$ grep pcmanf .config/mimeapps.list
inode/directory=pcmanfm-qt.desktop
[username@arch ~]$ grep -A3 -B2 pcmanfm /usr/bin/xdg-open
open_lxde()
{
    # pcmanfm only knows how to handle file:// urls and filepaths, it seems.
    if is_file_url_or_path "$1"; then
        local file="$(file_url_to_path "$1")"

--
        fi

        pcmanfm "$file"
    else
        open_generic "$1"
    fi

So, xdg-open thinks it's running in lxde? Why? I use lxqt.

Last edited by nesk (2017-10-22 07:37:57)

Offline

#2 2017-10-22 04:02:54

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

What's in viewnior.desktop?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2017-10-22 04:28:56

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

cfr wrote:

What's in viewnior.desktop?

Irrelevant, as the OP said and as inspection of /usr/bin/xdg-open reveals, when lxde is detected as the DE, it does what it does with most DEs and simply opens everything with the DE-specific xdg-open equivalent -- so I assume pcmanfm does the same as `gio open`, gnome-open, kde-open, exo-open, etc.

Which is interesting since its main utility is a file browser but okay. smile

nesk wrote:

So, xdg-open thinks it's running in lxde? Why? I use lxqt.

It doesn't think any such thing.

case "$DE" in
[...]
    lxde|lxqt)
    open_lxde "$url"
    ;;

I assume that the xdg-open authors assume all LXQT users are running distros where, presumably, pcmanfm-qt has a compatibility symlink allowing it to be invoked as pcmanfm as well. So they didn't bother to make a separate opener for LXQT, and simply recycled the LXDE one.

Last edited by eschwartz (2017-10-22 04:30:17)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2017-10-22 07:38:30

nesk
Member
Registered: 2011-03-31
Posts: 181

Re: [solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

Indeed, there's an upstream bug report for it already: https://bugs.freedesktop.org/show_bug.cgi?id=103146

Offline

#5 2017-10-22 13:06:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

Eschwartz wrote:
cfr wrote:

What's in viewnior.desktop?

Irrelevant, as the OP said and as inspection of /usr/bin/xdg-open reveals, when lxde is detected as the DE, it does what it does with most DEs and simply opens everything with the DE-specific xdg-open equivalent -- so I assume pcmanfm does the same as `gio open`, gnome-open, kde-open, exo-open, etc.

Thanks. I never realised xdg-open used DE-heuristics like that.

Which is interesting since its main utility is a file browser but okay. smile

On my system, gwenview is treated as the default file manager, which seemed to me equally strange.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2017-10-22 23:08:11

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [solved, open upstream bug] xdg-open tries to use pcmanfm on LXQt

cfr wrote:

On my system, gwenview is treated as the default file manager, which seemed to me equally strange.

Well, that's probably because update-desktop-database chooses and re-chooses the system default based on an RNG, every time it is run. You need to set a user default in ~/.config/mimeapps.list or the XDG standard says "whatever happens to be randomly listed first in the system /usr/share/applications/mimeinfo.cache is for some reason assumed to be the preferred opener".

So any application that announces it *can* handle inode/directory, can magically be assigned as the default file browser, and what's worse, it can change every time pacman installs or updates any *.desktop file at all.

Last edited by eschwartz (2017-10-22 23:09:21)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB