xdg-open "https://nixos.wiki/"
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
I’ve tried just about every permutation I can think of, all extra portals included, none included, only the current desktop I’m using, or combinations I’ve seen in forum posts. e.g. with hyprland + gtk but not wlr nor gnome. Add kde in for fun, remove it, it does not matter. Under no circumstance can xdg open a link, not from the slack desktop app, not from the command line. Not under hyprland, gnome, kde, i3, sway, river. Not under wayland, and not under X11.
I have tried many permutations of the above as well, for example remove gtk and gnome in case they were stepping on kde’s toes. Same sort of thing with wlr and hyprland. How about just KDE? Nope. This has no effect.
Have you checked the output of systemctl --user status xdg-desktop-portal-gtk.service (or any of the other implementations)? For the sake of testing, I would suggest sticking to one DE/WM and one portal implementation. Example for Hyprland + xdg-desktop-portal-gtk:
Note the use of XDG_CURRENT_DESKTOP. This is used to determine if a portal is compatible with the current desktop.
There is a portal config file that can be used to provide an explicit mapping. Since my desktop is run under a gnome session I keep GNOME.
The only part I don’t have working is one of my machines does not use the dark theme for the portal. The others do use the dark theme so a bit of a mystery there.
➜ systemctl --user restart xdg-desktop-portal.service
~
➜ systemctl --user status xdg-desktop-portal-gtk.service
● xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
Loaded: loaded (/etc/systemd/user/xdg-desktop-portal-gtk.service; linked-runtime; preset: enabled)
Active: active (running) since Tue 2024-07-02 09:53:13 CDT; 26min ago
Main PID: 162708 (.xdg-desktop-po)
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/xdg-desktop-portal-gtk.service
└─162708 /nix/store/yfbi77nfbv9bfz8c2n7p1l2xg93g8wkd-xdg-desktop-portal-gtk-1.15.1/libexec/xdg-desktop-portal-gtk
Jul 02 10:10:44 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:44 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:44 spectre360 .xdg-desktop-po[162708]: Unable to load progress from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load col-resize from the cursor theme
Jul 02 10:10:50 spectre360 .xdg-desktop-po[162708]: Unable to load progress from the cursor theme
~
➜ xdg-open "https://nixos.wiki/"
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
I’d suggest you pick one portal impl, not all of them at the same time.
Also, you probably also need to run systemctl --user import-environment; presumably whatever config you’re using isn’t taking care of that for you already.
I just remembered that I had a portal issue a while back (I’d get a “No Apps available” message when opening a link). IDK if the solution will work for you, but try running these commands. Omit PATH if necessary:
Still not working, I have tried @coreyoconnor 's config directly, but maybe I am invoking it wrong? Do I need to modify gdm or sddm to do something special?
Also here are more systemctls:
➜ xdg-open http://joshuacox.github.io
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
~
❯ systemctl --user import-environment PATH
systemctl --user restart xdg-desktop-portal.service
~
➜ xdg-open http://joshuacox.github.io
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
~
❯ systemctl --user import-environment PATH
systemctl --user restart xdg-desktop-portal.service
~
➜ systemctl --user status xdg-desktop-portal-gtk.service
● xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
Loaded: loaded (/etc/systemd/user/xdg-desktop-portal-gtk.service; linked-runtime; preset: enabled)
Active: active (running) since Wed 2024-07-03 12:20:01 CDT; 1min 50s ago
Main PID: 6236 (.xdg-desktop-po)
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/xdg-desktop-portal-gtk.service
└─6236 /nix/store/hzb2mqfishizqk3v5y2iq6allrx2r3jw-xdg-desktop-portal-gtk-1.15.1/libexec/xdg-desktop-portal-gtk
Jul 03 12:20:01 spectre360 systemd[4585]: Starting Portal service (GTK/GNOME implementation)...
Jul 03 12:20:01 spectre360 systemd[4585]: Started Portal service (GTK/GNOME implementation).
~
➜ xdg-open http://joshuacox.github.io
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.OpenURI” on object at path /org/freedesktop/portal/desktop
Darn! The intention with that config is for it to be enabled and “just work”. Unfortunately I don’t really know what is going on haha. Still figuring it out.
There are some arcane debugging commands I have somewhere. Checking…
Not sure if this will help, but do you have programs.dconf.enable = true; in your NixOS config? Or is anything else setting it? If not, then set it, rebuild and reboot.