launching GTK apps on MacOS+homebrew (revenge of $XDG_DATA_DIRS) #3633
Unanswered
mitchblank
asked this question in
Feature Requests, Ideas
Replies: 2 comments 4 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
We set the default based on the XDG specification, namely:
This feels like it's a bug in the Homebrew formula for GTK or GTK itself where it should be exporting additional data dirs into your shell. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorry if this is a dup of any other discussion. I found several things which were close to this, but nothing that captured this problem exactly.
Background:
$XDG_DATA_DIRS
; in order to not break other programs it prepends what it thinks the default value will be: see Setting XDG_DATA_DIRS breaks various GTK-based programs #2711 This presumably works on linux.$XDG_DATA_DIRS
isn't the same as it would be on linux. (I'm guessing this is relative to--prefix
that GTK itself was compiled with?)The end effect is that GTK apps (in my case,
virt-manager
) break when started from ghostty:If I manually add
$HOMEBREW_PREFIX/share
to the front of$XDG_DATA_DIRS
it works:So basically,
virt-manager
(and probably other GTK apps) built on homebrew work with an unset$XDG_DATA_DIRS
, but not with one that is set but missing its bits.Right now ghostty's default
$XDG_DATA_DIRS
seems to be hardcoded:ghostty/src/termio/Exec.zig
Line 810 in bee2188
I don't know if there is a great solution that would work in all cases, but at least on MacOS that should probably include
/opt/homebrew/share
if it exists. That wouldn't solve the problem in general for other software managers (or non-default homebrew installs) but at least it would cover a lot of people.On linuxbrew it seems use
/home/linuxbrew/.linuxbrew/share
per Homebrew/brew#18317Maybe just probing for some of these common "share" locations would solve the problem well enough?
Beta Was this translation helpful? Give feedback.
All reactions