customize/my-theme.el
author bwmaister@gmail.com
Sat Dec 12 16:43:28 2009 -0500 (2009-12-12)
changeset 10 dc5cd95cc26c
parent 9 576e96854c48
permissions -rw-r--r--
Make the style a modified color-theme-comidia, instead of loading it and then modifying.
     1 (defun jdz-get-hostname (&optional long-p)
     2   "Get the current hostname by calling 'hostname'"
     3   (interactive "*P")
     4   (let ((jdz-hostname-buffer (generate-new-buffer " get-hostname"))
     5 	(hostname "unknown"))
     6     (unwind-protect
     7 	(save-excursion
     8 	  (set-buffer jdz-hostname-buffer)
     9 	  (apply 'call-process
    10 		 (list "hostname" nil t nil))
    11 	  (skip-chars-backward "\n\t ")
    12 	  (setq hostname (buffer-substring (point-min) (point))))
    13       (kill-buffer jdz-hostname-buffer))
    14     (if (interactive-p)
    15 	(insert hostname))
    16     hostname))
    17 
    18 (add-hook 'after-make-frame-functions
    19 	  (lambda (frame)
    20 	    (progn
    21 	      (add-to-list 'default-frame-alist
    22 			   (cons 'height
    23 				 (/ (x-display-pixel-height)
    24 				    (frame-char-height)))
    25 			   (add-to-list 'default-frame-alist
    26 					(cons 'width
    27 					      (/ (x-display-pixel-width)
    28 						 (frame-char-width))))))))
    29 
    30 ;;fonts!
    31 (add-hook 'after-make-frame-functions
    32   (lambda (frame)
    33     (if (and (string= system-type "gnu/linux")
    34 	     (string= (jdz-get-hostname) "spacebuntu"))
    35 	(set-frame-font "DejaVu Sans Mono-11")
    36       ;;(set-frame-font "Inconsolata-15")
    37       ;;(set-frame-font "Consolas-14")
    38       (if (string= system-type "windows-nt")
    39 	  (set-frame-font "Consolas")))))
    40 
    41 
    42 ;; (add-hook 'after-make-frame-functions
    43 ;;   (lambda (frame)
    44 ;;     (progn
    45 ;;       (set-frame-height frame
    46 ;; 			(-
    47 ;; 			 (/ (x-display-pixel-height)
    48 ;; 			    (frame-char-height))
    49 ;; 			 2))
    50 ;;       (set-frame-width  frame
    51 ;; 			(/ (x-display-pixel-width)
    52 ;; 			   (frame-char-width))))))
    53 
    54 (add-hook 'after-make-frame-functions
    55   (lambda (frame)
    56     (set-variable 'color-theme-is-global nil)
    57     (select-frame frame)
    58     (if window-system
    59 
    60      ;;; color-them-that-actually-works-but-only-if-we're-not-in-a-terminal:
    61 	(progn
    62 	  (setq load-path (cons "~/.emacs.d/plugins/color-theme-6.6.0"
    63 				load-path))
    64 	  (load "color-theme")
    65 	  ;;(load "themes/color-theme-tango")
    66 	  ;;(load "themes/color-theme-inkpot")
    67 	  ;;(load "themes/color-theme-intrepid")
    68 	  ;;(color-theme-intrepid)
    69 
    70 	  ;; this is required for the remaining color themes
    71 	  (load "themes/color-theme-library")
    72 	  ;;(color-theme-billw)
    73 	  ;;(color-theme-oswald)
    74 	  ;;(color-theme-subtle-hacker)
    75 	  ;;(load "color-theme-taming-mr-arneson")
    76 	  ;;(color-theme-taming-mr-arneson)
    77 	  ;;(color-theme-comidia)
    78 	  (load "themes/color-theme-comidia-modified")
    79 	  (color-theme-comidia-modified)
    80 	  )
    81       (color-theme-tty-dark))))
    82 
    83 (if window-system
    84     (progn
    85       (run-hook-with-args 'after-make-frame-functions (car (frame-list)))))