Files
dotfiles/Doom/.doom.d/org/personal.org
dx d97b08021e ~ivy-read -> completing-read for dx:themes/set-new-theme
completing-read for icomplete-mode but also because it allows others to
use it, regardless of completion framework of choice
2020-05-31 00:57:27 +01:00

2.8 KiB

Personal module

Preclude

Personal functionality or variables that aid my workflow or are just cool.

Variables

Some user variables

(setq user-full-name "Aryadev Chavali"
      user-mail-address "aryadevchavali1@gmail.com")

Reload

Reload the doom session by brute force fully loading the "config.el" file in the doom private directory.

(defun dx:reload ()
  "Reload instance of doom"
  (interactive)
  (load-file (concat doom-private-dir "config.el")))

Change theme

Allow user to set a theme from a limited set of candidates, based on "dx:theme-list".

  • Themes sanctioned by me:

    • doom-solarized-dark: just the right everything. best for day.
    • doom-gruvbox: good contrast, better for night.
    • doom-city-lights: Eh contrast, quite dark
    • doom-outrun-electric: Interesting colour palette
    • doom-vibrant: Good contrast, bit lighter
    • doom-molokai: hacker style
    • doom-solarized-light: Light orange theme that's actually okay on the eyes
    • doom-acario-light: Light theme with not bad colours
  • Themes not sanctioned:

    • Light themes other than solarized-light and acario
    • Horrid low contrast ones with no colour. Grayscale particularly. I can't handle those.
(setq dx:themes/theme-list '(doom-solarized-dark
                             doom-gruvbox doom-city-lights
                             doom-outrun-electric doom-vibrant doom-molokai
                             doom-solarized-light doom-acario-light
                             base16-3024 base16-classic-dark base16-material-vivid))

(defun dx:themes/set-new-theme ()
  "Set the theme from my own selection, mutate as you see fit"
  (interactive)
  (let ((theme (completing-read "Select theme: " dx:themes/theme-list)))
    (condition-case nil
        (progn
          (mapc #'disable-theme custom-enabled-themes)
          (load-theme (intern theme) t)
          (when (fboundp 'powerline-reset)
            (powerline-reset)))
      (error "Problem loading theme %s" theme))))

Password store

Function to get a password given a key.

(defun dx:password-store/get-password (KEY)
  (shell-command-to-string (concat "pass " KEY)))

Weather

Function to quickly check weather, which is what I wanted wttrin for.

(defun dx:weather ()
  "Check the weather at the 'location' stored in password store"
  (interactive)
  (wttrin (dx:password-store/get-password "location")))

Newline

Insert a newline without having to exit normal mode!

(defun dx:newline (&optional BACKWARD)
  (interactive)
  (message "%s" BACKWARD)
  (let ((old (point)))
    (cond ((and BACKWARD (= BACKWARD 1)) (+default/newline-above))
          (t (+default/newline-below)))
    (goto-char (+ old 1))
    (evil-normal-state)))