From 0f308b1c90444f5f0293bf40aa1ef177bc51036c Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Fri, 30 Dec 2022 10:54:17 +0100 Subject: Reorganise Guix home declaration into module tree --- tw/home/files/XCompose | 161 +++ tw/home/files/Xresources | 13 + tw/home/files/catppuccin/dunst | 1 + tw/home/files/catppuccin/emacs | 1 + tw/home/files/catppuccin/kde | 1 + tw/home/files/catppuccin/kitty | 1 + tw/home/files/catppuccin/neomutt | 1 + tw/home/files/catppuccin/newsboat | 1 + tw/home/files/catppuccin/polybar | 1 + tw/home/files/catppuccin/rofi | 1 + tw/home/files/catppuccin/zathura | 1 + tw/home/files/cursors.ini | 4 + tw/home/files/dunstrc | 98 ++ tw/home/files/emacs-init.el | 565 +++++++++ tw/home/files/emacs-packages/actionlint.el | 34 + tw/home/files/emacs-packages/alidist-mode.el | 162 +++ tw/home/files/emacs-packages/bemscript-mode.el | 92 ++ tw/home/files/emacs-packages/environmentd-mode.el | 46 + tw/home/files/emacs-packages/ifm-mode.el | 18 + tw/home/files/emacs-packages/org-latex-classes.el | 54 + tw/home/files/emacs-packages/pam-env-mode.el | 45 + tw/home/files/emacs-packages/vcard-mode.el | 56 + tw/home/files/gitconfig | 43 + tw/home/files/gpg-agent.conf | 4 + tw/home/files/gpg.conf | 142 +++ tw/home/files/gtk2.ini | 20 + tw/home/files/gtk3.ini | 16 + tw/home/files/htoprc | 59 + tw/home/files/i3.conf | 250 ++++ tw/home/files/khal.conf | 39 + tw/home/files/khard.conf | 22 + tw/home/files/kitty.conf | 1337 +++++++++++++++++++++ tw/home/files/lesskey | 33 + tw/home/files/mailcap | 10 + tw/home/files/muttrc | 173 +++ tw/home/files/neomutt | 1 + tw/home/files/newsboat.conf | 29 + tw/home/files/passmenu | 91 ++ tw/home/files/picom.conf | 304 +++++ tw/home/files/polybar.ini | 235 ++++ tw/home/files/prompt.zsh | 128 ++ tw/home/files/ranger.conf | 52 + tw/home/files/rofi.rasi | 41 + tw/home/files/sessionmenu | 29 + tw/home/files/user-dirs.dirs | 15 + tw/home/files/vdirsyncer.conf | 77 ++ tw/home/files/vim-keys.muttrc | 36 + tw/home/files/volume | 60 + tw/home/files/zathurarc | 32 + tw/home/files/zshrc | 168 +++ tw/home/lap.scm | 697 +++++++++++ 51 files changed, 5500 insertions(+) create mode 100644 tw/home/files/XCompose create mode 100644 tw/home/files/Xresources create mode 160000 tw/home/files/catppuccin/dunst create mode 160000 tw/home/files/catppuccin/emacs create mode 160000 tw/home/files/catppuccin/kde create mode 160000 tw/home/files/catppuccin/kitty create mode 160000 tw/home/files/catppuccin/neomutt create mode 160000 tw/home/files/catppuccin/newsboat create mode 160000 tw/home/files/catppuccin/polybar create mode 160000 tw/home/files/catppuccin/rofi create mode 160000 tw/home/files/catppuccin/zathura create mode 100644 tw/home/files/cursors.ini create mode 100644 tw/home/files/dunstrc create mode 100644 tw/home/files/emacs-init.el create mode 100644 tw/home/files/emacs-packages/actionlint.el create mode 100644 tw/home/files/emacs-packages/alidist-mode.el create mode 100644 tw/home/files/emacs-packages/bemscript-mode.el create mode 100644 tw/home/files/emacs-packages/environmentd-mode.el create mode 100644 tw/home/files/emacs-packages/ifm-mode.el create mode 100644 tw/home/files/emacs-packages/org-latex-classes.el create mode 100644 tw/home/files/emacs-packages/pam-env-mode.el create mode 100644 tw/home/files/emacs-packages/vcard-mode.el create mode 100644 tw/home/files/gitconfig create mode 100644 tw/home/files/gpg-agent.conf create mode 100644 tw/home/files/gpg.conf create mode 100644 tw/home/files/gtk2.ini create mode 100644 tw/home/files/gtk3.ini create mode 100644 tw/home/files/htoprc create mode 100644 tw/home/files/i3.conf create mode 100644 tw/home/files/khal.conf create mode 100644 tw/home/files/khard.conf create mode 100644 tw/home/files/kitty.conf create mode 100644 tw/home/files/lesskey create mode 100644 tw/home/files/mailcap create mode 100644 tw/home/files/muttrc create mode 160000 tw/home/files/neomutt create mode 100644 tw/home/files/newsboat.conf create mode 100755 tw/home/files/passmenu create mode 100644 tw/home/files/picom.conf create mode 100644 tw/home/files/polybar.ini create mode 100644 tw/home/files/prompt.zsh create mode 100644 tw/home/files/ranger.conf create mode 100644 tw/home/files/rofi.rasi create mode 100755 tw/home/files/sessionmenu create mode 100644 tw/home/files/user-dirs.dirs create mode 100644 tw/home/files/vdirsyncer.conf create mode 100644 tw/home/files/vim-keys.muttrc create mode 100755 tw/home/files/volume create mode 100644 tw/home/files/zathurarc create mode 100644 tw/home/files/zshrc create mode 100644 tw/home/lap.scm (limited to 'tw/home') diff --git a/tw/home/files/XCompose b/tw/home/files/XCompose new file mode 100644 index 00000000..cb73e833 --- /dev/null +++ b/tw/home/files/XCompose @@ -0,0 +1,161 @@ +# -*- mode: conf-colon -*- +## Locale defaults +include "%S/en_US.UTF-8/Compose" +# This file apparently doesn't exist for all locales, including en_GB. +# Most useful things live in en_US, included above. +include "%L" + +## Dashes + : "–" U2013 # EN DASH + : "–" U2013 # EN DASH + : "–" U2013 # EN DASH + : "—" U2014 # EM DASH + : "—" U2014 # EM DASH + <1> : "—" U2014 # EM DASH + <2> : "⸺" U2E3A # TWO-EM DASH + <3> : "⸻" U2E3B # THREE-EM DASH + : "―" U2015 # HORIZONTAL BAR + : "―" U2015 # HORIZONTAL BAR + +## Mathematical operators + : "−" U2212 # MINUS SIGN + : "−" U2212 # MINUS SIGN + : "≡" U2261 # IDENTICAL TO + : "≢" U2262 # NOT IDENTICAL TO + : "≈" U2248 # ALMOST EQUAL TO + : "≃" similarequal # ASYMPTOTICALLY EQUAL TO + : "≃" similarequal # ASYMPTOTICALLY EQUAL TO + : "≲" U2272 # LESS-THAN OR EQUIVALENT TO + : "≲" U2272 # LESS-THAN OR EQUIVALENT TO + : "≳" U2273 # GREATER-THAN OR EQUIVALENT TO + : "≳" U2273 # GREATER-THAN OR EQUIVALENT TO + : "↚" U219A # LEFTWARDS ARROW WITH STROKE + : "↛" U219B # RIGHTWARDS ARROW WITH STROKE + : "↮" U21AE # LEFT RIGHT ARROW WITH STROKE + : "∄" U2204 # THERE DOES NOT EXIST + : "∉" U2209 # NOT AN ELEMENT OF + : "∌" U220C # DOES NOT CONTAIN AS MEMBER + : "∤" U2224 # DOES NOT DIVIDE + : "∤" U2224 # DOES NOT DIVIDE + : "∦" U2226 # NOT PARALLEL TO + : "∦" U2226 # NOT PARALLEL TO + : "≁" U2241 # NOT TILDE + : "≁" U2241 # NOT TILDE + +## Symbols + : "⌀" U2300 # DIAMETER SIGN +# Note: also defined as , but that's hard to remember! + : "№" numerosign # NUMERO SIGN +# is already reserved for Ō + : "⊖" U2296 # ○ - CIRCLED MINUS +# is already reserved for Ȯ + : "⊙" U2299 # ○ - CIRCLED DOT + +## Whitespace + : " " U00A0 # NO-BREAK SPACE (~) + : " " U2002 # EN SPACE (\enspace) + : " " U2003 # EM SPACE (\quad) + <3> : " " U2004 # THREE-PER-EM SPACE + <4> : " " U2005 # FOUR-PER-EM SPACE + <6> : " " U2006 # SIX-PER-EM SPACE + : " " U2007 # FIGURE SPACE +

: " " U2008 # PUNCTUATION SPACE + : " " U2009 # THIN SPACE (\,) + : " " U200A # HAIR SPACE + : " " U205F # MEDIUM MATHEMATICAL SPACE (may be used around operators) + +## Greek uppercase + : "Α" U0391 + : "Β" U0392 + : "Γ" U0393 + : "Δ" U0394 + : "Ε" U0395 + : "Ζ" U0396 + : "Η" U0397 + : "Θ" U0398 + : "Ι" U0399 + : "Κ" U039A + : "Λ" U039B + : "Μ" U039C + : "Ν" U039D + : "Ξ" U039E + : "Ο" U039F +

: "Π" U03A0 + : "Ρ" U03A1 + : "Σ" U03A3 + : "Τ" U03A4 + : "Υ" U03A5 + : "Φ" U03A6 + : "Χ" U03A7 + : "Ψ" U03A8 + : "Ω" U03A9 + +## Greek lowercase + : "α" U03B1 + : "β" U03B2 + : "γ" U03B3 + : "δ" U03B4 + : "ε" U03B5 + : "ζ" U03B6 + : "η" U03B7 + : "θ" U03B8 + : "ι" U03B9 + : "κ" U03BA + : "λ" U03BB + : "μ" U03BC + : "ν" U03BD + : "ξ" U03BE + : "ο" U03BF +

