I'm running Firefox in Ubuntu18.04 server, on an LXC container.

On the host I'm running Xepher, which renders the X transferred over ssh.

Xephyr -ac -screen 1920x1200 -br -reset -terminate  :2 &
DISPLAY=:2 ssh -Y user@remote firefox &

It works except that Firefox only takes up about 2/3 of the screen in both width and height. If I make scree size 1280x800 then Firefox appears smaller but still takes about 2/3 of the screen in both width and height.

I can't see anything in the Firefox CLI startup parameters, nor does it seem to be a common use case.

How can I set the size (without a window manager) ?

Following comment suggestion I tried xdotool, and it succeeded ::

$ DISPLAY=:10 xdotool getdisplaygeometry
1920 1200
$ DISPLAY=:10 xdotool selectwindow
$ DISPLAY=:10 xdotool getwindowgeometry 2097155
Window 2097155
  Position: 0,0 (screen: 0)
  Geometry: 1280x1040
$ DISPLAY=:10 xdotool windowsize 2097155 1920 1200

Following another comment suggestion, in a single command:

DISPLAY=:10 xdotool search --onlyvisible --class Firefox windowsize 95% 95%
  • @dsstorefile1 - It worked. Make it an answer and I'll mark it correct. Jul 9, 2019 at 10:01
  • 1
    Note, you should be able to simplify that to a single non-interactive command: xdotool search --onlyvisible --class Firefox windowsize 100% 100%
    – meuh
    Jul 9, 2019 at 10:18
  • @meuh - That xdotool search --onlyvisible --class Firefox windowsize 100% 100% works well. Jul 9, 2019 at 12:03


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.