comparison pers-init.el @ 29:e59705180efa laptop

device/frame stuff
author ht
date Wed, 16 May 2018 15:40:47 +0100
parents 0e2183025318
children 6324d06c5a32
comparison
equal deleted inserted replaced
28:0e2183025318 29:e59705180efa
418 (defun ht-custom-size () 418 (defun ht-custom-size ()
419 (interactive) 419 (interactive)
420 (site-caseq (laptop 420 (site-caseq (laptop
421 (message (format "pw: %s" (device-pixel-width (selected-device)))))) 421 (message (format "pw: %s" (device-pixel-width (selected-device))))))
422 (if (fboundp 'device-pixel-width) 422 (if (fboundp 'device-pixel-width)
423 (let ((pw (device-pixel-width (selected-device)))) 423 (let ((pw (device-pixel-width (selected-device)))
424 (ph (device-pixel-height (selected-device))))
424 (cond ((>= pw 1680) 425 (cond ((>= pw 1680)
425 ;; we're on a big external monitor 426 ;; we're on a big external monitor
427 (require 'font-menu)
428 (font-menu-set-font nil nil 10)
426 (set-frame-pixel-size (selected-frame) 900 960) 429 (set-frame-pixel-size (selected-frame) 900 960)
427 (set-frame-position (selected-frame) -3 -20) 430 (set-frame-position (selected-frame) -3 -20))
428 ((= (device-pixel-height (selected-device)) 768) 431 ((= pw 1097)
429 ;; we're on a narrow cinema-ratio laptop 432 ;; we're on an XPS 13
430 (set-frame-pixel-size (selected-frame) 690 710) 433 (require 'font-menu)
431 (set-frame-position (selected-frame) -5 -26)) 434 (font-menu-set-font nil nil 9)
432 ((= (device-pixel-height (selected-device)) 900) 435 (set-frame-pixel-size (selected-frame) 583 583); 39 x 80
433 ;; we're on a cinema-ratio laptop 436 (set-frame-position (selected-frame) -5 -26))
434 (set-frame-pixel-size (selected-frame) 800 820) 437 ((= ph 768)
435 (set-frame-position (selected-frame) -3 -20)) 438 ;; we're on a narrow cinema-ratio laptop
436 ((= pw 1600) 439 (set-frame-pixel-size (selected-frame) 690 710)
437 ;; we're on a big external monitor 440 (set-frame-position (selected-frame) -5 -26))
438 (set-frame-pixel-size (selected-frame) 900 1120) 441 ((= ph 900)
439 (set-frame-position (selected-frame) -3 -20)) 442 ;; we're on a cinema-ratio laptop
440 ((= pw 1280) 443 (set-frame-pixel-size (selected-frame) 800 820)
441 (cond ((eq (device-pixel-height) 720) 444 (set-frame-position (selected-frame) -3 -20))
442 (set-frame-pixel-size (selected-frame) 700 655) 445 ((= pw 1600)
443 (set-frame-position (selected-frame) -3 -30)) 446 ;; we're on a big external monitor
444 (t 447 (set-frame-pixel-size (selected-frame) 900 1120)
445 (set-frame-pixel-size (selected-frame) 700 960) 448 (set-frame-position (selected-frame) -3 -20))
446 (set-frame-position (selected-frame) -3 -20))))))))) 449 ((= pw 1280)
450 (cond ((= ph 720)
451 (set-frame-pixel-size (selected-frame) 700 655)
452 (set-frame-position (selected-frame) -3 -30))
453 (t
454 (set-frame-pixel-size (selected-frame) 700 960)
455 (set-frame-position (selected-frame) -3 -20))))))))
447 456
448 (ht-custom-size) 457 (ht-custom-size)
449 458
450 ;;; make dired list directories first 459 ;;; make dired list directories first
451 (defadvice dired-insert-directory (before my-dired-insert-directory 460 (defadvice dired-insert-directory (before my-dired-insert-directory