Sway Version: 1.2
Distro: Arch
Debug (seemingly irrelevant in this case)
When attempting to launch Android Studio, I get the following error:
Startup Error: Unable to detect graphics environment
My zsh environment dotfile:
path=(
/bin
/usr/bin
/usr/local/bin
~/.cargo/bin
/usr/lib/jvm/java-8-openjdk
)
#Enable wayland for firefox.
export MOZ_ENABLE_WAYLAND=1
#Let QT5 communicate with wayland
export QT_QPA_PLATFORM=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk
output of archlinux-java status:
Available Java environments:
java-12-openjdk
java-8-openjdk (default)
I am doing everything from my own profile, no sudo confusion!
This seems like a wayland issue, but I've prowled through various threads on Github and Stack Overflow to no avail.
Am I neglecting something blindingly obvious? Is there a magical environment variable that eludes me?
Thanks in advance for any help and/or advice!
Do you have xwayland installed?
For a full debug log, please use (sway logs to stderr not stdout):
sway -d >sway.log 2>&1
@RedSoxFan thank you for the clarification!
I do not have xwayland installed. This has been a point of confusion for me in fact. I am unaware of how to determine if an application supports wayland or expects X11.
Another common error I've been encountering when applications don't launch goes something like this:
(some_application:11010): Gtk-WARNING **: 20:09:04.873: cannot open display:
Can I reasonably assume that "display errors" suggest the application is looking for an X server?
I do not have xwayland installed
Android Studio does not have native wayland support so it will require xwayland to be installed.
This has been a point of confusion for me in fact. I am unaware of how to determine if an application supports wayland or expects X11.
If it isn't launching without xwayland installed, it probably requires xwayland. With xwayland installed, you can see which is being used with a variety of methods. The more popular ones that I've seen are:
for_window [shell=".*"] title_format "%title - %shell" (will show xwayland -- for xwayland -- or xdg-shell -- for native wayland -- in the title)for_window [shell="xwayland"] title_format "%title [xwayland]" (will show [xwayland] in the title for xwayland)xeyes (if the eyes move while over the window, it's xwayland)xprop (if you can click on the window, it's xwayland)Can I reasonably assume that "display errors" suggest the application is looking for an X server?
Yes
_Closing this issue since it should be resolved after installing xwayland_
@RedSoxFan
After having installed xwayland and setting xwayland enable in my config I am still receiving the same error. Any further suggestions would be much appreciated.
Can you execute env inside sway and paste the output?
LANG=en_US.UTF-8
SWAYSOCK=/run/user/1000/sway-ipc.1000.1930.sock
WAYLAND_DISPLAY=wayland-0
HG=/usr/bin/hg
NVM_DIR=/home/hunter/.nvm
HOME=/home/hunter
USER=hunter
OLDPWD=/home/hunter
MOZ_ENABLE_WAYLAND=1
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_VTNR=1
XDG_SEAT=seat0
NVM_CD_FLAGS=-q
JAVA_HOME=/usr/lib/jvm/java-8-openjdk
_=/bin/env
I3SOCK=/run/user/1000/sway-ipc.1000.1930.sock
VTE_VERSION=5602
JOURNAL_STREAM=9:22729
QT_QPA_PLATFORM=wayland
LOGNAME=hunter
MAIL=/var/spool/mail/hunter
PATH=/home/hunter/.nvm/versions/node/v10.16.3/bin:/bin:/usr/bin:/usr/local/bin:/home/hunter/.cargo/bin:/usr/lib/jvm/java-8-openjdk
XDG_RUNTIME_DIR=/run/user/1000
NVM_BIN=/home/hunter/.nvm/versions/node/v10.16.3/bin
XDG_SESSION_ID=1
SHELL=/usr/bin/zsh
_JAVA_AWT_WM_NONREPARENTING=1
XDG_SESSION_TYPE=tty
INVOCATION_ID=239bedd3a2e049ea82de8a1dfc50d2bb
SHLVL=2
PWD=/home/hunter
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
COLORTERM=truecolor
XCURSOR_SIZE=24
TERM=xterm-termite
XDG_SESSION_CLASS=user
I should note that if I try to set DISPLAY to the common settings (i.e. :0.0, :1) I end up getting variations of the following error:
java.awt.AWTError: Can't connect to X11 server using '0.0' as the value of the DISPLAY variable.
DISPLAY is not set, which means Xwayland is disabled. Double-check your config.
My config has "xwayland enable" near the top of the file (on line 6).
I installed the package "xorg-server-xwayland" and have done no other configuration besides that. Is there something I'm missing beyond the "xwayland enable" setting?
Your sway log doesn't say the same thing: https://gist.github.com/HTempleman/c0660075fbe21b6be4b90637e5eacdd4#file-newerror-log-L547
Feeling foolish.
When I initially set up my sway config, I did so in ~/.sway/config. For whatever reason, I forgot this and began making all of my changes in ~/.config/sway/config.
Sure enough, the former config file had xwayland set to disable. Gonna be more thorough in reading debug logs now!
Most helpful comment
Your sway log doesn't say the same thing: https://gist.github.com/HTempleman/c0660075fbe21b6be4b90637e5eacdd4#file-newerror-log-L547