You are not logged in.
When trying to open Gnome apps from a terminal, I get a `Gtk-WARNING **: cannot open display: :0` which baffles me for various reasons:
It does not seem to be an xhost/xauth problem, because opening non Gnome apps works fine, for example: firefox, skype, chromium, gvim, etc. open fine if invoke them from the terminal. Curiously, nautilus opens fine too, but apps like gedit, gnome-chess, gnome-contacts, gnome-calendar, evolution, gtk3-widget-factory and so on fail with the cannot open display warning. Interestingly, lollypop (a python gtk3 app) fails with a different error that might give a hint to what's going on: it fails because `Gdk.Screen.get_default()` returns null.
Now all these apps launch just fine if I start them from the Activities menu or from the Alt-F2 run dialog in Gnome 3. I log into Gnome from GDM; the issue is the same if I start another window manager.
Any ideas what may be causing this or how to debug it? My next step would be to try to attach gcc to see where exactly the apps fail, I'd much appreciate any pointers to what might be going on.
Offline
Don't know if you've solved it by now, but I have had the same problem for weeks. Thankfully the solution has been here all the time:
https://bugs.archlinux.org/task/46374
Should be solved by adding
. /etc/X11/xinit/xinitrc.d/50-systemd-user.sh
to your .xinitrc
Offline
That wasn't it in my case, but I finally figured it out: the environment variable GDK_BACKEND was set to 'wayland'.
Offline