1

When I try to run wmctrl (e.g. wmctrl -l) from a tty outside of X (e.g. tty1), I get "Cannot open display."

I have tried setting the $DISPLAY and $XAUTHORITY variables to the values I get from a terminal emulator inside X, but it changes nothing.

1 Answers1

1

Setting DISPLAY is not enough; the variable will only be set within the shell. To work in programs called from the shell, it must be exported.

export DISPLAY=:0

Or you call wmctrl like this:

DISPLAY=:0 wmctrl