4

I'm currently working on using the crouton xiwi X windows target to run an Emacs session on a Chromebook. I've done this by starting Emacs as the last entry in .xinitrc making it effectively the window manager for the session. Despite having the frame configured to be fullsize it's not using the full width of the display (which can be resized dynamically).

Is there native support in Emacs for querying the host X session display size or do I need to resort to shell script calls to extract the data?

stsquad
  • 4,626
  • 28
  • 45
  • The question title is not very clear - please consider editing it. What could be meant by the size of a *window system*? If the window system is, say, X Window, what could its *size* mean? – Drew Mar 04 '15 at 15:42

2 Answers2

5

To expand on Tarsius' answer.

display-pixel-width and display-pixel-height return the width and height respectively.

display-monitor-attributes-list will give you information on all the available monitors attached to the DISPLAY. If you're dealing with a multi-monitor situation you'll probably need:

(assq 'workarea (nth X (display-monitor-attributes-list)))  ;; X is the howmany-eth monitor

This gives you (workarea X Y WIDTH HEIGHT) where width and height are the available space on the current monitor.

Jonathan Leech-Pepin
  • 4,307
  • 1
  • 19
  • 32
4

Use display-pixel-width and display-pixel-height.

tarsius
  • 25,298
  • 4
  • 69
  • 109