Gtk-WARNING ** cannot open display: :0 error when running `authy`

Hi,

I install Twilio Authy 1.8.3 via snap. The first time I ran it, no issue.

Now, when I tried to run it from the search bar it does not open.

When I tried to run it via the terminal, I get the following error:

$ authy

(authy:43597): Gtk-WARNING **: 17:59:05.444: cannot open display: :0

I have a fresh install of manjaro-gnome (Nibia 20.2).

Most research results points to wayland issues and are quite old. I understand I am using wayland as it is the default settings, right?

I don’t know if Wayland is default but the error is consistent with a system using Wayland.

This is because Wayland do not allow X applications to be run with root permissions.

Logoff and the select the gear icon to change session to an Xorg session - login - then it will work.

You may be able to start the app using pkexec which is the polkit pendant to sudo.

I have seen a number of comments about having this error when running an app with sudo.

Please note that I am not trying to run the app with sudo. authy is a google authenticator app, it has no reason to run sudo.

I have fixed the issue by deleting the snap version and instead using the AUR package.

Now I wonder I am going to run into the same issue for all snap I may install?