Guest User

Untitled

a guest
Jul 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. (defun set-frame-size-according-to-resolution ()
  2. (interactive)
  3. (if window-system
  4. (progn
  5. ;; use 180 char wide window for largeish displays
  6. ;; and smaller 80 column windows for smaller displays
  7. ;; pick whatever numbers make sense for you
  8. (if (> (x-display-pixel-width) 1280)
  9. (add-to-list 'default-frame-alist (cons 'width 180))
  10. (add-to-list 'default-frame-alist (cons 'width 80)))
  11. ;; for the height, subtract a couple hundred pixels
  12. ;; from the screen height (for panels, menubars and
  13. ;; whatnot), then divide by the height of a char to
  14. ;; get the height we want
  15. (add-to-list 'default-frame-alist
  16. (cons 'height (/ (- (x-display-pixel-height) 200) (frame-char-height)))))))
  17.  
  18. (set-frame-size-according-to-resolution)
Add Comment
Please, Sign In to add comment