Emacs: Load doom-themes and TRAMP on slow computers.

This commit is contained in:
tastytea 2020-11-30 15:50:41 +01:00
parent dd68a950d2
commit 03a18144a1
2 changed files with 61 additions and 67 deletions

View File

@ -1,6 +1,6 @@
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*- ;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-11-30T09:58:13+0100> ;; Time-stamp: <2020-11-30T15:50:27+0100>
;;; Commentary: ;;; Commentary:
@ -61,50 +61,48 @@
(not (my/font-installed-p "all-the-icons"))) (not (my/font-installed-p "all-the-icons")))
(all-the-icons-install-fonts t))) (all-the-icons-install-fonts t)))
(unless slow-computer (use-package doom-themes
(use-package doom-themes :demand t
:demand t :after (all-the-icons)
:after (all-the-icons) :custom ((doom-themes-treemacs-theme "doom-colors")
:custom ((doom-themes-treemacs-theme "doom-colors") (doom-themes-treemacs-enable-variable-pitch nil))
(doom-themes-treemacs-enable-variable-pitch nil)) :config (progn
:config (progn (defun my/reload-theme ()
(defun my/reload-theme () (load-theme 'doom-outrun-electric t)
(load-theme 'doom-outrun-electric t) (when (display-graphic-p)
(when (display-graphic-p) (set-face-background 'scroll-bar (face-background 'default))
(set-face-background 'scroll-bar (face-background 'default)) (set-face-foreground 'scroll-bar (face-foreground 'shadow)))
(set-face-foreground 'scroll-bar (face-foreground 'shadow))) (when (fboundp #'my/ruler-set-colors)
(when (fboundp #'my/ruler-set-colors) (my/ruler-set-colors))
(my/ruler-set-colors)) (when (fboundp #'my/volatile-highlights-reset-color)
(when (fboundp #'my/volatile-highlights-reset-color) (my/volatile-highlights-reset-color)))
(my/volatile-highlights-reset-color))) (my/reload-theme)
(my/reload-theme)
(doom-themes-visual-bell-config) ; Flash modeline on error. (doom-themes-visual-bell-config) ; Flash modeline on error.
;; No icons in TUI, see ;; No icons in TUI, see
;; <https://github.com/hlissner/emacs-doom-themes/issues/489> ;; <https://github.com/hlissner/emacs-doom-themes/issues/489>
(doom-themes-treemacs-config) (doom-themes-treemacs-config)
;; Write a minimal theme to file, to load it in early-init.el. ;; Write a minimal theme to file, to load it in early-init.el.
(unless (string= (face-background 'default) "unspecified-bg") (unless (string= (face-background 'default) "unspecified-bg")
(let ((minimal-theme)) (let ((minimal-theme))
(setq minimal-theme (concat "(set-face-background 'default \"" (setq minimal-theme (concat "(set-face-background 'default \""
(face-background 'default) "\")\n" (face-background 'default) "\")\n"
"(set-face-foreground 'default \"" "(set-face-foreground 'default \""
(face-foreground 'default) "\")\n" (face-foreground 'default) "\")\n"
"(menu-bar-mode -1)\n" "(menu-bar-mode -1)\n"
"(when (display-graphic-p)\n" "(when (display-graphic-p)\n"
" (tool-bar-mode -1))\n")) " (tool-bar-mode -1))\n"))
(with-temp-file (expand-file-name "early-theme.el" (with-temp-file (expand-file-name "early-theme.el"
user-emacs-directory) user-emacs-directory)
(insert minimal-theme)))) (insert minimal-theme))))
(defun my/treemacs-reset-fringe () (defun my/treemacs-reset-fringe ()
"Make fringe in treemacs visible again." "Make fringe in treemacs visible again."
(set-window-fringes (selected-window) 8)) (set-window-fringes (selected-window) 8))
(advice-add #'doom-themes-hide-fringes-maybe (advice-add #'doom-themes-hide-fringes-maybe
:after #'my/treemacs-reset-fringe)) :after #'my/treemacs-reset-fringe))
:hook (server-after-make-frame . my/reload-theme)) :hook (server-after-make-frame . my/reload-theme))
) ; unless slow-computer.
;; Neat modeline. ;; Neat modeline.
(use-package doom-modeline (use-package doom-modeline

View File

@ -1,37 +1,33 @@
;;; server.el --- Set up network stuff.. -*- lexical-binding: t; -*- ;;; server.el --- Set up network stuff.. -*- lexical-binding: t; -*-
;; Time-stamp: <2020-11-29T15:17:55+0100> ;; Time-stamp: <2020-11-30T15:48:09+0100>
;;; Commentary: ;;; Commentary:
;;; Code: ;;; Code:
(require 'basics/package-management) (require 'basics/package-management)
(require 'basics/global-variables)
;; Edit remote files. (use-package tramp
(unless slow-computer :straight (:type built-in)
(use-package tramp :defer 2
:straight (:type built-in) :custom ((tramp-use-ssh-controlmaster-options nil
:defer 2 "Don't override SSH config.")
:custom ((tramp-use-ssh-controlmaster-options nil (tramp-default-method "ssh" "Faster than scp and supports ports.")
"Don't override SSH config.") (tramp-password-prompt-regexp
(tramp-default-method "ssh" "Faster than scp and supports ports.") (concat
(tramp-password-prompt-regexp "^.*"
(concat (regexp-opt
"^.*" '("passphrase" "Passphrase"
(regexp-opt "password" "Password"
'("passphrase" "Passphrase" "Verification code")
"password" "Password" t)
"Verification code") ".*:\0? *") "Add verification code support.")
t) (tramp-connection-timeout 20)
".*:\0? *") "Add verification code support.") (tramp-auto-save-directory
(tramp-connection-timeout 20) (concat user-emacs-directory "backups/") "Auto-save locally."))
(tramp-auto-save-directory :config (add-to-list
(concat user-emacs-directory "backups/") "Auto-save locally.")) 'tramp-remote-path 'tramp-own-remote-path)) ; Respect remote PATH.
:config (add-to-list
'tramp-remote-path 'tramp-own-remote-path)) ; Respect remote PATH.
) ; unless slow-computer.
;; Run server on TCP socket if: ;; Run server on TCP socket if:
;; - Our EUID is not 0, ;; - Our EUID is not 0,