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