How can I use the color theme in console mode?

I use a dark blue theme, but it seems ugly under the console. So I want to use the color theme under the terminal, what can I do?

+3
source share
4 answers

Set the "TERM" variable to the monochrome terminal before starting Emacs. For example, if you use xterm, use:

TERM=xterm-mono emacs -nw

If "console" means the Linux console in text mode, you can try using "vt100" (or "vt320").

+1
source

, , , window-system something, , nil, , So color-theme-darkblue2, :

(if window-system
    (progn
       (load "color-theme")
       (color-theme-darkblue2)))

. , , , else-part, :

(load "color-theme")
(if window-system
     (color-theme-darkblue2)
   (some-term-theme)))
+13

, , multi-tty Emacs CVS ( 23):

(defun mrc-xwin-look (frame)
  "Setup to use if running in an X window"
  (color-theme-deep-blue))

(defun mrc-terminal-look (frame)
  "Setup to use if running in a terminal"
  (color-theme-charcoal-black))

(defun mrc-setup-frame (frame)
  (set-variable 'color-theme-is-global nil)
  (select-frame frame)
  (cond
   ((window-system)
    (mrc-xwin-look frame)
    (tool-bar-mode -1)
    (mrc-maximize-frame))
   (t (mrc-terminal-look frame))))

(add-hook 'after-make-frame-functions 'mrc-setup-frame)

(add-hook 'after-init-hook
      (lambda ()
        (mrc-setup-frame (selected-frame))))

, X. ( .)

, :

(defun mrc-maximize-frame ()
  "Toggle frame maximized state"
  ;; from http://paste.lisp.org/display/54627/raw
  (interactive)
  (cond
   ((eq 'x (window-system))
    (progn
      (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                 '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
      (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
                 '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))))
   (t
    (message "Window system %s is not supported by maximize"
         (symbol-name (window-system))))))
+1

, :

(when window-system
   (load-theme '<myThemeName>))

Thus, this will load the theme in all cases when the window system is not zero, which in principle is any type of gui.

0
source

Source: https://habr.com/ru/post/1699326/


All Articles