]> git.armaanb.net Git - config.org.git/blob - config.org
Switch to using whitespace mode
[config.org.git] / config.org
1 #+TITLE: System Configuration
2 #+DESCRIPTION: Personal system configuration in org-mode format.
3 #+AUTHOR: Armaan Bhojwani
4 #+EMAIL: me@armaanb.net
5
6 * Welcome
7 Welcome to my system configuration! This file contains my Emacs configuration, but also my config files for many of the other programs on my system!
8 ** Compatability
9 I am currently using Emacs 28 with native compilation, so some settings and packages may not be available for older versions of Emacs. This is a purely personal configuration, so while I can guarantee that it works on my setup, it might not work for you.
10 ** Choices
11 I chose to create a powerful, yet not overly heavy Emacs configuration. Things like a fancy modeline, icons, or LSP mode do not increase my productivity, and create visual clutter, and thus have been excluded.
12
13 Another important choice has been to integrate Emacs into a large part of my computing environment (see [[*Emacs OS]]). I use email, IRC, RSS, et cetera, all through Emacs which simplifies my workflow and creates an amazingly integrated environment.
14
15 Lastly, I use Evil mode. Modal keybindings are simpler and more ergonomic than standard Emacs style, and Vim keybindings are what I'm comfortable with and are pervasive throughout computing.
16 ** License
17 Released under the [[https://opensource.org/licenses/MIT][MIT license]] by Armaan Bhojwani, 2021. Note that many snippets are taken from online, and other sources, who are credited for their work near their contributions.
18 * Package management
19 ** Bootstrap straight.el
20 straight.el is really nice for managing package, and it integrates nicely with use-package. It uses the bootstrapping system defined here for installation.
21 #+begin_src emacs-lisp
22   (defvar native-comp-deferred-compilation-deny-list ())
23   (defvar bootstrap-version)
24   (let ((bootstrap-file
25          (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
26         (bootstrap-version 5))
27     (unless (file-exists-p bootstrap-file)
28       (with-current-buffer
29           (url-retrieve-synchronously
30            "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
31            'silent 'inhibit-cookies)
32         (goto-char (point-max))
33         (eval-print-last-sexp)))
34     (load bootstrap-file nil 'nomessage))
35 #+end_src
36 ** Replace package.el with straight
37 #+begin_src emacs-lisp
38   (straight-use-package 'use-package)
39   (setq straight-use-package-by-default t)
40 #+end_src
41 * Visual options
42 ** Theme
43 Use the Modus Operandi theme by Protesilaos Stavrou. Its the best theme for Emacs by far, because how clear and readable it is. It is highly customizable, but I just set a few options here.
44 #+begin_src emacs-lisp
45   (use-package modus-themes
46     :custom
47     (modus-themes-slanted-constructs t)
48     (modus-themes-bold-constructs t)
49     (modus-themes-mode-line '3d)
50     (modus-themes-scale-headings t)
51     (modus-themes-diffs 'desaturated)
52     :config (load-theme 'modus-vivendi t))
53 #+end_src
54 ** Typography
55 *** Font
56 JetBrains Mono is a great programming font with ligatures. The "NF" means that it has been patched with the [[https://www.nerdfonts.com/][Nerd Fonts]].
57 #+begin_src emacs-lisp
58   (add-to-list 'default-frame-alist '(font . "JetBrainsMonoNF-12"))
59 #+end_src
60 *** Ligatures
61 #+begin_src emacs-lisp
62   (use-package ligature
63     :straight (ligature :type git :host github :repo "mickeynp/ligature.el")
64     :config
65     (ligature-set-ligatures
66      '(prog-mode text-mode)
67      '("-|" "-~" "---" "-<<" "-<" "--" "->" "->>" "-->" "/=" "/=="
68        "/>" "//" "/*" "*>" "*/" "<-" "<<-" "<=>" "<=" "<|" "<||"
69        "<|||" "<|>" "<:" "<>" "<-<" "<<<" "<==" "<<=" "<=<" "<==>"
70        "<-|" "<<" "<~>" "<=|" "<~~" "<~" "<$>" "<$" "<+>" "<+" "</>"
71        "</" "<*" "<*>" "<->" "<!--" ":>" ":<" ":::" "::" ":?" ":?>"
72        ":=" "::=" "=>>" "==>" "=/=" "=!=" "=>" "===" "=:=" "==" "!=="
73        "!!" "!=" ">]" ">:" ">>-" ">>=" ">=>" ">>>" ">-" ">=" "&&&"
74        "&&" "|||>" "||>" "|>" "|]" "|}" "|=>" "|->" "|=" "||-" "|-"
75        "||=" "||" ".." ".?" ".=" ".-" "..<" "..." "+++" "+>" "++"
76        "[||]" "[<" "[|" "{|" "?." "?=" "?:" "##" "###" "####" "#["
77        "#{" "#=" "#!" "#:" "#_(" "#_" "#?" "#(" ";;" "_|_" "__" "~~"
78        "~~>" "~>" "~-" "~@" "$>" "^=" "]#"))
79     (global-ligature-mode t))
80 #+end_src
81 ** Line numbers
82 Display relative line numbers except in certain modes.
83 #+begin_src emacs-lisp
84   (global-display-line-numbers-mode)
85   (setq display-line-numbers-type 'relative)
86   (dolist (no-line-num '(term-mode-hook
87                          pdf-view-mode-hook
88                          shell-mode-hook
89                          org-mode-hook
90                          circe-mode-hook
91                          eshell-mode-hook))
92     (add-hook no-line-num (lambda () (display-line-numbers-mode 0))))
93 #+end_src
94 ** Highlight matching parenthesis
95 #+begin_src emacs-lisp
96   (use-package paren
97     :config (show-paren-mode)
98     :custom (show-paren-style 'parenthesis))
99 #+end_src
100 ** Modeline
101 *** Show current function
102 #+begin_src emacs-lisp
103   (which-function-mode)
104 #+end_src
105 *** Make position in file more descriptive
106 Show current column and file size.
107 #+begin_src emacs-lisp
108   (column-number-mode)
109   (size-indication-mode)
110 #+end_src
111 *** Hide minor modes
112 #+begin_src emacs-lisp
113   (use-package minions
114     :config (minions-mode))
115 #+end_src
116 ** Whitespace mode
117 Highlight whitespace and other bad text practices.
118 #+begin_src emacs-lisp
119   (use-package whitespace
120     :custom (whitespace-style '(face lines-tail)))
121   (dolist (hook '(prog-mode-hook))
122     (add-hook hook (lambda () (whitespace-mode 1))))
123 #+end_src
124 ** Highlight todo items in comments
125 +begin_src emacs-lisp
126   (use-package hl-todo
127     :straight (hl-todo :type git :host github :repo "tarsius/hl-todo")
128     :config (global-hl-todo-mode 1))
129 #+end_src
130 ** Blink cursor
131 #+begin_src emacs-lisp
132   (blink-cursor-mode)
133 #+end_src
134 ** Visual line mode
135 Soft wrap words and do operations by visual lines in some modes.
136 #+begin_src emacs-lisp
137   (dolist (hook '(text-mode-hook
138                   org-mode-hook
139                   markdown-mode-hook
140                   mu4e-view-mode-hook))
141     (add-hook hook (lambda () (visual-line-mode 1))))
142 #+end_src
143 ** Auto fill mode
144 #+begin_src emacs-lisp
145   (dolist (hook '(scdoc-mode-hook
146                   mu4e-compose-mode-hook))
147     (add-hook hook (lambda () (auto-fill-mode 1))))
148 #+end_src
149 ** Display number of matches in search
150 #+begin_src emacs-lisp
151   (use-package anzu
152     :config (global-anzu-mode)
153     :bind
154     ([remap query-replace] . anzu-query-replace)
155     ([remap query-replace-regexp] . anzu-query-replace-regexp))
156 #+end_src
157 *** TODO This config doesn't work right
158 ** Visual bell
159 Invert modeline color instead of audible bell or the standard visual bell.
160 #+begin_src emacs-lisp
161   (setq visible-bell nil
162         ring-bell-function
163         (lambda () (invert-face 'mode-line)
164           (run-with-timer 0.1 nil #'invert-face 'mode-line)))
165 #+end_src
166 * Evil mode
167 ** General
168 #+begin_src emacs-lisp
169   (use-package evil
170     :custom (select-enable-clipboard nil)
171     :config
172     (evil-mode)
173     (fset 'evil-visual-update-x-selection 'ignore) ;; Keep clipboard and register seperate
174     ;; Use visual line motions even outside of visual-line-mode buffers
175     (evil-global-set-key 'motion "j" 'evil-next-visual-line)
176     (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
177     (global-set-key (kbd "<escape>") 'keyboard-escape-quit))
178 #+end_src
179 ** Evil collection
180 Evil bindings for tons of packages.
181 #+begin_src emacs-lisp
182   (use-package evil-collection
183     :after evil
184     :init (evil-collection-init)
185     :custom (evil-collection-setup-minibuffer t))
186 #+end_src
187 ** Surround
188 tpope prevails!
189 #+begin_src emacs-lisp
190   (use-package evil-surround
191     :config (global-evil-surround-mode))
192 #+end_src
193 ** Nerd commenter
194 Makes commenting super easy
195 #+begin_src emacs-lisp
196   (use-package evil-nerd-commenter
197     :bind (:map evil-normal-state-map
198                 ("gc" . evilnc-comment-or-uncomment-lines))
199     :custom (evilnc-invert-comment-line-by-line nil))
200 #+end_src
201 ** Undo redo
202 Fix the oopsies!
203 #+begin_src emacs-lisp
204   (evil-set-undo-system 'undo-redo)
205 #+end_src
206 ** Number incrementing
207 Add back C-a/C-x bindings.
208 #+begin_src emacs-lisp
209   (use-package evil-numbers
210     :straight (evil-numbers :type git :host github :repo "juliapath/evil-numbers")
211     :bind (:map evil-normal-state-map
212                 ("C-M-a" . evil-numbers/inc-at-pt)
213                 ("C-M-x" . evil-numbers/dec-at-pt)))
214 #+end_src
215 ** Evil org
216 #+begin_src emacs-lisp
217   (use-package evil-org
218     :after org
219     :hook (org-mode . evil-org-mode)
220     :config
221     (evil-org-set-key-theme '(textobjects insert navigation shift todo)))
222
223   (use-package evil-org-agenda
224     :straight (:type built-in)
225     :after evil-org
226     :config (evil-org-agenda-set-keys))
227 #+end_src
228 * Org mode
229 ** General
230 #+begin_src emacs-lisp
231   (use-package org
232     :straight (:type built-in)
233     :commands (org-capture org-agenda)
234     :custom
235     (org-ellipsis " ▾")
236     (org-agenda-start-with-log-mode t)
237     (org-agenda-files (quote ("~/Org/tasks.org" "~/Org/break.org")))
238     (org-log-done 'time)
239     (org-log-into-drawer t)
240     (org-src-tab-acts-natively t)
241     (org-src-fontify-natively t)
242     (org-startup-indented t)
243     (org-hide-emphasis-markers t)
244     (org-fontify-whole-block-delimiter-line nil)
245     (org-archive-default-command 'org-archive-to-archive-sibling)
246     :bind
247     ("C-c a" . org-agenda)
248     (:map evil-normal-state-map ("ga" . org-archive-subtree-default)))
249 #+end_src
250 ** Tempo
251 Define templates for lots of common structure elements. Mostly just used within this file.
252 #+begin_src emacs-lisp
253   (use-package org-tempo
254     :after org
255     :straight (:type built-in)
256     :config
257     (dolist (addition '(("el" . "src emacs-lisp")
258                         ("el" . "src emacs-lisp")
259                         ("sp" . "src conf :tangle ~/.spectrwm.conf")
260                         ("ash" . "src shell :tangle ~/.config/ash/ashrc")
261                         ("pi" . "src conf :tangle ~/.config/picom/picom.conf")
262                         ("git" . "src conf :tangle ~/.gitconfig")
263                         ("du" . "src conf :tangle ~/.config/dunst/dunstrc")
264                         ("za" . "src conf :tangle ~/.config/zathura/zathurarc")
265                         ("ff1" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css")
266                         ("ff2" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css")
267                         ("xr" . "src conf :tangle ~/.Xresources")
268                         ("tm" . "src conf :tangle ~/.tmux.conf")
269                         ("gp" . "src conf :tangle ~/.gnupg/gpg.conf")
270                         ("ag" . "src conf :tangle ~/.gnupg/gpg-agent.conf")
271                         ("xm" . "src conf :tangle ~/.config/xmodmap")))
272       (add-to-list 'org-structure-template-alist addition)))
273 #+end_src
274 * Autocompletion
275 ** Ivy
276 A well balanced completion framework.
277 #+begin_src emacs-lisp
278   (use-package ivy
279     :bind (:map ivy-minibuffer-map
280            ("TAB" . ivy-alt-done))
281            (:map ivy-switch-buffer-map
282            ("M-d" . ivy-switch-buffer-kill))
283     :config (ivy-mode))
284 #+end_src
285 ** Ivy-rich
286 #+begin_src emacs-lisp
287   (use-package ivy-rich
288     :after (ivy counsel)
289     :config (ivy-rich-mode))
290 #+end_src
291 ** Counsel
292 Ivy everywhere.
293 #+begin_src emacs-lisp
294   (use-package counsel
295     :bind ("C-M-j" . 'counsel-switch-buffer)
296     :config (counsel-mode))
297 #+end_src
298 ** Remember frequent commands
299 #+begin_src emacs-lisp
300   (use-package ivy-prescient
301     :after counsel
302     :config
303     (prescient-persist-mode)
304     (ivy-prescient-mode))
305 #+end_src
306 * Emacs OS
307 ** RSS
308 Use elfeed for reading RSS. I have another file with all the feeds in it that I'd rather keep private.
309 #+begin_src emacs-lisp
310   (use-package elfeed
311     :bind (("C-c e" . elfeed))
312     :config (load "~/.emacs.d/feeds.el")
313     :bind (:map elfeed-search-mode-map ("C-c C-o" . 'elfeed-show-visit)))
314 #+end_src
315 ** Email
316 Use mu4e for reading emails.
317 Contexts are a not very well known feature of mu4e that makes it super easy to manage multiple accounts. Much better than some of the hacky methods and external packages that I've seen.
318 *** TODO Switch to mbsync
319 =offlineimap= really crappy (slow and requires python2), and I need to replace it with =mbsync=.
320 *** TODO Include mbsync/offlineimap config
321 *** TODO Split up and document this config a bit
322 *** Setup
323 #+begin_src emacs-lisp
324   (use-package smtpmail
325     :straight (:type built-in))
326   (use-package mu4e
327     :load-path "/usr/share/emacs/site-lisp/mu4e"
328     :straight (:build nil)
329     :bind (("C-c m" . mu4e))
330     :config
331     (setq user-full-name "Armaan Bhojwani"
332           smtpmail-local-domain "armaanb.net"
333           smtpmail-stream-type 'ssl
334           smtpmail-smtp-service '465
335           mu4e-change-filenames-when-moving t
336           mu4e-get-mail-command "offlineimap -q"
337           message-citation-line-format "On %a %d %b %Y at %R, %f wrote:\n"
338           message-citation-line-function 'message-insert-formatted-citation-line
339           mu4e-completing-read-function 'ivy-completing-read
340           mu4e-confirm-quit nil
341           mu4e-view-use-gnus t
342           mail-user-agent 'mu4e-user-agent
343           mu4e-context-policy 'pick-first
344           mu4e-contexts
345           `( ,(make-mu4e-context
346                :name "school"
347                :enter-func (lambda () (mu4e-message "Entering school context"))
348                :leave-func (lambda () (mu4e-message "Leaving school context"))
349                :match-func (lambda (msg)
350                              (when msg
351                                (string-match-p "^/school" (mu4e-message-field msg :maildir))))
352                :vars '((user-mail-address . "abhojwani22@nobles.edu")
353                        (mu4e-sent-folder . "/school/Sent")
354                        (mu4e-drafts-folder . "/school/Drafts")
355                        (mu4e-trash-folder . "/school/Trash")
356                        (mu4e-refile-folder . "/school/Archive")
357                        (message-cite-reply-position . above)
358                        (user-mail-address . "abhojwani22@nobles.edu")
359                        (smtpmail-smtp-user . "abhojwani22@nobles.edu")
360                        (smtpmail-smtp-server . "smtp.gmail.com")))
361              ,(make-mu4e-context
362                :name "personal"
363                :enter-func (lambda () (mu4e-message "Entering personal context"))
364                :leave-func (lambda () (mu4e-message "Leaving personal context"))
365                :match-func (lambda (msg)
366                              (when msg
367                                (string-match-p "^/personal" (mu4e-message-field msg :maildir))))
368                :vars '((mu4e-sent-folder . "/personal/Sent")
369                        (mu4e-drafts-folder . "/personal/Drafts")
370                        (mu4e-trash-folder . "/personal/Trash")
371                        (mu4e-refile-folder . "/personal/Archive")
372                        (user-mail-address . "me@armaanb.net")
373                        (message-cite-reply-position . below)
374                        (smtpmail-smtp-user . "me@armaanb.net")
375                        (smtpmail-smtp-server . "smtp.mailbox.org")))))
376     (add-to-list 'mu4e-bookmarks
377                  '(:name "Unified inbox"
378                          :query "maildir:\"/personal/INBOX\" or maildir:\"/school/INBOX\""
379                          :key ?b))
380     :hook ((mu4e-compose-mode . flyspell-mode)
381            (message-send-hook . (lambda () (unless (yes-or-no-p "Ya sure 'bout that?")
382                                              (signal 'quit nil))))))
383 #+end_src
384 *** Discourage Gnus from displaying HTML emails
385 #+begin_src emacs-lisp
386   (with-eval-after-load "mm-decode"
387     (add-to-list 'mm-discouraged-alternatives "text/html")
388     (add-to-list 'mm-discouraged-alternatives "text/richtext"))
389 #+end_src
390 ** Default browser
391 Set EWW as default browser except for multimedia which should open in MPV.
392 #+begin_src emacs-lisp
393   (defun browse-url-mpv (url &optional new-window)
394     "Ask MPV to load URL."
395     (interactive)
396     (start-process "mpv" "*mpv*" "mpv" url))
397
398   (setq browse-url-handlers
399         (quote
400          (("youtu\\.?be" . browse-url-mpv)
401           ("peertube.*" . browse-url-mpv)
402           ("vid.*" . browse-url-mpv)
403           ("vid.*" . browse-url-mpv)
404           ("*.mp4" . browse-url-mpv)
405           ("*.mp3" . browse-url-mpv)
406           ("*.ogg" . browse-url-mpv)
407           ("." . eww-browse-url)
408           )))
409 #+end_src
410 ** EWW
411 Some EWW enhancements.
412 *** Give buffer a useful name
413 #+begin_src emacs-lisp
414   ;; From https://protesilaos.com/dotemacs/
415   (defun prot-eww--rename-buffer ()
416     "Rename EWW buffer using page title or URL.
417         To be used by `eww-after-render-hook'."
418     (let ((name (if (eq "" (plist-get eww-data :title))
419                     (plist-get eww-data :url)
420                   (plist-get eww-data :title))))
421       (rename-buffer (format "*%s # eww*" name) t)))
422
423   (use-package eww
424     :straight (:type built-in)
425     :bind (("C-c w" . eww))
426     :hook (eww-after-render-hook prot-eww--rename-buffer))
427 #+end_src
428 *** Keybinding
429 #+begin_src emacs-lisp
430   (global-set-key (kbd "C-c w") 'eww)
431 #+end_src
432 ** IRC
433 Circe is a really nice IRC client that claims to be above RCIRC and below ERC in terms of features. ERC felt a bit messy and finicky to me, and Circe has all the features that I need. This setup gets the password for my bouncer (Pounce) instances via my =~/.authinfo.gpg= file.
434 #+begin_src emacs-lisp
435   (defun fetch-password (&rest params)
436     (require 'auth-source)
437     (let ((match (car (apply 'auth-source-search params))))
438       (if match
439           (let ((secret (plist-get match :secret)))
440             (if (functionp secret)
441                 (funcall secret)
442               secret))
443         (error "Password not found for %S" params))))
444
445   (use-package circe
446     :config
447     (enable-lui-track)
448     (enable-circe-color-nicks)
449     (setq circe-network-defaults '(("libera"
450                                     :host "irc.armaanb.net"
451                                     :nick "emacs"
452                                     :user "emacs"
453                                     :use-tls t
454                                     :port 6698
455                                     :pass (lambda (null) (fetch-password
456                                                           :login "emacs"
457                                                           :machine "irc.armaanb.net"
458                                                           :port 6698)))
459                                    ("oftc"
460                                     :host "irc.armaanb.net"
461                                     :nick "emacs"
462                                     :user "emacs"
463                                     :use-tls t
464                                     :port 6699
465                                     :pass (lambda (null) (fetch-password
466                                                           :login "emacs"
467                                                           :machine "irc.armaanb.net"
468                                                           :port 6699)))
469                                    ("tilde"
470                                     :host "irc.armaanb.net"
471                                     :nick "emacs"
472                                     :user "emacs"
473                                     :use-tls t
474                                     :port 6696
475                                     :pass (lambda (null) (fetch-password
476                                                           :login "emacs"
477                                                           :machine "irc.armaanb.net"
478                                                           :port 6696)))))
479     :custom (circe-default-part-message "goodbye!")
480     :bind (:map circe-mode-map ("C-c C-r" . circe-reconnect-all)))
481
482   (defun acheam-irc ()
483     "Open circe"
484     (interactive)
485     (if (get-buffer "irc.armaanb.net:6696")
486         (switch-to-buffer "irc.armaanb.net:6696")
487       (progn (switch-to-buffer "*scratch*")
488              (circe "libera")
489              (circe "oftc")
490              (circe "tilde"))))
491
492   (global-set-key (kbd "C-c i") 'acheam-irc)
493 #+end_src
494 ** Calendar
495 Still experimenting with this setup. Not sure if I will keep it, but it works well for seeing my calendar events. I use =vdirsyncer= to sync my calendar events which I'm really not happy with.
496 #+begin_src emacs-lisp
497   (defun sync-calendar ()
498     "Sync calendars with vdirsyncer"
499     (interactive)
500     (async-shell-command "vdirsyncer sync"))
501
502   (use-package calfw
503     :bind (:map cfw:calendar-mode-map ("C-S-u" . sync-calendar)))
504   (use-package calfw-ical)
505   (use-package calfw-org)
506
507   (defun acheam-calendar ()
508     "Open calendars"
509     (interactive)
510     (cfw:open-calendar-buffer
511      :contents-sources (list
512                         (cfw:org-create-source "Green")
513                         (cfw:ical-create-source
514                          "Personal"
515                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
516                          "Gray")
517                         (cfw:ical-create-source
518                          "Personal"
519                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
520                          "Red")
521                         (cfw:ical-create-source
522                          "School"
523                          "~/.local/share/vdirsyncer/school/abhojwani22@nobles.edu.ics"
524                          "Cyan"))
525      :view 'week))
526
527   (global-set-key (kbd "C-c c") 'acheam-calendar)
528 #+end_src
529 ** PDF reader
530 #+begin_src emacs-lisp
531   (use-package pdf-tools
532     :hook (pdf-view-mode . pdf-view-midnight-minor-mode))
533 #+end_src
534 * Emacs IDE
535 ** Python formatting
536 #+begin_src emacs-lisp
537   (use-package blacken
538     :hook (python-mode . blacken-mode)
539     :custom (blacken-line-length 79))
540
541 #+end_src
542 ** Strip trailing whitespace
543 #+begin_src emacs-lisp
544   (use-package ws-butler
545     :config (ws-butler-global-mode))
546 #+end_src
547 ** Flycheck
548 Automatic linting. I need to look into configuring this more.
549 #+begin_src emacs-lisp
550   (use-package flycheck
551     :config (global-flycheck-mode))
552 #+end_src
553 ** Project management
554 I never use this, but apparently its very powerful. Another item on my todo list.
555 #+begin_src emacs-lisp
556   (use-package projectile
557     :config (projectile-mode)
558     :custom ((projectile-completion-system 'ivy))
559     :bind-keymap
560     ("C-c p" . projectile-command-map)
561     :init
562     (when (file-directory-p "~/Code")
563       (setq projectile-project-search-path '("~/Code")))
564     (setq projectile-switch-project-action #'projectile-dired))
565
566   (use-package counsel-projectile
567     :after projectile
568     :config (counsel-projectile-mode))
569 #+end_src
570 ** Dired
571 The best file manager!
572 #+begin_src emacs-lisp
573   (use-package dired
574     :straight (:type built-in)
575     :commands (dired dired-jump)
576     :custom ((dired-listing-switches "-agho --group-directories-first"))
577     :config (evil-collection-define-key 'normal 'dired-mode-map
578               "h" 'dired-single-up-directory
579               "l" 'dired-single-buffer))
580
581   (use-package dired-single
582     :commands (dired dired-jump))
583
584   (use-package dired-open
585     :commands (dired dired-jump)
586     :custom (dired-open-extensions '(("png" . "feh")
587                                      ("mkv" . "mpv"))))
588
589   (use-package dired-hide-dotfiles
590     :hook (dired-mode . dired-hide-dotfiles-mode)
591     :config
592     (evil-collection-define-key 'normal 'dired-mode-map
593       "H" 'dired-hide-dotfiles-mode))
594 #+end_src
595 ** Git
596 *** Magit
597 A very good Git interface.
598 #+begin_src emacs-lisp
599   (use-package magit)
600 #+end_src
601 *** Email
602 #+begin_src emacs-lisp
603   (use-package piem)
604   (use-package git-email
605     :straight (git-email :repo "https://git.sr.ht/~yoctocell/git-email")
606     :config (git-email-piem-mode))
607 #+end_src
608 * General text editing
609 ** Indentation
610 Automatically indent after every change. I'm not sure how much I like this. It slows down the editor and code sometimes ends up in a half-indented state meaning I have to manually reformat using "==" anyways.
611 #+begin_src emacs-lisp
612   (use-package aggressive-indent
613     :config (global-aggressive-indent-mode))
614 #+end_src
615 ** Spell checking
616 Spell check in text mode, and in prog-mode comments.
617 #+begin_src emacs-lisp
618   (dolist (hook '(text-mode-hook
619                   markdown-mode-hook
620                   scdoc-mode-hook))
621     (add-hook hook (lambda () (flyspell-mode))))
622   (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
623     (add-hook hook (lambda () (flyspell-mode -1))))
624   (add-hook 'prog-mode (lambda () (flyspell-prog mode)))
625   (setq ispell-silently-savep t)
626 #+end_src
627 ** Sane tab width
628 #+begin_src emacs-lisp
629   (setq-default tab-width 2)
630 #+end_src
631 ** Save place
632 Opens file where you left it.
633 #+begin_src emacs-lisp
634   (save-place-mode)
635 #+end_src
636 ** Writing mode
637 Distraction free writing a la junegunn/goyo.
638 #+begin_src emacs-lisp
639   (use-package olivetti
640     :bind ("C-c o" . olivetti-mode))
641 #+end_src
642 ** Abbreviations
643 Abbreviate things! I just use this for things like my email address and copyright notice.
644 #+begin_src emacs-lisp
645   (setq abbrev-file-name "~/.emacs.d/abbrevs.el")
646   (setq save-abbrevs 'silent)
647   (setq-default abbrev-mode t)
648 #+end_src
649 ** TRAMP
650 #+begin_src emacs-lisp
651   (setq tramp-default-method "ssh")
652 #+end_src
653 ** Follow version controlled symlinks
654 #+begin_src emacs-lisp
655   (setq vc-follow-symlinks t)
656 #+end_src
657 ** Open file as root
658 #+begin_src emacs-lisp
659   (defun doas-edit (&optional arg)
660     "Edit currently visited file as root.
661
662     With a prefix ARG prompt for a file to visit.
663     Will also prompt for a file to visit if current
664     buffer is not visiting a file.
665
666     Modified from Emacs Redux."
667     (interactive "P")
668     (if (or arg (not buffer-file-name))
669         (find-file (concat "/doas:root@localhost:"
670                            (ido-read-file-name "Find file(as root): ")))
671       (find-alternate-file (concat "/doas:root@localhost:" buffer-file-name))))
672
673     (global-set-key (kbd "C-x C-r") #'doas-edit)
674 #+end_src
675 ** Markdown mode
676 #+begin_src emacs-lisp
677   (use-package markdown-mode)
678 #+end_src
679 ** scdoc mode
680 Get it for yourself at https://git.armaanb.net/scdoc
681 #+begin_src emacs-lisp
682   (add-to-list 'load-path "~/Code/scdoc-mode")
683   (autoload 'scdoc-mode "scdoc-mode" "Major mode for editing scdoc files" t)
684   (add-to-list 'auto-mode-alist '("\\.scd\\'" . scdoc-mode))
685 #+end_src
686 * Keybindings
687 ** Switch windows
688 #+begin_src emacs-lisp
689   (use-package ace-window
690     :bind ("M-o" . ace-window))
691 #+end_src
692 ** Kill current buffer
693 Makes "C-x k" binding faster.
694 #+begin_src emacs-lisp
695   (substitute-key-definition 'kill-buffer 'kill-buffer-and-window global-map)
696 #+end_src
697 * Other settings
698 ** OpenSCAD syntax
699 #+begin_src emacs-lisp
700   (use-package scad-mode)
701 #+end_src
702 ** Control backup and lock files
703 Stop backup files from spewing everywhere.
704 #+begin_src emacs-lisp
705   (setq backup-directory-alist `(("." . "~/.emacs.d/backups"))
706         create-lockfiles nil)
707 #+end_src
708 ** Make yes/no easier
709 #+begin_src emacs-lisp
710   (defalias 'yes-or-no-p 'y-or-n-p)
711 #+end_src
712 ** Move customize file
713 No more clogging up init.el.
714 #+begin_src emacs-lisp
715   (setq custom-file "~/.emacs.d/custom.el")
716   (load custom-file)
717 #+end_src
718 ** Better help
719 #+begin_src emacs-lisp
720   (use-package helpful
721     :commands (helpful-callable helpful-variable helpful-command helpful-key)
722     :custom
723     (counsel-describe-function-function #'helpful-callable)
724     (counsel-describe-variable-function #'helpful-variable)
725     :bind
726     ([remap describe-function] . counsel-describe-function)
727     ([remap describe-command] . helpful-command)
728     ([remap describe-variable] . counsel-describe-variable)
729     ([remap describe-key] . helpful-key))
730 #+end_src
731 ** GPG
732 #+begin_src emacs-lisp
733   (use-package epa-file
734     :straight (:type built-in)
735     :custom
736     (epa-file-select-keys nil)
737     (epa-file-encrypt-to '("me@armaanb.net"))
738     (password-cache-expiry (* 60 15)))
739
740   (use-package pinentry
741     :config (pinentry-start))
742 #+end_src
743 ** Pastebin
744 #+begin_src emacs-lisp
745   (use-package 0x0
746     :straight (0x0 :type git :repo "https://git.sr.ht/~zge/nullpointer-emacs")
747     :custom (0x0-default-service 'envs))
748 #+end_src
749 *** TODO Replace this with uploading to my own server
750 Similar to the ufile alias in my ashrc
751 ** Automatically clean buffers
752 Automatically close unused buffers (except those of Circe) at midnight.
753 #+begin_src emacs-lisp
754   (midnight-mode)
755   (add-to-list 'clean-buffer-list-kill-never-regexps (lambda (buffer-name)
756                                                        (with-current-buffer buffer-name
757                                                          (derived-mode-p 'lui-mode))))
758 #+end_src
759 * Tangles
760 ** Spectrwm
761 Spectrwm is a really awesome window manager! Would highly recommend.
762 *** General settings
763 #+begin_src conf :tangle ~/.spectrwm.conf
764   workspace_limit = 5
765   warp_pointer = 1
766   modkey = Mod4
767   autorun = ws[1]:/home/armaa/Code/scripts/autostart
768 #+end_src
769 *** Bar
770 Disable the bar by default (it can still be brought back up with MOD+b). The font just needs to be set to something that you have installed, otherwise spectrwm won't launch.
771 #+begin_src conf :tangle ~/.spectrwm.conf
772   bar_enabled = 0
773   bar_font = xos4 JetBrains Mono:pixelsize=14:antialias=true # any installed font
774 #+end_src
775 *** Keybindings
776 I'm not a huge fan of how spectrwm handles keybindings, probably my biggest gripe with it.
777 **** WM actions
778 #+begin_src conf :tangle ~/.spectrwm.conf
779   program[term] = st -e tmux
780   program[screenshot_all] = flameshot gui
781   program[notif] = /home/armaa/Code/scripts/setter status
782   program[pass] = /home/armaa/Code/scripts/passmenu
783
784   bind[notif] = MOD+n
785   bind[pass] = MOD+Shift+p
786 #+end_src
787 **** Media keys
788 #+begin_src conf :tangle ~/.spectrwm.conf
789   program[paup] = /home/armaa/Code/scripts/setter audio +5
790   program[padown] = /home/armaa/Code/scripts/setter audio -5
791   program[pamute] = /home/armaa/Code/scripts/setter audio
792   program[brigup] = /home/armaa/Code/scripts/setter brightness +10%
793   program[brigdown] = /home/armaa/Code/scripts/setter brightness 10%-
794   program[next] = playerctl next
795   program[prev] = playerctl previous
796   program[pause] = playerctl play-pause
797
798   bind[padown] = XF86AudioLowerVolume
799   bind[paup] = XF86AudioRaiseVolume
800   bind[pamute] = XF86AudioMute
801   bind[brigdown] = XF86MonBrightnessDown
802   bind[brigup] = XF86MonBrightnessUp
803   bind[pause] = XF86AudioPlay
804   bind[next] = XF86AudioNext
805   bind[prev] = XF86AudioPrev
806 #+end_src
807 **** HJKL
808 #+begin_src conf :tangle ~/.spectrwm.conf
809   program[h] = xdotool keyup h key --clearmodifiers Left
810   program[j] = xdotool keyup j key --clearmodifiers Down
811   program[k] = xdotool keyup k key --clearmodifiers Up
812   program[l] = xdotool keyup l key --clearmodifiers Right
813
814   bind[h] = MOD + Control + h
815   bind[j] = MOD + Control + j
816   bind[k] = MOD + Control + k
817   bind[l] = MOD + Control + l
818 #+end_src
819 **** Programs
820 #+begin_src conf :tangle ~/.spectrwm.conf
821   program[email] = emacsclient -ce '(progn (switch-to-buffer "*scratch*") (mu4e))'
822   program[irc] = emacsclient -ce '(acheam-irc)'
823   program[rss] = emacsclient -ce '(elfeed)'
824   program[calendar] = emacsclient -ce '(acheam-calendar)'
825   program[calc] = emacsclient -ce '(progn (calc) (windmove-up) (delete-window))'
826   program[firefox] = firefox
827   program[emacs] = emacsclient -c
828
829   bind[email] = MOD+Control+1
830   bind[irc] = MOD+Control+2
831   bind[rss] = MOD+Control+3
832   bind[calendar] = MOD+Control+4
833   bind[calc] = MOD+Control+5
834   bind[firefox] = MOD+Control+0
835   bind[emacs] = MOD+Control+Return
836 #+end_src
837 *** Quirks
838 Float some specific programs by default.
839 #+begin_src conf :tangle ~/.spectrwm.conf
840   quirk[Castle Menu] = FLOAT
841   quirk[momen] = FLOAT
842 #+end_src
843 ** Ash
844 *** Options
845 Use the vi editing mode. I still haven't found a good way to show visual feedback of the current mode. Ideally the cursor would change to a beam when in insert mode, and a box when in normal mode.
846 #+begin_src conf :tangle ~/.config/ash/ashrc
847   set -o vi
848 #+end_src
849 *** Functions
850 **** Finger
851 #+begin_src shell :tangle ~/.config/ash/ashrc
852   finger() {
853       user=$(echo "$1" | cut -f 1 -d '@')
854       host=$(echo "$1" | cut -f 2 -d '@')
855       echo $user | nc "$host" 79
856   }
857 #+end_src
858 **** Upload to ftp.armaanb.net
859 #+begin_src shell :tangle ~/.config/ash/ashrc
860   _uprint() {
861       echo "https://l.armaanb.net/$(basename "$1")" | tee /dev/tty | xclip -sel c
862   }
863
864   _uup() {
865       rsync "$1" "root@armaanb.net:/var/ftp/pub/$2" --chmod 644
866   }
867
868   ufile() {
869       _uup "$1" "$2"
870       _uprint "$1"
871   }
872
873   uclip() {
874       tmp=$(mktemp)
875       xclip -o -sel c >> "$tmp"
876       basetmp=$(echo "$tmp" | tail -c +5)
877       _uup "$tmp" "$basetmp"
878       _uprint "$basetmp"
879       rm -f "$tmp"
880   }
881 #+end_src
882 *** Exports
883 #+begin_src shell :tangle ~/.config/ash/ashrc
884   export EDITOR="emacsclient -c"
885   export VISUAL="$EDITOR"
886   export TERM=xterm-256color # for compatability
887
888   export GPG_TTY="$(tty)"
889   export MANPAGER='nvim +Man!'
890   export PAGER='less'
891
892   export GTK_USE_PORTAL=1
893
894   export PATH="/home/armaa/.local/bin:$PATH" # prioritize .local/bin
895   export PATH="/home/armaa/Code/scripts:$PATH" # prioritize my scripts
896   export PATH="/home/armaa/Code/scripts/bin:$PATH" # prioritize my bins
897   export PATH="$PATH:/home/armaa/.cargo/bin"
898   export PATH="$PATH:/home/armaa/.local/share/gem/ruby/2.7.0/bin"
899   export PATH="$PATH:/usr/sbin"
900   export PATH="$PATH:/opt/FreeTube/freetube"
901
902   export LC_ALL="en_US.UTF-8"
903   export LC_CTYPE="en_US.UTF-8"
904   export LANGUAGE="en_US.UTF-8"
905
906   export CDPATH=:~
907
908   export KISS_PATH="/home/armaa/Virtual/kiss/home/armaa/kiss-repo"
909   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/core"
910   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/extra"
911   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/xorg"
912   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/testing"
913   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-community/community"
914   export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
915 #+end_src
916 *** Aliases
917 **** SSH
918 #+begin_src shell :tangle ~/.config/ash/ashrc
919   alias bhoji-drop='ssh -p 23 root@armaanb.net'
920   alias irc='ssh root@armaanb.net -t abduco -A irc catgirl freenode'
921   alias union='ssh 192.168.1.18'
922   alias mine='ssh -p 23 root@pickupserver.cc'
923   alias tcf='ssh root@204.48.23.68'
924   alias ngmun='ssh root@157.245.89.25'
925   alias prox='ssh root@192.168.1.224'
926   alias ncq='ssh root@143.198.123.17'
927   alias envs='ssh acheam@envs.net'
928 #+end_src
929 **** File management
930 #+begin_src shell :tangle ~/.config/ash/ashrc
931   alias ls='LC_COLLATE=C ls -lh --group-directories-first'
932   alias la='ls -A'
933   alias df='df -h / /boot'
934   alias du='du -h'
935   alias free='free -m'
936   alias cp='cp -riv'
937   alias rm='rm -iv'
938   alias mv='mv -iv'
939   alias ln='ln -v'
940   alias grep='grep -in'
941   alias mkdir='mkdir -pv'
942   alias lanex='java -jar ~/.local/share/lxc/lanxchange.jar'
943   emacs() { $EDITOR "$@" & }
944   alias vim="emacs"
945 #+end_src
946 **** System management
947 #+begin_src shell :tangle ~/.config/ash/ashrc
948   alias crontab='crontab-argh'
949   alias sudo='doas'
950   alias pasu='git -C ~/.password-store push'
951   alias yadu='yadm add -u && yadm commit -m "Updated `date -Iseconds`" && \
952     yadm push'
953 #+end_src
954 **** Networking
955 #+begin_src shell :tangle ~/.config/ash/ashrc
956   alias ping='ping -c 10'
957   alias gps='gpg --keyserver keyserver.ubuntu.com --search-keys'
958   alias gpp='gpg --keyserver keyserver.ubuntu.com --recv-key'
959   alias plan='T=$(mktemp) && \
960           rsync root@armaanb.net:/etc/finger/plan.txt "$T" && \
961           TT=$(mktemp) && \
962           head -n -2 $T > $TT && \
963           /bin/nvim $TT && \
964           echo >> "$TT" && \
965           echo "Last updated: $(date -R)" >> "$TT" && \
966           fold -sw 72 "$TT" > "$T"| \
967           rsync "$T" root@armaanb.net:/etc/finger/plan.txt && \
968           rm -f "$T"'
969 #+end_src
970 **** Virtual machines, chroots
971 #+begin_src shell :tangle ~/.config/ash/ashrc
972   alias ckiss="doas chrooter ~/Virtual/kiss"
973   alias cdebian="doas chrooter ~/Virtual/debian bash"
974   alias cwindows='devour qemu-system-x86_64 \
975     -smp 3 \
976     -cpu host \
977     -enable-kvm \
978     -m 3G \
979     -device VGA,vgamem_mb=64 \
980     -device intel-hda \
981     -device hda-duplex \
982     -net nic \
983     -net user,smb=/home/armaa/Public \
984     -drive format=qcow2,file=/home/armaa/Virtual/windows.qcow2'
985 #+end_src
986 **** Latin
987 #+begin_src shell :tangle ~/.config/ash/ashrc
988   alias words='gen-shell -c "words"'
989   alias words-e='gen-shell -c "words ~E"'
990 #+end_src
991 **** Other
992 #+begin_src shell :tangle ~/.config/ash/ashrc
993   alias bigrandomfile='dd if=/dev/urandom of=1GB-urandom bs=1M count=1024 \
994     iflag=fullblock'
995   alias bigboringfile='dd if=/dev/zero of=1GB-zero bs=1M count=1024 \
996     iflag=fullblock'
997   alias ytmusic="youtube-dl -x --add-metadata  --audio-format aac \
998     --restrict-filenames -o '%(title)s.%(ext)s'"
999   alias bc='bc -l'
1000 #+end_src
1001 ** MPV
1002 Make MPV play a little bit smoother.
1003 #+begin_src conf :tangle ~/.config/mpv/mpv.conf
1004   ytdl-format="bestvideo[height<=?1080]+bestaudio/best"
1005   hwdec=auto-copy
1006 #+end_src
1007 ** Inputrc
1008 This file is used for any GNU Readline programs. I use Emacs editing mode mostly because of one annoyance which is that to clear the screen using ^L, you have to be in normal mode which is a pain. If there is a way to rebind this, I'd love to know!.
1009 #+begin_src conf :tangle ~/.inputrc
1010   set editing-mode emacs
1011 #+end_src
1012 ** Git
1013 *** User
1014 #+begin_src conf :tangle ~/.gitconfig
1015   [user]
1016   name = Armaan Bhojwani
1017   email = me@armaanb.net
1018   signingkey = 0FEB9471E19C49C60CFBEB133C9ED82FFE788E4A
1019 #+end_src
1020 *** Init
1021 #+begin_src conf :tangle ~/.gitconfig
1022   [init]
1023   defaultBranch = main
1024 #+end_src
1025 *** GPG
1026 #+begin_src conf :tangle ~/.gitconfig
1027   [gpg]
1028   program = gpg
1029 #+end_src
1030 *** Sendemail
1031 #+begin_src conf :tangle ~/.gitconfig
1032   [sendemail]
1033   smtpserver = smtp.mailbox.org
1034   smtpuser = me@armaanb.net
1035   smtpencryption = ssl
1036   smtpserverport = 465
1037   confirm = auto
1038 #+end_src
1039 *** Submodule
1040 #+begin_src conf :tangle ~/.gitconfig
1041   [submodule]
1042   recurse = true
1043 #+end_src
1044 *** Aliases
1045 #+begin_src conf :tangle ~/.gitconfig
1046   [alias]
1047   stat = diff --stat
1048   sclone = clone --depth 1
1049   sclean = clean -dfX
1050   a = add
1051   aa = add .
1052   c = commit
1053   quickfix = commit . --amend --no-edit
1054   p = push
1055   subup = submodule update --remote
1056   loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 # Empty hash
1057   pushnc = push -o skip-ci
1058 #+end_src
1059 *** Commit
1060 #+begin_src conf :tangle ~/.gitconfig
1061   [commit]
1062   gpgsign = true
1063   verbose = true
1064 #+end_src
1065 ** Dunst
1066 Lightweight notification daemon. Eventually I'd like to replace this with something dbus-less.
1067 *** General
1068 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1069   [global]
1070   font = "JetBrains Mono Medium Nerd Font 11"
1071   allow_markup = yes
1072   format = "<b>%s</b>\n%b"
1073   sort = no
1074   indicate_hidden = yes
1075   alignment = center
1076   bounce_freq = 0
1077   show_age_threshold = 60
1078   word_wrap = yes
1079   ignore_newline = no
1080   geometry = "400x5-10+10"
1081   transparency = 0
1082   idle_threshold = 120
1083   monitor = 0
1084   sticky_history = yes
1085   line_height = 0
1086   separator_height = 1
1087   padding = 8
1088   horizontal_padding = 8
1089   max_icon_size = 32
1090   separator_color = "#ffffff"
1091   startup_notification = false
1092 #+end_src
1093 *** Modes
1094 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1095   [frame]
1096   width = 1
1097   color = "#ffffff"
1098
1099   [shortcuts]
1100   close = mod4+c
1101   close_all = mod4+shift+c
1102   history = mod4+ctrl+c
1103
1104   [urgency_low]
1105   background = "#222222"
1106   foreground = "#ffffff"
1107   highlight = "#ffffff"
1108   timeout = 5
1109
1110   [urgency_normal]
1111   background = "#222222"
1112   foreground = "#ffffff"
1113   highlight = "#ffffff"
1114   timeout = 15
1115
1116   [urgency_critical]
1117   background = "#222222"
1118   foreground = "#a60000"
1119   highlight = "#ffffff"
1120   timeout = 0
1121 #+end_src
1122 ** Zathura
1123 The best document reader!
1124 *** Options
1125 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1126   map <C-i> recolor
1127   map <A-b> toggle_statusbar
1128   set selection-clipboard clipboard
1129   set scroll-step 200
1130
1131   set window-title-basename "true"
1132   set selection-clipboard "clipboard"
1133 #+end_src
1134 *** Colors
1135 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1136   set default-bg         "#000000"
1137   set default-fg         "#ffffff"
1138   set render-loading     true
1139   set render-loading-bg  "#000000"
1140   set render-loading-fg  "#ffffff"
1141
1142   set recolor-lightcolor "#000000" # bg
1143   set recolor-darkcolor  "#ffffff" # fg
1144   set recolor            "true"
1145 #+end_src
1146 ** Firefox
1147 Just some basic Firefox CSS. Will probably have to rewrite for the Proton redesign.
1148 *** Swap tab and URL bars
1149 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1150   #nav-bar {
1151       -moz-box-ordinal-group: 1 !important;
1152   }
1153
1154   #PersonalToolbar {
1155       -moz-box-ordinal-group: 2 !important;
1156   }
1157
1158   #titlebar {
1159       -moz-box-ordinal-group: 3 !important;
1160   }
1161 #+end_src
1162 *** Hide URL bar when not focused.
1163 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1164   #navigator-toolbox:not(:focus-within):not(:hover) {
1165       margin-top: -30px;
1166   }
1167
1168   #navigator-toolbox {
1169       transition: 0.1s margin-top ease-out;
1170   }
1171 #+end_src
1172 *** Black screen by default
1173 userChrome.css:
1174 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1175   #main-window,
1176   #browser,
1177   #browser vbox#appcontent tabbrowser,
1178   #content,
1179   #tabbrowser-tabpanels,
1180   #tabbrowser-tabbox,
1181   browser[type="content-primary"],
1182   browser[type="content"] > html,
1183   .browserContainer {
1184       background: black !important;
1185       color: #fff !important;
1186   }
1187 #+end_src
1188
1189 userContent.css:
1190 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css
1191   @-moz-document url("about:home"), url("about:blank"), url("about:newtab") {
1192       body {
1193           background: black !important;
1194       }
1195   }
1196 #+end_src
1197 ** Xresources
1198 Modus operandi theme. No program I use checks for anything beyond foreground and background, but hey, it can't hurt to have all the colors in there.
1199 #+begin_src conf :tangle ~/.Xresources
1200   ! special
1201   ,*.foreground:   #ffffff
1202   ,*.background:   #000000
1203   ,*.cursorColor:  #ffffff
1204
1205   ! black
1206   ,*.color0:       #000000
1207   ,*.color8:       #555555
1208
1209   ! red
1210   ,*.color1:       #ff8059
1211   ,*.color9:       #ffa0a0
1212
1213   ! green
1214   ,*.color2:       #00fc50
1215   ,*.color10:      #88cf88
1216
1217   ! yellow
1218   ,*.color3:       #eecc00
1219   ,*.color11:      #d2b580
1220
1221   ! blue
1222   ,*.color4:       #29aeff
1223   ,*.color12:      #92baff
1224
1225   ! magenta
1226   ,*.color5:       #feacd0
1227   ,*.color13:      #e0b2d6
1228
1229   ! cyan
1230   ,*.color6:       #00d3d0
1231   ,*.color14:      #a0bfdf
1232
1233   ! white
1234   ,*.color7:       #eeeeee
1235   ,*.color15:      #dddddd
1236 #+end_src
1237 ** Tmux
1238 I use tmux in order to keep my st build light. Still learning how it works.
1239 #+begin_src conf :tangle ~/.tmux.conf
1240   set -g status off
1241   set -g mouse on
1242   set-option -g history-limit 50000
1243   set-window-option -g mode-keys vi
1244   bind-key -T copy-mode-vi 'v' send -X begin-selection
1245   bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
1246 #+end_src
1247 ** GPG
1248 *** Config
1249 #+begin_src conf :tangle ~/.gnupg/gpg.conf
1250   default-key 3C9ED82FFE788E4A
1251   use-agent
1252 #+end_src
1253 *** Agent
1254 #+begin_src conf :tangle ~/.gnupg/gpg-agent.conf
1255   pinentry-program /sbin/pinentry-gnome3
1256   max-cache-ttl 600
1257   default-cache-ttl 600
1258   allow-emacs-pinentry
1259 #+end_src
1260 ** Xmodmap
1261 #+begin_src conf :tangle ~/.config/xmodmap
1262   !
1263   ! Unmap left super
1264   !
1265   clear mod4
1266
1267   !
1268   ! Turn right alt into super
1269   !
1270   remove mod1 = Alt_R
1271   add mod4 = Alt_R
1272
1273   !
1274   ! Swap caps and control
1275   !
1276   remove Lock = Caps_Lock
1277   remove Control = Control_L
1278   remove Lock = Control_L
1279   remove Control = Caps_Lock
1280   keysym Control_L = Caps_Lock
1281   keysym Caps_Lock = Control_L
1282   add Lock = Caps_Lock
1283   add Control = Control_L
1284 #+end_src