Package: xdg-utils
Version: 1.1.3-4.1
Severity: normal
File: /usr/bin/xdg-open

Hi,

sorry for making this lengthy, but this is first-hand user experience.
If TL;DR is wanted, please scroll down to the summary section.

This issue has bothered me for a while and I had to report it
eventually. I have a mixed system here, not just one single DE. And
xdg-open is apparently used in many applications. And the behavior on
folders puzzled me:

 - xdg-open .  --> opens VS Code
 - xdg-open /tmp  --> opens QDirStat

And the manual of xdg-open does not give me any clue on how to
investigate or modify it. Which UI tool can I use? Which CLI tool may I
use?

The first idea was to use xdg-settings. That tool does NOT HELP ME AT
ALL. I can get and check and set something, but WHAT? There is no "list"
sub-command in that utility.

Okay, so I had to check the internet. Found out about MimeType and found
code.desktop and qdirstat.desktop, and found the mime types
inode/directory and inode/mountpoint . So I had to read further to
create $HOME/.local/share/applications/thunar.desktop which is based on
the packaged version, and I added this into it:

$ grep Mime $HOME/.local/share/applications/thunar.desktop
MimeType=inode/directory;inode/mountpoint;

Expected result:

- the change should be picked up
- the preferred version in user's home should be used

Actual result:

$ xdg-open /var/tmp
[main 2024-04-04T10:41:10.001Z] update#setState idle
[main 2024-04-04T10:41:11.720Z] Extension host with pid 1431582 exited with 
code: 0, signal: unknown.
[main 2024-04-04T10:41:11.728Z] [UtilityProcess id: 1, type: fileWatcher, pid: 
1431552]: crashed with code 15 and reason 'killed'

And it still opens it with code, not thunar. And what is this
fileWatcher being killed? So, assuming that it might use a user service
for all operations, I have applied "systemctl --user restart xdg..." on
all services. Result: no luck, nothing has changed.

So eventually I hat do dig further, after finding out that those are
just shell scripts, which brings us to "xdg-mime query default
inode/directory" returning code.desktop.

And only after bash-x-ing this I have learned about the existence of
defaults.list file. And I still had no idea how to create or modify it.

So I had to use SO again and found 
https://unix.stackexchange.com/questions/36380/how-to-properly-and-easily-configure-xdg-open-without-any-environment#59088

And only after creating the file with the following I get to my actual
target.

[Default Applications]
inode/directory=thunar.desktop
inode/mountpoint=thunar.desktop


So, my summary, what would I expect:

- the manpages shall document the related configuration files, at least
  briefly
- default.list should have a manpage (no user should be forced to use
  web sources for such basic knowledge)
- the MimeType of the user's desktop files probably should be considered
  first, and the system versions later
- there should be some kind of verbosity switch, which would print
  relevant information along the decision making, without having to dig
  through all the shell debug log.

Best regards,
Eduard.

-- Package-specific info:
Desktop environment: XDG_CURRENT_DESKTOP=

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'oldoldstable'), (500, 
'unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.2 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

xdg-utils depends on no packages.

Versions of packages xdg-utils recommends:
ii  libfile-mimeinfo-perl  0.34-1
ii  libnet-dbus-perl       1.2.0-2+b2
ii  libx11-protocol-perl   0.56-9
ii  x11-utils              7.7+6+b1
ii  x11-xserver-utils      7.7+10+b1

xdg-utils suggests no packages.

-- no debconf information

--
<Zomb> Noch freiwillige Tester für svn-inject und svn-uupdate hier?
<Greek0> Wenn du mir erklärst, was das is ;)
<Zomb> Greek0: Dope für Maintainer, echt guter Stoff.

Reply via email to