nixos/home/emacs/modules/custom-ui-config.el
Evie Litherland-Smith ef73c2e417 Customise dashboard
Add hydra for controlling emms
2023-10-27 08:57:48 +01:00

103 lines
4 KiB
EmacsLisp

;;; custom-ui-config.el -*- lexical-binding: t; -*-
;; Copyright (C) 2023
;; SPDX-License-Identifier: MIT
;; Author: System Crafters Community
;;; Code:
(defconst crafted-startup-ascii-logo
'(" .000000. " ;; Make sure 1st line is as wide as widest
" .0. .0."
" .00. .00."
" .000cl. .lc000."
".0 0."
"0. .o0000o. .0"
" 00 .0' '0. 00"
" 00 .0 0. 00"
" HHHHH HHHHHHHHHHHH HHHHH"
"HHHH HHH HHHHHHHHHHHHHH HHHH"
" HHHHHH HHHHHHHHH HHHHHHHH"
" HHH HHHH HHHHHHHHH HHHH"
" HHH HHHHHH"
" HHHHH HH"))
(setq use-dialog-box nil
display-line-numbers 'relative
fill-column 80
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-set-navigator t
dashboard-set-init-info t
dashboard-startup-banner 'ascii
dashboard-projects-backend 'project-el
dashboard-projects-switch-function 'project-switch-project
dashboard-projects-show-base t
dashboard-items '((recents . 5)
(bookmarks . 5)
(projects . 5)
(agenda . 5)
(registers . 5))
dashboard-banner-ascii (concat " .000000. \n"
" .0. .0. \n"
" .00. .00. \n"
" .000cl. .lc000. \n"
".0 0.\n"
"0. .o0000o. .0\n"
" 00 .0' '0. 00 \n"
" 00 .0 0. 00 \n"
" HHHHH HHHHHHHHHHHH HHHHH \n"
"HHHH HHH HHHHHHHHHHHHHH HHHH\n"
" HHHHHH HHHHHHHHH HHHHHHHH \n"
" HHH HHHH HHHHHHHHH HHHH \n"
" HHH HHHHHH \n"
" HHHHH HH \n"))
(tool-bar-mode -1)
(scroll-bar-mode -1)
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-12"))
(global-prettify-symbols-mode +1)
(set-frame-parameter nil 'alpha-background 80)
(add-to-list 'default-frame-alist '(alpha-background . 80))
(when (require 'doom-themes nil :noerror) (load-theme 'doom-tokyo-night t))
;; Dashboard
(when (require 'dashboard nil :noerror)
(setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*")))
(dashboard-setup-startup-hook))
;; Extra minor-modes
(when (require 'which-key nil :noerror) (which-key-mode +1))
(when (require 'page-break nil :noerror) (global-page-break-lines-mode +1))
;;;; Help Buffers
;; Make `describe-*' screens more helpful
(when (require 'helpful nil :noerror)
(keymap-set helpful-mode-map "<remap> <revert-buffer>" #'helpful-update)
(keymap-global-set "<remap> <describe-command>" #'helpful-command)
(keymap-global-set "<remap> <describe-function>" #'helpful-callable)
(keymap-global-set "<remap> <describe-key>" #'helpful-key)
(keymap-global-set "<remap> <describe-symbol>" #'helpful-symbol)
(keymap-global-set "<remap> <describe-variable>" #'helpful-variable)
(keymap-global-set "C-h F" #'helpful-function))
;; Bind extra `describe-*' commands
(keymap-global-set "C-h K" #'describe-keymap)
;; add visual pulse when changing focus, like beacon but built-in
;; from from https://karthinks.com/software/batteries-included-with-emacs/
(defun pulse-line (&rest _)
"Pulse the current line."
(pulse-momentary-highlight-one-line (point)))
(dolist (command '(scroll-up-command
scroll-down-command
recenter-top-bottom
other-window))
(advice-add command :after #'pulse-line))
(provide 'custom-ui-config)
;;; custom-ui-config.el ends here