dotfiles

active dotfiles
git clone git://git.jakekoroman.com/dotfiles
Log | Files | Refs | README

commit 3b4590b1a745b06ce36cb558a4749923675e9b35
Author: Jake Koroman <jake@jakekoroman.com>
Date:   Sun,  1 Jun 2025 10:55:23 -0400

Ready. Set. Go!

Diffstat:
A.Xresources | 7+++++++
A.gitconfig | 6++++++
A.gitignore | 10++++++++++
AMANIFEST | 9+++++++++
AREADME | 4++++
Adeploy.sh | 44++++++++++++++++++++++++++++++++++++++++++++
Aemacs/init.el | 589+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/handmade-theme.el | 42++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/odin-mode.el | 310+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/simple-light-theme.el | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/solarized-definitions.el | 829+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/solarized-theme.el | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/local/toxi-theme.el | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aemacs/snippets/c++-mode/.yas-parents | 2++
Aemacs/snippets/c-mode/define | 6++++++
Aemacs/snippets/c-mode/for | 8++++++++
Aemacs/snippets/c-mode/fprintf | 6++++++
Aemacs/snippets/c-mode/if | 8++++++++
Aemacs/snippets/c-mode/include | 6++++++
Aemacs/snippets/c-mode/includeq | 6++++++
Aemacs/snippets/c-mode/main | 10++++++++++
Aemacs/snippets/c-mode/note | 6++++++
Aemacs/snippets/c-mode/printf | 6++++++
Aemacs/snippets/c-mode/printf_args | 6++++++
Aemacs/snippets/c-mode/sdlboil | 30++++++++++++++++++++++++++++++
Aemacs/snippets/c-mode/stdio | 6++++++
Aemacs/snippets/c-mode/stdlib | 6++++++
Aemacs/snippets/c-mode/struct | 7+++++++
Aemacs/snippets/c-mode/todo | 6++++++
Aemacs/snippets/fundamental-mode/mit | 25+++++++++++++++++++++++++
Aemacs/snippets/mhtml-mode/tag | 6++++++
Aemacs/snippets/org-mode/src | 8++++++++
Aemacs/snippets/zig-mode/note | 6++++++
Aemacs/snippets/zig-mode/todo | 6++++++
Agtk-3.0/settings.ini | 6++++++
Ai3/config | 196+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ai3status/config | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aisyncrc | 40++++++++++++++++++++++++++++++++++++++++
Ascripts/bookmarks | 7+++++++
Ascripts/change_wallpaper | 8++++++++
Ascripts/checkmail | 8++++++++
Ascripts/murder | 3+++
Ascripts/passmenu-otp | 32++++++++++++++++++++++++++++++++
Ascripts/rdp | 19+++++++++++++++++++
Ascripts/rdpmenu | 5+++++
Ascripts/safeedit | 19+++++++++++++++++++
Ascripts/sshmenu | 7+++++++
Ascripts/syncmail | 17+++++++++++++++++
Ascripts/weather | 3+++
Asxhkd/sxhkdrc | 42++++++++++++++++++++++++++++++++++++++++++
50 files changed, 2663 insertions(+), 0 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -0,0 +1,7 @@ +Xcursor.theme: Adwaita +Xcursor.size: 32 +Xft.dpi: 144 + +#include ".cache/wal/colors.Xresources" + +XTerm*metaSendsEscape: true diff --git a/.gitconfig b/.gitconfig @@ -0,0 +1,6 @@ +[user] + name = Jake Koroman + email = jake@jakekoroman.com + +[sendemail] + sendmailCmd = msmtp -a personal diff --git a/.gitignore b/.gitignore @@ -0,0 +1,10 @@ +emacs/auto-save-list +emacs/custom* +emacs/eln-cache +emacs/elpa +emacs/eshell +emacs/history +emacs/image-dired/ +emacs/recentf +emacs/tramp +emacs/transient diff --git a/MANIFEST b/MANIFEST @@ -0,0 +1,9 @@ +.Xresources|symlink| +emacs|symlink|.config/ +i3|symlink|.config/ +i3status|symlink|.config/ +scripts|symlink| +sxhkd|symlink|.config/ +gtk-3.0|symlink|.config/ +isyncrc|symlink|.config/ +.gitconfig|symlink| diff --git a/README b/README @@ -0,0 +1,4 @@ +framework 13 dotfiles +===================== + +dotfiles for my framework laptop. deploy.sh script symlinks everything in the manifest file. diff --git a/deploy.sh b/deploy.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# stolen from: https://github.com/rexim/dotfiles/blob/master/deploy.sh + +SCRIPT_DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )" + +symlinkFile() { + filename="$SCRIPT_DIR/$1" + destination="$HOME/$2/$1" + + mkdir -p $(dirname "$destination") + + if [ ! -L "$destination" ]; then + if [ -e "$destination" ]; then + echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually" && exit 1 + else + ln -s "$filename" "$destination" + echo "[OK] $filename -> $destination" + fi + else + echo "[WARNING] $filename already symlinked" + fi +} + +deployManifest() { + for row in $(cat $SCRIPT_DIR/$1); do + filename=$(echo $row | cut -d \| -f 1) + operation=$(echo $row | cut -d \| -f 2) + destination=$(echo $row | cut -d \| -f 3) + + case $operation in + symlink) + symlinkFile $filename $destination + ;; + + *) + echo "[WARNING] Unknown operation $operation. Skipping..." + ;; + esac + done +} + +echo "--- Configs ---" +deployManifest MANIFEST diff --git a/emacs/init.el b/emacs/init.el @@ -0,0 +1,589 @@ +;;; -*- lexical-binding: t -*- + +(setq custom-file (concat user-emacs-directory "custom.el")) +(add-to-list 'load-path "~/.config/emacs/local") +(add-to-list 'custom-theme-load-path "~/.config/emacs/local") +(when (file-exists-p custom-file) + (load custom-file)) + +(load "odin-mode.el") + +;;; Appearance and basic functionality +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +(setq jrk/font-name "Iosevka-") +(setq jrk/font-size 12) +(setq jrk/font-big-size 24) +(setq jrk/font (concat jrk/font-name (number-to-string jrk/font-size))) +(modify-all-frames-parameters `((font . ,jrk/font))) + +(set-default 'truncate-lines nil) + +(add-hook 'before-save-hook 'delete-trailing-whitespace) + +;; no tabs in lisp files +(add-hook 'scheme-mode-hook (lambda () (setq indent-tabs-mode nil))) +(add-hook 'emacs-lisp-mode-hook (lambda () (setq indent-tabs-mode nil))) + +;; tab-width 2 in html and js files +(add-hook 'mhtml-mode-hook (lambda () (setq tab-width 2))) +(add-hook 'js-mode-hook (lambda () + (setq js-indent-level 2) + (setq tab-width 2))) + +(add-hook 'Info-mode-hook (lambda () (display-line-numbers-mode -1))) + +(setq display-buffer-alist + '( + ((or "\\*Help\\*" + "\\*Occur\\*") + (display-buffer-reuse-mode-window display-buffer-below-selected)) + )) + +;; (setq-default indent-tabs-mode nil) +(setq-default tab-width 4) +(setq inhibit-splash-screen t + inhibit-startup-message t + scroll-step 3 + auto-save-default nil + make-backup-files nil + blink-cursor-mode nil + ring-bell-function 'ignore + display-line-numbers-type 'relative + dired-listing-switches "-alh --group-directories-first" + compilation-scroll-output t + gc-cons-threshold 100000000 + compilation-ask-about-save nil + frame-resize-pixelwise t + mouse-drag-mode-line-buffer 1 + display-time-24hr-format t + ) + +;; (global-hl-line-mode 1) +(global-display-line-numbers-mode) + +(require 'package) +(add-to-list 'package-archives + '("melpa-stable" . "https://stable.melpa.org/packages/") t) + +(use-package compile + :ensure t + :config + ;; pascal compilation errors + (add-to-list 'compilation-error-regexp-alist + '("^\\(.*\\)(\\([0-9]+\\)+\\,\\([0-9]+\\)).*" 1 2 3))) + +(use-package modus-themes + :ensure t + :config + (setq modus-themes-org-blocks 'gray-background) + (load-theme 'modus-operandi t)) + +(use-package ef-themes + :ensure t) + +;;; TODO: make guix package +;; (use-package gruber-darker-theme +;; :ensure t) + +(use-package minions + :ensure t + + :custom + (minions-mode-line-delimiters (cons "" "")) + + :config + (defun +set-minions-mode-line-lighter () + (setq minions-mode-line-lighter + (if (display-graphic-p) "⚙" "#"))) + + (add-hook 'server-after-make-frame-hook #'+set-minions-mode-line-lighter) + (display-time-mode 1) + (display-battery-mode 1) + (minions-mode 1)) + +(use-package olivetti + :ensure t + :config + (add-hook 'olivetti-mode-on-hook (lambda () (olivetti-set-width 144)))) + +(use-package zenburn-theme + :ensure t) + +(use-package savehist + :ensure nil + :init + (savehist-mode)) + +(use-package eat + :ensure t) +;; (add-hook 'eshell-first-time-mode-hook #'eat-eshell-mode)) + +(use-package eshell + :ensure nil + :config + (setq eshell-cp-interactive-query t) (add-to-list 'eshell-modules-list 'eshell-elecslash) + :hook (eshell-mode . (lambda () + (display-line-numbers-mode -1)))) + +(use-package vertico + :ensure t + :init + (vertico-mode 1) + (setq vertico-cycle t) + :config + (setq vertico-multiform-categories + '((consult-grep + buffer + (vertico-buffer-display-action . (display-buffer-same-window)))))) + +(use-package orderless + :ensure t + :init + ;; Configure a custom style dispatcher (see the Consult wiki) + ;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch) + ;; orderless-component-separator #'orderless-escapable-split-on-space) + (setq completion-styles '(orderless basic) + completion-category-defaults nil + completion-category-overrides '((file (styles partial-completion)))) + :config + (vertico-multiform-mode) + (setq vertico-multiform-categories + '((consult-grep buffer)))) + +(use-package dired + :ensure nil + :bind + (:map dired-mode-map + ("o" . dired-find-file) + ("n" . dired-up-directory)) + :config + (setq dired-clean-up-buffers-too t + dired-dwim-target t + dired-recursive-copies 'always + dired-recursive-deletes 'top + global-auto-revert-non-file-buffers t + auto-revert-verbose nil)) + +(use-package marginalia + :ensure t + :init + (marginalia-mode)) + +(use-package company + :ensure t + :config + (setq company-idle-delay nil) + (global-company-mode) + :bind + ("C-<return>" . company-complete) + ("C-<tab>" . dabbrev-expand)) + +(use-package yasnippet + :ensure t + :config + (require 'company) + ;; Add yasnippet support for all company backends + ;; https://github.com/syl20bnr/spacemacs/pull/179 + (defvar company-mode/enable-yas t + "Enable yasnippet for all backends.") + + (defun company-mode/backend-with-yas (backend) + (if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend))) + backend + (append (if (consp backend) backend (list backend)) + '(:with company-yasnippet)))) + (setq company-backends (mapcar #'company-mode/backend-with-yas company-backends)) + (yas-global-mode 1)) + +(use-package dumb-jump + :ensure t + :config + (setq xref-show-definitions-function #'xref-show-definitions-completing-read) + (add-hook 'xref-backend-functions #'dumb-jump-xref-activate)) + +(use-package magit :ensure t) + +(use-package go-mode :ensure t) + +(use-package lua-mode :ensure t) + +(use-package rust-mode :ensure t) + +(use-package glsl-mode :ensure t) + +(use-package htmlize :ensure t) + +(use-package zig-mode + :ensure t + :config + (setq zig-format-on-save nil)) + +(use-package org + :ensure nil + :config + (setq org-directory "~/org") + (setq org-agenda-files (list org-directory)) + (setq org-html-validation-link nil) + (setq org-insert-heading-respect-content t) + (org-babel-do-load-languages + 'org-babel-load-languages + '((shell . t))) + :hook (org-mode . (lambda () + (display-line-numbers-mode -1)))) + +(use-package org-tempo + :ensure t + :after (org) + :config + (add-to-list 'org-structure-template-alist + '("el" . "src emacs-lisp"))) + +(use-package org-bullets + :ensure t + :after (org) + :ensure + :hook + (org-mode . (lambda () + (org-bullets-mode)))) + +(use-package ido + :ensure t + :config + (setq ido-enable-flex-matching t + ido-everywhere t + ido-show-dot-for-dired t + ido-auto-merge-work-directories-length -1) + (ido-mode 0)) + +(use-package message + :ensure nil + :config + (setq message-kill-buffer-on-exit t)) + +(use-package notmuch + :ensure t + :hook + (message-setup . (lambda () (mml-secure-sign-pgpmime))) + :bind + ("C-c n" . notmuch) + :config + (setq send-mail-function 'sendmail-send-it + sendmail-program "msmtp" + ;; msmtp read from address to determine which smtp account to use + message-sendmail-extra-arguments '("--read-envelope-from") + ;; removes the very evil --from + message-sendmail-f-is-evil t) + + (setq notmuch-identities '("Jake Koroman <jake@jakekoroman.com>" + "Jake Koroman <koromanj@miltonhydro.com>")) + (setq notmuch-fcc-dirs '(("jake@jakekoroman.com" . "personal/Sent") + ("koromanj@miltonhydro.com" . "work/Sent"))) + (setq notmuch-always-prompt-for-sender t) + (setq notmuch-draft-folder "drafts")) + +(setq-default c-basic-offset 4 + c-default-style '((java-mode . "java") + (awk-mode . "awk") + (other . "bsd"))) +(c-set-offset 'case-label '+) + +(font-lock-add-keywords 'c-mode + '(("internal" . font-lock-keyword-face) + ("global" . 'font-lock-keyword-face))) + +(defun jrk/eshell () + "Open eshell in other window" + (interactive) + (split-window-sensibly) + (other-window 1) + (eshell)) + +(defun jrk/indent-buffer () + "Run indent-region on entire buffer" + (interactive) + (indent-region (point-min) (point-max) nil)) +;; (add-hook 'before-save-hook 'indent-buffer) + +(defun jrk/find-corresponding-file () + "Find the file that corresponds to this one." + (interactive) + (setq CorrespondingFileName nil) + (setq BaseFileName (file-name-sans-extension buffer-file-name)) + (if (string-match "\\.c" buffer-file-name) + (setq CorrespondingFileName (concat BaseFileName ".h"))) + (if (string-match "\\.h" buffer-file-name) + (if (file-exists-p (concat BaseFileName ".c")) + (setq CorrespondingFileName (concat BaseFileName ".c")) + (setq CorrespondingFileName (concat BaseFileName ".cpp")))) + (if (string-match "\\.hin" buffer-file-name) + (setq CorrespondingFileName (concat BaseFileName ".cin"))) + (if (string-match "\\.cin" buffer-file-name) + (setq CorrespondingFileName (concat BaseFileName ".hin"))) + (if (string-match "\\.cpp" buffer-file-name) + (setq CorrespondingFileName (concat BaseFileName ".h"))) + (if CorrespondingFileName (find-file CorrespondingFileName) + (error "Unable to find a corresponding file"))) + +(defun jrk/find-corresponding-file-other-window () + "Finds the file that corresponds to this and opens it in the other window." + (interactive) + (find-file-other-window buffer-file-name) + (find-corresponding-file)) + +(defun jrk/gud () + "Run gud-gdb in other window" + (interactive) + (let* ((files (directory-files (file-name-directory buffer-file-name))) + (input (completing-read "executable: " files))) + (split-window-sensibly) + (other-window 1) + (gud-gdb (concat "gdb --fullname " input)))) + +;; Sets the default compile command based on OS +(if (string= system-type "windows-nt") + (setq compile-command "build.bat") + (setq compile-command "guix shell -m ./manifest.scm -- ./build.sh")) + +(defun jrk/disable-all-themes () + "Disables all active themes." + (interactive) + (dolist (i custom-enabled-themes) + (disable-theme i))) + +(defun jrk/load-theme-proper () + "Disables all active themes and loads new one" + (interactive) + (let ((theme (completing-read "Load custom theme: " (custom-available-themes)))) + (jrk/disable-all-themes) + (load-theme (intern theme) t))) + +(defun jrk/update-theme () + "Set theme based on time of day" + (interactive) + (let ((hour (nth 2 (parse-time-string (current-time-string))))) + (disable-all-themes) + (if (and (> hour 9) + (< hour 18)) + (load-theme 'zenburn t) + (load-theme 'gruber-darker t)))) + +(defun jrk/swap-theme () + "Swaps theme to either zenburn or gruber-darker" + (interactive) + (let ((theme (nth 0 custom-enabled-themes))) + (disable-all-themes) + (if (string= theme "gruber-darker") + (load-theme 'zenburn t) + (load-theme 'gruber-darker t)))) + +(defun jrk/transparency (value) + "Sets the transparency of the frame window. 0=transparent/100=opaque" + (interactive "nTransparency Value 0 - 100 opaque: ") + (set-frame-parameter (selected-frame) 'alpha-background value)) + +(defun jrk/toggle-big-font () + "Toggles on/off a bigger font for hidpi or presentations" + (interactive) + (if (eq (aref (font-info (face-attribute 'default :font)) 2) (* 2 jrk/font-size)) + (setq jrk/font (concat jrk/font-name (number-to-string jrk/font-big-size))) + (setq jrk/font (concat jrk/font-name (number-to-string jrk/font-size)))) + (set-frame-font jrk/font)) + +(defun jrk/meow-setup-colemakdh () + (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak-dh) + (meow-motion-overwrite-define-key + '("i" . meow-prev) + '("e" . meow-next) + '(";" . meow-temp-normal) + '("/" . meow-visit) + '("<escape>" . ignore)) + (meow-leader-define-key + '("?" . meow-cheatsheet) + '("." . find-file) + '("," . switch-to-buffer) + '(">" . find-file-other-window) + '("<" . switch-to-buffer-other-window) + '("q" . compile) + '("d" . dired-jump) + '("o" . other-window) + '("1" . meow-digit-argument) + '("2" . meow-digit-argument) + '("3" . meow-digit-argument) + '("4" . meow-digit-argument) + '("5" . meow-digit-argument) + '("6" . meow-digit-argument) + '("7" . meow-digit-argument) + '("8" . meow-digit-argument) + '("9" . meow-digit-argument) + '("0" . meow-digit-argument)) + (meow-normal-define-key + '("0" . meow-expand-0) + '("1" . meow-expand-1) + '("2" . meow-expand-2) + '("3" . meow-expand-3) + '("4" . meow-expand-4) + '("5" . meow-expand-5) + '("6" . meow-expand-6) + '("7" . meow-expand-7) + '("8" . meow-expand-8) + '("9" . meow-expand-9) + '("-" . negative-argument) + '(";" . meow-reverse) + '("," . meow-inner-of-thing) + '("." . meow-bounds-of-thing) + '("[" . meow-beginning-of-thing) + '("]" . meow-end-of-thing) + '("/" . meow-visit) + '("a" . meow-append) + '("A" . meow-open-below) + '("b" . meow-back-word) + '("B" . meow-back-symbol) + '("c" . meow-change) + '("i" . meow-prev) + '("I" . join-line) + '("f" . meow-find) + '("g" . meow-cancel-selection) + '("G" . meow-grab) + '("n" . meow-left) + '("N" . meow-left-expand) + '("o" . meow-right) + '("O" . meow-right-expand) + '("j" . meow-join) + '("k" . meow-kill) + '("l" . meow-line) + '("L" . meow-goto-line) + '("h" . meow-mark-word) + '("H" . meow-mark-symbol) + '("e" . meow-next) + '("E" . meow-next-expand) + '("m" . meow-block) + '("M" . meow-to-block) + '("p" . meow-yank) + '("q" . meow-quit) + '("r" . meow-replace) + '("s" . meow-insert) + '("S" . meow-open-above) + '("t" . meow-till) + '("u" . meow-undo) + '("U" . meow-undo-in-selection) + '("v" . meow-search) + '("w" . meow-next-word) + '("W" . meow-next-symbol) + '("x" . meow-delete) + '("X" . meow-backward-delete) + '("y" . meow-save) + '("z" . meow-pop-selection) + '("'" . repeat) + '("<escape>" . ignore))) + +(global-set-key (kbd "M-n") 'next-error) +(global-set-key (kbd "M-p") 'previous-error) +(global-set-key (kbd "<f2>") 'olivetti-mode) + +(use-package meow + :ensure t + :config + (add-to-list 'meow-mode-state-list '(notmuch-hello-mode . motion)) + (add-to-list 'meow-mode-state-list '(notmuch-search-mode . motion)) + (setq meow-use-clipboard t) + (setq meow-keypad-self-insert-undefined nil) + (jrk/meow-setup-colemakdh) + (meow-setup-indicator) + (meow-global-mode 1)) + +(setq jrk/mpv-cmd "mpv") +(setq jrk/ytdlp-cmd "yt-dlp") +(setq jrk/ytdlp-cmd-args '("--embed-chapters" "--sponsorblock-remove" "Sponsor" "-P" "~/videos")) + +(defun jrk/elfeed-show-running-cmd () + (let ((cmd browse-url-generic-program) + (args browse-url-generic-args) + (format-str "opening with %s") + (arg-str "")) + (dolist (arg args) + (setf arg-str (concat arg-str " " arg))) + (message (format format-str + (concat cmd arg-str))))) + +(defun jrk/clear-browse-url-progam () + (setq browse-url-generic-program nil) + (setq browse-url-generic-args nil)) + +(defun jrk/elfeed-show-open-mpv () + (interactive) + (setq browse-url-generic-program jrk/mpv-cmd) + (jrk/elfeed-show-running-cmd) + (elfeed-show-visit 1) + (jrk/clear-browse-url-progam)) + +(defun jrk/elfeed-search-open-mpv () + (interactive) + (setq browse-url-generic-program jrk/mpv-cmd) + (jrk/elfeed-show-running-cmd) + (elfeed-search-browse-url 1) + (jrk/clear-browse-url-progam)) + +(defun jrk/elfeed-show-open-ytdlp () + (interactive) + (setq browse-url-generic-program jrk/ytdlp-cmd) + (setq browse-url-generic-args jrk/ytdlp-cmd-args) + (jrk/elfeed-show-running-cmd) + (elfeed-show-visit 1) + (jrk/clear-browse-url-progam)) + +(defun jrk/elfeed-search-open-ytdlp () + (interactive) + (setq browse-url-generic-program jrk/ytdlp-cmd) + (setq browse-url-generic-args jrk/ytdlp-cmd-args) + (jrk/elfeed-show-running-cmd) + (elfeed-search-browse-url 1) + (jrk/clear-browse-url-progam)) + +(use-package elfeed + :ensure t + :bind + (("C-c r" . elfeed) + :map elfeed-show-mode-map + ("m" . jrk/elfeed-show-open-mpv) + ("d" . jrk/elfeed-show-open-ytdlp) + + :map elfeed-search-mode-map + ("m" . jrk/elfeed-search-open-mpv) + ("d" . jrk/elfeed-search-open-ytdlp) + + ) + :config + (setq elfeed-feeds + '( + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCLtREJY21xRfCuEKvdki1Kw" youtube) + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCqNpjt_UcMPgm_9gphZgHYA" youtube) + ("https://www.youtube.com/feeds/videos.xml?channel_id=UCk9RA3G-aVQXvp7-Q4Ac9kQ" youtube) + + ("https://suckless.org/atom.xml" suckless news) + ("https://www.gentoo.org/feeds/news.xml" gentoo news) + ) + )) + +(defun send-cmd-to-geiser-repl (cmd) + "Sends a cmd to the current geiser repl" + (geiser-repl--switch-to-repl) + (geiser-repl--send cmd)) + +(defun geiser-load-current-buffer-in-repl () + "Loads current buffer into the current geiser repl" + (interactive) + (send-cmd-to-geiser-repl (concat ",load " (buffer-file-name)))) + +;; Startup time +;; (defun efs/display-startup-time () +;; (message +;; "Emacs loaded in %s with %d garbage collections." +;; (format +;; "%.2f seconds" +;; (float-time +;; (time-subtract after-init-time before-init-time))) +;; gcs-done)) +;; (add-hook 'emacs-startup-hook #'efs/display-startup-time) diff --git a/emacs/local/handmade-theme.el b/emacs/local/handmade-theme.el @@ -0,0 +1,42 @@ +(unless (<= 24 emacs-major-version) + (error "handmade-theme requires Emacs 24 or later.")) + +(deftheme handmade + "Dark theme based on Casey Muratori's handmade hero theme") + +(custom-theme-set-faces + 'handmade + `(default ((t (:foreground "burlywood3" :background "#202020")))) + `(cursor ((t (:background "#40FF40")))) + `(region ((t (:background "dark blue")))) + `(font-lock-builtin-face ((t (:foreground "burlywood3")))) + `(font-lock-comment-face ((t (:foreground "gray50")))) + ;; `(font-lock-constant-face ((t (:foreground "olive drab")))) + `(font-lock-doc-face ((t (:foreground "gray50")))) + `(font-lock-function-name-face ((t (:foreground "burlywood3")))) + `(font-lock-keyword-face ((t (:foreground "DarkGoldenrod3")))) + `(font-lock-string-face ((t (:foreground "olive drab")))) + `(font-lock-type-face ((t (:foreground "burlywood3")))) + `(font-lock-variable-name-face ((t (:foreground "burlywood3")))) + `(font-lock-constant-face ((t (:foreground "burlywood3")))) + `(mode-line ((t (:foreground "#181818" :background "orange2")))) + ;; diff + `(diff-header ((t (:background "gray35")))) + `(diff-file-header ((t (:background "gray35")))) + `(diff-hunk-header ((t (:background "gray35")))) + ;; dired + `(dired-directory ((t (:foreground "DarkGoldenrod3")))) + `(dired-symlink ((t (:foreground "cyan")))) + ;; vertico + `(vertico-current ((t (:background "navy")))) + ;; ido + `(ido-subdir ((t (:foreground "cyan")))) + ;; iedit + `(iedit-occurrence ((t (:background "navy"))))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'handmade) diff --git a/emacs/local/odin-mode.el b/emacs/local/odin-mode.el @@ -0,0 +1,310 @@ +;;; odin-mode.el --- A minor mode for odin + +;; Author: Ethan Morgan +;; Keywords: odin, language, languages, mode +;; Package-Requires: ((emacs "24.1")) +;; Homepage: https://github.com/glassofethanol/odin-mode + +;; This file is NOT part of GNU Emacs. + +;;; Code: + +(require 'cl-lib) +(require 'rx) +(require 'js) + +(defgroup odin nil + "Odin mode" + :group 'languages) + +;; `compilation-mode' configuration + +(eval-after-load 'compile + '(add-to-list 'compilation-error-regexp-alist '("^\\(.*?\\)(\\([0-9]+\\):\\([0-9]+\\).*" 1 2 3))) + +(defconst odin-mode-syntax-table + (let ((table (make-syntax-table))) + (modify-syntax-entry ?\" "\"" table) + (modify-syntax-entry ?\\ "\\" table) + + ;; additional symbols + (modify-syntax-entry ?' "\"" table) + (modify-syntax-entry ?` "\"" table) + (modify-syntax-entry ?: "." table) + (modify-syntax-entry ?+ "." table) + (modify-syntax-entry ?- "." table) + (modify-syntax-entry ?% "." table) + (modify-syntax-entry ?& "." table) + (modify-syntax-entry ?| "." table) + (modify-syntax-entry ?^ "." table) + (modify-syntax-entry ?! "." table) + (modify-syntax-entry ?$ "." table) + (modify-syntax-entry ?= "." table) + (modify-syntax-entry ?< "." table) + (modify-syntax-entry ?> "." table) + (modify-syntax-entry ?? "." table) + + ;; Need this for #directive regexes to work correctly + (modify-syntax-entry ?# "_" table) + + ;; Modify some syntax entries to allow nested block comments + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23n" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\^m "> b" table) + + table)) + +(defconst odin-builtins + '("len" "cap" + "typeid_of" "type_info_of" + "swizzle" "complex" "real" "imag" "quaternion" "conj" + "jmag" "kmag" + "min" "max" "abs" "clamp" + "expand_to_tuple" + + "init_global_temporary_allocator" + "copy" "pop" "unordered_remove" "ordered_remove" "clear" "reserve" + "resize" "new" "new_clone" "free" "free_all" "delete" "make" + "clear_map" "reserve_map" "delete_key" "append_elem" "append_elems" + "append" "append_string" "clear_dynamic_array" "reserve_dynamic_array" + "resize_dynamic_array" "incl_elem" "incl_elems" "incl_bit_set" + "excl_elem" "excl_elems" "excl_bit_set" "incl" "excl" "card" + "assert" "panic" "unimplemented" "unreachable")) + +(defconst odin-keywords + '("import" "foreign" "package" + "where" "when" "if" "else" "for" "switch" "in" "notin" "do" "case" + "break" "continue" "fallthrough" "defer" "return" "proc" + "struct" "union" "enum" "bit_field" "bit_set" "map" "dynamic" + "auto_cast" "cast" "transmute" "distinct" "opaque" + "using" "inline" "no_inline" + "size_of" "align_of" "offset_of" "type_of" + + "context" + ;; "_" + + ;; Reserved + "macro" "const")) + +(defconst odin-constants + '("nil" "true" "false" + "ODIN_OS" "ODIN_ARCH" "ODIN_ENDIAN" "ODIN_VENDOR" + "ODIN_VERSION" "ODIN_ROOT" "ODIN_DEBUG")) + +(defconst odin-typenames + '("bool" "b8" "b16" "b32" "b64" + + "int" "i8" "i16" "i32" "i64" + "i16le" "i32le" "i64le" + "i16be" "i32be" "i64be" + "i128" "u128" + "i128le" "u128le" + "i128be" "u128be" + + "uint" "u8" "u16" "u32" "u64" + "u16le" "u32le" "u64le" + "u16be" "u32be" "u64be" + + "f32" "f64" + "complex64" "complex128" + + "quaternion128" "quaternion256" + + "rune" + "string" "cstring" + + "uintptr" "rawptr" + "typeid" "any" + "byte")) + +(defconst odin-attributes + '("builtin" + "export" + "static" + "deferred_in" "deferred_none" "deferred_out" + "require_results" + "default_calling_convention" "link_name" "link_prefix" + "deprecated" "private" "thread_local")) + + +(defconst odin-proc-directives + '("#force_inline" + "#force_no_inline" + "#type") + "Directives that can appear before a proc declaration") + +(defconst odin-directives + (append '("#align" "#packed" + "#any_int" + "#raw_union" + "#no_nil" + "#complete" + "#no_alias" + "#c_vararg" + "#assert" + "#file" "#line" "#location" "#procedure" "#caller_location" + "#load" + "#defined" + "#bounds_check" "#no_bounds_check" + "#partial") odin-proc-directives)) + +(defun odin-wrap-word-rx (s) + (concat "\\<" s "\\>")) + +(defun odin-wrap-keyword-rx (s) + (concat "\\(?:\\S.\\_<\\|\\`\\)" s "\\_>")) + +(defun odin-wrap-directive-rx (s) + (concat "\\_<" s "\\>")) + +(defun odin-wrap-attribute-rx (s) + (concat "[[:space:]\n]*@[[:space:]\n]*(?[[:space:]\n]*" s "\\>")) + +(defun odin-keywords-rx (keywords) + "build keyword regexp" + (odin-wrap-keyword-rx (regexp-opt keywords t))) + +(defun odin-directives-rx (directives) + (odin-wrap-directive-rx (regexp-opt directives t))) + +(defun odin-attributes-rx (attributes) + (odin-wrap-attribute-rx (regexp-opt attributes t))) + +(defconst odin-identifier-rx "[[:word:][:multibyte:]_]+") +(defconst odin-hat-type-rx (rx (group (and "^" (1+ (any word "." "_")))))) +(defconst odin-dollar-type-rx (rx (group "$" (or (1+ (any word "_")) (opt "$"))))) +(defconst odin-number-rx + (rx (and + symbol-start + (or (and (+ digit) (opt (and (any "eE") (opt (any "-+")) (+ digit)))) + (and "0" (any "xX") (+ hex-digit))) + (opt (and (any "_" "A-Z" "a-z") (* (any "_" "A-Z" "a-z" "0-9")))) + symbol-end))) +(defconst odin-proc-rx (concat "\\(\\_<" odin-identifier-rx "\\_>\\)\\s *::\\s *\\(" (odin-directives-rx odin-proc-directives) "\\)?\\s *\\_<proc\\_>")) + +(defconst odin-type-rx (concat "\\_<\\(" odin-identifier-rx "\\)\\s *::\\s *\\(?:struct\\|enum\\|union\\|distinct\\)\\s *\\_>")) + + +(defconst odin-font-lock-defaults + `( + ;; Types + (,odin-hat-type-rx 1 font-lock-type-face) + (,odin-dollar-type-rx 1 font-lock-type-face) + (,(odin-keywords-rx odin-typenames) 1 font-lock-type-face) + (,odin-type-rx 1 font-lock-type-face) + + ;; Hash directives + (,(odin-directives-rx odin-directives) 1 font-lock-preprocessor-face) + + ;; At directives + (,(odin-attributes-rx odin-attributes) 1 font-lock-preprocessor-face) + + ;; Keywords + (,(odin-keywords-rx odin-keywords) 1 font-lock-keyword-face) + + ;; single quote characters + ("'\\(\\\\.\\|[^']\\)'" . font-lock-constant-face) + + ;; Variables + (,(odin-keywords-rx odin-builtins) 1 font-lock-builtin-face) + + ;; Constants + (,(odin-keywords-rx odin-constants) 1 font-lock-constant-face) + + ;; Strings + ;; ("\\\".*\\\"" . font-lock-string-face) + + ;; Numbers + (,(odin-wrap-word-rx odin-number-rx) . font-lock-constant-face) + + ;; Procedures + (,odin-proc-rx 1 font-lock-function-name-face) + + ("---" . font-lock-constant-face) + ("\\.\\.<" . font-lock-constant-face) + ("\\.\\." . font-lock-constant-face) + )) + +;; add setq-local for older emacs versions +(unless (fboundp 'setq-local) + (defmacro setq-local (var val) + `(set (make-local-variable ',var) ,val))) + +(defconst odin--defun-rx "\(.*\).*\{") + +(defmacro odin-paren-level () + `(car (syntax-ppss))) + +(defun odin-line-is-defun () + "return t if current line begins a procedure" + (interactive) + (save-excursion + (beginning-of-line) + (let (found) + (while (and (not (eolp)) (not found)) + (if (looking-at odin--defun-rx) + (setq found t) + (forward-char 1))) + found))) + +(defun odin-beginning-of-defun (&optional count) + "Go to line on which current function starts." + (interactive) + (let ((orig-level (odin-paren-level))) + (while (and + (not (odin-line-is-defun)) + (not (bobp)) + (> orig-level 0)) + (setq orig-level (odin-paren-level)) + (while (>= (odin-paren-level) orig-level) + (skip-chars-backward "^{") + (backward-char)))) + (if (odin-line-is-defun) + (beginning-of-line))) + +(defun odin-end-of-defun () + "Go to line on which current function ends." + (interactive) + (let ((orig-level (odin-paren-level))) + (when (> orig-level 0) + (odin-beginning-of-defun) + (end-of-line) + (setq orig-level (odin-paren-level)) + (skip-chars-forward "^}") + (while (>= (odin-paren-level) orig-level) + (skip-chars-forward "^}") + (forward-char))))) + +(defalias 'odin-parent-mode + (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode)) + +;;;###autoload +(define-derived-mode odin-mode odin-parent-mode "Odin" + :syntax-table odin-mode-syntax-table + :group 'odin + (setq bidi-paragraph-direction 'left-to-right) + (setq-local require-final-newline mode-require-final-newline) + (setq-local parse-sexp-ignore-comments t) + (setq-local comment-start-skip "\\(//+\\|/\\*+\\)\\s *") + (setq-local comment-start "//") + (setq-local comment-end "") + (setq-local indent-line-function 'js-indent-line) + (setq-local font-lock-defaults '(odin-font-lock-defaults)) + (setq-local beginning-of-defun-function 'odin-beginning-of-defun) + (setq-local end-of-defun-function 'odin-end-of-defun) + (setq-local electric-indent-chars + (append "{}():;," electric-indent-chars)) + (setq imenu-generic-expression + `(("type" ,(concat "^" odin-type-rx) 1) + ("proc" ,(concat "^" odin-proc-rx) 1))) + + (font-lock-ensure)) + +;;;###autoload +(add-to-list 'auto-mode-alist '("\\.odin\\'" . odin-mode)) + +(provide 'odin-mode) + + +;;; odin-mode.el ends here diff --git a/emacs/local/simple-light-theme.el b/emacs/local/simple-light-theme.el @@ -0,0 +1,50 @@ +(deftheme simple-light + "minimalistic theme for simplicity. + + Follows the philosphy of there should only be 3 main colours. + 1 for code, 1 for comments, and 1 for strings. + These rules guarantee a theme will be simple and usable.") + +(custom-theme-set-faces + 'simple-light + `(default ((t (:foreground "gray10" :background "gray90")))) + `(cursor ((t (:background "black")))) + `(region ((t (:background "gray65")))) + `(highlight ((t (:background "gray80")))) + `(font-lock-builtin-face ((t (:foreground "gray10")))) + `(font-lock-comment-face ((t (:foreground "gray50")))) + `(font-lock-doc-face ((t (:foreground "forest green")))) + `(font-lock-function-name-face ((t (:foreground "gray10")))) + `(font-lock-keyword-face ((t (:foreground "gray10")))) + `(font-lock-string-face ((t (:foreground "forest green")))) + `(font-lock-type-face ((t (:foreground "gray10")))) + `(font-lock-variable-name-face ((t (:foreground "gray10")))) + `(font-lock-constant-face ((t (:foreground "gray10")))) + `(mode-line ((t (:background "gray75")))) + `(error ((t (:foreground "firebrick")))) + ;; org + `(org-table ((t (:background "gray80" :foreground "gray10")))) + `(org-block ((t (:background "gray80" :foreground "gray10")))) + `(org-document-title ((t (:foreground "gray10")))) + `(org-hide ((t (:foreground "gray90")))) + `(org-document-info ((t (:foreground "gray10")))) + ;; eshell + `(eshell-prompt ((t (:foreground "firebrick")))) + `(eshell-ls-symlink ((t (:foreground "dark cyan")))) + `(eshell-ls-directory ((t (:foreground "royal blue")))) + ;; dired + `(dired-directory ((t (:foreground "blue")))) + `(dired-symlink ((t (:foreground "dark cyan")))) + ;; vertico + `(vertico-current ((t (:background "gray65")))) + ;; ido + `(ido-subdir ((t (:foreground "dark cyan")))) + ;; iedit + `(iedit-occurrence ((t (:background "navy"))))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'simple-light) diff --git a/emacs/local/solarized-definitions.el b/emacs/local/solarized-definitions.el @@ -0,0 +1,829 @@ +;;; solarized-definitions.el --- Solarized theme color assignments -*- lexical-binding: t -*- + +(eval-when-compile + (unless (require 'cl-lib nil t) + (require 'cl) + (defalias 'cl-case 'case))) + +(defconst solarized-description + "Color theme by Ethan Schoonover, created 2011-03-24. +Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized.") + +(defgroup solarized nil + "Customizations for the Solarized theme." + :group 'faces + :prefix "solarized-") + +(defcustom solarized-termcolors 16 + "The number of colors to use on 256-color terminals. +This is set to 16 by default, meaning that Solarized will attempt to use the +standard 16 colors of your terminal emulator. You will need to set those colors +to the correct Solarized values either manually or by importing one of the many +colorschemes available for popular terminal emulators and Xdefaults." + :type '(choice (const 16) (const 256)) + :group 'solarized) + +(defcustom solarized-degrade nil + "Use only 256 colors on graphic displays. +For test purposes only; when in GUI mode, forces Solarized to use the 256 +degraded color mode to test the approximate color values for accuracy." + :type 'boolean + :group 'solarized) + +(defcustom solarized-diff-mode 'normal + "Sets the level of highlighting to use in diff-like modes." + :type '(choice (const high) (const normal) (const low)) + :group 'solarized) + +(defcustom solarized-bold nil + "Stops Solarized from displaying bold when nil." + :type 'boolean + :group 'solarized) + +(defcustom solarized-underline nil + "Stops Solarized from displaying underlines when nil." + :type 'boolean + :group 'solarized) + +(defcustom solarized-italic nil + "Stops Solarized from displaying italics when nil." + :type 'boolean + :group 'solarized) + +(defcustom solarized-contrast 'normal + "Adjust the contrast level of Solarized. +Stick with normal! It's been carefully tested. Setting this option to high or +low does use the same Solarized palette but simply shifts some values up or down +in order to expand or compress the tonal range displayed." + :type '(choice (const high) (const normal) (const low)) + :group 'solarized) + +(defcustom solarized-broken-srgb + (if (and (eq system-type 'darwin) (eq window-system 'ns)) + (not (and (boundp 'ns-use-srgb-colorspace) + ns-use-srgb-colorspace)) + nil) + "Whether sRGB is broken on your system. +If you are on a Mac and have either Emacs prior to 24.4 or Mac OS prior to 10.7 +this should be t (the default is usually correct). Solarized works around this +issue by using with alternative colors. However, these colors are not totally +portable, so you may be able to edit the “Gen RGB” column in +solarized-definitions.el to improve them further." + :type 'boolean + :group 'solarized) + +;; FIXME: The Generic RGB colors will actually vary from device to device, but +;; hopefully these are closer to the intended colors than the sRGB values +;; that Emacs seems to dislike +(defvar solarized-colors ; ANSI(Solarized terminal) + ;; name sRGB Gen RGB 256 16 8 + '((base03 "#002b36" "#042028" "#1c1c1c" "brightblack" "black") + (base02 "#073642" "#0a2832" "#262626" "black" "black") + (base01 "#586e75" "#465a61" "#585858" "brightgreen" "green") + (base00 "#657b83" "#52676f" "#626262" "brightyellow" "yellow") + (base0 "#839496" "#708183" "#808080" "brightblue" "blue") + (base1 "#93a1a1" "#81908f" "#8a8a8a" "brightcyan" "cyan") + (base2 "#eee8d5" "#e9e2cb" "#e4e4e4" "white" "white") + (base3 "#fdf6e3" "#fcf4dc" "#ffffd7" "brightwhite" "white") + (yellow "#b58900" "#a57705" "#af8700" "yellow" "yellow") + (orange "#cb4b16" "#bd3612" "#d75f00" "brightred" "red") + (red "#dc322f" "#c60007" "#d70000" "red" "red") + (magenta "#d33682" "#c61b6e" "#af005f" "magenta" "magenta") + (violet "#6c71c4" "#5859b7" "#5f5faf" "brightmagenta" "magenta") + (blue "#268bd2" "#2075c7" "#0087ff" "blue" "blue") + (cyan "#2aa198" "#259185" "#00afaf" "cyan" "cyan") + (green "#859900" "#728a05" "#5f8700" "green" "green")) + "This is a table of all the colors used by the Solarized color theme. +Each column is a different set, one of which will be chosen based on term +capabilities, etc.") + +(defun solarized--current-colors (light) + "Attempt to mimic the Vim version’s color configuration. +If LIGHT is non-nil, invert the base faces." + (let ((current-colors + (cons + (cons 'back (copy-sequence (cdr (assoc 'base03 solarized-colors)))) + (mapcar #'copy-sequence (copy-sequence solarized-colors))))) + (if light + (setf (cdr (assoc 'base03 current-colors)) (cdr (assoc 'base3 solarized-colors)) + (cdr (assoc 'base02 current-colors)) (cdr (assoc 'base2 solarized-colors)) + (cdr (assoc 'base01 current-colors)) (cdr (assoc 'base1 solarized-colors)) + (cdr (assoc 'base00 current-colors)) (cdr (assoc 'base0 solarized-colors)) + (cdr (assoc 'base0 current-colors)) (cdr (assoc 'base00 solarized-colors)) + (cdr (assoc 'base1 current-colors)) (cdr (assoc 'base01 solarized-colors)) + (cdr (assoc 'base2 current-colors)) (cdr (assoc 'base02 solarized-colors)) + (cdr (assoc 'base3 current-colors)) (cdr (assoc 'base03 solarized-colors)) + (cdr (assoc 'back current-colors)) (cdr (assoc 'base03 current-colors)))) + (cond ((eq 'high solarized-contrast) + (setf (cdr (assoc 'base01 current-colors)) (cdr (assoc 'base00 current-colors)) + (cdr (assoc 'base00 current-colors)) (cdr (assoc 'base0 current-colors)) + (cdr (assoc 'base0 current-colors)) (cdr (assoc 'base1 current-colors)) + (cdr (assoc 'base1 current-colors)) (cdr (assoc 'base2 current-colors)) + (cdr (assoc 'base2 current-colors)) (cdr (assoc 'base3 current-colors)) + (cdr (assoc 'back current-colors)) (cdr (assoc 'back current-colors)))) + ((eq 'low solarized-contrast) + (setf (cdr (assoc 'back current-colors)) (cdr (assoc 'base02 current-colors))))) + current-colors)) + +(defun solarized-face-for-index (facespec index &optional light) + "Replace the Solarized symbols in FACESPEC with the colors in column INDEX. +The colors are looked up in ‘solarized-colors’, and base colors are inverted if +LIGHT is non-nil." + (let ((new-fontspec (copy-sequence facespec))) + (dolist (property '(:foreground :background :color)) + (let ((color-name (plist-get new-fontspec property))) + (when (and color-name (symbolp color-name)) + (plist-put new-fontspec + property + ;; NOTE: We try to turn an 8-color term into a 10-color term by not + ;; using default background and foreground colors, expecting the + ;; user to have the right colors set for them. + (unless (and (= index 5) + (or (and (eq property :background) + (eq color-name 'back)) + (and (eq property :foreground) + (member color-name '(base0 base1))))) + (nth index + (assoc color-name + (solarized--current-colors light)))))))) + (when (consp (plist-get new-fontspec :box)) + (plist-put new-fontspec + :box + (solarized-face-for-index (plist-get new-fontspec :box) + index + light))) + (when (consp (plist-get new-fontspec :underline)) + (plist-put new-fontspec + :underline + (solarized-face-for-index (plist-get new-fontspec :underline) + index + light))) + new-fontspec)) + +(defun dark-and-light (display plist index) + "Return a list of faces, distinguishing between dark and light if necessary." + (let ((dark (solarized-face-for-index plist index)) + (light (solarized-face-for-index plist index t))) + (if (equal dark light) + (list (list display dark)) + (list (list (cons '(background dark) display) dark) + (list (cons '(background light) display) light))))) + +(defun 8-and-16 (plist) + "Return a list of faces, distinguishing between dark and light if necessary." + (let ((eight (dark-and-light '() plist 5)) + (sixteen (dark-and-light '() plist 4))) + (append + (unless (equal eight sixteen) + (mapcar (lambda (spec) + (setf (car spec) + (append '((type tty) (min-colors 16)) (car spec))) + spec) + sixteen)) + (mapcar (lambda (spec) + (setf (car spec) + (append '((type tty) (min-colors 8)) (car spec))) + spec) + eight)))) + +(defun create-face-spec (name facespec) + "Generate a full face-spec for face NAME from the Solarized FACESPEC. +This generates the spec across a variety of displays from the FACESPEC, which +contains Solarized symbols." + `(,name (,@(dark-and-light '((type graphic)) + facespec + (cond (solarized-degrade 3) + (solarized-broken-srgb 2) + (t 1))) + ;; only produce 256-color term-specific settings if ‘solarized-termcolors’ is 256 + ,@(when (= solarized-termcolors 256) + (dark-and-light '((type tty) (min-colors 256)) facespec 3)) + ,@(8-and-16 facespec)))) + +(defun solarized-color-definitions () + "Produces the set of face-specs for all faces defined by this theme." + (let ((bold (if solarized-bold 'bold 'unspecified)) + (bright-bold (if solarized-bold 'unspecified 'bold)) + (underline (if solarized-underline t 'unspecified)) + (opt-under (if (eq solarized-contrast 'low) t 'unspecified)) + (italic (if solarized-italic 'italic 'unspecified))) + (let ((bg-back '(:background back)) + (bg-base03 '(:background base03)) + (bg-base02 '(:background base02)) + (bg-base01 '(:background base01)) + (bg-base00 '(:background base00)) + (bg-base0 '(:background base0)) + (bg-base1 '(:background base1)) + (bg-base2 '(:background base2)) + (bg-base3 '(:background base3)) + (bg-green '(:background green)) + (bg-yellow '(:background yellow)) + (bg-orange '(:background orange)) + (bg-red '(:background red)) + (bg-magenta '(:background magenta)) + (bg-violet '(:background violet)) + (bg-blue '(:background blue)) + (bg-cyan '(:background cyan)) + + (fg-base03 '(:foreground base03)) + (fg-base02 '(:foreground base02)) + (fg-base01 '(:foreground base01)) + (fg-base00 '(:foreground base00)) + (fg-base0 '(:foreground base0)) + (fg-base1 '(:foreground base1)) + (fg-base2 '(:foreground base2)) + (fg-base3 '(:foreground base3)) + (fg-green '(:foreground green)) + (fg-yellow '(:foreground yellow)) + (fg-orange '(:foreground orange)) + (fg-red '(:foreground red)) + (fg-magenta '(:foreground magenta)) + (fg-violet '(:foreground violet)) + (fg-blue '(:foreground blue)) + (fg-cyan '(:foreground cyan)) + + (fmt-none `()) + (fmt-bold `(:weight ,bold)) + (fmt-bldi `(:weight ,bold :slant ,italic)) + (fmt-undr `( :underline ,underline)) + (fmt-undb `(:weight ,bold :underline ,underline)) + (fmt-undi `( :slant ,italic :underline ,underline)) + (fmt-uopt `( :underline ,opt-under)) + (fmt-curl-red '( :underline (:color red :style wave))) + (fmt-curl-violet '( :underline (:color violet :style wave))) + (fmt-curl-cyan '( :underline (:color cyan :style wave))) + (fmt-curl-yellow '( :underline (:color yellow :style wave))) + (fmt-ital `( :slant ,italic)) + ;; FIXME: not quite the same + (fmt-stnd `( :inverse-video t)) + (fmt-revr `( :inverse-video t)) + (fmt-revb `(:weight ,bold :inverse-video t)) + (fmt-revbb `(:weight ,bright-bold :inverse-video t)) + (fmt-revbbu `(:weight ,bright-bold :underline ,underline :inverse-video t))) + (mapcar (lambda (face) (apply 'create-face-spec face)) + `(;; basic + (default (,@fg-base0 ,@bg-back)) ; Normal + (cursor (,@fg-base03 ,@bg-base0)) ; Cursor + (shadow (,@fg-base01)) + (link (,@fmt-undr ,@fg-violet)) ; Underlined + (link-visited (,@fmt-undr ,@fg-magenta)) + (match (,@fmt-revr ,@fg-yellow)) ; Search + (error (,@fmt-revr ,@fg-red)) ; ErrorMsg + (warning (,@fmt-bold ,@fg-red)) ; WarningMsg + (success (,@fg-blue)) ; MoreMsg + (escape-glyph (,@fg-red)) + (fringe (,@fg-base01 ,@bg-base02)) + (linum (,@fg-base01 ,@bg-base02)) + (header-line (,@fg-base0 ,@bg-base02 ,@fmt-revbb)) ; Pmenu + (highlight (,@bg-base02)) + (hl-line (:underline ,opt-under ,@bg-base02)) ; CursorLine + (isearch (,@fmt-stnd ,@fg-orange ,@bg-back)) ; IncSearch + (isearch-fail (:inherit error)) ; ErrorMsg + (lazy-highlight (:inherit match)) ; Search + (menu (,@fg-base0 ,@bg-base02)) + (minibuffer-prompt (,@fmt-bold ,@fg-cyan)) ; Question + (mode-line ; StatusLine + (,@fg-base1 ,@bg-base02 ,@fmt-revbb :box nil)) + (mode-line-inactive ; StatusLineNC + (,@fg-base00 ,@bg-base02 ,@fmt-revbb :box nil)) + (mode-line-buffer-id (,@fmt-bold :inherit mode-line)) + (mode-line-buffer-id-inactive (,@fmt-bold :inherit mode-line-inactive)) + (region (,@fg-base01 ,@bg-base03 ,@fmt-revbb)) ; Visual + (secondary-selection (,@bg-base02)) + (shadow (,@fg-base01)) + (trailing-whitespace (,@fmt-revr ,@fg-red)) + (vertical-border (,@fg-base0)) + ;; comint + (comint-highlight-prompt (,@fg-blue)) + ;; compilation + (compilation-info (,@fmt-bold ,@fg-green)) + (compilation-warning (,@fmt-bold ,@fg-orange)) + ;; custom + (custom-button + (,@fg-base1 ,@bg-base02 :box (:line-width 2 :style released-button))) + (custom-button-mouse + (,@fmt-revr ,@fg-base1 ,@bg-base02 :inherit custom-button)) + (custom-button-pressed + (,@fmt-revr ,@fg-base1 ,@bg-base02 + :box (:line-width 2 :style pressed-button) + :inherit custom-button-mouse)) + (custom-changed (,@fmt-revr ,@fg-blue ,@bg-base3)) + (custom-comment (,@fg-base1 ,@bg-base02)) + (custom-comment-tag (,@fg-base1 ,@bg-base02)) + (custom-documentation (:inherit default)) + (custom-group-tag (,@fg-base1)) + (custom-group-tag-1 (,@fmt-bold ,@fg-base1)) + (custom-invalid (,@fmt-revr ,@fg-red ,@bg-back)) + (custom-link (,@fg-violet)) + (custom-state (,@fg-green)) + (custom-variable-tag (,@fg-base1)) + ;; diff - DiffAdd, DiffChange, DiffDelete, and DiffText + ,@(cl-case solarized-diff-mode + (high + `((diff-added (,@fmt-revr ,@fg-green)) + (diff-changed (,@fmt-revr ,@fg-yellow)) + (diff-removed (,@fmt-revr ,@fg-red)) + (diff-refine-changed (,@fmt-revr ,@fg-blue ,@bg-back)))) + (low + `((diff-added (,@fmt-undr ,@fg-green)) + (diff-changed (,@fmt-undr ,@fg-yellow)) + (diff-removed (,@fmt-bold ,@fg-red)) + (diff-refine-changed (,@fmt-undr ,@fg-blue ,@bg-back)))) + (normal + (if window-system + `((diff-added (,@fmt-bold ,@fg-green ,@bg-base02)) + (diff-changed (,@fmt-bold ,@fg-yellow ,@bg-base02)) + (diff-removed (,@fmt-bold ,@fg-red ,@bg-base02)) + (diff-refine-changed (,@fmt-bold ,@fg-blue ,@bg-base02))) + `((diff-added (,@fg-green ,@bg-base02)) + (diff-changed (,@fg-yellow ,@bg-base02)) + (diff-removed (,@fg-red ,@bg-base02)) + (diff-refine-changed (,@fg-blue ,@bg-base02)))))) + (diff-refine-added (:inherit diff-added ,@fmt-revr)) + (diff-refine-removed (:inherit diff-removed ,@fmt-revr)) + (diff-file-header (:inherit default ,@fg-blue)) + (diff-hunk-header (:inherit default)) + (diff-header (,@fg-base1 ,@bg-back)) + ;; IDO + (ido-only-match (,@fg-green)) + (ido-subdir (,@fg-blue)) + (ido-first-match (,@fmt-bold ,@fg-green)) + ;; emacs-wiki + (emacs-wiki-bad-link-face (,@fmt-undr ,@fg-red)) + (emacs-wiki-link-face (,@fmt-undr ,@fg-blue)) + (emacs-wiki-verbatim-face (,@fmt-undr ,@fg-base00)) + ;; eshell + (eshell-ls-archive (,@fg-magenta)) + (eshell-ls-backup (,@fg-yellow)) + (eshell-ls-clutter (,@fg-orange)) + (eshell-ls-directory (,@fg-blue)) ; Directory + (eshell-ls-executable (,@fg-green)) + (eshell-ls-missing (,@fg-red)) + (eshell-ls-product (,@fg-yellow)) + (eshell-ls-readonly (,@fg-base1)) + (eshell-ls-special (,@fg-violet)) + (eshell-ls-symlink (,@fg-cyan)) + (eshell-ls-unreadable (,@fg-base00)) + (eshell-prompt (,@fmt-bold ,@fg-green)) + ;; font-lock + (font-lock-builtin-face (,@fmt-none ,@fg-green)) ; Statement + (font-lock-comment-face (,@fmt-ital ,@fg-base01)) ; Comment + (font-lock-constant-face (,@fmt-none ,@fg-cyan)) ; Constant + (font-lock-function-name-face ; Identifier + (,@fmt-none ,@fg-blue)) + (font-lock-keyword-face (,@fmt-none ,@fg-green)) ; Statement + (font-lock-string-face (,@fmt-none ,@fg-cyan)) ; Constant + (font-lock-type-face (,@fmt-none ,@fg-yellow)) ; Type + (font-lock-variable-name-face ; Identifier + (,@fmt-none ,@fg-blue)) + (font-lock-warning-face (,@fmt-bold ,@fg-red)) ; Error + (font-lock-doc-face (,@fmt-ital ,@fg-base01)) ; Comment + (font-lock-doc-string-face ; Comment (XEmacs-only) + (,@fmt-ital ,@fg-base01)) + (font-lock-color-constant-face (,@fmt-none ,@fg-green)) + (font-lock-comment-delimiter-face ; Comment + (,@fmt-ital ,@fg-base01)) + (font-lock-preprocessor-face (,@fmt-none ,@fg-orange)) ; PreProc + (font-lock-reference-face (,@fmt-none ,@fg-cyan)) + (font-lock-negation-char-face (,@fmt-none ,@fg-red)) + (font-lock-other-type-face (,@fmt-ital ,@fg-blue)) + (font-lock-regexp-grouping-construct (,@fmt-none ,@fg-orange)) + (font-lock-special-keyword-face (,@fmt-none ,@fg-red)) ; Special + (font-lock-exit-face (,@fmt-none ,@fg-red)) + (font-lock-other-emphasized-face (,@fmt-bldi ,@fg-violet)) + (font-lock-regexp-grouping-backslash (,@fmt-none ,@fg-yellow)) + ;; info + (info-xref (:inherit link)) + (info-xref-visited (:inherit link-visited)) + ;; org + (org-block-background (,@bg-base02)) + (org-hide (,@fg-base03)) + (org-todo (,@fmt-bold ,@fg-base03 ,@bg-red)) + (org-done (,@fmt-bold ,@fg-green)) + (org-todo-kwd-face (,@fmt-bold ,@fg-base03 ,@bg-red)) + (org-done-kwd-face (,@fmt-bold ,@fg-green)) + (org-project-kwd-face (,@fg-violet ,@bg-base03)) + (org-waiting-kwd-face (,@fg-orange ,@bg-base03)) + (org-someday-kwd-face (,@fg-blue ,@bg-base03)) + (org-started-kwd-face (,@fg-yellow ,@bg-base03)) + (org-cancelled-kwd-face (,@fg-green ,@bg-base03)) + (org-delegated-kwd-face (,@fg-cyan ,@bg-base03)) + (org-default (:inherit default)) + (org-level-1 (:inherit outline-1)) + (org-level-2 (:inherit outline-2)) + (org-level-3 (:inherit outline-3)) + (org-level-4 (:inherit outline-4)) + (org-level-5 (:inherit outline-5)) + (org-level-6 (:inherit outline-6)) + (org-level-7 (:inherit outline-7)) + (org-level-8 (:inherit outline-8)) + (org-special-keyword (,@fmt-ital ,@fg-base01)) + (org-drawer (,@fmt-bold ,@fg-blue)) + (org-column (,@fmt-revr ,@fg-cyan)) + (org-column-title (,@fmt-bold ,@fmt-revr)) + (org-warning (,@fmt-bold ,@fg-red)) + (org-archived (,@fg-base01)) + (org-link (,@fmt-undr ,@fg-violet)) + (org-footnote (,@fmt-undr ,@fg-violet)) + (org-ellipses (,@fg-yellow :strike-through t) ) + (org-target (,@fmt-undr)) + (org-date (,@fmt-undr ,@fg-violet)) + (org-date-selected (,@fmt-revr ,@fg-red)) + (org-sexp-date (,@fmt-undr ,@fg-violet)) + (org-tag (,@fmt-bold)) + (org-list-dt (,@fmt-bold)) + (org-agenda-done (,@fg-green)) + (org-headline-done (,@fg-base01)) + (org-priority (,@fmt-ital ,@fg-base01)) + (org-checkbox (,@fmt-bold)) + (org-table (,@fg-cyan)) + (org-formula (:weight bold :slant italic ,@fg-red)) + (org-code (,@fg-base01)) + (org-document-title (,@fmt-bold ,@fg-cyan)) + (org-document-info (,@fg-cyan)) + (org-document-info-keyword (,@fg-base01)) + (org-block (,@fg-base01)) + (org-verbatim (,@fmt-undr ,@fg-base01)) + (org-clock-overlay (,@fmt-revr ,@bg-cyan ,@fg-base03)) + (org-agenda-structure (,@fmt-bold ,@fg-blue)) + (org-scheduled (:weight bold :slant italic ,@fg-green)) + (org-scheduled-today (:weight bold :slant italic ,@fg-green)) + (org-agenda-dimmed-todo-face (,@fg-base00)) + (org-scheduled-previously (,@fmt-bold ,@fg-red)) + (org-upcoming-deadline (,@fmt-bold ,@fg-red)) + (org-agenda-restriction-lock (,@fmt-revr ,@fg-base03 ,@bg-cyan)) + (org-time-grid (,@fg-yellow)) + (org-latex-and-related(,@fg-orange)) + ;; table + (table-cell (,@fmt-none ,@fg-base0 ,@bg-back)) + ;; outline - pandocBlockQuoteLeader[1–6] + (outline-1 (,@fg-blue)) + (outline-2 (,@fg-cyan)) + (outline-3 (,@fg-yellow)) + (outline-4 (,@fg-red)) + (outline-5 (,@fg-base0)) + (outline-6 (,@fg-base01)) + (outline-7 (,@fg-orange)) + (outline-8 (,@fg-violet)) + ;; show-paren - MatchParen + (show-paren-match (,@fmt-bold ,@fg-cyan ,@bg-base02)) + (show-paren-mismatch (,@fmt-bold ,@fg-red ,@bg-base01)) + ;; speedbar + ;; (speedbar-button-face (,@fmt-none ,@fg-base1)) + (speedbar-button-face + (,@fg-base1 ,@bg-base02 + :box (:line-width 2 :style released-button))) + (speedbar-directory-face (,@fmt-none ,@fg-blue)) + (speedbar-file-face (,@fmt-none ,@fg-green)) + ;; (speedbar-highlight-face (,@bg-base02)) + (speedbar-highlight-face + (,@fmt-revr ,@fg-base1 ,@bg-base02 + :inherit speedbar-button-face)) + ;; (speedbar-selected-face (,@fmt-undr ,@fg-yellow)) + (speedbar-selected-face (,@fmt-none ,@bg-base02 ,@fg-green)) + (speedbar-separator-face (,@fmt-stnd)) + (speedbar-tag-face (,@fmt-none ,@fg-blue)) + ;; widgets + (widget-field + (,@fg-base1 ,@bg-base02 :box (:line-width 1 :color base2) + :inherit default)) + (widget-single-line-field (:inherit widget-field)) + ;; extra modules + ;; ------------- + ;; alert + (alert-urgent (,@fg-red)) + (alert-high (,@fg-orange)) + (alert-moderate (,@fg-yellow)) + (alert-normal (,@fg-green)) + (alert-low (,@fg-blue)) + (alert-trivial (,@fg-violet)) + ;; col-highlight -- Highlight the current column. + ;; http://www.emacswiki.org/emacs/col-highlight.el + (col-highlight (,@bg-base02)) + ;; ace-jump-mode + (ace-jump-face-background (,@fmt-none ,@fg-base01)) + (ace-jump-face-foreground (,@fmt-bold ,@fg-red)) + ;; bm visual bookmarks + (bm-face ((t (,@bg-orange ,@fg-base03)))) + (bm-fringe-face ((t (,@bg-orange ,@fg-base03)))) + (bm-fringe-persistent-face ((t (,@bg-blue ,@fg-base03)))) + (bm-persistent-face ((t (,@bg-blue ,@fg-base03)))) + ;; Flymake + (flymake-errline (,@fmt-bold ,@fg-red)) ; Error + (flymake-warnline (,@fmt-bold ,@fg-red)) + ;; column-marker + (column-marker-1 (,@bg-base01)) + (column-marker-2 (,@bg-cyan)) + (column-marker-3 (,@bg-violet)) + ;; jabber + (jabber-activity-face (,@fmt-bold ,@fg-red)) + (jabber-activity-personal-face (,@fmt-bold ,@fg-blue)) + (jabber-chat-error (,@fmt-bold ,@fg-red)) + (jabber-chat-prompt-foreign (,@fmt-bold ,@fg-red)) + (jabber-chat-prompt-local (,@fmt-bold ,@fg-blue)) + (jabber-chat-prompt-system (,@fmt-bold ,@fg-green)) + (jabber-chat-text-foreign (,@fg-base1)) + (jabber-chat-text-local (,@fg-base0)) + (jabber-chat-rare-time-face (,@fmt-undr ,@fg-green)) + (jabber-roster-user-away (,@fmt-ital ,@fg-green)) + (jabber-roster-user-chatty (,@fmt-bold ,@fg-orange)) + (jabber-roster-user-dnd (,@fmt-ital ,@fg-red)) + (jabber-roster-user-error + (:weight light :slant italic ,@fg-red)) + (jabber-roster-user-offline (,@fg-base01)) + (jabber-roster-user-online (,@fmt-bold ,@fg-blue)) + (jabber-roster-user-xa (,@fmt-ital ,@fg-magenta)) + ;; git-gutter + (git-gutter:modified (,@fg-violet)) + (git-gutter:added (,@fg-green)) + (git-gutter:deleted (,@fg-red)) + ;; gnus - these are mostly taken from mutt, not VIM + (gnus-cite-1 (:inherit outline-1)) + (gnus-cite-2 (:inherit outline-2)) + (gnus-cite-3 (:inherit outline-3)) + (gnus-cite-4 (:inherit outline-4)) + (gnus-cite-5 (:inherit outline-5)) + (gnus-cite-6 (:inherit outline-6)) + (gnus-cite-7 (:inherit outline-7)) + (gnus-cite-8 (:inherit outline-8)) + (gnus-cite-9 (,@fg-green)) + (gnus-cite-10 (,@fg-magenta)) + (gnus-cite-11 (,@fg-base02)) + (gnus-group-mail-1 (,@fmt-bold ,@fg-base3)) + (gnus-group-mail-1-empty (,@fg-base3)) + (gnus-group-mail-2 (,@fmt-bold ,@fg-base2)) + (gnus-group-mail-2-empty (,@fg-base2)) + (gnus-group-mail-3 (,@fmt-bold ,@fg-magenta)) + (gnus-group-mail-3-empty (,@fg-magenta)) + (gnus-group-mail-low (,@fmt-bold ,@fg-base00)) + (gnus-group-mail-low-empty (,@fg-base00)) + (gnus-group-news-1 (,@fmt-bold ,@fg-base1)) + (gnus-group-news-1-empty (,@fg-base1)) + (gnus-group-news-2 (,@fmt-bold ,@fg-blue)) + (gnus-group-news-2-empty (,@fg-blue)) + (gnus-group-news-low (,@fmt-bold ,@fg-violet)) + (gnus-group-news-low-empty (,@fg-violet)) + (gnus-emphasis-highlight-words ; highlight + (,@fmt-none ,fg-yellow)) + (gnus-header-content (,@fmt-none ,@fg-base01)) ; hdrdefault + (gnus-header-from (,@fmt-none ,@fg-base00)) ; header ^From + (gnus-header-name (,@fmt-none ,@fg-base01)) ; hdrdefault + (gnus-header-newsgroups (,@fmt-none ,@fg-base02)) ; hdrdefault + (gnus-header-subject (,@fmt-none ,@fg-blue)) ; header ^Subject + (gnus-server-agent (,@fmt-bold ,@fg-base3)) + (gnus-server-closed (,@fmt-ital ,@fg-base1)) + (gnus-server-denied (,@fmt-bold ,@fg-base2)) + (gnus-server-offline (,@fmt-bold ,@fg-green)) + (gnus-server-opened (,@fmt-bold ,@fg-cyan)) + (gnus-signature (,@fmt-none ,@fg-base01)) ; signature + (gnus-splash (,@fg-base2)) + (gnus-summary-cancelled ; deleted messages + (,@fmt-none ,@fg-red)) + (gnus-summary-high-ancient + (,@fmt-bold :inherit gnus-summary-normal-ancient)) + (gnus-summary-high-read + (,@fmt-bold :inherit gnus-summary-normal-read)) + (gnus-summary-high-ticked + (,@fmt-bold :inherit gnus-summary-normal-ticked)) + (gnus-summary-high-undownloaded + (,@fmt-bold :inherit gnus-summary-normal-undownloaded)) + (gnus-summary-high-unread + (,@fmt-bold :inherit gnus-summary-normal-unread)) + (gnus-summary-low-ancient + (,@fmt-ital :inherit gnus-summary-normal-ancient)) + (gnus-summary-low-read + (,@fmt-ital :inherit gnus-summary-normal-ancient)) + (gnus-summary-low-unread + (,@fmt-ital :inherit gnus-summary-normal-unread)) + (gnus-summary-low-ticked + (,@fmt-ital :inherit gnus-summary-normal-ancient)) + (gnus-summary-low-undownloaded + (,@fmt-ital :inherit gnus-summary-normal-ancient)) + (gnus-summary-normal-ancient ; old messages + (,@fmt-none ,@fg-blue)) + (gnus-summary-normal-read ; read messages + (,@fmt-none ,@fg-base01)) + (gnus-summary-normal-ticked (,@fmt-none ,@fg-red)) ; flagged + (gnus-summary-normal-undownloaded (,@fmt-none ,@fg-base2)) + (gnus-summary-normal-unread ; unread messages + (,@fmt-none ,@fg-blue)) + (gnus-summary-selected ; indicator + (,@fmt-none ,@fg-base03 ,@bg-yellow)) + ;;helm + (helm-apt-deinstalled (,@fg-base01)) + (helm-apt-installed (,@fg-green)) + (helm-bookmark-addressbook (,@fg-blue)) + (helm-bookmark-directory (:inherit helm-ff-directory)) + (helm-bookmark-file (:inherit helm-ff-file)) + (helm-bookmark-gnus (,@fg-cyan)) + (helm-bookmark-info (,@fg-green)) + (helm-bookmark-man (,@fg-violet)) + (helm-bookmark-w3m (,@fg-yellow)) + (helm-bookmarks-su (,@fg-orange)) + (helm-buffer-not-saved (,@fg-orange)) + (helm-buffer-process (,@fg-magenta)) + (helm-buffer-saved-out (,@fmt-revr ,@fg-red ,@bg-back)) + (helm-buffer-size (,@fg-base01)) + (helm-candidate-number (,@fmt-bold ,@bg-base02 ,@fg-base1)) + (helm-emms-playlist (,@fmt-none ,@fg-base01)) + (helm-etags+-highlight-face (:inherit highlight)) + (helm-ff-directory (,@bg-back ,@fg-blue)) + (helm-ff-executable (,@fmt-bold ,@fg-green)) + (helm-ff-file (:inherit default)) + (helm-ff-invalid-symlink (,@bg-base02 ,@fg-red)) + (helm-ff-prefix (,@fmt-revr ,@fg-yellow)) + (helm-ff-symlink (,@fmt-bold ,@fg-cyan)) + (helm-gentoo-match (:inherit helm-match)) + (helm-grep-cmd-line (:inherit diff-added)) + (helm-grep-file (,@fmt-undr ,@fg-cyan)) + (helm-grep-finish (,@fg-green)) + (helm-grep-lineno (,@fg-orange)) + (helm-grep-match (:inherit helm-match)) + (helm-grep-running (,@fg-red)) + (helm-helper (:inherit helm-header)) + (helm-history-deleted (:inherit helm-ff-invalid-symlink)) + (helm-history-remote (,@fg-red)) + (helm-lisp-completion-info (,@fg-base0)) + (helm-lisp-show-completion (,@fmt-bold ,@fg-yellow ,@bg-base02)) + (helm-ls-git-added-copied-face (,@fg-green)) + (helm-ls-git-conflict-face (,@fmt-bold ,@fg-red)) + (helm-ls-git-deleted-and-staged-face (,@fmt-ital ,@fg-base01)) + (helm-ls-git-deleted-not-staged-face (,@fmt-bold ,@fg-green)) + (helm-ls-git-modified-and-staged-face (,@fmt-ital ,@fg-base01)) + (helm-ls-git-modified-not-staged-face (,@fmt-ital ,@fg-base01)) + (helm-ls-git-renamed-modified-face (,@fg-green)) + (helm-ls-git-untracked-face (,@fg-red)) + (helm-M-x-key (,@fmt-none ,@fg-orange)) + (helm-match (:inherit match)) + (helm-moccur-buffer (,@fmt-undr ,@fg-cyan)) + (helm-selection (:inherit region)) + (helm-selection-line (:inherit secondary-selection)) + (helm-separator (,@fg-red)) + (helm-source-header (:inherit helm-header)) + (helm-time-zone-current (,@fg-green)) + (helm-time-zone-home (,@fg-red)) + (helm-visible-mark (,@fmt-bold ,@bg-back ,@fg-magenta)) + (helm-w3m-bookmarks (:inherit helm-bookmark-w3m)) + ;; markdown + (markdown-bold-face (:inherit bold)) + (markdown-header-delimiter-face (:inherit shadow)) + (markdown-header-face (:inherit outline-1)) + (markdown-header-face-1 (:inherit outline-1)) + (markdown-header-face-2 (:inherit outline-2)) + (markdown-header-face-3 (:inherit outline-3)) + (markdown-header-face-4 (:inherit outline-4)) + (markdown-header-face-5 (:inherit outline-5)) + (markdown-header-face-6 (:inherit outline-6)) + (markdown-header-rule-face (:inherit shadow)) + (markdown-italic-face (:inherit italic)) + (markdown-link-face (:inherit shadow)) + (markdown-link-title-face (:inherit link)) + (markdown-url-face (:inherit link)) + ;; Message + (message-mml (,@fg-blue)) + (message-cited-text (,@fg-base2)) + (message-separator (,@fg-base3)) + (message-header-xheader (,@fg-violet)) + (message-header-name (,@fg-cyan)) + (message-header-other (,@fg-red)) + (message-header-newsgroups (,@fmt-bldi ,@fg-yellow)) + (message-header-subject (,@fg-base00)) + (message-header-cc (,@fmt-bold ,@fg-green)) + (message-header-to (,@fmt-bold ,@fg-base1)) + ;; minimap + (minimap-active-region-background (,@bg-base02)) + (minimap-semantic-function-face (,bg-base3)) + (minimap-semantic-type-face (,bg-base3)) + (minimap-semantic-variable-face (,bg-base3)) + ;; parenface + (parenface-bracket-face (:inherit shadow)) + (parenface-curly-face (:inherit shadow)) + (parenface-paren-face (:inherit shadow)) + ;; paren-face + (parenthesis (:inherit shadow)) + ;; rainbow-delimiters + (rainbow-delimiters-depth-1-face (:inherit outline-1)) + (rainbow-delimiters-depth-2-face (:inherit outline-2)) + (rainbow-delimiters-depth-3-face (:inherit outline-3)) + (rainbow-delimiters-depth-4-face (:inherit outline-4)) + (rainbow-delimiters-depth-5-face (:inherit outline-5)) + (rainbow-delimiters-depth-6-face (:inherit outline-6)) + (rainbow-delimiters-depth-7-face (:inherit outline-7)) + (rainbow-delimiters-depth-8-face (:inherit outline-8)) + (rainbow-delimiters-depth-9-face (,@fg-green)) + ;; powerline + (powerline-active1 (,@fg-base00 :inherit mode-line)) + (powerline-active2 (,@fg-base0 :inherit mode-line)) + (powerline-inactive1 (,@fg-base02 ,@bg-base1 :inherit mode-line-inactive)) + (powerline-inactive2 (,@fg-base01 :inherit mode-line-inactive)) + ;; slime + (slime-error-face (,@fmt-revr ,@fg-red)) ; ErrorMsg + (slime-note-face (,@fg-yellow)) + (slime-repl-inputted-output-face (,@fg-red)) + (slime-repl-output-mouseover-face (:box (:color base3))) + (slime-style-warning-face (,@fmt-bold ,@fg-orange)) + (slime-warning-face (,@fmt-bold ,@fg-red)) ; WarningMsg + ;; smartparens + (sp-pair-overlay-face (,@bg-base02)) + (sp-wrap-overlay-face (,@bg-base02)) + (sp-wrap-tag-overlay-face (,@bg-base02)) + (sp-show-pair-match-face (,@fg-magenta ,@bg-back)) + (sp-show-pair-mismatch-face (,@bg-red ,@fg-base02)) + ;; whitespace + (whitespace-empty (,@fg-red)) + (whitespace-hspace (,@fg-orange)) + (whitespace-indentation (,@fg-base02)) + (whitespace-space (,@fg-base02)) + (whitespace-space-after-tab (,@fg-cyan)) + (whitespace-space-before-tab (,@fmt-bold ,@fg-red)) + (whitespace-tab (,@fg-base02)) + (whitespace-trailing (,@fmt-bold ,@fg-red ,@bg-base02)) + (whitespace-highlight-face (,@fg-red ,@bg-blue)) + (whitespace-line (,@fg-magenta)) + (whitespace-newline (:inherit shadow :slant normal)) + ;; writegood + (writegood-weasels-face (,@fmt-curl-cyan ,@fg-cyan)) + (writegood-passive-voice-face (,@fg-magenta)) + (writegood-duplicates-face (:inherit error)) + ;; rcirc + (rcirc-my-nick (,@fg-blue)) + (rcirc-nick-in-message (,@fg-orange)) + (rcirc-other-nick (,@fg-green)) + (rcirc-prompt (,@fg-yellow)) + (rcirc-bright-nick (,@fg-magenta)) + (rcirc-server (,@fg-base1)) + (rcirc-timestamp (,@fg-base01)) + ;;font-latex + (font-latex-warning-face (,@fg-red)) + (font-latex-sectioning-5-face (,@fg-violet)) + ;;flyspell + (flyspell-incorrect (,@fmt-curl-red)) ; SpellBad + (flyspell-duplicate (,@fmt-curl-yellow)) + ;; rst-mode + (rst-level-1 (:inherit outline-1)) + (rst-level-2 (:inherit outline-2)) + (rst-level-3 (:inherit outline-3)) + (rst-level-4 (:inherit outline-4)) + (rst-level-5 (:inherit outline-5)) + (rst-level-6 (:inherit outline-6)) + ;;ansi-color + (ansi-color-cyan (,@fg-cyan ,@bg-cyan)) + (ansi-color-blue (,@fg-blue ,@bg-blue)) + (ansi-color-magenta (,@fg-magenta ,@bg-magenta)) + (ansi-color-red (,@fg-red ,@bg-red)) + (ansi-color-yellow (,@fg-yellow ,@bg-yellow)) + (ansi-color-green (,@fg-green ,@bg-green)) + (ansi-color-black (,@fg-base02 ,@bg-base02)) + (ansi-color-white (,@fg-base2 ,@bg-base2)) + (ansi-color-bright-cyan (,@fg-base1 ,@bg-base1)) + (ansi-color-bright-blue (,@fg-base0 ,@bg-base0)) + (ansi-color-bright-magenta (,@fg-violet ,@bg-violet)) + (ansi-color-bright-red (,@fg-orange ,@bg-orange)) + (ansi-color-bright-yellow (,@fg-base00 ,@bg-base00)) + (ansi-color-bright-green (,@fg-base01 ,@bg-base01)) + (ansi-color-bright-black (,@fg-base03 ,@bg-base03)) + (ansi-color-bright-white (,@fg-base3 ,@bg-base3)) + ;; company + (company-tooltip (,@fg-base00 ,@bg-base02)) + (company-tooltip-selection (,@fg-green ,@bg-base02)) + (company-tooltip-mouse (,@fg-base1 ,@bg-base02)) + (company-tooltip-common (,@fg-blue ,@bg-base02 ,@fmt-undr)) + (company-tooltip-common-selection (,@fg-green ,@bg-base02 ,@fmt-undr)) + (company-tooltip-annotation (,@fg-yellow ,@bg-base02)) + (company-scrollbar-fg (,@bg-base0)) + (company-scrollbar-bg (,@bg-base02)) + (company-preview (,@bg-green)) + (company-preview-common (,@fg-base01 ,@bg-base02)) + (company-template-field (,@fg-base03 ,@bg-yellow)) + ;; hydra + (hydra-face-red (,@fmt-bold ,@fg-red)) + (hydra-face-blue (,@fmt-bold ,@fg-blue)) + (hydra-face-amaranth (,@fmt-bold ,@fg-orange)) + (hydra-face-pink (,@fmt-bold ,@fg-magenta)) + (hydra-face-teal (,@fmt-bold ,@fg-cyan)) + ;; guide-key + (guide-key/prefix-command-face (,@fg-blue)) + (guide-key/highlight-command-face (,@fg-orange)) + (guide-key/key-face (,@fg-green)) + ;; magit + (magit-log-sha1 (,@fg-red)) + (magit-branch (,@fg-yellow)) + (magit-tag (,@fg-green)) + (magit-log-author (,@fg-cyan)) + (magit-log-head-label-remote (,@fg-green)) + (magit-log-head-label-tags (,@fg-orange)) + (magit-log-head-label-local (,@fg-yellow)) + (magit-log-head-label-head (,@fg-violet)) + (magit-process-ok (,@fg-green :inherit magit-section-title)) + (magit-process-ng (,@fg-red :inherit magit-section-title)) + ;; undo-tree + (undo-tree-visualizer-current-face (,@fg-orange)) + (undo-tree-visualizer-default-face (:inherit shadow)) + (undo-tree-visualizer-active-branch-face (:inherit default)) + (undo-tree-visualizer-unmodified-face (,@fg-cyan)) + (undo-tree-visualizer-register-face (,@fg-yellow)) + ;; haskell + (haskell-keyword-face (,@fg-cyan))))))) + +(provide 'solarized-definitions) +;;; solarized-definitions.el ends here diff --git a/emacs/local/solarized-theme.el b/emacs/local/solarized-theme.el @@ -0,0 +1,50 @@ +;; solarized-theme.el --- Solarized custom theme -*- lexical-binding: t; -*- + +(require 'solarized-definitions + (locate-file "solarized-definitions.el" custom-theme-load-path + '("c" ""))) + +(deftheme solarized solarized-description) + +(apply #'custom-theme-set-faces 'solarized (solarized-color-definitions)) + +(custom-theme-set-variables + 'solarized + ;; This is obsolete, but something might still be referencing it. + `(ansi-color-names-vector + ,(apply #'vector + (mapcar (lambda (color-name) + (nth 1 (assoc color-name solarized-colors))) + '(base02 red green yellow blue magenta cyan base2))))) + +(cl-defun solarized-update-background-mode + (appearance &optional (frames (frame-list))) + "Set the APPEARANCE of all frames to either 'light or 'dark. +This is not specific to Solarized – it will update the appearance of any theme +that observes the background characteristic." + (setq frame-background-mode appearance) + (mapc #'frame-set-background-mode frames) + ;; Supposedly #'frame-set-background-mode updates the faces, but it doesn’t + ;; seem to actually., so re-enable all the themes. + (mapc #'enable-theme (reverse custom-enabled-themes)) + ;; For some reason, ‘enable-theme’ (or maybe ‘solarized’?) is resetting the + ;; ‘frame-background-mode’, so reset it here. + (setq frame-background-mode appearance)) + +(defun solarized-toggle-background-mode () + "Toggle between light and dark background modes. +This is not specific to Solarized – it will update the appearance of any theme +that observes the background characteristic." + (interactive) + (let ((new-mode (pcase frame-background-mode + ('dark 'light) + (_ 'dark)))) + (solarized-update-background-mode new-mode))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'solarized) +;;; solarized-theme.el ends here diff --git a/emacs/local/toxi-theme.el b/emacs/local/toxi-theme.el @@ -0,0 +1,65 @@ +(unless (<= 24 emacs-major-version) + (error "toxi-theme requires Emacs 24 or later.")) + +(deftheme toxi + "toxi's dark color theme - forked to my liking") + +(custom-theme-set-faces + 'toxi + ;; frame + `(default ((t (:foreground "#a4ffd8" :background "#0b1210")))) + `(cursor ((t (:foreground "white")))) + `(hl-line ((t (:background "#272822")))) + `(minibuffer-prompt ((t (:foreground "#14bccc" :bold t)))) + `(modeline ((t (:background "#465253" :foreground "#ffffff")))) + `(modeline-inactive ((t (:background "#162223" :foreground "#355e6b")))) + `(region ((t (:background "#441ea4")))) + `(show-paren-match-face ((t (:background "#ffff00")))) + ;; main + `(font-lock-builtin-face ((t (:foreground "#00ffff")))) + `(font-lock-comment-face ((t (:foreground "#7d7d7d")))) + `(font-lock-constant-face ((t (:foreground "#f2ee81")))) + `(font-lock-doc-string-face ((t (:foreground "#40be67")))) + `(font-lock-function-name-face ((t (:foreground "#a4ffd8")))) + `(font-lock-keyword-face ((t (:foreground "#ffff00")))) + `(font-lock-string-face ((t (:foreground "#50de77")))) + `(font-lock-type-face ((t (:foreground "#a4ffd8")))) + `(font-lock-variable-name-face ((t (:foreground "#a4ffd8")))) + `(font-lock-warning-face ((t (:bold t :foreground "#ff0055")))) + ;; dired + `(dired-directory ((t (:bold t :foreground "#ffff00")))) + `(dired-symlink ((t (:bold t :foreground "#00ffff")))) + ;; rainbow-delimiters + `(rainbow-delimiters-depth-1-face ((t (:foreground "#990000")))) + `(rainbow-delimiters-depth-2-face ((t (:foreground "#383838")))) + `(rainbow-delimiters-depth-3-face ((t (:foreground "#505050")))) + `(rainbow-delimiters-depth-4-face ((t (:foreground "#6c6c6c")))) + `(rainbow-delimiters-depth-5-face ((t (:foreground "#888888")))) + `(rainbow-delimiters-depth-6-face ((t (:foreground "#a7a7a7")))) + `(rainbow-delimiters-depth-7-face ((t (:foreground "#c4c4c4")))) + `(rainbow-delimiters-depth-8-face ((t (:foreground "#e1e1e1")))) + `(rainbow-delimiters-depth-9-face ((t (:foreground "#ffffff")))) + ;; ido + `(ido-first-match ((t (:foreground "#ffff00")))) + `(ido-only-match ((t (:foreground "#00ff00")))) + `(ido-subdir ((t (:foreground "#00ffff")))) + ;; iedit + `(iedit-occurrence ((t (:background "#441ea4")))) + ;; whitespace + `(whitespace-space ((t (:foreground "#595959")))) + ;; yasnippet + `(yas/field-highlight-face ((t (:background "#383830")))) + ;; vertico + `(vertico-current ((t (:background "#441ea4")))) + ;; org + `(org-hide ((t (:foreground "#0b1210")))) + `(org-block ((t (:background "#1b2220")))) + `(org-link ((t (:foreground "#56cff2" :underline t))))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'toxi) + diff --git a/emacs/snippets/c++-mode/.yas-parents b/emacs/snippets/c++-mode/.yas-parents @@ -0,0 +1 @@ +c-mode +\ No newline at end of file diff --git a/emacs/snippets/c-mode/define b/emacs/snippets/c-mode/define @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: define +# key: d +# -- +#define $0 +\ No newline at end of file diff --git a/emacs/snippets/c-mode/for b/emacs/snippets/c-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for (u64 ${1:i} = 0; $1 < $2; ++$1) { + $0 +} +\ No newline at end of file diff --git a/emacs/snippets/c-mode/fprintf b/emacs/snippets/c-mode/fprintf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fprintf +# key: fpr +# -- +fprintf($1, "$2"); +\ No newline at end of file diff --git a/emacs/snippets/c-mode/if b/emacs/snippets/c-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if ($1) { + $0 +} +\ No newline at end of file diff --git a/emacs/snippets/c-mode/include b/emacs/snippets/c-mode/include @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: include +# key: inc +# -- +#include <$0> +\ No newline at end of file diff --git a/emacs/snippets/c-mode/includeq b/emacs/snippets/c-mode/includeq @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: includeq +# key: incq +# -- +#include "$0" +\ No newline at end of file diff --git a/emacs/snippets/c-mode/main b/emacs/snippets/c-mode/main @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# -- +int +main(int argc, char **argv) { + $0 + return 0; +} +\ No newline at end of file diff --git a/emacs/snippets/c-mode/note b/emacs/snippets/c-mode/note @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: note +# key: note +# -- +/* NOTE(jake): $0 */ +\ No newline at end of file diff --git a/emacs/snippets/c-mode/printf b/emacs/snippets/c-mode/printf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf +# key: pr +# -- +printf("$0"); +\ No newline at end of file diff --git a/emacs/snippets/c-mode/printf_args b/emacs/snippets/c-mode/printf_args @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf_args +# key: pra +# -- +printf("$1", $0); +\ No newline at end of file diff --git a/emacs/snippets/c-mode/sdlboil b/emacs/snippets/c-mode/sdlboil @@ -0,0 +1,29 @@ +# -*- mode: snippet -*- +# name: sdlboil +# key: sdlboil +# -- +SDL_Init(SDL_INIT_VIDEO); + +SDL_Window *window = SDL_CreateWindow("SDL Boilerplate", + 0, 0, + 1280, 720, + SDL_WINDOW_RESIZABLE); + +SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, + SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); + +bool running = true; +while (running) { + SDL_Event event = {0}; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_QUIT: { + running = false; + } break; + } + } + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); +} +$0 +\ No newline at end of file diff --git a/emacs/snippets/c-mode/stdio b/emacs/snippets/c-mode/stdio @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdio +# key: stdio +# -- +#include <stdio.h> +\ No newline at end of file diff --git a/emacs/snippets/c-mode/stdlib b/emacs/snippets/c-mode/stdlib @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdlib +# key: stdlib +# -- +#include <stdlib.h> +\ No newline at end of file diff --git a/emacs/snippets/c-mode/struct b/emacs/snippets/c-mode/struct @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: struct +# key: st +# -- +typedef struct { +} $0; +\ No newline at end of file diff --git a/emacs/snippets/c-mode/todo b/emacs/snippets/c-mode/todo @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: todo +# key: todo +# -- +/* TODO(jake): $0 */ +\ No newline at end of file diff --git a/emacs/snippets/fundamental-mode/mit b/emacs/snippets/fundamental-mode/mit @@ -0,0 +1,24 @@ +# -*- mode: snippet -*- +# name: mit +# key: mit +# -- +Copyright `(format-time-string "%Y")` Jake Koroman <jakekoroman@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +\ No newline at end of file diff --git a/emacs/snippets/mhtml-mode/tag b/emacs/snippets/mhtml-mode/tag @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: <tag>...</tag> +# key: tag +# -- +<${1:tag}>$0</$1> +\ No newline at end of file diff --git a/emacs/snippets/org-mode/src b/emacs/snippets/org-mode/src @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: src +# key: <s +# -- +#+begin_src $1 + $0 +#+end_src +\ No newline at end of file diff --git a/emacs/snippets/zig-mode/note b/emacs/snippets/zig-mode/note @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: note +# key: note +# -- +// NOTE(jake): $0 +\ No newline at end of file diff --git a/emacs/snippets/zig-mode/todo b/emacs/snippets/zig-mode/todo @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: todo +# key: todo +# -- +// TODO(jake): $0 +\ No newline at end of file diff --git a/gtk-3.0/settings.ini b/gtk-3.0/settings.ini @@ -0,0 +1,6 @@ +[Settings] +gtk-application-prefer-dark-theme=true +gtk-cursor-theme-name=Adwaita +gtk-cursor-theme-size=32 +gtk-icon-theme-name=Adwaita +gtk-theme-name=Adwaita diff --git a/i3/config b/i3/config @@ -0,0 +1,196 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +font pango:Iosevka 10 + +gaps outer 20px +gaps inner 5px +default_border pixel 2px + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +exec --no-startup-id xrdb $HOME/.Xresources +exec --no-startup-id sxhkd +exec --no-startup-id xset r rate 300 50 +exec --no-startup-id autorandr --change +exec --no-startup-id xwallpaper --zoom ~/pictures/wallpaper +exec --no-startup-id xss-lock --transfer-sleep-lock -- xlock -mode rain +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 2%+ && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id wpctl set-volume @DEFAULT_SINK@ 2%- && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id wpctl set-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec $TERMINAL + +# kill focused window +bindsym $mod+Shift+c kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id i3-dmenu-desktop +bindsym $mod+Shift+d exec --no-startup-id dmenu_run + +# move focus by monitor +bindsym $mod+period move workspace to output right +bindsym $mod+comma move workspace to output left + +# change focus +bindsym $mod+n focus left +bindsym $mod+e focus down +bindsym $mod+i focus up +bindsym $mod+o focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+n move left +bindsym $mod+Shift+e move down +bindsym $mod+Shift+i move up +bindsym $mod+Shift+o move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+m layout tabbed +bindsym $mod+g layout toggle split + +# scratchpad +bindsym $mod+Shift+semicolon move scratchpad +bindsym $mod+semicolon scratchpad show + +# toggle tiling / floating +bindsym $mod+Control+Tab floating toggle + +# change focus between tiling / floating windows +bindsym $mod+Tab focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+q reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +bindsym $mod+Control+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +set $resize_amount 2 + +mode "resize" { + bindsym n resize shrink width $resize_amount px or $resize_amount ppt + bindsym e resize grow height $resize_amount px or $resize_amount ppt + bindsym i resize shrink height $resize_amount px or $resize_amount ppt + bindsym o resize grow width $resize_amount px or $resize_amount ppt + + bindsym Left resize shrink width $resize_amount px or $resize_amount ppt + bindsym Down resize grow height $resize_amount px or $resize_amount ppt + bindsym Up resize shrink height $resize_amount px or $resize_amount ppt + bindsym Right resize grow width $resize_amount px or $resize_amount ppt + + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +mode "mpd" { + bindsym p exec mpc toggle + bindsym n exec mpc next + bindsym j exec mpc seek -00:00:10 + bindsym l exec mpc seek +00:00:10 + + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+p mode "default" +} + +bindsym $mod+p mode "mpd" + +for_window [class="floatterm"] floating enable + +bar { + status_command i3status + tray_output primary + position top +} diff --git a/i3status/config b/i3status/config @@ -0,0 +1,59 @@ +general { + colors = true + interval = 5 +} + +order += "wireless wlan0" +order += "ethernet _first_" +order += "battery 1" +order += "volume master" +order += "memory" +#order += "cpu_usage" +order += "time local" +order += "load" + +time { + format = "%Y-%m-%d %H:%M:%S" +} + +load { + format = "%5min %15min" +} + +cpu_usage { + format = "CPU: %usage" +} + +memory { + format = "M: %used / %total" + threshold_degraded = "10%" + format_degraded = "M: %free FREE" +} + +volume master { + format = "A: %volume" + format_muted = "A: %volume (muted)" + device = "pulse" +} + +battery 1 { + format = "%status %percentage %remaining" + format_down = "your battery disappeared" + status_chr = "CHR" + status_bat = "BAT" + status_unk = "????" + status_full = "FULL" + path = "/sys/class/power_supply/BAT%d/uevent" + low_threshold = "20" + threshold_type = "percentage" +} + +wireless wlan0 { + format_up = "W: (%quality at %essid) %ip" + format_down = "W: down" +} + +ethernet _first_ { + format_up = "E: %ip (%speed)" + format_down = "E: down" +} +\ No newline at end of file diff --git a/isyncrc b/isyncrc @@ -0,0 +1,40 @@ +IMAPStore personal-remote +Host imap.purelymail.com +Port 993 +TLSType IMAPS +User jake@jakekoroman.com +PassCmd "pass show jake@jakekoroman.com" + +MaildirStore personal-local +Path ~/mail/personal/ +Inbox ~/mail/personal/INBOX +Subfolders Verbatim + +Channel personal +Far :personal-remote: +Near :personal-local: +Create Both +Expunge Both +SyncState * +Patterns * + +IMapStore work-remote +Host localhost +Port 1143 +TLSType None +AuthMechs LOGIN +User koromanj@miltonhydro.com +PassCmd "pass show koromanj@miltonhydro.com" + +MaildirStore work-local +Path ~/mail/work/ +Inbox ~/mail/work/INBOX +Subfolders Verbatim + +Channel work +Far :work-remote: +Near :work-local: +Create Both +Expunge Both +SyncState * +Patterns * diff --git a/scripts/bookmarks b/scripts/bookmarks @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +readarray -t bookmarks < $MENULAUNCHER_DIR/bookmarks + +url=$(printf '%s\n' "${bookmarks[@]}" | dmenu -p "Bookmark: " -i -l 16 | sed 's/^.*: //g') + +[[ ! -z "$url" ]] && firefox --new-tab $url diff --git a/scripts/change_wallpaper b/scripts/change_wallpaper @@ -0,0 +1,8 @@ +#!/bin/sh + +wallpaper=$(ls ~/pictures/wallpapers/ | dmenu -p "Wallpaper: " -i -l 16) + +cd ~/pictures +rm -f wallpaper +ln -s "wallpapers/$wallpaper" wallpaper +xwallpaper --zoom ~/pictures/wallpaper & diff --git a/scripts/checkmail b/scripts/checkmail @@ -0,0 +1,8 @@ +#!/bin/sh + +[ $# -lt 1 ] && echo "error: invalid usage: requires an email as an argument" && exit 1 + +mail_address="$1" +mail_dir="$XDG_DATA_HOME/mail/$mail_address/INBOX/new" + +echo "$(ls $mail_dir | wc -l) " diff --git a/scripts/murder b/scripts/murder @@ -0,0 +1,3 @@ +#!/bin/sh + +ps -e | fzf | awk 'OFS=" " {print $1}' | xargs kill $1 diff --git a/scripts/passmenu-otp b/scripts/passmenu-otp @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + +# dmenu_cmd="wofi_style --show dmenu $@" +dmenu_cmd="dmenu -l 12 -i $@" +password=$(printf '%s\n' "${password_files[@]}" | $dmenu_cmd) + +[[ -n $password ]] || exit + +pass_cmd=show +if pass show "$password" | grep -q '^otpauth://'; then + pass_cmd=otp +fi + +if [[ $typeit -eq 0 ]]; then + pass $pass_cmd -c "$password" 2>/dev/null +else + pass $pass_cmd "$password" | { IFS= read -r pass; printf %s "$pass"; } | + xdotool type --clearmodifiers --file - +fi diff --git a/scripts/rdp b/scripts/rdp @@ -0,0 +1,19 @@ +#!/bin/sh + +# to be used with the rdpmenu script + +set -x + +if test -z "$1"; then + echo "Usage: ./rdp <server_name>" + exit +fi + +RDP_FILE="$XDG_DATA_HOME/rdp/$1" +CONN_SETTINGS="/size:1920x1080 /scale:140 /dynamic-resolution /from-stdin /cert:tofu /tls-seclevel:0 -grab-keyboard" +CONN_SERVER=$(grep "server=" $RDP_FILE | sed "s/server=//") +CONN_USER=$(grep "user=" $RDP_FILE | sed "s/user=//") +CONN_PASS=$(grep "pass=" $RDP_FILE | sed "s/pass=//") +CONN_DOMAIN=$(grep "domain=" $RDP_FILE | sed "s/domain=//") + +pass show "$CONN_PASS" | xfreerdp /v:"$CONN_SERVER" /u:"$CONN_USER" /d:"$CONN_DOMAIN" $CONN_SETTINGS diff --git a/scripts/rdpmenu b/scripts/rdpmenu @@ -0,0 +1,5 @@ +#!/bin/sh + +server=$(ls "$XDG_DATA_HOME/rdp" | dmenu -p "Server: " -i -l 16) + +[ ! -z "$server" ] && rdp "$server" diff --git a/scripts/safeedit b/scripts/safeedit @@ -0,0 +1,19 @@ +#!/bin/sh + +[ "$#" -lt 1 ] && echo "error: invalid usage: requires an arugement" && exit 1 + +set -e + +bak="$1.original" + +if [ -e "$bak" ]; then + echo -n "$bak exists! replace? (y/N): " + read input + [ ! "$input" = "y" ] && exit 0 +fi + +cp "$1" "$bak" +echo "info: created backup file $bak" + +[ -z $EDITOR ] && echo "error: EDITOR is not set. attempting to use vi" && export EDITOR=vi +$EDITOR "$1" diff --git a/scripts/sshmenu b/scripts/sshmenu @@ -0,0 +1,7 @@ +#!/bin/bash + +readarray -t servers < $MENULAUNCHER_DIR/sshmenu + +server=$(printf '%s\n' "${servers[@]}" | dmenu -p "Server" -w -i -l 16 | sed 's/^.*: //g') + +[[ ! -z "$server" ]] && foot -e ssh -Y -X $server diff --git a/scripts/syncmail b/scripts/syncmail @@ -0,0 +1,17 @@ +#!/bin/sh + +# notmuch search --output=files tag:archive | \ +# xargs -I {} sh -c 'mv {} ~/mail/archive/cur/$(basename $(echo {} | sed 's/,.*$//g'))' +# notmuch tag -archive +archived -- tag:archive + +notmuch search --output=files --format=text0 tag:delete | xargs -r0 rm + +mbsync -a +notmuch new + +notmuch tag +assyst -- from:assyst@hoist.tech and tag:new + +notmuch tag -new +inbox +unread +work -- path:work/** and tag:new +notmuch tag -new +inbox +unread +personal -- path:personal/** and tag:new + +notmuch tag +inbox +unread +unknown -new -- tag:new diff --git a/scripts/weather b/scripts/weather @@ -0,0 +1,3 @@ +#!/bin/sh + +curl -s "wttr.in/cambridge+canada?lang=fr&0" | sed 's/cambridge+canada/Cambridge/g' diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc @@ -0,0 +1,41 @@ +super+shift+control+alt+slash + bookmarks + +super+shift+control+alt+period + rdpmenu + +super+shift+control+alt+r + i3-dmenu-desktop + +super+shift+control+alt+e + emacsclient -c + +super+shift+control+alt+m + $TERMINAL -e "neomutt" + +super+shift+control+alt+s + flameshot gui + +super+shift+control+alt+l + loginctl lock-session + +super+shift+control+alt+p + passmenu-otp + +super+shift+control+alt+v + sleep 0.5 && xdotool type "$(xclip -o)" + +super+shift+control+alt+w + change_wallpaper + +super+shift+control+alt+Return + $TERMINAL -c floatterm + +XF86AudioPlay + playerctl play-pause + +XF86MonBrightnessUp + brightnessctl set 5%+ + +XF86MonBrightnessDown + brightnessctl set 5%- +\ No newline at end of file