emersion / grim

Grab images from a Wayland compositor

Home Page:https://wayland.emersion.fr/grim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed to create display

kellpossible opened this issue · comments

With the command:

grim test.png

I get the following output:

failed to create display

Using ArchLinux 64 bit, with sway version 1.0 on a Lenovo thinkpad.

There is no output associated with this command when running:

sway -d 2> sway.log

Is any other Wayland client working?

Obviously you need to run mako in your compositor.

Is any other Wayland client working?

What is an example of another client that you would expect to work?

Obviously you need to run mako in your compositor.

Sorry, not obvious to me, I don't know much about this topic, I'm just trying to take a screenshot in sway, what is mako, how is it relevant to this issue?

Gah. Sorry, I wanted to say "grim".

Can you try this:

  • Run a GTK3 client from your terminal (e.g. gnome-calculator)
  • Run echo $WAYLAND_DISPLAY

Thanks :)

Do I need to run this from a terminal while running sway? Or without sway, in the tty?

You need to run grim and all apps from within sway.

Hi @emersion, so it looks like it may be related to the terminal application that I'm using.

gnome-calculator works fine.

echo $WAYLAND_DISPLAY
alacritty

I've been using alacritty with the following launch configuration as a workaround for an early problem:

export WAYLAND_DISPLAY=alacritty
/usr/bin/alacritty

Anyway I tried these instructions from xfce4-terminal:

echo $WAYLAND_DISPLAY
wayland-0

And noticed that grim was working!

So thinking it probably has something to do with the WAYLAND_DISPLAY variable, I tried running alacritty without at and things seem to be working now! Thanks a lot for your help. I guess this issue can be closed now?

p.s. looking forward to trying out slurp too

Good that you've figured that out. If you set WAYLAND_DISPLAY to a bogus value, Wayland clients won't be able to connect to sway.