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?

  • 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 4, 2015 at 15:42

2 Answers 2


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.

  • You're missing a ) in your assq code.
    – NVaughan
    Mar 4, 2015 at 19:39

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.