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.

user341073
  • 13
  • 2

1 Answers1

0

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
Ian D. Scott
  • 116
  • 2