: "π" U03C0 + : "ρ" U03C1 + : "ς" U03C2 + : "σ" U03C3 + : "τ" U03C4 + : "υ" U03C5 + : "φ" U03C6 + : "ɸ" U03D5 + : "χ" U03C7 + : "ψ" U03C8 + : "ω" U03C9 + +## Weird symbols +# TODO: give these typeable names! + : "≄" U2244 # NOT ASYMPTOTICALLY EQUAL TO + : "≇" U2247 # NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO + : "≉" U2249 # NOT ALMOST EQUAL TO + : "≭" U226D # NOT EQUIVALENT TO + : "≮" U226E # NOT LESS-THAN + : "≮" U226E # NOT LESS-THAN + : "≯" U226F # NOT GREATER-THAN + : "≯" U226F # NOT GREATER-THAN + : "≰" U2270 # NEITHER LESS-THAN NOR EQUAL TO + : "≱" U2271 # NEITHER GREATER-THAN NOR EQUAL TO + : "≴" U2274 # NEITHER LESS-THAN NOR EQUIVALENT TO + : "≵" U2275 # NEITHER GREATER-THAN NOR EQUIVALENT TO + : "≸" U2278 # NEITHER LESS-THAN NOR GREATER-THAN + : "≹" U2279 # NEITHER GREATER-THAN NOR LESS-THAN + : "⊀" U2280 # DOES NOT PRECEDE + : "⊁" U2281 # DOES NOT SUCCEED + : "⊄" U2284 # NOT A SUBSET OF + : "⊄" U2284 # NOT A SUBSET OF + : "⊅" U2285 # NOT A SUPERSET OF + : "⊅" U2285 # NOT A SUPERSET OF + : "⊈" U2288 # NEITHER A SUBSET OF NOR EQUAL TO + : "⊉" U2289 # NEITHER A SUPERSET OF NOR EQUAL TO + : "⊬" U22AC # DOES NOT PROVE + : "⊭" U22AD # NOT TRUE + : "⊮" U22AE # DOES NOT FORCE + : "⊯" U22AF # NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE + : "⋠" U22E0 # DOES NOT PRECEDE OR EQUAL + : "⋡" U22E1 # DOES NOT SUCCEED OR EQUAL + : "⋢" U22E2 # NOT SQUARE IMAGE OF OR EQUAL TO + : "⋣" U22E3 # NOT SQUARE ORIGINAL OF OR EQUAL TO + : "⋪" U22EA # NOT NORMAL SUBGROUP OF + : "⋫" U22EB # DOES NOT CONTAIN AS NORMAL SUBGROUP + : "⋬" U22EC # NOT NORMAL SUBGROUP OF OR EQUAL TO + : "⋭" U22ED # DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL + : "⫝̸" U2ADC # FORKING + : "⊆" U2286 # _ ⊂ SUBSET OF OR EQUAL TO + : "⊆" U2286 # ⊂ _ SUBSET OF OR EQUAL TO + : "⊇" U2287 # _ ⊃ SUPERSET OF OR EQUAL TO + : "⊇" U2287 # ⊃ _ SUPERSET OF OR EQUAL TO diff --git a/tw/home/files/Xresources b/tw/home/files/Xresources new file mode 100644 index 00000000..ba534392 --- /dev/null +++ b/tw/home/files/Xresources @@ -0,0 +1,13 @@ +!! ~/.Xresources: X resources and settings + +*TkTheme: clam + +Xft.antialias: true +Xft.dpi: 96 +Xft.hinting: true +Xft.hintstyle: hintfull +Xft.lcdfilter: lcddefault +Xft.rgba: rgb + +Xcursor.theme: Catppuccin-Mocha-Dark-Cursors +Xcursor.size: 16 diff --git a/tw/home/files/catppuccin/dunst b/tw/home/files/catppuccin/dunst new file mode 160000 index 00000000..a72991e5 --- /dev/null +++ b/tw/home/files/catppuccin/dunst @@ -0,0 +1 @@ +Subproject commit a72991e56338289a9fce941b5df9f0509d2cba09 diff --git a/tw/home/files/catppuccin/emacs b/tw/home/files/catppuccin/emacs new file mode 160000 index 00000000..b4be30de --- /dev/null +++ b/tw/home/files/catppuccin/emacs @@ -0,0 +1 @@ +Subproject commit b4be30de73aa295ab56a20c21dff07fba3dec05e diff --git a/tw/home/files/catppuccin/kde b/tw/home/files/catppuccin/kde new file mode 160000 index 00000000..d95dd080 --- /dev/null +++ b/tw/home/files/catppuccin/kde @@ -0,0 +1 @@ +Subproject commit d95dd080b3e6a064390aceb8af0a6dc9506a40c0 diff --git a/tw/home/files/catppuccin/kitty b/tw/home/files/catppuccin/kitty new file mode 160000 index 00000000..43b08da1 --- /dev/null +++ b/tw/home/files/catppuccin/kitty @@ -0,0 +1 @@ +Subproject commit 43b08da1e1168aff2edb74105f293a90b4567c44 diff --git a/tw/home/files/catppuccin/neomutt b/tw/home/files/catppuccin/neomutt new file mode 160000 index 00000000..f6ce83da --- /dev/null +++ b/tw/home/files/catppuccin/neomutt @@ -0,0 +1 @@ +Subproject commit f6ce83da47cc36d5639b0d54e7f5f63cdaf69f11 diff --git a/tw/home/files/catppuccin/newsboat b/tw/home/files/catppuccin/newsboat new file mode 160000 index 00000000..be3d0ee1 --- /dev/null +++ b/tw/home/files/catppuccin/newsboat @@ -0,0 +1 @@ +Subproject commit be3d0ee1ba0fc26baf7a47c2aa7032b7541deb0f diff --git a/tw/home/files/catppuccin/polybar b/tw/home/files/catppuccin/polybar new file mode 160000 index 00000000..9ee66f83 --- /dev/null +++ b/tw/home/files/catppuccin/polybar @@ -0,0 +1 @@ +Subproject commit 9ee66f83335404186ce979bac32fcf3cd047396a diff --git a/tw/home/files/catppuccin/rofi b/tw/home/files/catppuccin/rofi new file mode 160000 index 00000000..62a78eaf --- /dev/null +++ b/tw/home/files/catppuccin/rofi @@ -0,0 +1 @@ +Subproject commit 62a78eaf0e12b69b75fdee9def6d333cebcb74a0 diff --git a/tw/home/files/catppuccin/zathura b/tw/home/files/catppuccin/zathura new file mode 160000 index 00000000..d85d8750 --- /dev/null +++ b/tw/home/files/catppuccin/zathura @@ -0,0 +1 @@ +Subproject commit d85d8750acd0b0247aa10e0653998180391110a4 diff --git a/tw/home/files/cursors.ini b/tw/home/files/cursors.ini new file mode 100644 index 00000000..c4eb9cdb --- /dev/null +++ b/tw/home/files/cursors.ini @@ -0,0 +1,4 @@ +[Icon Theme] +Name=Default +Comment=Default Cursor Theme +Inherits=Catppuccin-Mocha-Dark-Cursors diff --git a/tw/home/files/dunstrc b/tw/home/files/dunstrc new file mode 100644 index 00000000..c64d374f --- /dev/null +++ b/tw/home/files/dunstrc @@ -0,0 +1,98 @@ +# See dunst(5) for all configuration options -*- mode: conf -*- + +[global] + ### Display ### + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = mouse + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = 300 + + # The maximum height of a single notification, excluding the frame. + height = 300 + + # Offset from the origin + # Leave 24pt space for polybar. + offset = 16x40 + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + idle_threshold = 120 + + ### Text ### + + font = Fira Sans 12 + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + # format = "%s\n%b" + format = "%a %p\n%s\n%b" + + ### Icons ### + + # Recursive icon lookup. You can set a single theme, instead of having to + # define all lookup paths. + enable_recursive_icon_lookup = true + + # Set icon theme (only used for recursive icon lookup) + # You can also set multiple icon themes, with the leftmost one being used first. + # icon_theme = "Adwaita, breeze" + icon_theme = "Papirus-Dark, hicolor" + + ### History ### + + # Maximum amount of notifications kept in history + history_length = 100 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/env rofi -dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/env xdg-open + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el new file mode 100644 index 00000000..daf6f737 --- /dev/null +++ b/tw/home/files/emacs-init.el @@ -0,0 +1,565 @@ +;;; init.el --- Emacs configuration. -*- lexical-binding: t -*- +;;; Commentary: +;;; Code: + +;; Load settings set through Custom. +;; (setq custom-file (locate-user-emacs-file "custom.el")) +;; (when (file-readable-p custom-file) +;; (load custom-file)) + +(defun tw/xdg-emacs-subdir (type name) + "Get the name of a subdirectory called NAME under $XDG__HOME/emacs." + (expand-file-name + (concat "emacs/" (string-trim-right name "/") "/") + (pcase type + ('cache (or (getenv "XDG_CACHE_HOME") "~/.cache/")) + ('config (or (getenv "XDG_CONFIG_HOME") "~/.config/")) + ('data (or (getenv "XDG_DATA_HOME") "~/.local/share/")) + ;; The following two are Guix/GuixSD extensions. + ('log (or (getenv "XDG_LOG_HOME") "~/.local/var/log/")) + ('state (or (getenv "XDG_STATE_HOME") "~/.local/var/lib/")) + (_ (error "Unknown XDG directory type: %S" type))))) + +;; Global/built-in Custom settings +;; Apply these as early as possible so that e.g. the native-comp files go to the right place. +(mapc (apply-partially #'apply #'customize-set-variable) + `((native-comp-async-report-warnings-errors silent "Don't pop up Warnings buffer for native compilation.") + (native-compile-target-directory ,(tw/xdg-emacs-subdir 'cache "eln") "Put native-compiled binaries in the cache.") + ;; Emacs GUI customization. + (inhibit-startup-screen t "Don't show the startup screen with help links.") + (menu-bar-mode nil "Hide the menu bar globally.") + (tool-bar-mode nil "Hide the tool bar globally.") + (tooltip-mode nil "Show tooltips in the echo area instead.") + (max-mini-window-height 3 "Let the echo area grow to a maximum of 3 lines, e.g. when using `eldoc-mode'.") + (scroll-up-aggressively 0.0 "Don't recenter the window if the point moves off the page.") + (scroll-down-aggressively 0.0 "Don't recenter the window if the point moves off the page.") + ;; Indentation. + (indent-tabs-mode nil "Always use spaces to indent.") + ;; Niceties. + (global-hl-line-mode t "Highlight the current line in all buffers.") + (column-number-mode t "Show the column number in the statusline.") + (electric-pair-mode t "Auto-pair suitable characters like parentheses.") + (completion-cycle-threshold 6 "Allow cycling through completions if there are 6 or fewer of them."))) + +(defalias 'yes-or-no-p #'y-or-n-p + "Always use `y-or-n-p' when asking for confirmation.") + +;; Custom modes depending on file names. +(mapc (apply-partially #'add-to-list 'auto-mode-alist) + `((,(rx (or bos "/") "PKGBUILD" eos) . sh-mode) + (,(rx ".install" eos) . sh-mode) + (,(rx bos "/tmp/neomutt-") . mail-mode) + (,(rx "." (1+ anything) "rc" eos) . conf-unix-mode))) + +(add-to-list 'magic-mode-alist + `(,(rx "#!" (* (not space)) + (? "env" (+ space) (? "-S" (+ space))) + (or "guile" "racket")) + . scheme-mode)) + +(add-hook 'mail-mode-hook #'auto-fill-mode) + +;; `use-package' requirements. +(require 'package) +(package-initialize t) +(eval-when-compile + (require 'use-package)) +(use-package diminish) ; for using :diminish later +(use-package bind-key) ; for using :bind later + +;; Some packages below have `:commands (...) :demand t'. +;; We need :commands for the byte-compiler, but we want to load the package immediately. + +;; Look and feel +(set-face-attribute 'default nil :family "Hermit" :height 100) + +(use-package autothemer + ;; The "catppuccin" theme is linked to the appropriate variant by guix home. + :config (load-theme 'catppuccin-mocha t)) + +(defun tw/get-catppuccin-color (name) + "Get the hex code of the Catppuccin color named NAME." + (cl-loop for color in (autothemer--theme-colors autothemer-current-theme) + when (string= (autothemer--color-name color) name) + return (autothemer--color-value color))) + +(custom-set-faces + `(cursor ((default :background ,(tw/get-catppuccin-color "rosewater"))) t + "Make the cursor \"rosewater\", as recommended by Catppuccin upstream, overriding catppuccin/emacs.")) + +(use-package smart-mode-line + :commands (sml/setup) :demand t + :custom + (sml/no-confirm-load-theme t "Stop Emacs from constantly asking for user confirmation.") + (sml/mode-width 'right "Move the minor-mode list to the right of the modeline.") + (sml/theme 'respectful "Make `smart-mode-line' blend in with the active theme.") + :config (sml/setup)) + +;; Built-in Emacs stuff. +(use-package package + :custom + (package-archives nil "Don't fetch packages from the internet; only get them from Guix.")) + +(use-package recentf + :custom + (recentf-max-saved-items 1000 "Save lots of recently-opened files.") + (recentf-save-file ,(tw/xdg-emacs-subdir 'data "recentf") "Save recently-opened files here.") + (recentf-mode t "Save recently-opened files.")) + +(use-package savehist + :custom + (savehist-file ,(tw/xdg-emacs-subdir 'data "history") "Save minibuffer history here.") + (savehist-mode t "Save minibuffer history on quit.")) + +(use-package files + :custom + (backup-directory-alist `(("." . ,(tw/xdg-emacs-subdir 'data "backup"))) + "Save all backup files in one place to avoid clutter.")) + +;; General editor behaviour. +(use-package ivy + :commands (ivy-mode) :demand t + :custom + (ivy-use-selectable-prompt t "Allow selecting the ivy input as-is.") + (ivy-use-virtual-buffers t "Show recentf and bookmarks in buffers list.") + :config (ivy-mode +1) + :diminish ivy-mode) + +(use-package counsel ; extra niceties for `ivy-mode' + :after (ivy evil) ; evil for :bind-ing to + :bind (("SPC" . counsel-M-x) ; doesn't work + ("fr" . counsel-buffer-or-recentf) + :map evil-visual-state-map + ("SPC" . counsel-M-x)) + :commands (counsel-mode) :demand t + :config (counsel-mode +1) + :diminish counsel-mode) + +(defun tw/counsel-dash-is-help () + "Install `counsel-dash-at-point' as `evil-lookup-func'." + (setq-local evil-lookup-func #'counsel-dash-at-point)) + +(use-package counsel-dash + :bind (("K" . counsel-dash-at-point) ; TODO: just install as `evil-lookup-func'? + ("dK" . counsel-dash) + ("di" . counsel-dash-install-docset) + ("da" . counsel-dash-activate-docset) + ("dd" . counsel-dash-deactivate-docset)) + :hook (python-mode . tw/counsel-dash-is-help) + :custom + (counsel-dash-docsets-path (tw/xdg-emacs-subdir 'data "dash-docsets") "Store docsets in the XDG data directory.") + (counsel-dash-browser-func 'eww "Open documentation pages using `eww' instead of an external browser.") + (counsel-dash-enable-debugging nil "Disable popping up useless warnings.")) + +(use-package rainbow-mode + :after (evil) + :bind (("tR" . rainbow-mode))) + +(use-package display-line-numbers + ;; Included in Emacs >= 26. Better than `linum-mode'. + ;; There is also `global-display-line-numbers-mode', but that also + ;; enables line numbers in help windows, which I don't want. + :hook (prog-mode conf-mode)) + +(use-package which-key + :commands (which-key-mode) :demand t + :config (which-key-mode +1) + :diminish which-key-mode) + +(use-package undo-tree + :after (evil) ; for our :bind-ing + :bind (("U" . undo-tree-visualize)) + :custom + (undo-tree-history-directory-alist + `(("." . ,(tw/xdg-emacs-subdir 'data "undo-tree-history"))) + "Store all `undo-tree' history in a single directory, instead of next to the associated file.") + :commands (global-undo-tree-mode) + :demand t ; this is required so that the :config stanza is actually run asap despite :bind + :config (global-undo-tree-mode +1)) + +;; IDE-like features. +(use-package vc + :after (which-key evil) + :init (which-key-add-key-based-replacements + "g" '("vc" . "Version control") + "gM" '("merge" . "Version control merging")) + :bind-keymap ("g" . vc-prefix-map)) + +(use-package corfu ; https://github.com/minad/corfu + :hook (prog-mode ledger-mode shell-mode eshell-mode) + :custom + (corfu-auto t "Show completion popup after a few seconds automatically.") + :diminish corfu-mode) + +(use-package corfu-doc + :after (corfu) + :hook (corfu-mode) + :diminish corfu-doc-mode) + +(use-package flyspell + :hook mail-mode) + +(use-package flymake + :after (evil which-key) + :hook prog-mode + :init (which-key-add-key-based-replacements + "e" '("errors" . "Flymake")) + :bind (("eb" . flymake-start) + ("el" . flymake-show-buffer-diagnostics) + ("ep" . flymake-show-project-diagnostics) + ("e." . display-local-help) ; Show the error message at point in the minibuffer. + ; `flymake' also shows it using `eldoc', but documentation + ; seems to override error messages. + ("en" . flymake-goto-next-error) + ("eN" . flymake-goto-prev-error)) + :custom + (flymake-suppress-zero-counters nil "Show severity counters even when they are zero.")) + +(use-package flymake-collection + :after (flymake) + ;; This needs to be called in `after-init-hook' so that all other + ;; packages' `:flymake-hook's are processed before f-c-hook-setup is + ;; called. See https://github.com/mohkale/flymake-collection. + :hook (after-init . flymake-collection-hook-setup)) + +;; Language Server Protocol. +(defun tw/help-is-eldoc (&rest _) + "Set up `evil-lookup-func' to display the `eldoc' buffer." + (setq-local evil-lookup-func #'eldoc-doc-buffer)) + +(use-package eglot + ;; I have clang (for clangd) and python-lsp-server installed. + ;; `:hook' adds `-mode' to the package name, but `eglot-mode' doesn't exist. + :hook ((python-mode c-mode c++-mode) . eglot) + :custom + (eglot-autoshutdown t "Shut down language servers after deleting their last associated buffer.") + (eglot-sync-connect 0.1 "Wait for the language server in the background if it takes longer than 100ms.") + :config + ;; TODO: only run `tw/help-is-eldoc' if `eglot-managed-p' is true. + (add-hook 'eglot-managed-mode-hook #'tw/help-is-eldoc)) + +;; Non-LSP language modes. +(use-package cmake-mode + :mode (rx (or (: (or bos "/") "CMakeLists.txt") ".cmake") eos)) + +(use-package gnuplot + :commands (gnuplot-mode gnuplot-make-buffer) + :mode ((rx ".gnuplot" eos) . gnuplot-mode)) + +(use-package graphviz-dot-mode + :mode (rx ".dot" eos) + :custom (graphviz-dot-view-command "xdot %s" "Use xdot for previewing graphviz files.")) + +(use-package hcl-mode + :mode (rx "." (or "hcl" "nomad") eos)) + +(use-package mmm-mode + :commands (mmm-mode)) + +(use-package puppet-mode + :mode (rx ".pp" eos)) + +(use-package python + :commands (python-mode) + :mode (((rx ".py" (? (or ?\i ?\w)) eos) . python-mode) + ((rx ".aurora" eos) . python-mode))) + +(use-package rec-mode + :mode (rx ".rec" eos)) + +(use-package sh-script ; built-in + :custom (sh-basic-offset 2 "Use 2 spaces for `sh-mode' indents.")) + +(use-package tcl + :mode ((rx ".tcl" eos) . tcl-mode) + :magic ((rx "#%Module1.0") . tcl-mode)) + +(use-package web-mode + :mode (rx "." (or "htm" "html" "js" "css" "scss") eos)) + +(use-package yaml-mode + :mode (rx ".y" (? "a") "ml" eos)) + +(use-package ledger-mode + :mode (rx ".journal" eos) + :custom + (ledger-default-date-format ledger-iso-date-format "Use hledger-style dates.") + (ledger-reconcile-default-date-format ledger-iso-date-format "Use hledger-style dates.") + (ledger-reconcile-default-commodity "€" "Make euros the default currency.") + (ledger-post-account-alignment-column 2 "Use 2-space indents.") + (ledger-post-amount-alignment-at :decimal "Align amounts at decimal points/commas.") + (ledger-post-amount-alignment-column 52 "Align amounts' decimal points to the 52nd column.") + (ledger-highlight-xact-under-point nil "Don't highlight the transaction at point.")) + +(use-package geiser + :after (evil) + :commands (geiser geiser-eval-buffer geiser-eval-definition geiser-eval-region geiser-eval-last-sexp) + :hook (scheme-mode . geiser-autodoc-mode) + :config + (evil-define-key '(normal visual) scheme-mode-map + (kbd "i") #'geiser + (kbd "eb") #'geiser-eval-buffer + (kbd "ef") #'geiser-eval-definition + (kbd "er") #'geiser-eval-region + (kbd "el") #'geiser-eval-last-sexp) + :defines scheme-mode-map) + +(use-package geiser-racket + :after (geiser)) +(use-package geiser-guile + :after (geiser)) + +;; Org-mode +(use-package org) +(use-package ob ; org-babel + :after (org)) + +(use-package outline + :commands (outline-mode outline-minor-mode) + :custom + ;; Mirror the default "C-c @" binding for `outline-minor-mode'. + (outline-minor-mode-prefix (kbd "@") "Use localleader for `outline-minor-mode' keybindings.")) + +;; My own custom packages, and stuff that isn't on MELPA. +;; (use-package actionlint ; TODO: port to flymake +;; :after (flycheck) +;; :load-path "include/") + +(use-package alidist-mode + :after (flymake mmm-mode yaml-mode) + :mode (rx (or bos "/") "alidist/" (1+ anything) ".sh" eos) + :load-path "include/") + +(use-package bemscript-mode + :load-path "include/" + :mode (rx ".bem" eos)) + +(use-package ifm-mode + :load-path "include/" + :mode (rx ".ifm" eos)) + +(use-package pam-env-mode + :load-path "include/" + :mode (rx (or bos "/") (or "pam_env.conf" ".pam_environment") eos)) + +(use-package environmentd-mode + :load-path "include/" + :mode (rx (or bos "/") + (or (: (? "etc/") "environment") + (: ".environment.d/" (1+ (not ?\/)) ".conf")) + eos)) + +(use-package org-latex-classes + :after (ox-latex) + :load-path "include/") + +(use-package ob-rec + ;; `org-babel' hooks for `rec-mode' + :after (org ob rec-mode) + :load-path "include/") + +(use-package vcard-mode + :load-path "include/" + :mode (rx "." (or "vcf" "vcard") eos)) + +;; Vim keybindings. +(defun tw/switch-to-other-buffer () + "Switch to the last-used buffer." + (interactive) + (switch-to-buffer (other-buffer))) + +(defun tw/new-buffer () + "Open a new, empty buffer." + (interactive) + (switch-to-buffer (generate-new-buffer "untitled"))) + +(defun tw/delete-current-buffer-file () + "Ask for confirmation, then delete the file associated with the current buffer." + (interactive) + (let ((buffer (current-buffer))) + (when (yes-or-no-p (concat "Delete `" (buffer-file-name buffer) "'?")) + (delete-file (buffer-file-name buffer)) + (kill-buffer buffer)))) + +(use-package evil + :after (which-key) + :commands (evil-mode evil-ex-nohighlight) + :init (setq evil-want-keybinding nil) ; evil-collection needs this + :custom + (evil-undo-system 'undo-tree "Use `undo-tree' for evil's undo-redo function.") + (evil-want-minibuffer t "Use evil bindings in the minibuffer too.") + (evil-want-C-u-scroll t "Scroll on C-u in normal mode, not `universal-argument'.") + (evil-want-C-u-delete t "Delete line on C-u in insert mode, not `universal-argument'.") + (evil-want-Y-yank-to-eol t "Yank from point to end-of-line on Y.") + :config + (evil-mode +1) + (evil-set-leader '(normal visual) (kbd "SPC")) ; + (evil-set-leader '(normal visual) (kbd "\\") t) ; + (evil-define-key '(normal insert visual replace) 'global + (kbd "C-s") #'save-buffer) + ;; Global major-mode-independent keys should be defined here. Major + ;; mode-dependent keys (e.g. for launching a REPL) should go under + ;; instead. Use `use-package' `:bind' for those. + (evil-define-key '(normal visual) 'global + ;; These keybindings mirror the default Spacemacs ones because I have + ;; muscle memory of those. + (kbd ":") #'eval-expression + (kbd "TAB") #'tw/switch-to-other-buffer + (kbd "bb") #'switch-to-buffer + (kbd "bd") #'kill-current-buffer + (kbd "bn") #'tw/new-buffer + (kbd "br") #'revert-buffer-quick + (kbd "bx") #'kill-buffer-and-window + (kbd "fd") #'tw/delete-current-buffer-file + (kbd "ff") #'find-file + (kbd "fs") #'save-buffer + (kbd "h") help-map + (kbd "sc") #'evil-ex-nohighlight + (kbd "tf") #'auto-fill-mode + (kbd "tl") #'toggle-truncate-lines + (kbd "tn") #'display-line-numbers-mode + (kbd "u") #'universal-argument + (kbd "w") evil-window-map + (kbd "wd") #'evil-window-delete ; analogous to "bd" + (kbd "wx") #'kill-buffer-and-window) ; analogous to "bx" + (which-key-add-key-based-replacements + ;; Names are a `cons' of a short name and a long name. + ;; E.g. for b, "buffer" is shown under "b" in the "" menu, + ;; while "Buffers" is shown as the title in the "b" menu. + "b" '("buffer" . "Buffers") + "f" '("file" . "Files") + "h" '("help" . "General help and documentation") + "q" '("quit" . "Finish editing the current buffer in emacsclient") + "s" '("search" . "Search operations and options") + "t" '("toggle" . "Toggles and quick settings") + "w" '("window" . "Windows")) + :functions (evil-define-key evil-set-leader + evil-define-key* evil-window-delete evil-delay) + :defines (evil-visual-state-map)) + +(use-package evil-collection + :after (evil) + :commands (evil-collection-init) :demand t + :config (evil-collection-init)) + +(use-package evil-org + :after (evil org) + :hook org-mode + :config + (evil-define-key '(normal visual) org-mode-map + (kbd "\\") #'org-ctrl-c-ctrl-c + (kbd "'") #'org-edit-src-code + (kbd "e") #'org-export-dispatch) + (evil-define-key '(normal visual) org-src-mode-map + (kbd "'") #'org-edit-src-exit + (kbd "\\") #'org-edit-src-save + (kbd "a") #'org-edit-src-abort)) + +(use-package evil-replace-with-register + :after (evil) + :commands (evil-replace-with-register-install) :demand t + ;; :custom (evil-replace-with-register-key "gR" "Use the default key.") + :config (evil-replace-with-register-install)) + +(use-package evil-commentary + :after (evil) + :commands (evil-commentary-mode) :demand t + :config (evil-commentary-mode +1)) + +(use-package evil-expat ; for :reverse, :remove, :rename, :colo, :g*, ... ex commands + :after (evil)) + +(use-package evil-surround + :after (evil) + :commands (global-evil-surround-mode) :demand t + :config (global-evil-surround-mode +1)) + +(use-package evil-smartparens + :after (evil smartparens) + :hook smartparens-enabled-hook) + +(use-package evil-multiedit + ;; See: https://github.com/hlissner/evil-multiedit#usage + :commands (evil-multiedit-default-keybinds) :demand t + :config (evil-multiedit-default-keybinds)) + +(use-package evil-args + :after (evil) + :config + ;; Bind evil-args text objects only. + ;; See https://github.com/wcsmith/evil-args for more bindings. + (define-key evil-inner-text-objects-map "a" 'evil-inner-arg) + (define-key evil-outer-text-objects-map "a" 'evil-outer-arg)) + +(use-package evil-numbers + :after (evil) + :bind (("+" . evil-numbers/inc-at-pt) + ("-" . evil-numbers/dec-at-pt))) + +(use-package evil-goggles ; visual previews for edit operations + :after (evil) + :commands (evil-goggles-mode evil-goggles-use-diff-faces) :demand t + :config + (evil-goggles-mode +1) + (evil-goggles-use-diff-faces) + :diminish evil-goggles-mode) + +(use-package evil-traces ; visual previews for :ex commands + :after (evil) + :commands (evil-traces-mode evil-traces-use-diff-faces) :demand t + :config + (evil-traces-mode +1) + (evil-traces-use-diff-faces) + :diminish evil-traces-mode) + +(use-package evil-markdown + :after (evil markdown-mode) + :hook markdown-mode) + +(use-package evil-tex + :after (evil tex) + :hook tex-mode) + +(use-package evil-text-object-python + :after (evil python) + :hook (python-mode . evil-text-object-python-add-bindings)) + +;; Lisp features +(use-package aggressive-indent + :hook (; scheme-mode + emacs-lisp-mode common-lisp-mode)) + +(defun tw/lisp-evil-setup () + "Set up evil in general `lisp-mode' buffers." + (setq-local evil-symbol-word-search t + ;; https://github.com/wcsmith/evil-args#customization + evil-args-delimiters '(" "))) + +;; Sadly, not all Lisp modes derive from `lisp-mode'. +(add-hook 'lisp-mode-hook #'tw/lisp-evil-setup) +(add-hook 'lisp-data-mode-hook #'tw/lisp-evil-setup) ; for elisp +(add-hook 'scheme-mode-hook #'tw/lisp-evil-setup) + +;; buffer-locally set `evil-lookup-func' (used on K keys) for +;; languages where something better than man pages is available +;; (e.g. `describe-symbol' for elisp). +(defun tw/elisp-lookup-func () + "Show help in `emacs-lisp-mode' buffers." + (let ((sym (symbol-at-point))) + (if sym (describe-symbol sym) + (call-interactively #'describe-symbol)))) + +(defun tw/emacs-lisp-evil-setup () + "Set up evil in `emacs-lisp-mode' buffers." + (setq-local evil-lookup-func #'tw/elisp-lookup-func)) + +(add-hook 'emacs-lisp-mode-hook #'tw/emacs-lisp-evil-setup) + +(evil-define-key '(normal visual) emacs-lisp-mode-map + (kbd "eb") #'eval-buffer + (kbd "ef") #'eval-defun + (kbd "er") #'eval-region + (kbd "el") #'eval-last-sexp + (kbd "ep") #'eval-print-last-sexp) + +;;; init.el ends here diff --git a/tw/home/files/emacs-packages/actionlint.el b/tw/home/files/emacs-packages/actionlint.el new file mode 100644 index 00000000..3c37e34b --- /dev/null +++ b/tw/home/files/emacs-packages/actionlint.el @@ -0,0 +1,34 @@ +;;; actionlint.el --- Flycheck checker for GitHub Actions. +;;; Commentary: +;; GitHub Actions are defined using mostly plain YAML files. +;; Actionlint is a linter catching GitHub Action-specific mistakes, and also +;; checks Shell and Python code embedded in Actions (using shellcheck and +;; pyflakes, respectively). +;;; Code: + +(require 'flycheck) + +(defun actionlint-github-workflow-p () + "Does the current buffer contain a GitHub Action?" + (string-match-p "\\.github/workflows/[^/]+\\.yml\\'" (buffer-file-name))) + +(flycheck-def-executable-var actionlint "actionlint") + +(flycheck-define-checker actionlint + "A syntax checker and linter for alidist recipes." + ;; `flycheck-alidist-executable' automatically overrides the car of the + ;; :command list if set and non-nil. + :command ("actionlint" "-no-color" "-oneline" source) + :error-patterns + ((error line-start (file-name) ":" line ":" column ": " (message) + " [" (id (minimal-match (one-or-more not-newline))) "]" line-end)) + ;; Only enable this in actual GitHub Actions, not just any YAML document. + :modes (yaml-mode) + :predicate actionlint-github-workflow-p + ;; Also check the document with YAML checkers, whether or not we have errors. + :next-checkers (yaml-ruby yaml-yamllint)) + +(add-to-list 'flycheck-checkers 'actionlint) + +(provide 'actionlint) +;;; actionlint.el ends here diff --git a/tw/home/files/emacs-packages/alidist-mode.el b/tw/home/files/emacs-packages/alidist-mode.el new file mode 100644 index 00000000..0f264e3b --- /dev/null +++ b/tw/home/files/emacs-packages/alidist-mode.el @@ -0,0 +1,162 @@ +;;; alidist-mode.el --- Major mode for alidist recipes -*- lexical-binding: t -*- +;;; Commentary: +;;; alidist recipes are shell scripts with a YAML header in front. We +;;; want both these parts highlighted properly, and to lint the whole +;;; thing with a custom script that glues together yamllint and +;;; shellcheck with a few custom checks. +;;; Code: + +(require 'custom) +(require 'flymake) +(require 'mmm-mode) +(require 'mmm-cmds) +(require 'mmm-vars) +(require 'sh-script) +(require 'yaml-mode) + +(defgroup alidist-mode nil + "Alidist-related options." + :group 'languages + :prefix "alidist-mode-") + +(defcustom alidist-mode-alidistlint-executable "alidistlint" + "The alidistlint executable to use. This will be looked up in $PATH." + :type '(string) + :risky t + :group 'alidist-mode) + +(defvar alidist-mode--message-regexp + (rx bol "-:" ; filename + (group (+ digit)) ":" ; line + (group (+ digit)) ": " ; column + (group (or "note" "warning" "error")) ": " ; type + (group (+ not-newline)) eol) ; message + "Regular expression matching messages from alidistlint. +`alidist-flymake' expects the following capturing groups in this +regexp: (1) line number; (2) column number; (3) error type; (4) +message.") + +(defvar-local alidist-mode--flymake-proc nil + "The latest invocation of alidistlint.") + +;; See info node: (flymake)An annotated example backend. +(defun alidist-flymake (report-fn &rest _args) + "Run alidistlint and report diagnostics from it using REPORT-FN. +Any running invocations are killed before running another one." + (unless (executable-find alidist-mode-alidistlint-executable) + (funcall report-fn :panic + :explanation "Cannot find `alidist-mode-alidistlint-executable' program") + (error "Cannot find alidistlint executable")) + + ;; Kill previous check, if it's still running. + (when (process-live-p alidist-mode--flymake-proc) + (kill-process alidist-mode--flymake-proc)) + + ;; This needs `lexical-binding'. + (let ((source (current-buffer))) + (save-restriction + (widen) + (setq alidist-mode--flymake-proc + (make-process + :name "alidistlint-flymake" :noquery t :connection-type 'pipe + ;; Direct output to a temporary buffer. + :buffer (generate-new-buffer " *alidistlint-flymake*") + :command (list alidist-mode-alidistlint-executable "-f" "gcc" "-") + :sentinel + (lambda (proc _event) + "Parse diagnostic messages once the process PROC has exited." + ;; Check the process has actually exited, not just been suspended. + (when (memq (process-status proc) '(exit signal)) + (unwind-protect + ;; Only proceed if we've got the "latest" process. + (if (with-current-buffer source (eq proc alidist-mode--flymake-proc)) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cl-loop + while (search-forward-regexp alidist-mode--message-regexp nil t) + for (beg . end) = (flymake-diag-region + source + (string-to-number (match-string 1)) + (string-to-number (match-string 2))) + for type = (pcase (match-string 3) + ("note" :note) + ("warning" :warning) + ("error" :error) + (type (error "Unknown alidistlint error type %s" type))) + collect (flymake-make-diagnostic source beg end type (match-string 4)) + into diags + finally (funcall report-fn diags))) + (flymake-log :warning "Canceling obsolete check %s" proc)) + ;; Clean up temporary buffer. + (kill-buffer (process-buffer proc))))))) + ;; Send the buffer to alidistlint on stdin. + (process-send-region alidist-mode--flymake-proc (point-min) (point-max)) + (process-send-eof alidist-mode--flymake-proc)))) + +(defvar-local alidist-mode--mmm-refresh-timer nil + "An idle timer for the current buffer, to make `mmm-mode' reparse it.") +(put 'alidist-mode--mmm-refresh-timer 'risky-local-variable t) + +(defun alidist-mode--cancel-refresh-timer () + "Cancel and delete the timer that reparses the buffer. +It is stored in `alidist-mode--mmm-refresh-timer'." + (when alidist-mode--mmm-refresh-timer + (cancel-timer alidist-mode--mmm-refresh-timer) + (setq alidist-mode--mmm-refresh-timer nil))) + +(define-derived-mode alidist-mode yaml-mode "alidist" + "An outer mode for alidist recipes, handling the metadata." + (mmm-mode) + ;; `mmm-mode' doesn't refresh its submodes when the buffer changes + ;; (e.g. when a *_recipe key is added to the YAML header), so + ;; refresh manually when idle. + (alidist-mode--cancel-refresh-timer) + (add-hook 'kill-buffer-hook #'alidist-mode--cancel-refresh-timer 0 t) + (setq alidist-mode--mmm-refresh-timer + (run-with-idle-timer + 2 t (lambda (original-buffer) + (when (eq original-buffer (current-buffer)) + ;; Silence `mmm-parse-buffer''s annoying message. + (let ((inhibit-message t)) + (mmm-parse-buffer)))) + ;; Idle timers are global, so make sure we only run the timer + ;; in the right buffer. Save the buffer now to enable this, + ;; and compare every time the timer ticks over. + (current-buffer))) + ;; Set up `flymake-mode'. + (add-hook 'flymake-diagnostic-functions #'alidist-flymake nil t)) + +(define-derived-mode alidist-script-mode sh-mode "Script" + "A mode for scripts in alidist recipes with some default settings." + (sh-set-shell "bash")) + +(mmm-add-group + 'alidist-recipe + '((alidist-main-script + :submode alidist-script-mode + :face mmm-default-submode-face + :front (rx line-start "---\n") + :back (rx buffer-end)) + (alidist-option-script + :submode alidist-script-mode + :face mmm-default-submode-face + ;; Any *_recipe key with a multiline string value is probably a script. + :front (rx line-start (* whitespace) (1+ (any alnum ?\_)) "_recipe: |\n") + ;; End of YAML header, or another YAML key. + :back (rx line-start + (or "---\n" + (seq (* whitespace) (+ (any alnum ?\_)) ":" + (or line-end whitespace))))))) + +;; Make `mmm-mode' remember `sh-mode' indentation variables. +(cl-dolist (var sh-var-list) + (cl-pushnew `(,var nil (sh-mode)) + mmm-save-local-variables :test 'equal)) + +(mmm-add-mode-ext-class 'alidist-mode nil 'alidist-recipe) +(add-to-list 'auto-mode-alist + (cons (rx (or bot "/") "alidist/" (1+ (not ?\/)) ".sh" eot) + #'alidist-mode)) + +(provide 'alidist-mode) +;;; alidist-mode.el ends here diff --git a/tw/home/files/emacs-packages/bemscript-mode.el b/tw/home/files/emacs-packages/bemscript-mode.el new file mode 100644 index 00000000..f46c858b --- /dev/null +++ b/tw/home/files/emacs-packages/bemscript-mode.el @@ -0,0 +1,92 @@ +;;; bemscript-mode.el --- Syntax highlighting for MERRILL BEMScript files. +;;; Commentary: +;;; Based on the MERRILL manual. Some commands may have been missed. +;;; Code: + +(defconst bemscript-mode-keywords + '("set" "setsubdomain" "magnetite" "iron" "tm54" "resize" "cubic anisotropy" + "uniaxial anisotropy" "cubicrotation" "easy axis" "external field strength" + "external field direction" "readmesh" "loadmesh" "readmagnetization" + "uniform magnetization" "randomize magnetization" "randomize all moments" + "remesh" "conjugategradient" "steepestdescent" "minimize" "energylog" + "closelogfile" "writeloopdata" "writemagnetization" "writedemag" "writehyst" + "writeboxdata" "appenddemagzone" "magnetizationtopath" "pathtomagnetization" + "renewpath" "refinepathto" "writetecplotpath" "readtecplotpath" + "readtecplotzone" "keypause" "makeinitialpath" "pathminimize" "pathlogfile" + "systemcommand" "pathstructureenergies" "reportenergy" "stop" "end" "loop" + "endloop" "define" "addto" "undefine" "generatecubemesh" "zonename") + "List of keywords for BEMScript mode. Intended for case folding.") + +(defconst bemscript-mode-builtins + '("Aex" "CurvatureWeight" "ExchangeCalculator" "K1" "K2" "Ls" "Ms" "mu" + "MaxEnergyEvaluations" "MaxPathEvaluations" "MaxRestart" "MaxMeshNumber" + "NEBSpring" "PathN" "Zone" "ZoneIncrement") + "List of built-in variable names for BEMScript.") + +(defconst bemscript-mode-special + '("patran" "tecplot" "POINT" "BLOCK" "SD" "muT" "mT" "T" "C") + "Variables with special meanings and units in BEMScript.") + +;; Available font-lock-*-faces: doc type string builtin comment keyword warning +;; constant (reference) preprocessor syntactic-function function-name +;; negation-char variable-name comment-delimiter +(defconst bemscript-mode-font-lock-defaults + `((;; See font-lock-keywords docs. Earlier lines seem to override later ones, + ;; except if both have OVERRIDE? t. + ;; Format: (REGEXP (GROUPNUM FACENAME OVERRIDE? LAXMATCH?)...) + ;; Comments + ("!\\(.*\\)" 1 font-lock-comment-face t t) + ("!" 0 font-lock-comment-delimiter-face t) + ("!!.*$" 0 font-lock-doc-face t) + + ;; Equals signs need spaces around them. + ("\\s-=\\s-" 0 font-lock-type-face t) ; there is no "operator" etc face + ("=" . font-lock-warning-face) + + ;; Numbers and variables + ("\\<[0-9]*\\.?[0-9]+\\(e[-+]?\\)?[0-9]*\\>" . font-lock-constant-face) + ("\\(\\<[#%][A-Z_a-z][0-9A-Z_a-z]*\\>\\|\\$[A-Z_a-z][0-9A-Za-z_]*\\$\\)" + . font-lock-variable-name-face) + + ;; Preprocessor (&-substitution) + (,(concat "\\([^&]\\|^\\)\\(&&\\)*" ; && escapes & + "\\(&\\([_a-zA-Z][_a-zA-Z0-9]*\\|{[_a-zA-Z][_a-zA-Z0-9]*}\\)\\)") + 3 font-lock-preprocessor-face) + (,(concat "\\([^&]\\|^\\)\\(&&\\)*" ; && escapes & + "\\(&\\($" ; bare & + "\\|[^&{_a-zA-Z]\\|{[^_a-zA-Z]" ; invalid char following & or &{ + ; invalid name or unclosed { + "\\|{[_a-zA-Z][_0-9a-zA-Z]*\\([^_0-9a-zA-Z}]\\|$\\)\\)\\)") + 3 font-lock-warning-face t) + + ;; Variable definitions + ("\\<\\(loop\\|define\\)\\s-+\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\>" + 2 font-lock-function-name-face) + ("\\<\\(addto\\|undefine\\)\\s-+\\([_a-zA-Z][_a-zA-Z0-9]*\\)\\>" + 2 font-lock-variable-name-face) + + ;; Keywords + (,(regexp-opt bemscript-mode-special 'words) . font-lock-string-face) + (,(regexp-opt bemscript-mode-keywords 'words) . font-lock-keyword-face) + (,(regexp-opt bemscript-mode-builtins 'words) . font-lock-builtin-face)) + + ;; KEYWORDS-ONLY: if t, no syntactic fontification (strings and comments) + nil + ;; CASE-FOLD: if t, make keywords case-insensitive. + t) + "Font lock settings for BEMScript mode.") + +(define-derived-mode bemscript-mode prog-mode "BEMScript" + "BEMScript-mode is used for editing MERRILL scripts." + (setq comment-start "!" + comment-end "" + tab-width 2 + font-lock-defaults bemscript-mode-font-lock-defaults) + ;; Only word syntax entries are highlighted; add needed chars. + (modify-syntax-entry ?# "w") + ;; Strings in BEMScript are not quoted. + (modify-syntax-entry ?\" "w")) + +(add-to-list 'auto-mode-alist '("\\.bem\\'" . bemscript-mode)) +(provide 'bemscript-mode) +;;; bemscript-mode.el ends here diff --git a/tw/home/files/emacs-packages/environmentd-mode.el b/tw/home/files/emacs-packages/environmentd-mode.el new file mode 100644 index 00000000..4bb8812e --- /dev/null +++ b/tw/home/files/emacs-packages/environmentd-mode.el @@ -0,0 +1,46 @@ +;;; environmentd-mode.el --- Major mode for environment.d(5) files. + +;;; Commentary: + +;; This major mode font-locks files including /etc/environment and +;; ~/.config/environment.d/*.conf. Their format is specified by the +;; environment.d(5) man page. + +;;; Code: + +(defconst environmentd-mode/font-lock-defaults + '((("^[[:blank:]]+[^[:blank:]]+" . font-lock-warning-face) ; stray leading whitespace + ("^#+[[:blank:]]*" . font-lock-comment-delimiter-face) + ("^#+[[:blank:]]*\\(.*\\)$" 1 font-lock-comment-face) + ("\\\\[$\\]" . font-lock-string-face) ; escaped $ \ + ("^\\([A-Za-z_][A-Za-z0-9_]*\\)\\(=\\)" + (1 font-lock-variable-name-face) + (2 font-lock-keyword-face)) + ("\\(\\${\\)\\([A-Za-z_][A-Za-z0-9_]*\\)\\(:[+-]\\)[^}]*\\(}\\)" + (1 font-lock-keyword-face) + (2 font-lock-variable-name-face) + (3 font-lock-keyword-face) + (4 font-lock-keyword-face)) ; ${X:-default}-variable references + ("\\(\\${\\)\\([A-Za-z_][A-Za-z0-9_]*\\)\\(}\\)" + (1 font-lock-keyword-face) + (2 font-lock-variable-name-face) + (3 font-lock-keyword-face)) ; ${X}-variable references + ("\\(\\$\\)\\([A-Za-z_][A-Za-z0-9_]*\\)" + (1 font-lock-keyword-face) + (2 font-lock-variable-name-face))) ; $X-variable references + t nil ((?\' . "w") (?\" . "w"))) + "Font lock settings for Environment.d mode. See `font-lock-defaults' for documentation.") + +(define-derived-mode environmentd-mode prog-mode "Environment.d" + "Environment.d mode is used for environment.d(5) files." + (setq-local comment-start "#" + comment-start-skip "#" + comment-end "" + font-lock-defaults environmentd-mode/font-lock-defaults)) + +(add-to-list 'auto-mode-alist + '("/environment\\.d/[^/]+\\.conf\\'\\|\\`/etc/environment\\'" + . environmentd-mode)) + +(provide 'environmentd-mode) +;;; environmentd-mode.el ends here diff --git a/tw/home/files/emacs-packages/ifm-mode.el b/tw/home/files/emacs-packages/ifm-mode.el new file mode 100644 index 00000000..7416588b --- /dev/null +++ b/tw/home/files/emacs-packages/ifm-mode.el @@ -0,0 +1,18 @@ +(define-generic-mode 'ifm-mode + '("#") + '("title" "map" "require" "room" "join" "to" "dir" "exit" "go" "oneway" + "tag" "from" "link" "nolink" "item" "in" "note" "score" "need" "after" + "before" "leave" "all" "except" "cmd" "length" "start" "finish" "nodrop" + "nopath" "style" "hidden" "keep" "with" "until" "ignore" "give" "lost" + "do" "get" "drop" "until" "safe" "ignore" "goto" "endstyle") + '(("\\<\\(\\(north\\|south\\)\\(east\\|west\\)?\\|[ns][ew]?\\|east\\|west\\|[ew]\\)\\>" + . 'font-lock-builtin-face) + ("\\<\\([du]\\|down\\|up\\|in\\|out\\|last\\|it\\|them\\)\\>" + . 'font-lock-builtin-face) + ("\\<[0-9]+" . 'font-lock-constant-face) + ("\\<[_a-zA-Z][_0-9A-Za-z]*\\>" . 'font-lock-variable-name-face)) + '("\\.ifm\\'") + nil + "A mode for interactive fiction manager files") + +(provide 'ifm-mode) diff --git a/tw/home/files/emacs-packages/org-latex-classes.el b/tw/home/files/emacs-packages/org-latex-classes.el new file mode 100644 index 00000000..90d13341 --- /dev/null +++ b/tw/home/files/emacs-packages/org-latex-classes.el @@ -0,0 +1,54 @@ +;;; org-latex-classes.el --- LaTeX documentclass definitions for org-mode. +;;; Commentary: +;;; Code: +(require 'ox-latex) + +(defun tw/latex-section-commands (name) + "Create a pair of section commands like (\"\\NAME{%s}\" . \"\\NAME*{%s}\")." + (cons (format "\\%s{%%s}" name) (format "\\%s*{%%s}" name))) + +(defconst tw/latex-part (tw/latex-section-commands "part")) +(defconst tw/latex-chapter (tw/latex-section-commands "chapter")) +(defconst tw/latex-section-and-below + (mapcar #'tw/latex-section-commands + '("section" "subsection" "subsubsection" "paragraph" "subparagraph"))) + +(setq org-latex-classes + `(("paperlike" "\\documentclass{paperlike}" + . ,tw/latex-section-and-below) + + ("examtext" "\\documentclass{examtext}" + . ,tw/latex-section-and-below) + + ("minutes" "\\documentclass{minutes}" + . ,tw/latex-section-and-below) + + ("mapreport" "\\documentclass{mapreport}" + ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("pt3report" "\\documentclass{pt3report}" + ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("article" "\\documentclass{article}" + . ,tw/latex-section-and-below) + + ("scrartcl" "\\documentclass{scrartcl}" + . ,tw/latex-section-and-below) + + ("report" "\\documentclass{report}" + ,tw/latex-part ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("report-noparts" "\\documentclass{report}" + ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("book" "\\documentclass{book}" + ,tw/latex-part ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("book-noparts" "\\documentclass{book}" + ,tw/latex-chapter . ,tw/latex-section-and-below) + + ("checklist" "\\documentclass{checklist}" + . ,tw/latex-section-and-below))) + +(provide 'org-latex-classes) +;;; org-latex-classes.el ends here diff --git a/tw/home/files/emacs-packages/pam-env-mode.el b/tw/home/files/emacs-packages/pam-env-mode.el new file mode 100644 index 00000000..75b0bf94 --- /dev/null +++ b/tw/home/files/emacs-packages/pam-env-mode.el @@ -0,0 +1,45 @@ +;;; pam-env.el --- Major mode for pam_env.conf(5) files. + +;;; Commentary: + +;; This major mode font-locks files including ~/.pam_environment and +;; /etc/security/pam_env.conf, but notably not /etc/environment. Their format is +;; specified by the pam_env.conf(5) man page. + +;; TODO: Only apply font-lock-variable-name-face to variable declarations if +;; the previous line didn't end with a backslash. The following case didn't +;; work (some declarations that should've been font-locked weren't): +;; '("\\(?:^$\\|[^\\\\]\\)[\r\n]\\([^[:blank:]]+\\)" +;; 1 font-lock-variable-name-face keep) + +;; pam_env does not support escaped double quotes ("). Single-quoted strings are +;; not used as string delimiters. We can only match against word chars in +;; `pam-env-mode/font-lock-defaults', so make double quotes word chars. + +;;; Code: + +(defconst pam-env-mode/font-lock-defaults + '((("^#+" . font-lock-comment-delimiter-face) + ("^#+[[:blank:]]*\\(.*\\)$" 1 font-lock-comment-face) + ("\\\\[@$\\]" . font-lock-string-face) ; escaped $ @ \ + ("@{[^}]+}" . font-lock-builtin-face) ; @{}-variable references + ("\\${[^}]+}" . font-lock-variable-name-face) ; ${}-variable references + ("\"[^\"]*\"" 0 font-lock-string-face keep) ; double-quoted strings; escaped " not supported + ("\\<\\(DEFAULT\\|OVERRIDE\\)=" . font-lock-keyword-face) ; DEFAULT= and OVERRIDE= + ("^[^[:blank:]]+" . font-lock-variable-name-face) ; variable declarations + ("[[:blank:]]+[^[:blank:]]+" . font-lock-warning-face)) ; stray whitespace + t nil ((?\' . "w") (?\" . "w"))) + "Font lock settings for PAM-Environment mode. See `font-lock-defaults' for documentation.") + +(define-derived-mode pam-env-mode prog-mode "PAM-Environment" + "PAM-environment mode is used for pam_env.conf(5) files." + (set (make-local-variable 'comment-start) "#") + (set (make-local-variable 'comment-start-skip) "^#+[[:blank:]]*") + (set (make-local-variable 'comment-end) "") + (set (make-local-variable 'font-lock-defaults) pam-env-mode/font-lock-defaults)) + +(let ((regexp "\\(\\`\\|/\\)\\(pam_env\\.conf\\|\\.pam_environment\\)\\'")) + (add-to-list 'auto-mode-alist `(,regexp . pam-env-mode))) + +(provide 'pam-env-mode) +;;; pam-env.el ends here diff --git a/tw/home/files/emacs-packages/vcard-mode.el b/tw/home/files/emacs-packages/vcard-mode.el new file mode 100644 index 00000000..a932477a --- /dev/null +++ b/tw/home/files/emacs-packages/vcard-mode.el @@ -0,0 +1,56 @@ +;;; vcard-mode.el --- Major mode for vCard files. + +;; Copyright (C) 2012 Desmond O. Chang + +;; Author: Desmond O. Chang +;; Version: 0.1.0 +;; Keywords: files + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This package provides a major mode to edit vCard files. + +;; To install it, put this file under your load path. Then add the +;; following to your .emacs file: + +;; (require 'vcard-mode) + +;; Or if you don't want to load it until editing a vCard file: + +;; (autoload 'vcard-mode "vcard-mode" "Major mode for vCard files" t) +;; (add-to-list 'auto-mode-alist '("\\.vc\\(f\\|ard\\)\\'" . vcard-mode)) + +;;; Code: + +(require 'generic) + +(defun vcard-mode-init () + (set (make-local-variable 'paragraph-start) "BEGIN:VCARD")) + +;;;###autoload +(define-generic-mode vcard-mode + '() + nil + '(("^BEGIN:VCARD" . font-lock-function-name-face) + (";[^:\n]+:" . font-lock-type-face) + ("^\\([^;:\n]+\\):?" . font-lock-keyword-face)) + '("\\.\\(vcf\\|vcard\\)\\'") + '(vcard-mode-init) + "Generic mode for vCard files.") + +(provide 'vcard-mode) + +;;; vcard-mode.el ends here diff --git a/tw/home/files/gitconfig b/tw/home/files/gitconfig new file mode 100644 index 00000000..1f6c49f1 --- /dev/null +++ b/tw/home/files/gitconfig @@ -0,0 +1,43 @@ +# This is Git's per-user configuration file. +[user] + name = Timo Wilken + email = timo.21.wilken@gmail.com + signingkey = 53EC3C06856883DD92355BC22FC78504681F69B0 +[commit] + gpgsign = true +[url "https://"] + insteadOf = git:// +[url "ssh://git@gitlab.cern.ch:7999/"] + insteadOf = https://gitlab.cern.ch/ +[url "ssh://git@ssh.github.com/"] + insteadOf = gh: +[gui] + fontui = -family \"Fira Sans\" -size 10 -weight normal -slant roman -underline 0 -overstrike 0 + fontdiff = -family \"Hermit\" -size 10 -weight normal -slant roman -underline 0 -overstrike 0 + tabsize = 4 +[merge] + summary = true + conflictstyle = diff3 +[color] + ui = auto +[pull] + rebase = false + ff = only +[alias] + glog = log --decorate --graph --all --oneline + plog = log --decorate --graph --all --oneline --pretty=tformat:\"%C(yellow)%h %Cgreen%as %Cblue%<(10,trunc)%an%Cred%d%Creset %s\" +[init] + defaultBranch = master +[advice] + detachedHead = false +# https://sw.kovidgoyal.net/kitty/kittens/diff/ +[diff] + tool = kitty + guitool = kitty.gui +[difftool] + prompt = false + trustExitCode = true +[difftool "kitty"] + cmd = kitty +kitten diff $LOCAL $REMOTE +[difftool "kitty.gui"] + cmd = kitty kitty +kitten diff $LOCAL $REMOTE \ No newline at end of file diff --git a/tw/home/files/gpg-agent.conf b/tw/home/files/gpg-agent.conf new file mode 100644 index 00000000..6f476443 --- /dev/null +++ b/tw/home/files/gpg-agent.conf @@ -0,0 +1,4 @@ +pinentry-program pinentry-rofi +# Needed if spawning lots of parallel gpg --decrypt processes. +# https://dev.gnupg.org/T3530 +auto-expand-secmem diff --git a/tw/home/files/gpg.conf b/tw/home/files/gpg.conf new file mode 100644 index 00000000..0d1d77a7 --- /dev/null +++ b/tw/home/files/gpg.conf @@ -0,0 +1,142 @@ +# Options for GnuPG +# Copyright 1998-2003, 2010 Free Software Foundation, Inc. +# Copyright 1998-2003, 2010 Werner Koch +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This file is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Unless you specify which option file to use (with the command line +# option "--options filename"), GnuPG uses the file ~/.gnupg/gpg.conf +# by default. +# +# An options file can contain any long options which are available in +# GnuPG. If the first non white space character of a line is a '#', +# this line is ignored. Empty lines are also ignored. +# +# See the gpg man page for a list of options. + + +# If you have more than 1 secret key in your keyring, you may want to +# uncomment the following option and set your preferred keyid. + +#default-key 621CC013 + + +# If you do not pass a recipient to gpg, it will ask for one. Using +# this option you can encrypt to a default key. Key validation will +# not be done in this case. The second form uses the default key as +# default recipient. + +#default-recipient some-user-id +#default-recipient-self + + +# Group names may be defined like this: +# group mynames = paige 0x12345678 joe patti +# +# Any time "mynames" is a recipient (-r or --recipient), it will be +# expanded to the names "paige", "joe", and "patti", and the key ID +# "0x12345678". Note there is only one level of expansion - you +# cannot make an group that points to another group. Note also that +# if there are spaces in the recipient name, this will appear as two +# recipients. In these cases it is better to use the key ID. + +#group mynames = paige 0x12345678 joe patti + + +# GnuPG can automatically locate and retrieve keys as needed using +# this option. This happens when encrypting to an email address (in +# the "user@@example.com" form) and there are no keys matching +# "user@example.com" in the local keyring. This option takes any +# number mechanisms which are tried in the given order. The default +# is "--auto-key-locate local" to search for keys only in the local +# key database. Uncomment the next line to locate a missing key using +# two DNS based mechanisms. + +#auto-key-locate local,pka,dane + + +# Common options for keyserver functions: +# (Note that the --keyserver option has been moved to dirmngr.conf) +# +# include-disabled = when searching, include keys marked as "disabled" +# on the keyserver (not all keyservers support this). +# +# no-include-revoked = when searching, do not include keys marked as +# "revoked" on the keyserver. +# +# verbose = show more information as the keys are fetched. +# Can be used more than once to increase the amount +# of information shown. +# +# auto-key-retrieve = automatically fetch keys as needed from the keyserver +# when verifying signatures or when importing keys that +# have been revoked by a revocation key that is not +# present on the keyring. +# +# no-include-attributes = do not include attribute IDs (aka "photo IDs") +# when sending keys to the keyserver. + +#keyserver-options auto-key-retrieve + + +# Uncomment this line to display photo user IDs in key listings and +# when a signature from a key with a photo is verified. + +#show-photos + + +# Use this program to display photo user IDs +# +# %i is expanded to a temporary file that contains the photo. +# %I is the same as %i, but the file isn't deleted afterwards by GnuPG. +# %k is expanded to the key ID of the key. +# %K is expanded to the long OpenPGP key ID of the key. +# %t is expanded to the extension of the image (e.g. "jpg"). +# %T is expanded to the MIME type of the image (e.g. "image/jpeg"). +# %f is expanded to the fingerprint of the key. +# %% is %, of course. +# +# If %i or %I are not present, then the photo is supplied to the +# viewer on standard input. If your platform supports it, standard +# input is the best way to do this as it avoids the time and effort in +# generating and then cleaning up a secure temp file. +# +# The default program is "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin" +# On Mac OS X and Windows, the default is to use your regular JPEG image +# viewer. +# +# Some other viewers: +# photo-viewer "qiv %i" +# photo-viewer "ee %i" +# photo-viewer "display -title 'KeyID 0x%k'" +# +# This one saves a copy of the photo ID in your home directory: +# photo-viewer "cat > ~/photoid-for-key-%k.%t" +# +# Use your MIME handler to view photos: +# photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG" + + +# Because some mailers change lines starting with "From " to ">From " +# it is good to handle such lines in a special way when creating +# cleartext signatures; all other PGP versions do it this way too. +# To enable full OpenPGP compliance you may want to use this option. + +#no-escape-from-lines + + +# Uncomment the following option to get rid of the copyright notice + +#no-greeting + +default-key 2FC78504681F69B0 + +keyserver hkp://pool.sks-keyservers.net +use-agent +group Friends = DB3DB428A6E2D6DFDAC4531369C6F5CF9FB85A52 diff --git a/tw/home/files/gtk2.ini b/tw/home/files/gtk2.ini new file mode 100644 index 00000000..6af8200a --- /dev/null +++ b/tw/home/files/gtk2.ini @@ -0,0 +1,20 @@ +gtk-theme-name="Catppuccin-Dark" +gtk-icon-theme-name="Papirus-Dark" +gtk-font-name="Fira Sans, 10" +gtk-cursor-theme-name="Catppuccin-Mocha-Dark-Cursors" +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_MENU +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle="hintslight" +gtk-xft-rgba="rgb" +#gtk-modules="appmenu-gtk-module" +gtk-enable-animations=1 +gtk-primary-button-warps-slider=0 +# Use Qt UI conventions, I think (at least this setting is from KDE). +gtk-alternative-button-order = 1 diff --git a/tw/home/files/gtk3.ini b/tw/home/files/gtk3.ini new file mode 100644 index 00000000..fff5946b --- /dev/null +++ b/tw/home/files/gtk3.ini @@ -0,0 +1,16 @@ +[Settings] +gtk-theme-name=Catppuccin-Dark +gtk-icon-theme-name=Papirus-Dark +gtk-font-name=Fira Sans 10 +gtk-cursor-theme-name=Catppuccin-Mocha-Dark-Cursors +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_MENU +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintslight +gtk-xft-rgba=rgb diff --git a/tw/home/files/htoprc b/tw/home/files/htoprc new file mode 100644 index 00000000..f47f1c8a --- /dev/null +++ b/tw/home/files/htoprc @@ -0,0 +1,59 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +htop_version=3.2.0 +config_reader_min_version=3 +fields=0 48 17 18 38 39 40 2 46 47 49 1 +hide_kernel_threads=1 +hide_userland_threads=1 +shadow_other_users=0 +show_thread_names=1 +show_program_path=0 +highlight_base_name=1 +highlight_deleted_exe=1 +highlight_megabytes=1 +highlight_threads=1 +highlight_changes=0 +highlight_changes_delay_secs=5 +find_comm_in_cmdline=1 +strip_exe_from_cmdline=1 +show_merged_command=0 +header_margin=1 +screen_tabs=0 +detailed_cpu_time=1 +cpu_count_from_one=0 +show_cpu_usage=1 +show_cpu_frequency=1 +update_process_names=1 +account_guest_in_cpu_meter=0 +color_scheme=0 +enable_mouse=1 +delay=15 +hide_function_bar=1 +header_layout=two_50_50 +column_meters_0=LeftCPUs Memory Swap +column_meter_modes_0=1 1 1 +column_meters_1=RightCPUs Tasks LoadAverage Uptime +column_meter_modes_1=1 2 2 2 +tree_view=1 +sort_key=46 +tree_sort_key=0 +sort_direction=-1 +tree_sort_direction=1 +tree_view_always_by_pid=1 +all_branches_collapsed=0 +screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command +.sort_key=PERCENT_CPU +.tree_sort_key=PID +.tree_view=1 +.tree_view_always_by_pid=1 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 +screen:I/O=PID USER EXE IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE +.sort_key=IO_RATE +.tree_sort_key=PID +.tree_view=0 +.tree_view_always_by_pid=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 diff --git a/tw/home/files/i3.conf b/tw/home/files/i3.conf new file mode 100644 index 00000000..43e4cead --- /dev/null +++ b/tw/home/files/i3.conf @@ -0,0 +1,250 @@ +# +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! +# Use xev to see keycodes for special keys. + +# Appearance and Styling {{{ +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:Fira Sans 10 + +title_align center +default_border pixel 3 +default_floating_border pixel 3 +hide_edge_borders smart +gaps inner 15 +gaps outer 0 +smart_gaps on + +# Catppuccin colours +# Foregrounds +set $c_fg #cdd6f4 +set $c_inactive #7f849c +# Backgrounds +set $c_bg #11111b +set $c_active #585b70 +set $c_urgent #f9e2af + +# class border background text indicator child_border +client.focused $c_active $c_active $c_fg $c_active $c_active +client.focused_inactive $c_bg $c_bg $c_fg $c_bg $c_bg +client.unfocused $c_bg $c_bg $c_inactive $c_bg $c_bg +client.urgent $c_urgent $c_urgent $c_fg $c_urgent $c_urgent +client.placeholder $c_bg $c_bg $c_inactive $c_bg $c_bg +client.background $c_bg +# }}} + +# Basic Configuration {{{ +# use the Super key as $mod +set $mod Mod4 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# essential applications +bindsym $mod+Return exec kitty "--directory=$(xcwd)" +bindsym $mod+i exec icecat --new-window +bindsym $mod+shift+i exec icecat --new-tab "$(xclip -out)" +bindsym $mod+e exec $EDITOR +# Use ASYNC_EDITOR so I can continue using ranger while the editor +# remains open in a separate window. +bindsym $mod+slash exec EDITOR=$ASYNC_EDITOR kitty ranger "$(xcwd)" +bindsym $mod+semicolon exec --no-startup-id nheko +bindsym $mod+shift+colon exec --no-startup-id kitty neomutt +bindsym $mod+y exec kitty pulsemixer + +# volume +bindsym XF86AudioRaiseVolume exec --no-startup-id volume +5 +bindsym XF86AudioLowerVolume exec --no-startup-id volume -5 +bindsym XF86AudioMute exec --no-startup-id volume toggle-mute + +# notifications +bindsym $mod+n exec dunstctl close +bindsym $mod+shift+n exec dunstctl history-pop +bindsym $mod+period exec dunstctl context + +# screen locking +bindsym $mod+shift+slash exec screenlock + +# kill focused window +bindsym $mod+shift+q kill + +# rofi menus +bindsym $mod+d exec rofi -show combi +bindsym $mod+shift+e exec rofi -show session:sessionmenu +# When selecting a history line in rofi-calc, it is printed; copy it so we can use it elsewhere. +bindsym $mod+q exec rofi -show calc | xclip -quiet -i -rmlastnl -selection clipboard +bindsym $mod+p exec passmenu --type-all +bindsym $mod+shift+p exec passmenu --type-pass +bindsym $mod+o exec passmenu --type-otp +bindsym $mod+comma exec rofi-colors.sh +bindsym $mod+shift+Return exec rofi -show ssh +# }}} + +# Basic Movement {{{ +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+shift+h move left +bindsym $mod+shift+j move down +bindsym $mod+shift+k move up +bindsym $mod+shift+l move right +bindsym $mod+shift+Left move left +bindsym $mod+shift+Down move down +bindsym $mod+shift+Up move up +bindsym $mod+shift+Right move right + +bindsym $mod+a focus parent +bindsym $mod+shift+a focus child +# }}} + +# Layout {{{ +bindsym $mod+b split h +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle +bindsym $mod+shift+f floating enable, resize set 1920 1080, move position 0 0 + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+x layout toggle split + +bindsym $mod+shift+space floating toggle +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# scratchpad +bindsym $mod+numbersign scratchpad show +bindsym $mod+shift+numbersign move to scratchpad +bindsym $mod+apostrophe sticky disable, floating disable +bindsym $mod+shift+apostrophe sticky enable, floating enable + +# move workspaces +bindsym $mod+shift+comma move workspace to output left +bindsym $mod+shift+period move workspace to output right +# }}} + +# Default Workspaces {{{ +# switch to workspace +bindsym $mod+Escape workspace back_and_forth +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 +bindsym $mod+parenleft workspace prev +bindsym $mod+parenright workspace next + +# move focused container to workspace +bindsym $mod+shift+Escape move container to workspace back_and_forth +bindsym $mod+shift+1 move container to workspace 1 +bindsym $mod+shift+2 move container to workspace 2 +bindsym $mod+shift+3 move container to workspace 3 +bindsym $mod+shift+4 move container to workspace 4 +bindsym $mod+shift+5 move container to workspace 5 +bindsym $mod+shift+6 move container to workspace 6 +bindsym $mod+shift+7 move container to workspace 7 +bindsym $mod+shift+8 move container to workspace 8 +bindsym $mod+shift+9 move container to workspace 9 +bindsym $mod+shift+0 move container to workspace 10 +bindsym $mod+shift+parenleft move container to workspace prev +bindsym $mod+shift+parenright move container to workspace next +# }}} + +# Custom Workspaces {{{ +set $ws_terminal 0:>_ +bindsym $mod+grave workspace "$ws_terminal" +bindsym $mod+shift+grave move container to workspace "$ws_terminal" + +set $ws_coding 50:🖊️ +bindsym $mod+c workspace "$ws_coding" +bindsym $mod+shift+c move container to workspace "$ws_coding" + +set $ws_games 60:🎮 +bindsym $mod+g workspace "$ws_games" +bindsym $mod+shift+g move container to workspace "$ws_games" + +set $ws_music 80:🎵 +bindsym $mod+u workspace "$ws_music" +bindsym $mod+shift+u move container to workspace "$ws_music" + +set $ws_messaging 90:💬 +bindsym $mod+m workspace "$ws_messaging" +bindsym $mod+shift+m move container to workspace "$ws_messaging" + +assign [class="^Franz$"] "$ws_messaging" +assign [window_role="^weechat$"] "$ws_messaging" +assign [window_role="^mutt$"] "$ws_messaging" +assign [class="^evolution-initial$"] "$ws_messaging" +assign [class="^kontact$"] "$ws_messaging" + +# NOTE: no_focus will also be ignored for the first window on a workspace as +# there shouldn’t be a reason to not focus the window in this case. This allows +# for better usability in combination with workspace_layout. (From i3 docs) +#no_focus [class="^Franz$"] +#no_focus [window_role="^weechat$"] +#no_focus [window_role="^mutt$"] +#no_focus [class="^evolution-initial$"] + +## PlayOnLinux +for_window [title="PlayOnLinux"] floating enable + +## Plasma/KDE: https://ryanlue.com/posts/2019-06-13-kde-i3 +# Don’t treat Plasma pop-ups as full-sized windows +for_window [class="plasmashell"] floating enable +# Don’t spawn an empty window for the Plasma Desktop +for_window [title="Desktop — Plasma"] move scratchpad +# Don’t let notifications and non-interactive pop-up windows steal focus +#no_focus [class="plasmashell" window_type="on_screen_display"] +# https://github.com/heckelson/i3-and-kde-plasma +# Move notifications to top-right corner. +#for_window [class="plasmashell" window_type="notification"] move up 400, move right 750, no_focus +# Notifications appear in the centre of the screen. According to +# https://old.reddit.com/r/i3wm/comments/bw1yfs/kde_notifications_appearing_in_the_centre_of/, +# setting notifications to appear in the top-left corner gets placement right. +no_focus [class="plasmashell" window_type="notification"] + +for_window [class="^Pyneedle$"] floating enable +for_window [instance="^emacs-initial$"] floating enable +for_window [class="^Spotify$"] move container to workspace "$ws_music" +for_window [class="^Pidgin$"] move container to workspace "$ws_messaging" +# }}} + +# Modes {{{ +mode "resize" { + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt + + bindsym shift+h resize shrink width 5 px or 5 ppt + bindsym shift+j resize grow height 5 px or 5 ppt + bindsym shift+k resize shrink height 5 px or 5 ppt + bindsym shift+l resize grow width 5 px or 5 ppt + + bindsym left resize shrink width 10 px or 10 ppt + bindsym down resize grow height 10 px or 10 ppt + bindsym up resize shrink height 10 px or 10 ppt + bindsym right resize grow width 10 px or 10 ppt + + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" +# }}} diff --git a/tw/home/files/khal.conf b/tw/home/files/khal.conf new file mode 100644 index 00000000..73bb5c19 --- /dev/null +++ b/tw/home/files/khal.conf @@ -0,0 +1,39 @@ +# https://lostpackets.de/khal/configure.html + +[default] +default_calendar = Personal +highlight_event_days = True +show_all_days = True +timedelta = 7d + +[highlight_days] +default_color = dark gray +method = foreground + +[locale] +timeformat = %H:%M +dateformat = %d/%m +longdateformat = %d/%m/%Y +datetimeformat = %d/%m %H:%M +longdatetimeformat = %d/%m/%Y %H:%M +weeknumbers = off + +[view] +monthdisplay = firstfullweek + +[calendars] +[[birthdays]] +type = birthdays +path = ~/.local/share/vdirsyncer/main-contacts/contacts +color = dark red +# Prefer other events' colours when colouring days. +priority = -1 + +[[indico]] +path = ~/.local/share/vdirsyncer/indico +color = yellow +readonly = True + +[[calendars]] +type = discover +path = ~/.local/share/vdirsyncer/calendars/imported-*ics diff --git a/tw/home/files/khard.conf b/tw/home/files/khard.conf new file mode 100644 index 00000000..a3cfe41a --- /dev/null +++ b/tw/home/files/khard.conf @@ -0,0 +1,22 @@ +# https://khard.readthedocs.io/en/latest/man/khard.conf.html + +[addressbooks] +[[main]] +path = ~/.local/share/vdirsyncer/main-contacts/contacts +[[sandbox]] +path = ~/.local/share/vdirsyncer/sandbox-contacts/sandbox-contacts + +[general] +default_action = list +merge_editor = vimdiff + +[contact table] +display = formatted_name +sort = last_name +group_by_addressbook = yes +localize_dates = yes +show_nicknames = yes +show_kinds = yes +show_uids = no +preferred_phone_number_type = pref, cell, home +preferred_email_address_type = pref, home, work diff --git a/tw/home/files/kitty.conf b/tw/home/files/kitty.conf new file mode 100644 index 00000000..014e70f6 --- /dev/null +++ b/tw/home/files/kitty.conf @@ -0,0 +1,1337 @@ +# vim:fileencoding=utf-8:ft=conf:foldmethod=marker + +#: Fonts {{{ + +#: kitty has very powerful font management. You can configure +#: individual font faces and even specify special fonts for particular +#: characters. + +font_family Hermit +# bold_font auto +# italic_font auto +# bold_italic_font auto + +#: You can specify different fonts for the bold/italic/bold-italic +#: variants. To get a full list of supported fonts use the `kitty +#: list-fonts` command. By default they are derived automatically, by +#: the OSes font system. Setting them manually is useful for font +#: families that have many weight variants like Book, Medium, Thick, +#: etc. For example:: + +#: font_family Operator Mono Book +#: bold_font Operator Mono Medium +#: italic_font Operator Mono Book Italic +#: bold_italic_font Operator Mono Medium Italic + +font_size 10.0 + +#: Font size (in pts) + +# force_ltr no + +#: kitty does not support BIDI (bidirectional text), however, for RTL +#: scripts, words are automatically displayed in RTL. That is to say, +#: in an RTL script, the words "HELLO WORLD" display in kitty as +#: "WORLD HELLO", and if you try to select a substring of an RTL- +#: shaped string, you will get the character that would be there had +#: the the string been LTR. For example, assuming the Hebrew word +#: ירושלים, selecting the character that on the screen appears to be ם +#: actually writes into the selection buffer the character י. + +#: kitty's default behavior is useful in conjunction with a filter to +#: reverse the word order, however, if you wish to manipulate RTL +#: glyphs, it can be very challenging to work with, so this option is +#: provided to turn it off. Furthermore, this option can be used with +#: the command line program GNU FriBidi +#: to get BIDI +#: support, because it will force kitty to always treat the text as +#: LTR, which FriBidi expects for terminals. + +# adjust_line_height 0 +# adjust_column_width 0 + +#: Change the size of each character cell kitty renders. You can use +#: either numbers, which are interpreted as pixels or percentages +#: (number followed by %), which are interpreted as percentages of the +#: unmodified values. You can use negative pixels or percentages less +#: than 100% to reduce sizes (but this might cause rendering +#: artifacts). + +# symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 PowerlineSymbols + +#: Map the specified unicode codepoints to a particular font. Useful +#: if you need special rendering for some symbols, such as for +#: Powerline. Avoids the need for patched fonts. Each unicode code +#: point is specified in the form U+. You +#: can specify multiple code points, separated by commas and ranges +#: separated by hyphens. symbol_map itself can be specified multiple +#: times. Syntax is:: + +#: symbol_map codepoints Font Family Name + +# disable_ligatures never + +#: Choose how you want to handle multi-character ligatures. The +#: default is to always render them. You can tell kitty to not render +#: them when the cursor is over them by using cursor to make editing +#: easier, or have kitty never render them at all by using always, if +#: you don't like them. The ligature strategy can be set per-window +#: either using the kitty remote control facility or by defining +#: shortcuts for it in kitty.conf, for example:: + +#: map alt+1 disable_ligatures_in active always +#: map alt+2 disable_ligatures_in all never +#: map alt+3 disable_ligatures_in tab cursor + +#: Note that this refers to programming ligatures, typically +#: implemented using the calt OpenType feature. For disabling general +#: ligatures, use the font_features setting. + +# font_features none + +#: Choose exactly which OpenType features to enable or disable. This +#: is useful as some fonts might have features worthwhile in a +#: terminal. For example, Fira Code Retina includes a discretionary +#: feature, zero, which in that font changes the appearance of the +#: zero (0), to make it more easily distinguishable from Ø. Fira Code +#: Retina also includes other discretionary features known as +#: Stylistic Sets which have the tags ss01 through ss20. + +#: Note that this code is indexed by PostScript name, and not the font +#: family. This allows you to define very precise feature settings; +#: e.g. you can disable a feature in the italic font but not in the +#: regular font. + +#: On Linux, these are read from the FontConfig database first and +#: then this, setting is applied, so they can be configured in a +#: single, central place. + +#: To get the PostScript name for a font, use kitty + list-fonts +#: --psnames: + +#: .. code-block:: sh + +#: $ kitty + list-fonts --psnames | grep Fira +#: Fira Code +#: Fira Code Bold (FiraCode-Bold) +#: Fira Code Light (FiraCode-Light) +#: Fira Code Medium (FiraCode-Medium) +#: Fira Code Regular (FiraCode-Regular) +#: Fira Code Retina (FiraCode-Retina) + +#: The part in brackets is the PostScript name. + +#: Enable alternate zero and oldstyle numerals:: + +#: font_features FiraCode-Retina +zero +onum + +#: Enable only alternate zero:: + +#: font_features FiraCode-Retina +zero + +#: Disable the normal ligatures, but keep the calt feature which (in +#: this font) breaks up monotony:: + +#: font_features TT2020StyleB-Regular -liga +calt + +#: In conjunction with force_ltr, you may want to disable Arabic +#: shaping entirely, and only look at their isolated forms if they +#: show up in a document. You can do this with e.g.:: + +#: font_features UnifontMedium +isol -medi -fina -init + +# box_drawing_scale 0.001, 1, 1.5, 2 + +#: Change the sizes of the lines used for the box drawing unicode +#: characters These values are in pts. They will be scaled by the +#: monitor DPI to arrive at a pixel value. There must be four values +#: corresponding to thin, normal, thick, and very thick lines. + +#: }}} + +#: Cursor customization {{{ + +# cursor #cccccc + +#: Default cursor color + +# cursor_text_color #111111 + +#: Choose the color of text under the cursor. If you want it rendered +#: with the background color of the cell underneath instead, use the +#: special keyword: background + +# cursor_shape block + +#: The cursor shape can be one of (block, beam, underline) + +# cursor_beam_thickness 1.5 + +#: Defines the thickness of the beam cursor (in pts) + +# cursor_underline_thickness 2.0 + +#: Defines the thickness of the underline cursor (in pts) + +# cursor_blink_interval -1 + +#: The interval (in seconds) at which to blink the cursor. Set to zero +#: to disable blinking. Negative values mean use system default. Note +#: that numbers smaller than repaint_delay will be limited to +#: repaint_delay. + +# cursor_stop_blinking_after 15.0 + +#: Stop blinking cursor after the specified number of seconds of +#: keyboard inactivity. Set to zero to never stop blinking. + +#: }}} + +#: Scrollback {{{ + +scrollback_lines 100000 + +#: Number of lines of history to keep in memory for scrolling back. +#: Memory is allocated on demand. Negative numbers are (effectively) +#: infinite scrollback. Note that using very large scrollback is not +#: recommended as it can slow down performance of the terminal and +#: also use large amounts of RAM. Instead, consider using +#: scrollback_pager_history_size. + +# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER + +#: Program with which to view scrollback in a new window. The +#: scrollback buffer is passed as STDIN to this program. If you change +#: it, make sure the program you use can handle ANSI escape sequences +#: for colors and text formatting. INPUT_LINE_NUMBER in the command +#: line above will be replaced by an integer representing which line +#: should be at the top of the screen. Similarly CURSOR_LINE and +#: CURSOR_COLUMN will be replaced by the current cursor position. + +scrollback_pager_history_size 1024 + +#: Separate scrollback history size, used only for browsing the +#: scrollback buffer (in MB). This separate buffer is not available +#: for interactive scrolling but will be piped to the pager program +#: when viewing scrollback buffer in a separate window. The current +#: implementation stores the data in UTF-8, so approximatively 10000 +#: lines per megabyte at 100 chars per line, for pure ASCII text, +#: unformatted text. A value of zero or less disables this feature. +#: The maximum allowed size is 4GB. + +scrollback_fill_enlarged_window yes + +#: Fill new space with lines from the scrollback buffer after +#: enlarging a window. + +# wheel_scroll_multiplier 5.0 + +#: Modify the amount scrolled by the mouse wheel. Note this is only +#: used for low precision scrolling devices, not for high precision +#: scrolling on platforms such as macOS and Wayland. Use negative +#: numbers to change scroll direction. + +# touch_scroll_multiplier 1.0 + +#: Modify the amount scrolled by a touchpad. Note this is only used +#: for high precision scrolling devices on platforms such as macOS and +#: Wayland. Use negative numbers to change scroll direction. + +#: }}} + +#: Mouse {{{ + +# mouse_hide_wait 3.0 + +#: Hide mouse cursor after the specified number of seconds of the +#: mouse not being used. Set to zero to disable mouse cursor hiding. +#: Set to a negative value to hide the mouse cursor immediately when +#: typing text. Disabled by default on macOS as getting it to work +#: robustly with the ever-changing sea of bugs that is Cocoa is too +#: much effort. + +# url_color #0087bd +# url_style curly + +#: The color and style for highlighting URLs on mouse-over. url_style +#: can be one of: none, single, double, curly + +open_url_modifiers shift +# open_url_modifiers kitty_mod + +#: The modifier keys to press when clicking with the mouse on URLs to +#: open the URL + +# open_url_with default + +#: The program with which to open URLs that are clicked on. The +#: special value default means to use the operating system's default +#: URL handler. + +# url_prefixes http https file ftp gemini irc gopher mailto news git + +#: The set of URL prefixes to look for when detecting a URL under the +#: mouse cursor. + +# detect_urls yes + +#: Detect URLs under the mouse. Detected URLs are highlighted with an +#: underline and the mouse cursor becomes a hand over them. Even if +#: this option is disabled, URLs are still clickable. + +# copy_on_select no + +#: Copy to clipboard or a private buffer on select. With this set to +#: clipboard, simply selecting text with the mouse will cause the text +#: to be copied to clipboard. Useful on platforms such as macOS that +#: do not have the concept of primary selections. You can instead +#: specify a name such as a1 to copy to a private kitty buffer +#: instead. Map a shortcut with the paste_from_buffer action to paste +#: from this private buffer. For example:: + +#: map cmd+shift+v paste_from_buffer a1 + +#: Note that copying to the clipboard is a security risk, as all +#: programs, including websites open in your browser can read the +#: contents of the system clipboard. + +# strip_trailing_spaces never + +#: Remove spaces at the end of lines when copying to clipboard. A +#: value of smart will do it when using normal selections, but not +#: rectangle selections. always will always do it. + +# rectangle_select_modifiers ctrl+alt + +#: The modifiers to use rectangular selection (i.e. to select text in +#: a rectangular block with the mouse) + +# terminal_select_modifiers shift + +#: The modifiers to override mouse selection even when a terminal +#: application has grabbed the mouse + +# select_by_word_characters @-./_~?&=%+# + +#: Characters considered part of a word when double clicking. In +#: addition to these characters any character that is marked as an +#: alphanumeric character in the unicode database will be matched. + +# click_interval -1.0 + +#: The interval between successive clicks to detect double/triple +#: clicks (in seconds). Negative numbers will use the system default +#: instead, if available, or fallback to 0.5. + +focus_follows_mouse yes + +#: Set the active window to the window under the mouse when moving the +#: mouse around + +# pointer_shape_when_grabbed arrow + +#: The shape of the mouse pointer when the program running in the +#: terminal grabs the mouse. Valid values are: arrow, beam and hand + +# default_pointer_shape beam + +#: The default shape of the mouse pointer. Valid values are: arrow, +#: beam and hand + +# pointer_shape_when_dragging beam + +#: The default shape of the mouse pointer when dragging across text. +#: Valid values are: arrow, beam and hand + +#: }}} + +#: Performance tuning {{{ + +# repaint_delay 10 + +#: Delay (in milliseconds) between screen updates. Decreasing it, +#: increases frames-per-second (FPS) at the cost of more CPU usage. +#: The default value yields ~100 FPS which is more than sufficient for +#: most uses. Note that to actually achieve 100 FPS you have to either +#: set sync_to_monitor to no or use a monitor with a high refresh +#: rate. Also, to minimize latency when there is pending input to be +#: processed, repaint_delay is ignored. + +# input_delay 3 + +#: Delay (in milliseconds) before input from the program running in +#: the terminal is processed. Note that decreasing it will increase +#: responsiveness, but also increase CPU usage and might cause flicker +#: in full screen programs that redraw the entire screen on each loop, +#: because kitty is so fast that partial screen updates will be drawn. + +# sync_to_monitor yes + +#: Sync screen updates to the refresh rate of the monitor. This +#: prevents tearing (https://en.wikipedia.org/wiki/Screen_tearing) +#: when scrolling. However, it limits the rendering speed to the +#: refresh rate of your monitor. With a very high speed mouse/high +#: keyboard repeat rate, you may notice some slight input latency. If +#: so, set this to no. + +#: }}} + +#: Terminal bell {{{ + +# enable_audio_bell yes + +#: Enable/disable the audio bell. Useful in environments that require +#: silence. + +# visual_bell_duration 0.0 + +#: Visual bell duration. Flash the screen when a bell occurs for the +#: specified number of seconds. Set to zero to disable. + +# window_alert_on_bell yes + +#: Request window attention on bell. Makes the dock icon bounce on +#: macOS or the taskbar flash on linux. + +# bell_on_tab yes + +#: Show a bell symbol on the tab if a bell occurs in one of the +#: windows in the tab and the window is not the currently focused +#: window + +# command_on_bell none + +#: Program to run when a bell occurs. + +#: }}} + +#: Window layout {{{ + +# remember_window_size yes +# initial_window_width 640 +# initial_window_height 400 + +#: If enabled, the window size will be remembered so that new +#: instances of kitty will have the same size as the previous +#: instance. If disabled, the window will initially have size +#: configured by initial_window_width/height, in pixels. You can use a +#: suffix of "c" on the width/height values to have them interpreted +#: as number of cells instead of pixels. + +# enabled_layouts * + +#: The enabled window layouts. A comma separated list of layout names. +#: The special value all means all layouts. The first listed layout +#: will be used as the startup layout. Default configuration is all +#: layouts in alphabetical order. For a list of available layouts, see +#: the https://sw.kovidgoyal.net/kitty/index.html#layouts. + +# window_resize_step_cells 2 +# window_resize_step_lines 2 + +#: The step size (in units of cell width/cell height) to use when +#: resizing windows. The cells value is used for horizontal resizing +#: and the lines value for vertical resizing. + +# window_border_width 0.5pt + +#: The width of window borders. Can be either in pixels (px) or pts +#: (pt). Values in pts will be rounded to the nearest number of pixels +#: based on screen resolution. If not specified the unit is assumed to +#: be pts. Note that borders are displayed only when more than one +#: window is visible. They are meant to separate multiple windows. + +# draw_minimal_borders yes + +#: Draw only the minimum borders needed. This means that only the +#: minimum needed borders for inactive windows are drawn. That is only +#: the borders that separate the inactive window from a neighbor. Note +#: that setting a non-zero window margin overrides this and causes all +#: borders to be drawn. + +# window_margin_width 0 + +#: The window margin (in pts) (blank area outside the border). A +#: single value sets all four sides. Two values set the vertical and +#: horizontal sides. Three values set top, horizontal and bottom. Four +#: values set top, right, bottom and left. + +# single_window_margin_width -1 + +#: The window margin (in pts) to use when only a single window is +#: visible. Negative values will cause the value of +#: window_margin_width to be used instead. A single value sets all +#: four sides. Two values set the vertical and horizontal sides. Three +#: values set top, horizontal and bottom. Four values set top, right, +#: bottom and left. + +# window_padding_width 0 + +#: The window padding (in pts) (blank area between the text and the +#: window border). A single value sets all four sides. Two values set +#: the vertical and horizontal sides. Three values set top, horizontal +#: and bottom. Four values set top, right, bottom and left. + +# placement_strategy center + +#: When the window size is not an exact multiple of the cell size, the +#: cell area of the terminal window will have some extra padding on +#: the sides. You can control how that padding is distributed with +#: this option. Using a value of center means the cell area will be +#: placed centrally. A value of top-left means the padding will be on +#: only the bottom and right edges. + +# active_border_color #00ff00 + +#: The color for the border of the active window. Set this to none to +#: not draw borders around the active window. + +# inactive_border_color #cccccc + +#: The color for the border of inactive windows + +# bell_border_color #ff5a00 + +#: The color for the border of inactive windows in which a bell has +#: occurred + +# inactive_text_alpha 1.0 + +#: Fade the text in inactive windows by the specified amount (a number +#: between zero and one, with zero being fully faded). + +# hide_window_decorations no + +#: Hide the window decorations (title-bar and window borders) with +#: yes. On macOS, titlebar-only can be used to only hide the titlebar. +#: Whether this works and exactly what effect it has depends on the +#: window manager/operating system. + +# resize_debounce_time 0.1 + +#: The time (in seconds) to wait before redrawing the screen when a +#: resize event is received. On platforms such as macOS, where the +#: operating system sends events corresponding to the start and end of +#: a resize, this number is ignored. + +# resize_draw_strategy static + +#: Choose how kitty draws a window while a resize is in progress. A +#: value of static means draw the current window contents, mostly +#: unchanged. A value of scale means draw the current window contents +#: scaled. A value of blank means draw a blank window. A value of size +#: means show the window size in cells. + +# resize_in_steps no + +#: Resize the OS window in steps as large as the cells, instead of +#: with the usual pixel accuracy. Combined with an +#: initial_window_width and initial_window_height in number of cells, +#: this option can be used to keep the margins as small as possible +#: when resizing the OS window. Note that this does not currently work +#: on Wayland. + +# confirm_os_window_close 0 + +#: Ask for confirmation when closing an OS window or a tab that has at +#: least this number of kitty windows in it. A value of zero disables +#: confirmation. This confirmation also applies to requests to quit +#: the entire application (all OS windows, via the quit action). + +#: }}} + +#: Tab bar {{{ + +# tab_bar_edge bottom + +#: Which edge to show the tab bar on, top or bottom + +# tab_bar_margin_width 0.0 + +#: The margin to the left and right of the tab bar (in pts) + +# tab_bar_style fade + +#: The tab bar style, can be one of: fade, separator, powerline, or +#: hidden. In the fade style, each tab's edges fade into the +#: background color, in the separator style, tabs are separated by a +#: configurable separator, and the powerline shows the tabs as a +#: continuous line. If you use the hidden style, you might want to +#: create a mapping for the select_tab action which presents you with +#: a list of tabs and allows for easy switching to a tab. + +# tab_bar_min_tabs 2 + +#: The minimum number of tabs that must exist before the tab bar is +#: shown + +# tab_switch_strategy previous + +#: The algorithm to use when switching to a tab when the current tab +#: is closed. The default of previous will switch to the last used +#: tab. A value of left will switch to the tab to the left of the +#: closed tab. A value of right will switch to the tab to the right of +#: the closed tab. A value of last will switch to the right-most tab. + +# tab_fade 0.25 0.5 0.75 1 + +#: Control how each tab fades into the background when using fade for +#: the tab_bar_style. Each number is an alpha (between zero and one) +#: that controls how much the corresponding cell fades into the +#: background, with zero being no fade and one being full fade. You +#: can change the number of cells used by adding/removing entries to +#: this list. + +# tab_separator " ┇" + +#: The separator between tabs in the tab bar when using separator as +#: the tab_bar_style. + +# tab_powerline_style angled + +#: The powerline separator style between tabs in the tab bar when +#: using powerline as the tab_bar_style, can be one of: angled, +#: slanted, or round. + +# tab_activity_symbol none + +#: Some text or a unicode symbol to show on the tab if a window in the +#: tab that does not have focus has some activity. + +# tab_title_template "{title}" + +#: A template to render the tab title. The default just renders the +#: title. If you wish to include the tab-index as well, use something +#: like: {index}: {title}. Useful if you have shortcuts mapped for +#: goto_tab N. In addition you can use {layout_name} for the current +#: layout name and {num_windows} for the number of windows in the tab. +#: Note that formatting is done by Python's string formatting +#: machinery, so you can use, for instance, {layout_name[:2].upper()} +#: to show only the first two letters of the layout name, upper-cased. +#: If you want to style the text, you can use styling directives, for +#: example: {fmt.fg.red}red{fmt.fg.default}normal{fmt.bg._00FF00}green +#: bg{fmt.bg.normal}. Similarly, for bold and italic: +#: {fmt.bold}bold{fmt.nobold}normal{fmt.italic}italic{fmt.noitalic}. + +# active_tab_title_template none + +#: Template to use for active tabs, if not specified falls back to +#: tab_title_template. + +# active_tab_foreground #000 +# active_tab_background #eee +# active_tab_font_style bold-italic +# inactive_tab_foreground #444 +# inactive_tab_background #999 +# inactive_tab_font_style normal + +#: Tab bar colors and styles + +# tab_bar_background none + +#: Background color for the tab bar. Defaults to using the terminal +#: background color. + +#: }}} + +#: Color scheme {{{ + +# foreground #dddddd +# background #000000 + +#: The foreground and background colors + +# background_opacity 1.0 + +#: The opacity of the background. A number between 0 and 1, where 1 is +#: opaque and 0 is fully transparent. This will only work if +#: supported by the OS (for instance, when using a compositor under +#: X11). Note that it only sets the background color's opacity in +#: cells that have the same background color as the default terminal +#: background. This is so that things like the status bar in vim, +#: powerline prompts, etc. still look good. But it means that if you +#: use a color theme with a background color in your editor, it will +#: not be rendered as transparent. Instead you should change the +#: default background color in your kitty config and not use a +#: background color in the editor color scheme. Or use the escape +#: codes to set the terminals default colors in a shell script to +#: launch your editor. Be aware that using a value less than 1.0 is a +#: (possibly significant) performance hit. If you want to dynamically +#: change transparency of windows set dynamic_background_opacity to +#: yes (this is off by default as it has a performance cost) + +# background_image none + +#: Path to a background image. Must be in PNG format. + +# background_image_layout tiled + +#: Whether to tile or scale the background image. + +# background_image_linear no + +#: When background image is scaled, whether linear interpolation +#: should be used. + +# dynamic_background_opacity no + +#: Allow changing of the background_opacity dynamically, using either +#: keyboard shortcuts (increase_background_opacity and +#: decrease_background_opacity) or the remote control facility. + +# background_tint 0.0 + +#: How much to tint the background image by the background color. The +#: tint is applied only under the text area, not margin/borders. Makes +#: it easier to read the text. Tinting is done using the current +#: background color for each window. This setting applies only if +#: background_opacity is set and transparent windows are supported or +#: background_image is set. + +# dim_opacity 0.75 + +#: How much to dim text that has the DIM/FAINT attribute set. One +#: means no dimming and zero means fully dimmed (i.e. invisible). + +# selection_foreground #000000 + +#: The foreground for text selected with the mouse. A value of none +#: means to leave the color unchanged. + +# selection_background #fffacd + +#: The background for text selected with the mouse. + + +#: The 256 terminal colors. There are 8 basic colors, each color has a +#: dull and bright version, for the first 16 colors. You can set the +#: remaining 240 colors as color16 to color255. + +# color0 #000000 +# color8 #767676 + +#: black + +# color1 #cc0403 +# color9 #f2201f + +#: red + +# color2 #19cb00 +# color10 #23fd00 + +#: green + +# color3 #cecb00 +# color11 #fffd00 + +#: yellow + +# color4 #0d73cc +# color12 #1a8fff + +#: blue + +# color5 #cb1ed1 +# color13 #fd28ff + +#: magenta + +# color6 #0dcdcd +# color14 #14ffff + +#: cyan + +# color7 #dddddd +# color15 #ffffff + +#: white + +# mark1_foreground black + +#: Color for marks of type 1 + +# mark1_background #98d3cb + +#: Color for marks of type 1 (light steel blue) + +# mark2_foreground black + +#: Color for marks of type 2 + +# mark2_background #f2dcd3 + +#: Color for marks of type 1 (beige) + +# mark3_foreground black + +#: Color for marks of type 3 + +# mark3_background #f274bc + +#: Color for marks of type 1 (violet) + +#: }}} + +#: Advanced {{{ + +# shell . + +#: The shell program to execute. The default value of . means to use +#: whatever shell is set as the default shell for the current user. +#: Note that on macOS if you change this, you might need to add +#: --login to ensure that the shell starts in interactive mode and +#: reads its startup rc files. + +# editor . + +#: The console editor to use when editing the kitty config file or +#: similar tasks. A value of . means to use the environment variables +#: VISUAL and EDITOR in that order. Note that this environment +#: variable has to be set not just in your shell startup scripts but +#: system-wide, otherwise kitty will not see it. + +# close_on_child_death no + +#: Close the window when the child process (shell) exits. If no (the +#: default), the terminal will remain open when the child exits as +#: long as there are still processes outputting to the terminal (for +#: example disowned or backgrounded processes). If yes, the window +#: will close as soon as the child process exits. Note that setting it +#: to yes means that any background processes still using the terminal +#: can fail silently because their stdout/stderr/stdin no longer work. + +# allow_remote_control no + +#: Allow other programs to control kitty. If you turn this on other +#: programs can control all aspects of kitty, including sending text +#: to kitty windows, opening new windows, closing windows, reading the +#: content of windows, etc. Note that this even works over ssh +#: connections. You can chose to either allow any program running +#: within kitty to control it, with yes or only programs that connect +#: to the socket specified with the kitty --listen-on command line +#: option, if you use the value socket-only. The latter is useful if +#: you want to prevent programs running on a remote computer over ssh +#: from controlling kitty. + +# listen_on none + +#: Tell kitty to listen to the specified unix/tcp socket for remote +#: control connections. Note that this will apply to all kitty +#: instances. It can be overridden by the kitty --listen-on command +#: line flag. This option accepts only UNIX sockets, such as +#: unix:${TEMP}/mykitty or (on Linux) unix:@mykitty. Environment +#: variables are expanded. If {kitty_pid} is present then it is +#: replaced by the PID of the kitty process, otherwise the PID of the +#: kitty process is appended to the value, with a hyphen. This option +#: is ignored unless you also set allow_remote_control to enable +#: remote control. See the help for kitty --listen-on for more +#: details. + +# env + +#: Specify environment variables to set in all child processes. Note +#: that environment variables are expanded recursively, so if you +#: use:: + +#: env MYVAR1=a +#: env MYVAR2=${MYVAR1}/${HOME}/b + +#: The value of MYVAR2 will be a//b. + +# update_check_interval 0.0 + +#: Periodically check if an update to kitty is available. If an update +#: is found a system notification is displayed informing you of the +#: available update. The default is to check every 24 hrs, set to zero +#: to disable. + +# startup_session none + +#: Path to a session file to use for all kitty instances. Can be +#: overridden by using the kitty --session command line option for +#: individual instances. See +#: https://sw.kovidgoyal.net/kitty/index.html#sessions in the kitty +#: documentation for details. Note that relative paths are interpreted +#: with respect to the kitty config directory. Environment variables +#: in the path are expanded. + +# clipboard_control write-clipboard write-primary + +#: Allow programs running in kitty to read and write from the +#: clipboard. You can control exactly which actions are allowed. The +#: set of possible actions is: write-clipboard read-clipboard write- +#: primary read-primary. You can additionally specify no-append to +#: disable kitty's protocol extension for clipboard concatenation. The +#: default is to allow writing to the clipboard and primary selection +#: with concatenation enabled. Note that enabling the read +#: functionality is a security risk as it means that any program, even +#: one running on a remote server via SSH can read your clipboard. + +# allow_hyperlinks yes + +#: Process hyperlink (OSC 8) escape sequences. If disabled OSC 8 +#: escape sequences are ignored. Otherwise they become clickable +#: links, that you can click by holding down ctrl+shift and clicking +#: with the mouse. The special value of ``ask`` means that kitty will +#: ask before opening the link. + +# term xterm-kitty + +#: The value of the TERM environment variable to set. Changing this +#: can break many terminal programs, only change it if you know what +#: you are doing, not because you read some advice on Stack Overflow +#: to change it. The TERM variable is used by various programs to get +#: information about the capabilities and behavior of the terminal. If +#: you change it, depending on what programs you run, and how +#: different the terminal you are changing it to is, various things +#: from key-presses, to colors, to various advanced features may not +#: work. + +#: }}} + +#: OS specific tweaks {{{ + +# wayland_titlebar_color system + +#: Change the color of the kitty window's titlebar on Wayland systems +#: with client side window decorations such as GNOME. A value of +#: system means to use the default system color, a value of background +#: means to use the background color of the currently active window +#: and finally you can use an arbitrary color, such as #12af59 or red. + +# macos_titlebar_color system + +#: Change the color of the kitty window's titlebar on macOS. A value +#: of system means to use the default system color, a value of +#: background means to use the background color of the currently +#: active window and finally you can use an arbitrary color, such as +#: #12af59 or red. WARNING: This option works by using a hack, as +#: there is no proper Cocoa API for it. It sets the background color +#: of the entire window and makes the titlebar transparent. As such it +#: is incompatible with background_opacity. If you want to use both, +#: you are probably better off just hiding the titlebar with +#: hide_window_decorations. + +# macos_option_as_alt no + +#: Use the option key as an alt key. With this set to no, kitty will +#: use the macOS native Option+Key = unicode character behavior. This +#: will break any Alt+key keyboard shortcuts in your terminal +#: programs, but you can use the macOS unicode input technique. You +#: can use the values: left, right, or both to use only the left, +#: right or both Option keys as Alt, instead. + +# macos_hide_from_tasks no + +#: Hide the kitty window from running tasks (⌘+Tab) on macOS. + +# macos_quit_when_last_window_closed no + +#: Have kitty quit when all the top-level windows are closed. By +#: default, kitty will stay running, even with no open windows, as is +#: the expected behavior on macOS. + +# macos_window_resizable yes + +#: Disable this if you want kitty top-level (OS) windows to not be +#: resizable on macOS. + +# macos_thicken_font 0 + +#: Draw an extra border around the font with the given width, to +#: increase legibility at small font sizes. For example, a value of +#: 0.75 will result in rendering that looks similar to sub-pixel +#: antialiasing at common font sizes. + +# macos_traditional_fullscreen no + +#: Use the traditional full-screen transition, that is faster, but +#: less pretty. + +# macos_show_window_title_in all + +#: Show or hide the window title in the macOS window or menu-bar. A +#: value of window will show the title of the currently active window +#: at the top of the macOS window. A value of menubar will show the +#: title of the currently active window in the macOS menu-bar, making +#: use of otherwise wasted space. all will show the title everywhere +#: and none hides the title in the window and the menu-bar. + +# macos_custom_beam_cursor no + +#: Enable/disable custom mouse cursor for macOS that is easier to see +#: on both light and dark backgrounds. WARNING: this might make your +#: mouse cursor invisible on dual GPU machines. + +# linux_display_server auto + +#: Choose between Wayland and X11 backends. By default, an appropriate +#: backend based on the system state is chosen automatically. Set it +#: to x11 or wayland to force the choice. + +#: }}} + +#: Keyboard shortcuts {{{ + +#: Keys are identified simply by their lowercase unicode characters. +#: For example: ``a`` for the A key, ``[`` for the left square bracket +#: key, etc. For functional keys, such as ``Enter or Escape`` the +#: names are present at https://sw.kovidgoyal.net/kitty/keyboard- +#: protocol.html#functional-key-definitions. For a list of modifier +#: names, see: GLFW mods +#: + +#: On Linux you can also use XKB key names to bind keys that are not +#: supported by GLFW. See XKB keys +#: for a list of key names. The name to use is the part +#: after the XKB_KEY_ prefix. Note that you can only use an XKB key +#: name for keys that are not known as GLFW keys. + +#: Finally, you can use raw system key codes to map keys, again only +#: for keys that are not known as GLFW keys. To see the system key +#: code for a key, start kitty with the kitty --debug-keyboard option. +#: Then kitty will output some debug text for every key event. In that +#: text look for ``native_code`` the value of that becomes the key +#: name in the shortcut. For example: + +#: .. code-block:: none + +#: on_key_input: glfw key: 65 native_code: 0x61 action: PRESS mods: 0x0 text: 'a' + +#: Here, the key name for the A key is 0x61 and you can use it with:: + +#: map ctrl+0x61 something + +#: to map ctrl+a to something. + +#: You can use the special action no_op to unmap a keyboard shortcut +#: that is assigned in the default configuration:: + +#: map kitty_mod+space no_op + +#: You can combine multiple actions to be triggered by a single +#: shortcut, using the syntax below:: + +#: map key combine action1 action2 action3 ... + +#: For example:: + +#: map kitty_mod+e combine : new_window : next_layout + +#: this will create a new window and switch to the next available +#: layout + +#: You can use multi-key shortcuts using the syntax shown below:: + +#: map key1>key2>key3 action + +#: For example:: + +#: map ctrl+f>2 set_font_size 20 + +# kitty_mod ctrl+shift + +#: The value of kitty_mod is used as the modifier for all default +#: shortcuts, you can change it in your kitty.conf to change the +#: modifiers for all the default shortcuts. + +# clear_all_shortcuts no + +#: You can have kitty remove all shortcut definition seen up to this +#: point. Useful, for instance, to remove the default shortcuts. + +# kitten_alias hints hints --hints-offset=0 + +#: You can create aliases for kitten names, this allows overriding the +#: defaults for kitten options and can also be used to shorten +#: repeated mappings of the same kitten with a specific group of +#: options. For example, the above alias changes the default value of +#: kitty +kitten hints --hints-offset to zero for all mappings, +#: including the builtin ones. + +#: Clipboard {{{ + +# map kitty_mod+c copy_to_clipboard + +#: There is also a copy_or_interrupt action that can be optionally +#: mapped to Ctrl+c. It will copy only if there is a selection and +#: send an interrupt otherwise. Similarly, copy_and_clear_or_interrupt +#: will copy and clear the selection or send an interrupt if there is +#: no selection. + +# map kitty_mod+v paste_from_clipboard +# map kitty_mod+s paste_from_selection +# map shift+insert paste_from_selection +# map kitty_mod+o pass_selection_to_program + +#: You can also pass the contents of the current selection to any +#: program using pass_selection_to_program. By default, the system's +#: open program is used, but you can specify your own, the selection +#: will be passed as a command line argument to the program, for +#: example:: + +#: map kitty_mod+o pass_selection_to_program firefox + +#: You can pass the current selection to a terminal program running in +#: a new kitty window, by using the @selection placeholder:: + +#: map kitty_mod+y new_window less @selection + +#: }}} + +#: Scrolling {{{ + +# map kitty_mod+up scroll_line_up +# map kitty_mod+k scroll_line_up +# map kitty_mod+down scroll_line_down +# map kitty_mod+j scroll_line_down +map shift+page_up scroll_page_up +map shift+page_down scroll_page_down +map shift+home scroll_home +map shift+end scroll_end +# map kitty_mod+h show_scrollback + +#: You can pipe the contents of the current screen + history buffer as +#: STDIN to an arbitrary program using the ``launch`` function. For +#: example, the following opens the scrollback buffer in less in an +#: overlay window:: + +#: map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R + +#: For more details on piping screen and buffer contents to external +#: programs, see launch. + +#: }}} + +#: Window management {{{ + +# map kitty_mod+enter new_window + +#: You can open a new window running an arbitrary program, for +#: example:: + +#: map kitty_mod+y launch mutt + +#: You can open a new window with the current working directory set to +#: the working directory of the current window using:: + +#: map ctrl+alt+enter launch --cwd=current + +#: You can open a new window that is allowed to control kitty via the +#: kitty remote control facility by prefixing the command line with @. +#: Any programs running in that window will be allowed to control +#: kitty. For example:: + +#: map ctrl+enter launch --allow-remote-control some_program + +#: You can open a new window next to the currently active window or as +#: the first window, with:: + +#: map ctrl+n launch --location=neighbor some_program +#: map ctrl+f launch --location=first some_program + +#: For more details, see launch. + +# map kitty_mod+n new_os_window + +#: Works like new_window above, except that it opens a top level OS +#: kitty window. In particular you can use new_os_window_with_cwd to +#: open a window with the current working directory. + +# map kitty_mod+w close_window +# map kitty_mod+] next_window +# map kitty_mod+[ previous_window +# map kitty_mod+f move_window_forward +# map kitty_mod+b move_window_backward +# map kitty_mod+` move_window_to_top +# map kitty_mod+r start_resizing_window +# map kitty_mod+1 first_window +# map kitty_mod+2 second_window +# map kitty_mod+3 third_window +# map kitty_mod+4 fourth_window +# map kitty_mod+5 fifth_window +# map kitty_mod+6 sixth_window +# map kitty_mod+7 seventh_window +# map kitty_mod+8 eighth_window +# map kitty_mod+9 ninth_window +# map kitty_mod+0 tenth_window +#: }}} + +#: Tab management {{{ + +# map kitty_mod+right next_tab +# map kitty_mod+left previous_tab +# map kitty_mod+t new_tab +# map kitty_mod+q close_tab +# map kitty_mod+. move_tab_forward +# map kitty_mod+, move_tab_backward +# map kitty_mod+alt+t set_tab_title + +#: You can also create shortcuts to go to specific tabs, with 1 being +#: the first tab, 2 the second tab and -1 being the previously active +#: tab, and any number larger than the last tab being the last tab:: + +#: map ctrl+alt+1 goto_tab 1 +#: map ctrl+alt+2 goto_tab 2 + +#: Just as with new_window above, you can also pass the name of +#: arbitrary commands to run when using new_tab and use +#: new_tab_with_cwd. Finally, if you want the new tab to open next to +#: the current tab rather than at the end of the tabs list, use:: + +#: map ctrl+t new_tab !neighbor [optional cmd to run] +#: }}} + +#: Layout management {{{ + +# map kitty_mod+l next_layout + +#: You can also create shortcuts to switch to specific layouts:: + +#: map ctrl+alt+t goto_layout tall +#: map ctrl+alt+s goto_layout stack + +#: Similarly, to switch back to the previous layout:: + +#: map ctrl+alt+p last_used_layout +#: }}} + +#: Font sizes {{{ + +#: You can change the font size for all top-level kitty OS windows at +#: a time or only the current one. + +# map kitty_mod+equal change_font_size all +2.0 +# map kitty_mod+plus change_font_size all +2.0 +# map kitty_mod+kp_add change_font_size all +2.0 +# map kitty_mod+minus change_font_size all -2.0 +# map kitty_mod+kp_subtract change_font_size all -2.0 +# map kitty_mod+backspace change_font_size all 0 + +#: To setup shortcuts for specific font sizes:: + +#: map kitty_mod+f6 change_font_size all 10.0 + +#: To setup shortcuts to change only the current OS window's font +#: size:: + +#: map kitty_mod+f6 change_font_size current 10.0 +#: }}} + +#: Select and act on visible text {{{ + +#: Use the hints kitten to select text and either pass it to an +#: external program or insert it into the terminal or copy it to the +#: clipboard. + +# map kitty_mod+e kitten hints + +#: Open a currently visible URL using the keyboard. The program used +#: to open the URL is specified in open_url_with. + +# map kitty_mod+p>f kitten hints --type path --program - + +#: Select a path/filename and insert it into the terminal. Useful, for +#: instance to run git commands on a filename output from a previous +#: git command. + +# map kitty_mod+p>shift+f kitten hints --type path + +#: Select a path/filename and open it with the default open program. + +# map kitty_mod+p>l kitten hints --type line --program - + +#: Select a line of text and insert it into the terminal. Use for the +#: output of things like: ls -1 + +# map kitty_mod+p>w kitten hints --type word --program - + +#: Select words and insert into terminal. + +# map kitty_mod+p>h kitten hints --type hash --program - + +#: Select something that looks like a hash and insert it into the +#: terminal. Useful with git, which uses sha1 hashes to identify +#: commits + +# map kitty_mod+p>n kitten hints --type linenum + +#: Select something that looks like filename:linenum and open it in +#: vim at the specified line number. + +# map kitty_mod+p>y kitten hints --type hyperlink + +#: Select a hyperlink (i.e. a URL that has been marked as such by the +#: terminal program, for example, by ls --hyperlink=auto). + + +#: The hints kitten has many more modes of operation that you can map +#: to different shortcuts. For a full description see kittens/hints. +#: }}} + +#: Miscellaneous {{{ + +# map kitty_mod+f11 toggle_fullscreen +# map kitty_mod+f10 toggle_maximized +# map kitty_mod+u kitten unicode_input +# map kitty_mod+f2 edit_config_file +# map kitty_mod+escape kitty_shell window + +#: Open the kitty shell in a new window/tab/overlay/os_window to +#: control kitty using commands. + +# map kitty_mod+a>m set_background_opacity +0.1 +# map kitty_mod+a>l set_background_opacity -0.1 +# map kitty_mod+a>1 set_background_opacity 1 +# map kitty_mod+a>d set_background_opacity default +# map kitty_mod+delete clear_terminal reset active + +#: You can create shortcuts to clear/reset the terminal. For example:: + +#: # Reset the terminal +#: map kitty_mod+f9 clear_terminal reset active +#: # Clear the terminal screen by erasing all contents +#: map kitty_mod+f10 clear_terminal clear active +#: # Clear the terminal scrollback by erasing it +#: map kitty_mod+f11 clear_terminal scrollback active +#: # Scroll the contents of the screen into the scrollback +#: map kitty_mod+f12 clear_terminal scroll active + +#: If you want to operate on all windows instead of just the current +#: one, use all instead of active. + +#: It is also possible to remap Ctrl+L to both scroll the current +#: screen contents into the scrollback buffer and clear the screen, +#: instead of just clearing the screen:: + +#: map ctrl+l combine : clear_terminal scroll active : send_text normal,application \x0c + + +#: You can tell kitty to send arbitrary (UTF-8) encoded text to the +#: client program when pressing specified shortcut keys. For example:: + +#: map ctrl+alt+a send_text all Special text + +#: This will send "Special text" when you press the ctrl+alt+a key +#: combination. The text to be sent is a python string literal so you +#: can use escapes like \x1b to send control codes or \u21fb to send +#: unicode characters (or you can just input the unicode characters +#: directly as UTF-8 text). The first argument to send_text is the +#: keyboard modes in which to activate the shortcut. The possible +#: values are normal or application or kitty or a comma separated +#: combination of them. The special keyword all means all modes. The +#: modes normal and application refer to the DECCKM cursor key mode +#: for terminals, and kitty refers to the special kitty extended +#: keyboard protocol. + +#: Another example, that outputs a word and then moves the cursor to +#: the start of the line (same as pressing the Home key):: + +#: map ctrl+alt+a send_text normal Word\x1b[H +#: map ctrl+alt+a send_text application Word\x1bOH + +#: }}} + +# }}} diff --git a/tw/home/files/lesskey b/tw/home/files/lesskey new file mode 100644 index 00000000..8793a77c --- /dev/null +++ b/tw/home/files/lesskey @@ -0,0 +1,33 @@ +# -*- mode: conf-space -*- +# No compilation is necessary any more in recent less versions. + +#command +{ prev-file +} next-file +N reverse-search +n repeat-search +^h back-screen + +#env +LESS=--ignore-case --quit-if-one-screen --save-marks --no-histdups --RAW-CONTROL-CHARS --LONG-PROMPT --chop-long-lines +LESSOPEN=|src-hilite-lesspipe.sh %s +LESSHISTFILE=$XDG_DATA_HOME/less/history +LESSHISTSIZE=10000 +# *? setting is shared between LESS{,UTF}BINFMT, with the latter's setting taking priority +LESSBINFMT=*k%02X +LESSUTFBINFMT=U+%04lX +# Use pretty colours for bold/underline/... -- mostly in `man' +# https://wiki.archlinux.org/index.php/Color_output_in_console#less +# Note: these values are verbatim as less doesn't support escaping +# characters in lesskey (I think). +# blink -> italic white-on-red +LESS_TERMCAP_mb= +# bold -> bold blue +LESS_TERMCAP_md= +LESS_TERMCAP_me= +# reverse video -> reverse, bright yellow background +LESS_TERMCAP_so= +LESS_TERMCAP_se= +# underline -> italic green +LESS_TERMCAP_us= +LESS_TERMCAP_ue= diff --git a/tw/home/files/mailcap b/tw/home/files/mailcap new file mode 100644 index 00000000..904ce065 --- /dev/null +++ b/tw/home/files/mailcap @@ -0,0 +1,10 @@ +# mailcap -*- conf-space -*- +# When using `auto_view ` in muttrc, a command for that MIME type is +# chosen, only considering those with copiousoutput set. Its output is displayed +# in place of the attachment directly in the message view. + +text/html; lynx -display_charset=UTF-8 -dump %s; copiousoutput; nametemplate=%s.html +text/calendar; khal printics %s; copiousoutput +image/*; kitty +kitten icat %s; copiousoutput +audio/*; mpv --no-video %s +application/pdf; zathura %s diff --git a/tw/home/files/muttrc b/tw/home/files/muttrc new file mode 100644 index 00000000..470b1f2b --- /dev/null +++ b/tw/home/files/muttrc @@ -0,0 +1,173 @@ +# -*- mode: conf-space; -*- +# Colour scheme +source `echo "\$XDG_CONFIG_HOME/mutt/catppuccin.muttrc"` +color index color2 default ~O # unread, but not new, messages are green, like new messages + +# Vim-like keybindings +source ~/.guix-home/profile/share/doc/neomutt/vim-keys/vim-keys.rc +# I have a Return key, not an Enter key, and I want to use it to display the +# message, not reply to it. +bind index '' display-message +bind index '' list-reply +# group-chat-reply = reply to all recipients preserving To/Cc. +bind index a group-chat-reply +bind pager a group-chat-reply + +set abort_nosubject = ask-yes +set abort_unmodified = ask-yes +set auto_edit edit_headers fast_reply reverse_name noreverse_real_name +set sig_dashes sig_on_top +set pager_stop pager_index_lines=10 pager_context=2 pager_skip_quoted_context=3 + +set allow_ansi # needed for catimg and the like +unset help # hide keybind hints in top row +# Don't ask for confirmation. +set quit +unset confirmappend + +# Use khard for contact info. +set query_command = "khard email --parsable" + +set sort = "reverse-date" # newest first, threads grouped +set use_threads = "threads" +unset mark_old # always keep unread messages as "new" +set tilde nomarkers +set sleep_time = 0 # no delay when switching mailboxes to display info +set auto_tag # commands automatically apply to tagged messages (if any), without having to press ";" +set delete # auto-purge deleted messages when syncing + +# show IMAP mailboxes in the sidebar +set imap_check_subscribed + +set sidebar_visible sidebar_format = "%B%* %?F? %F!?%?N? %N?" +set sidebar_folder_indent sidebar_short_path + +set index_format = "%4C %Z %[%_d %b %H:%M] %-15.15L %s%* %?l?%4l&%4c?" +set status_format = " %r %f (%?M?%M/?%m#%?n? %nN?%?o? %oO?%?d? %dD?%?F? %FF?%?t? %t*?%?p? %pP?%?b? %bE?%?l? %l?) %> %s/%S %P " +set sidebar_format = "%D%* %!%?N? %N?" +set attach_format = "%u%D%I %t%4n %T%.40d%> %.9m/%.12M, %.6e%?C?, %C?, %4s " + +set mail_check_stats +set pgp_decrypt_command = "gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" +set smime_encrypt_self smime_default_key = 681F69B0 +unset arrow_cursor +set ssl_force_tls + +set new_mail_command = "if [ %u -gt 0 ]; then dunstify -a neomutt -i mail-unread 'New mail' 'You have %u unread messages.'; fi" + +set history = 1000 +set history_file = `echo "\$XDG_DATA_HOME/neomutt/history"` +set save_history = 1000 + +# The $XDG_DATA_HOME/neomutt directory must exist, else neomutt will +# silently fail to save the certificate file. +set certificate_file = `echo "\$XDG_DATA_HOME/neomutt/certificates"` +set debug_file = `echo "\${XDG_LOG_HOME:-$XDG_DATA_HOME/neomutt}/neomutt-debug.log"` + +set smime_certificates = `echo "\$XDG_DATA_HOME/neomutt/smime/certificates"` +set smime_keys = `echo "\$XDG_DATA_HOME/neomutt/smime/keys"` + +# For using both, header and body caching, $header_cache and +# $message_cachedir can be safely set to the same value. +set message_cachedir = `echo "\$XDG_CACHE_HOME/neomutt/"` +set header_cache = `echo "\$XDG_CACHE_HOME/neomutt/"` + +# I don't care about these headers; hide them by default. +ignore x-mailer user-agent + +alternative_order text/plain text/enriched text/html text image +auto_view text/html text/calendar image/jpeg image/png + +set my_mythic = "imaps://oncilla.mythic-beasts.com/" +account-hook "$my_mythic" 'unmailboxes *' +account-hook "$my_mythic" 'set folder = "$my_mythic"' +account-hook "$my_mythic" 'set smtp_url = "smtps://smtp-auth.mythic-beasts.com"' +account-hook "$my_mythic" 'set imap_user = "timo@twilken.net"' +account-hook "$my_mythic" 'set smtp_user = "timo@twilken.net"' +account-hook "$my_mythic" 'set imap_pass = `pass www/mythic-beasts/email/timo | head -1`' +account-hook "$my_mythic" 'set smtp_pass = `pass www/mythic-beasts/email/timo | head -1`' +account-hook "$my_mythic" 'set spool_file = +INBOX' +account-hook "$my_mythic" 'set postponed = +Drafts' +account-hook "$my_mythic" 'set record = +Sent' +account-hook "$my_mythic" 'set trash = +Rubbish' +account-hook "$my_mythic" 'set from = "$imap_user"' +account-hook "$my_mythic" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators imap_authenticators imap_oauth_refresh_command' + +set my_cern = "imaps://imap.cern.ch/" +account-hook "$my_cern" 'unmailboxes *' +account-hook "$my_cern" 'set folder = "$my_cern"' +account-hook "$my_cern" 'set smtp_url = "smtp://smtp.cern.ch:587"' # we need to rely on STARTTLS +account-hook "$my_cern" 'set imap_user = "twilken"' +account-hook "$my_cern" 'set smtp_user = "twilken"' +account-hook "$my_cern" 'set imap_pass = `pass cern/sso | head -1`' +account-hook "$my_cern" 'set smtp_pass = `pass cern/sso | head -1`' +account-hook "$my_cern" 'set smtp_authenticators = "login"' # only LOGIN supported, not even PLAIN +account-hook "$my_cern" "alternates '^timo\.wilken@cern\.ch$' '^twilken@cern\.ch$'" +account-hook "$my_cern" 'set spool_file = +INBOX' +account-hook "$my_cern" 'set postponed = +Drafts' +account-hook "$my_cern" 'set record = "+Sent Items"' +account-hook "$my_cern" 'set trash = "+Deleted Items"' +account-hook "$my_cern" 'set from = "$imap_user"' +account-hook "$my_cern" 'set ssl_use_tlsv1 ssl_use_tlsv1_1' # imap.cern.ch needs this; make sure to reset for other accounts! +account-hook "$my_cern" 'reset imap_authenticators imap_oauth_refresh_command' + +set my_gmail = "imaps://imap.gmail.com/" +account-hook "$my_gmail" 'unmailboxes *' +account-hook "$my_gmail" 'set folder = "$my_gmail"' +account-hook "$my_gmail" 'set smtp_url = "smtps://smtp.gmail.com"' +account-hook "$my_gmail" 'set imap_user = "timo.21.wilken@gmail.com"' +account-hook "$my_gmail" 'set smtp_user = "timo.21.wilken@gmail.com"' +account-hook "$my_gmail" 'set imap_pass = `pass www/google/app-passwords/mutt | head -1`' +account-hook "$my_gmail" 'set smtp_pass = `pass www/google/app-passwords/mutt | head -1`' +account-hook "$my_gmail" 'set spool_file = +INBOX' +account-hook "$my_gmail" 'set postponed = "+[Gmail]/Drafts"' +account-hook "$my_gmail" 'set record = "+[Gmail]/Sent Mail"' +account-hook "$my_gmail" 'set trash = "+[Gmail]/Bin"' +account-hook "$my_gmail" 'set from = "$imap_user"' +account-hook "$my_gmail" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators imap_authenticators imap_oauth_refresh_command' + +# ExOl needs OAUTH now! +# https://neomutt.org/guide/optionalfeatures.html#oauth +set my_cantab = "imaps://tw466@cantab.ac.uk@outlook.office365.com/" +account-hook "$my_cantab" 'unmailboxes *' +account-hook "$my_cantab" 'set folder = "$my_cantab"' +account-hook "$my_cantab" 'set smtp_url = "smtp://smtp-mail.outlook.com:587"' +account-hook "$my_cantab" 'set imap_user = "tw466@cantab.ac.uk"' +account-hook "$my_cantab" 'set smtp_user = "tw466@cantab.ac.uk"' +account-hook "$my_cantab" 'set imap_pass = `pass cambridge/raven | head -1`' +account-hook "$my_cantab" 'set smtp_pass = `pass cambridge/raven | head -1`' +account-hook "$my_cantab" 'set spool_file = +INBOX' +account-hook "$my_cantab" 'set postponed = +Drafts' +account-hook "$my_cantab" 'set record = "+Sent Items"' +account-hook "$my_cantab" 'set trash = "+Deleted Items"' +account-hook "$my_cantab" 'set from = "$imap_user"' +account-hook "$my_cantab" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators' +account-hook "$my_cantab" 'set imap_authenticators = "xoauth2"' +account-hook "$my_cantab" 'set imap_oauth_refresh_command = "mutt_oauth2.py --encryption-pipe=\"gpg --encrypt --recipient timo@twilken.net\" $XDG_DATA_HOME/neomutt/cantab.gpg"' + +set my_outlook = "imaps://timo_wilken@live.co.uk@outlook.office365.com/" +account-hook "$my_outlook" 'unmailboxes *' +account-hook "$my_outlook" 'set folder = "$my_outlook"' +account-hook "$my_outlook" 'set smtp_url = "smtp://smtp-mail.outlook.com:587"' +account-hook "$my_outlook" 'set imap_user = "timo_wilken@live.co.uk"' +account-hook "$my_outlook" 'set smtp_user = "timo_wilken@live.co.uk"' +account-hook "$my_outlook" 'set imap_pass = `pass www/microsoft | head -1`' +account-hook "$my_outlook" 'set smtp_pass = `pass www/microsoft | head -1`' +account-hook "$my_outlook" 'set spool_file = +INBOX' +account-hook "$my_outlook" 'set postponed = +Drafts' +account-hook "$my_outlook" 'set record = +Sent' +account-hook "$my_outlook" 'set trash = +Deleted' +account-hook "$my_outlook" 'set from = "$imap_user"' +account-hook "$my_outlook" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators' +account-hook "$my_outlook" 'set imap_authenticators = "xoauth2"' +account-hook "$my_outlook" 'set imap_oauth_refresh_command = "mutt_oauth2.py --encryption-pipe=\"gpg --encrypt --recipient timo@twilken.net\" $XDG_DATA_HOME/neomutt/outlook.gpg"' + +macro index,pager gm "set folder=$my_mythic+INBOX" "Switch to Mythic Beasts account" +macro index,pager gG "set folder=$my_gmail+INBOX" "Switch to Gmail account" +macro index,pager gw "set folder=$my_cern+INBOX" "Switch to CERN account" +macro index,pager gc "set folder=$my_cantab+INBOX" "Switch to Cantab account" +macro index,pager go "set folder=$my_outlook+INBOX" "Switch to Outlook account" + +# Open the Mythic inbox by default. +set folder = "$my_mythic" +set spool_file = "+INBOX" diff --git a/tw/home/files/neomutt b/tw/home/files/neomutt new file mode 160000 index 00000000..34816020 --- /dev/null +++ b/tw/home/files/neomutt @@ -0,0 +1 @@ +Subproject commit 34816020295ace8f4b94a4da4c89367354457f47 diff --git a/tw/home/files/newsboat.conf b/tw/home/files/newsboat.conf new file mode 100644 index 00000000..7959e138 --- /dev/null +++ b/tw/home/files/newsboat.conf @@ -0,0 +1,29 @@ +# newsboat config -*- conf-space -*- +# https://newsboat.org/releases/2.29/docs/newsboat.html#_newsboat_configuration_commands +# Vim-like keys. +bind-key j down +bind-key k up +bind-key J next-feed articlelist +bind-key K prev-feed articlelist + +# Reload feeds on startup, in parallel. +auto-reload yes +reload-threads 100 + +text-width 72 # wrap rendered HTML at 72 cols (or terminal width, if smaller) +scrolloff 2 # show 2 lines above/below selected line +show-keymap-hint no +show-title-bar yes +datetime-format "%e %b %Y" # e.g. " 9 Dec 2022" +notify-program "dunstify -a newsboat -i newsboat Newsboat" +notify-format "%d new articles (%n unread articles, %f unread feeds)" + +# Sync with Nextcloud News. +urls-source "ocnews" +ocnews-url "https://cloud.wilkenfamily.de/" +ocnews-login "timo" +ocnews-passwordeval "pass www/nextcloud/timo | head -1" +ocnews-flag-star "s" + +# Catppuccin theme. +include ~/.config/newsboat/config.catppuccin diff --git a/tw/home/files/passmenu b/tw/home/files/passmenu new file mode 100755 index 00000000..abeb98fb --- /dev/null +++ b/tw/home/files/passmenu @@ -0,0 +1,91 @@ +#!/bin/sh -e + +usage() { + cat << EOF +$(basename "$0") [-c | -p | -a] + + -c, --clip copy the user-selected password to the clipboard + -p, --type-pass auto-type the user-selected password only + -a, --type-all auto-type the user-selected username password + -h, --help show this help message and exit + -v, --version show the program version number and exit + +Later options override conflicting earlier ones. +If no option is given, -c/--clip is the default. +GNU-style combination of short options (e.g. -pa) is not supported. + +Abnormal exit codes: + 1 no password selected by user + 2 invalid command-line argument + 3 internal error + +(C) 2019-2022 Timo Wilken; MIT Licence. +Adapted from https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu. +EOF +} + +version() { + # Changelog: + # 1.0.0 (2019-??-??) initial version + # 1.0.1 (2022-07-17) script formatting; throw away passwords asap + # 1.0.2 (2022-10-??) remove fix_xdotool; this should be done on login + echo "$(basename "$0") 1.0.2" +} + +password_names() { + find "${PASSWORD_STORE_DIR-$HOME/.password-store}" -name '*.gpg' -type f \ + -printf '%P\n' | sed 's/\.gpg$//' +} + +extract_key() { + sed -rn "s/^$1:\\s+(.+)\$/\\1/p" +} + +type_stdin() { + tr -d '\n' | xdotool getactivewindow type --clearmodifiers --file - +} + +## Command-line arguments +mode=clip +while [ $# -gt 0 ]; do + case "$1" in + -o|--type-otp) mode=type-otp; shift;; + -p|--type-pass) mode=type-pass; shift;; + -a|--type-all) mode=type-all; shift;; + -c|--clip) mode=clip; shift;; + -h|--help) usage; exit;; + -v|--version) version; exit;; + + *) + echo "$(basename "$0"): unknown option: $1" >&2 + usage >&2 + exit 2;; + esac +done + +## Password selection menu +password_name=$(password_names | rofi -dmenu -i -p Password -no-custom) +[ -n "$password_name" ] || exit 1 + +## Password typing +case "$mode" in + clip) + # Suppress "copied ... to clipboard" notice on stdout. + pass show --clip "$password_name" > /dev/null;; + + type-otp) + pass otp "$password_name" | type_stdin;; + + type-*) + entry=$(pass show "$password_name") + if [ "$mode" = type-all ]; then + echo "$entry" | extract_key username | type_stdin + xdotool getactivewindow key Tab + fi + echo "$entry" | head -1 | type_stdin + unset entry;; + + *) + echo "$(basename "$0"): internal error: unknown mode: $mode" >&2 + exit 3;; +esac diff --git a/tw/home/files/picom.conf b/tw/home/files/picom.conf new file mode 100644 index 00000000..a7d86571 --- /dev/null +++ b/tw/home/files/picom.conf @@ -0,0 +1,304 @@ +# +# ~/.config/picom.conf -- Picom compositor configuration +# + +## Backend + +# Backend to use: "xrender" or "glx". +# GLX backend is typically much faster but depends on a sane driver. +backend: "glx"; + +## GLX backend + +glx-no-stencil: true; + +# GLX backend: Copy unmodified regions from front buffer instead of redrawing +# them all. My tests with nvidia-drivers show a 10% decrease in performance +# when the whole screen is modified, but a 20% increase when only 1/4 is. My +# tests on nouveau show terrible slowdown. +glx-copy-from-front: false; + +# GLX backend: Avoid rebinding pixmap on window damage. Probably could improve +# performance on rapid window content changes, but is known to break things on +# some drivers (LLVMpipe). Recommended if it works. +glx-no-rebind-pixmap: true; + +## Shadows + +# Enabled client-side shadows on windows. +shadow: false; +# The blur radius for shadows. (default 12) +shadow-radius: 25; +# The left offset for shadows. (default -15) +shadow-offset-x: -25; +# The top offset for shadows. (default -15) +shadow-offset-y: -25; +# The translucency for shadows. (default .75) +shadow-opacity: .3; + +# Set if you want different colour shadows +shadow-red: 0.03; +shadow-green: 0.03; +shadow-blue: 0.04; + +# The shadow exclude options are helpful if you have shadows enabled. Due to +# the way compton draws its shadows, certain applications will have visual +# glitches (most applications are fine, only apps that do weird things with +# xshapes or argb are affected). This list includes all the affected apps I +# found in my testing. The "! name~=''" part excludes shadows on any "Unknown" +# windows, this prevents a visual glitch with the XFWM alt tab switcher. +# From "man picom", Format of Conditions: WM_CLASS = class_i, class_g +shadow-exclude: [ +# "! name~=''", +# "name = 'Notification'", +# "name = 'Plank'", +# "name = 'Docky'", +# "name = 'Kupfer'", +# "name = 'xfce4-notifyd'", +# "name *= 'VLC'", + "name *= 'mpv'", + "class_g = 'ffplay'", +# "name *= 'compton'", +# "name *= 'Chromium'", +# "name *= 'Chrome'", + "class_g ?= 'Firefox'", +# "class_g = 'Conky'", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + "_GTK_FRAME_EXTENTS@:c", + "class_g ?= 'ulauncher'", + "class_g ?= 'tray'", + "class_g ?= 'i3-frame'", +# "class_g ?= 'Notify-osd'", +# "class_g ?= 'Cairo-dock'", +# "class_g ?= 'Xfce4-notifyd'", +# "class_g ?= 'Xfce4-power-manager'" + "class_g ?= 'Xfce4-screenshooter'", + "class_g ?= 'peek'" +]; + +# Avoid drawing shadow on all shaped windows (c.f. --detect-rounded-corners) +shadow-ignore-shaped: false; + +## Opacity + +inactive-opacity: 1; +active-opacity: 1; +frame-opacity: 1; +inactive-opacity-override: false; + +# Dim inactive windows. (0.0 - 1.0) +#inactive-dim = 0.1; +# Do not let dimness adjust based on window opacity. +#inactive-dim-fixed = true; + +# Blur background of transparent windows. Bad performance with X Render +# backend. GLX backend is preferred. +blur-method: "dual_kawase"; +blur-strength: 7; +#blur-method: "kernel"; +# generate kernel using compton-convgen.py --dump-compton gaussian 15 -f sigma=15 +#blur-kernel: "..."; +blur-background: true; +# Blur background of opaque windows with transparent frames as well. +blur-background-frame: true; +# Do not let blur radius adjust based on window opacity. +blur-background-fixed: true; +blur-background-exclude: [ + #"window_type = 'dock'", + #"window_type = 'desktop'", + "window_type = 'dnd'", + "window_type = 'dropdown_menu'", + "window_type = 'popup_menu'", + #"class_g = 'Rofi'" + "class_g ?= 'Xfce4-screenshooter'", + # for xfce4-screenshooter triggered from its xfce4-panel button + "class_g ?= 'Wrapper-2.0'", + "class_g ?= 'peek'" +]; + +## Rounded corners +#corner-radius: 16; +#rounded-corners-exclude: [ +# "window_type = 'dock'", +# "window_type = 'desktop'", +# "class_g ?= 'plasmashell'", +# "class_g ?= 'krunner'", +# "class_g ?= 'i3-frame'" +#]; + +## Fading + +# Fade windows during opacity changes. +fading: true; +# The time between steps in a fade in milliseconds. (default 10). +fade-delta: 5; +# Opacity change between steps while fading in. (default 0.028). +fade-in-step: 0.03; +# Opacity change between steps while fading out. (default 0.03). +fade-out-step: 0.03; +# Fade windows in/out when opening/closing +no-fading-openclose: false; + +# Specify a list of conditions of windows that should not be faded. +fade-exclude: []; + +## Other + +# Try to detect WM windows and mark them as active. +mark-wmwin-focused: true; +# Mark all non-WM but override-redirect windows active (e.g. menus). +mark-ovredir-focused: true; +# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead +# of using FocusIn/Out events. Usually more reliable but depends on a +# EWMH-compliant WM. +use-ewmh-active-win: true; +# Detect rounded corners and treat them as rectangular when +# --shadow-ignore-shaped is on. +detect-rounded-corners: true; + +# Detect _NET_WM_OPACITY on client windows, useful for window managers not +# passing _NET_WM_OPACITY of client windows to frame windows. This prevents +# opacity being ignored for some apps. For example without this enabled my +# xfce4-notifyd is 100% opacity no matter what. +detect-client-opacity: true; + +# Toggle VSync. See also: --vsync drm/opengl/opengl-oml. +vsync: true; + +# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate +# tearing. Reported to have no effect, though. +dbe: true; + +# Unredirect all windows if a full-screen opaque window is detected, to +# maximize performance for full-screen windows, like games. Known to cause +# flickering when redirecting/unredirecting windows. paint-on-overlay may make +# the flickering less obvious. +unredir-if-possible: true; + +# Specify a list of conditions of windows that should always be considered focused. +focus-exclude: []; + +# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group +# focused at the same time. +detect-transient: true; +# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group +# focused at the same time. WM_TRANSIENT_FOR has higher priority if +# --detect-transient is enabled, too. +detect-client-leader: true; + +opacity-rule: [ + "100:name *?= 'Call'", + "100:name *?= 'Conky'", + "100:class_g = 'Darktable'", + "50:class_g = 'Dmenu'", + "100:name *?= 'Event'", + "100:class_g = 'Firefox'", + "100:class_g = 'GIMP'", + "100:name *?= 'Image'", + "100:class_g = 'Lazpaint'", + "100:class_g = 'Midori'", + "100:name *?= 'Minitube'", + "83:class_g = 'Mousepad'", + "100:name *?= 'MuseScore'", + "90:name *?= 'Page Info'", + "100:name *?= 'Pale Moon'", + "100:name *?= 'Screenshot'", + "100:class_g = 'Viewnior'", + "100:name *?= 'VirtualBox'", + "100:name *?= 'VLC'", + "100:class_g = 'mpv'", + "100:name *?= 'Write'", + "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + "100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'" +]; + +## Window type settings + +wintypes: { + # WINDOW_TYPE is one of the 15 window types defined in the EWMH standard: + # https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html#idm45550357242464 + # fade: Fade the particular type of windows. + # shadow: Give those windows shadow + # opacity: Default opacity for the type of windows. + # focus: Controls whether the window of this type is to be always considered + # focused. (By default, all window types except "normal" and "dialog" has + # this on.) + # full-shadow: Controls whether shadow is drawn under the parts of the + # window that you normally won't be able to see. Useful when the window + # has parts of it transparent, and you want shadows in those areas. + # redir-ignore: Controls whether this type of windows should cause screen to + # become redirected again after been unredirected. If you have + # --unredir-if-possible set, and doesn't want certain window to cause + # unnecessary screen redirection, you can set this to true. + + normal: { + opacity: 1; + }; + + dialog: { + opacity: 1; + }; + + # On-screen notification + notify: { + opacity: 1; + }; + + tooltip: { + opacity: .85; + }; + + # Desktop window with icons etc. + desktop: { + }; + + # Persistent dock, usually on top of all other windows + dock: { + opacity: 1; + }; + + # Window representing something being dragged + dnd: { + opacity: .85; + shadow: true; + full-shadow: true; + }; + + # Menu "torn off" from another window + menu: { + opacity: 1; + }; + + # Toolbar "torn off" from another window + toolbar: { + opacity: 1; + }; + + # A menu from a right click + popup_menu: { + opacity: 1; + }; + + # A menu from a menu bar + dropdown_menu: { + opacity: 1; + }; + + # The pop-up/drop-down from a combo box + combo: { + opacity: 1; + }; + + # A starting application's splash screen + splash: { + opacity: 1; + }; + + # A small persistent utility window, such as a palette or toolbox + utility: { + }; + + unknown: { + }; +}; diff --git a/tw/home/files/polybar.ini b/tw/home/files/polybar.ini new file mode 100644 index 00000000..4243cb95 --- /dev/null +++ b/tw/home/files/polybar.ini @@ -0,0 +1,235 @@ +; -*- mode: conf-windows; -*- + +[global/wm] +include-file = catppuccin.ini + +[colors] +background = ${colors.base} +background-alt = ${colors.surface0} +primary = ${colors.blue} +alert = ${colors.yellow} +disabled = ${colors.overlay2} +empty-bar = ${colors.surface2} + +[settings] +screenchange-reload = true + +[bar/primary] +monitor = ${env:POLYBAR_MONITOR} +width = 100% +height = 24pt +radius = 0 +line-size = 3pt +line-color = ${colors.primary} +border-size = 0 +padding-left = 0 +padding-right = 2 +module-margin = 2 + +background = ${colors.background} +foreground = ${colors.text} + +font-0 = Fira Sans:size=11;2 +; Some workspace names have emojis in them. +font-1 = Openmoji:size=11;2 +; Hermit is needed for Unicode block chars. +font-2 = Hermit:size=10;1 + +separator = · +separator-foreground = ${colors.disabled} + +modules-left = i3 xwindow +modules-right = memory cpu temp xkeyboard pulseaudio dunst wlan eth battery date +tray-position = right + +enable-ipc = true + +cursor-click = pointer +cursor-scroll = ns-resize + +[module/i3] +type = internal/i3 +pin-workspaces = false +show-urgent = true +strip-wsnumbers = true +index-sort = true +label-mode-foreground = ${colors.alert} +label-mode-background = ${colors.background-alt} +label-mode-padding = 2 +label-focused-overline = ${colors.primary} +label-focused-padding = 1 +label-urgent-foreground = ${colors.alert} +label-urgent-background = ${colors.background-alt} +label-urgent-padding = 1 +label-unfocused-padding = 1 +label-visible-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title% +label-maxlen = 120 + +[module/pulseaudio] +type = internal/pulseaudio +format-volume = +label-volume = %percentage%% +label-muted = 🔇 +label-muted-foreground = ${colors.disabled} + +ramp-volume-0 = 🔈 +ramp-volume-1 = 🔉 +ramp-volume-2 = 🔊 +ramp-volume-0-foreground = ${colors.primary} +ramp-volume-1-foreground = ${colors.primary} +ramp-volume-2-foreground = ${colors.primary} + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock +; hide xkeyboard module unless Caps Lock is pressed +label-layout = +label-indicator-padding = 1 +label-indicator-margin = 0 +label-indicator-foreground = ${colors.alert} +label-indicator-background = ${colors.background-alt} + +[module/memory] +type = internal/memory +interval = 1 +format =