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

View File

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