I’m trying to set the default apps in XMonad for xdg-open, I have GTK and KDE portals, but I when I try they with xdg-open command its throw me a window that says “Apps no available”. I set they like this in my configuration.nix:
How do you start Xmonad? If I recall correctly I had to start my window manager with something like dbus-run-session river (I use river as WM) in order for xdg-open to work correctly.
My suspicion is that most people only don’t notice because of the very liberally sprinkled hard-coded fallback browsers.
My suggestion is to permanently set BROWSER=librewolf.
If you wish to get the xdg mime handling to work, browse through that script and manually prod the xdg-mime scripts until you figure out where things are going wrong. I’ve only ever set mime associations under user directories, so I’m not sure how global settings propagate. All of this ultimately ends up in a “cache”, which you may or may not need to regenerate.
If on the other hand the issue is an xdg-open inside a flatpak, then things get more tricky.
export BROWSER="librewolf" doesn’t works, I got the same popup. I export $EDITOR as vim for yazi a file manager in the terminal that open files with xdg-open, vim works in yazi, you input enter and its open the text file. But vim doesn’t works with xdg-open command directly e.g. xdg-open file.txt just throw the “No applications available” window.
Hang on, wait, this should not be possible if you use xdg-open. It does not open windows by itself, it’s a non-graphical application.
This means you must be running into it using one of the other backends, which should not be happening on xmonad. You’ve probably played with your DE variable, or registered some kind of catchall association. What is the window that pops up?
xdg-open does not respect the $EDITOR variable for what it’s worth, so that’s not a useful test. It’s just clear that you end up with a non-generic branch.
I set in /etc/nixos/configuration.nixXDG_CURRENT_DESKTOP=X-Generic in environment.variables section, but doesn’t wokrs, printenv prints its value. XDG_SESSION_TYPE=tty why I’m start XMonad with startx, thats matter?