Skip to content

Latest commit

 

History

History
183 lines (136 loc) · 6.25 KB

client.org

File metadata and controls

183 lines (136 loc) · 6.25 KB

Emacs Client Configuration File

\Author{Timo La\ss mann} \DocumentID{src_sh[:value verbatim]{shasum -a 256 config.org | awk ‘{print $1}’ }}

Display Settings

(setq ring-bell-function 'ignore);; turn everything offf

(when (window-system)
  (tool-bar-mode 0)               ;; Toolbars were only cool with XEmacs
  (menu-bar-mode 0)
  (when (fboundp 'horizontal-scroll-bar-mode)
    (horizontal-scroll-bar-mode -1))
  (scroll-bar-mode -1))            ;; Scrollbars are waste screen estate

Font Settings

Set default font size..

;; (set-face-attribute 'default nil :height 140)

I love syntax highlighting.

(global-font-lock-mode 1)

I think so. I keep changing my

font based on the monospace du jour… While I M+ because it is thinner and has more white space between lines, but Source Code Pro is so attractive, oh, and then there is Anonymous Pro…

While thicker, Fira does symbol ligatures. However, Hasklig is a nice font that is thinner and easier to read, with some symbolic ligatures that doesn’t interfere with my org-mode header bullets.

(defvar tl/fixed-font-family
  (cond ((x-list-fonts "Hasklig")         "Hasklig")
        ((x-list-fonts "Source Code Pro") "Source Code Pro")
        ((x-list-fonts "Anonymous Pro")   "Anonymous Pro")
        ((x-list-fonts "M+ 1mn")          "M+ 1mn"))
  "My fixed width font based on what is installed, `nil' if not defined.")

Since the headers are based on Adobe’s open source font pair of the

proportional font, Source Sans Pro, will match the non-proportional font, Source Code Pro.

(defvar tl/variable-font-tuple
  (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
        ((x-list-fonts "Lucida Grande")   '(:font "Lucida Grande"))
        ((x-list-fonts "Verdana")         '(:font "Verdana"))
        ((x-family-fonts "Sans Serif")    '(:family "Sans Serif"))
        (nil (warn "Cannot find a Sans Serif Font.  Install Source Sans Pro.")))
  "My variable width font available to org-mode files and whatnot.")

Resizing

According to this article, we can update the text-scale-XYZ functions to work on a frame instead of just a buffer:

(defun tl/text-scale-frame-change (fn)
  (let* ((current-font-name (frame-parameter nil 'font))
         (decomposed-font-name (x-decompose-font-name current-font-name))
         (font-size (string-to-number (aref decomposed-font-name 5))))
    (aset decomposed-font-name 5 (int-to-string (funcall fn font-size)))
    (set-frame-font (x-compose-font-name decomposed-font-name))))

(defun tl/text-scale-frame-increase ()
  (interactive)
  (tl/text-scale-frame-change '1+))

(defun tl/text-scale-frame-decrease ()
  (interactive)
  (tl/text-scale-frame-change '1-))

(global-set-key (kbd "C-+") 'tl/text-scale-frame-increase)
(global-set-key (kbd "C-=") 'tl/text-scale-frame-increase)
(global-set-key (kbd "C--") 'tl/text-scale-frame-decrease)

Color Theme

Use the color theme project by following these instructions. We now can do M-x color-theme-<TAB> RET

Let’s see if I can improve the spacemacs theme

;; (use-package gotham-theme
;;   :ensure t
;;   :init (load-theme 'gotham t)
;;   )

;; (defun tl/mod_background ()
;;   "Colors the block headers and footers to make them stand out more for dark themes"
;;   (interactive)
;;   (custom-set-faces
;;    '(org-block-begin-line ((t (:foreground "#008ED1" :background "#002E41" :extend t))))
;;    '(org-block-background ((t (:background "#000000" :extend t))))
;;    '(org-block            ((t (:background "#122022" :extend t))))
;;    '(org-block-end-line   ((t (:foreground "#008ED1" :background "#002E41" :extend t))))
;;    '(org-level-1 ((t (:bold t :height 1.3  :foreground "#cb4b16" ))))
;;    '(org-level-2 ((t (:bold t :height 1.2  :foreground "#b58900" ))))
;;    '(org-level-3 ((t (:bold nil :height 1.1  :foreground "#2aa198"  ))))
;;    '(org-level-4 ((t (:bold nil :height 1.0  :foreground "#00bdfa" ))))
;;    )
;;   )

;; (deftheme tl/mod_gotham  "Sub-theme to beautify spacemacs")

;; (defun tl/change-theme (theme back)
;;   "Changes the color scheme and reset the mode line."
;;   (load-theme theme t)
;;   (funcall back))

Activate theme

;; (tl/change-theme 'gotham 'tl/mod_background)
(provide 'init-client)

Powerline stuff

Nyan mode

(use-package nyan-mode
  :ensure t
  :config
  (progn
    (nyan-mode)
    (nyan-stop-animation))
  )

Battery indicator

A package called fancy-battery will be used if we are in GUI emacs, otherwise the built in battery-mode will be used. Fancy battery has very odd colors if used in the tty, hence us disabling it.

(use-package fancy-battery
  :ensure t
  :config
  (setq fancy-battery-show-percentage t)
  (setq battery-update-interval 15)
  (if window-system
      (fancy-battery-mode)
    (display-battery-mode)))