Skip to content

XDG_DATA_DIRS is reset to a minimal list of directories in applications opened from the Qubes app menu, breaking default application resolution #10299

@ArrayBolt3

Description

@ArrayBolt3

How to file a helpful issue

Qubes OS release

R4.3

Brief summary

Whonix modifies the XDG_DATA_DIRS environment variable via scripts in /etc/profile.d (and /etc/zprofile.d). These modifications allow Whonix to customize things such as default application associations. These changes are picked up by Qubes OS and do appear in login shells, but somehow XDG_DATA_DIRS (and to my awareness, only XDG_DATA_DIRS) is reset to a "minimal" set of directories in applications that are opened from the Qubes app menu. This results in all of Whonix's file association settings usually being ignored.

Steps to reproduce

  • Install a Whonix-Workstation 18 template.
  • Create an AppVM based off this template, and launch QTerminal in it.
  • Run echo $XDG_DATA_DIRS.
  • Open Qube Manager, select the Whonix-Workstation 18 AppVM, and click "Open console in qube".
  • Log in as "user" (no password required), then run echo $XDG_DATA_DIRS.

Expected behavior

In both instances, echo $XDG_DATA_DIRS should output /usr/share/usability-misc/xdg-override/:/usr/share/anon-apps-config/share/:/usr/share/open-link-confirmation/xdg-override:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/ or similar.

Actual behavior

In the DispVM console, echo $XDG_DATA_DIRS outputs the expected value, but in QTerminal, the returned string is /home/user/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/.

Additional information

This is contributing to an issue, where clicking on the Qubes Domains widget in the system tray, hovering over a Whonix-Workstation 18 qube, and clicking "Open File Manager" opens Catfish File Search rather than PCManFM-Qt. Whonix ships a file at /usr/share/usability-misc/xdg-override/applications/defaults.list that is supposed to set the default application for inode/directory to pcmanfm-qt.desktop. Right now that file is out-of-date and is pointing to thunar.desktop instead, but even when it is changed to point to pcmanfm-qt.desktop, Catfish still opens when clicking this button in the widget. Running xdg-open $HOME in QTerminal also opens Catfish. However, running DISPLAY=:0 xdg-open $HOME in the DispVM console opens PCManFM-Qt as expected. (Granted, it looks awful because QT_QPA_PLATFORMTHEME='lxqt' is strangely not being set properly, but that's an unrelated issue.)

The only thing I see in Qubes' code that looks like it modifies XDG_DATA_DIRS is https://github.com/QubesOS/qubes-core-agent-linux/blob/bffc6e0d0df3874781c0feda8297be5063fabba1/qubes-rpc/qubes.StartApp. Could this be part of the issue?

Metadata

Metadata

Assignees

Labels

C: otherNo other component ("C:") label applies to this issue, or the appropriate label is not yet known.P: defaultPriority: default. Default priority for new issues, to be replaced given sufficient information.affects-4.3This issue affects Qubes OS 4.3.diagnosedTechnical diagnosis of this issue has been performed.pr submittedA pull request has been submitted for this issue.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions