Yes this is a mess, but I want it up and backed up just in case. This *works*, as ugly as the files are.

This commit is contained in:
Phil Bajsicki 2023-09-21 02:46:05 +02:00
parent c8021a7b1b
commit 5a536877f4
12 changed files with 2389 additions and 518 deletions

File diff suppressed because one or more lines are too long

6
.config/doom/config Normal file
View file

@ -0,0 +1,6 @@
(global-unset-key (kbd "C-c l"))
(global-set-key (kbd "C-c l l") 'org-super-links-link)
(global-set-key (kbd "C-c l s") 'org-super-links-store-link)
(global-set-key (kbd "C-c l i") 'org-super-links-insert-drawer-link)
(global-set-key (kbd "C-c l r") 'org-super-links-quick-related)
(global-set-key (kbd "C-c l d") 'org-super-links-delete-link)

View file

@ -1,49 +1,122 @@
(setq user-full-name "Phil Bajsicki")
(setq global-auto-revert-mode t)
(org-edna-mode)
(setq auth-sources '("~/.authinfo"))
(setq-default backup-inhibited t)
(setq straight-repository-branch "develop")
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(after! counsel
(setq counsel-outline-display-style 'title))
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(setq doom-font (font-spec :family "Iosevka" :size 12 :weight 'semi-light)
doom-variable-pitch-font (font-spec :family "Iosevka" :size 13))
(load-theme 'doom-one t)
(doom-themes-neotree-config)
(doom-themes-org-config)
(set-frame-parameter nil 'alpha-background 70)
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(setq doom-font (font-spec :family "IosevkaTerm" :size 12)
doom-unicode-font (font-spec :family "IosevkaTerm" :size 12))
(dolist (charset '(unicode))
(set-fontset-font (frame-parameter nil 'font)
charset (font-spec :family "IosevkaTerm" :size 12)))
(add-to-list 'default-frame-alist '(alpha-background . 70))
(set-frame-parameter nil 'alpha-background 70)
(add-to-list 'default-frame-alist '(alpha-background . 80))
(setq display-line-numbers-type 'relative)
(setq next-screen-context-lines 4)
(setq-default global-visual-line-mode t)
(setq x-stretch-cursor t)
(setq column-number-mode t)
(after! persp-mode
(setq persp-emacsclient-init-frame-behaviour-override "main"))
(setq doom-modeline-persp-name t)
(setq straight-repository-branch "develop")
(global-set-key "\C-g" 'keyboard-quit)
(global-set-key "\C-cu" 'browse-url-chrome)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(setq org-directory "~/enc/org/")
(setq org-contacts-files
(file-expand-wildcards "~/enc/org/*.org"))
(setq org-enforce-todo-dependencies t)
(setq org-insert-heading-respect-content nil)
(setq org-reverse-note-order nil)
(setq org-show-following-heading t)
(setq org-show-hierarchy-above t)
(setq org-show-siblings nil)
(setq org-deadline-warning-days 7)
(setq org-blank-before-new-entry (quote ((heading . t)
(plain-list-item . nil))))
(setq org-todo-repeat-to-state "LOOP")
(setq org-remove-highlights-with-change nil)
(setq org-read-date-prefer-future nil)
(setq org-special-ctrl-a/e t)
(setq org-special-ctrl-k t)
(setq org-yank-adjusted-subtrees t)
(setq org-M-RET-may-split-line t)
(setq org-log-done (quote time))
(setq org-log-into-drawer t)
(setq org-catch-invisible-edits "smart")
(setq org-completion-use-ido t)
(setq org-use-property-inheritance nil)
(setq org-hierarchical-todo-statistics t)
(org-align-tags t)
(modify-all-frames-parameters
'((right-divider-width . 2)
(internal-border-width . 0)))
(dolist (face '(window-divider
window-divider-first-pixel
window-divider-last-pixel))
(face-spec-reset-face face)
(set-face-foreground face (face-attribute 'default :background)))
(set-face-background 'fringe (face-attribute 'default :background))
(setq
;; Edit settings
org-auto-align-tags nil
org-tags-column 0
org-catch-invisible-edits 'show-and-error
org-insert-heading-respect-content t
;; Org styling, hide markup etc.
org-hide-emphasis-markers t
org-pretty-entities t
org-ellipsis ""
;; Agenda styling
org-agenda-tags-column 0
org-agenda-block-separator ?─
org-agenda-time-grid
'((daily today require-timed)
(800 1000 1200 1400 1600 1800 2000)
" ┄┄┄┄┄ " "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄")
org-agenda-current-time-string
"⌚ now ─────────────────────────────────────────────────")
(global-org-modern-mode)
(setq-default org-enforce-todo-dependencies t)
(setq org-enforce-todo-checkbox-dependencies t)
(setq org-superstar-headline-bullets-list
'("" "" "" "" ""))
(setq org-M-RET-may-split-line '((default . t)))
(setq org-contacts-files '("~/enc/org/people.org"))
(add-hook 'write-file-hooks 'time-stamp)
(add-hook 'org-mode-hook
(lambda ()
;; yasnippet
;;disabled; (make-variable-buffer-local 'yas/trigger-key)
;;disabled; (org-set-local 'yas/trigger-key [tab])
;;disabled; (define-key yas/keymap [tab] 'yas/next-field-group)
;; flyspell mode for spell checking everywhere
;;disabled; (flyspell-mode 1)
;; auto-fill mode on
(auto-fill-mode 1)))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ch" 'counsel-org-link)
@ -51,23 +124,12 @@
(global-set-key "\C-cnn" 'org-capture)
(global-set-key "\C-cia" '(lambda ()(interactive)
(org-timestamp '(16))))
(org-time-stamp '(16))))
(global-set-key "\C-cii" '(lambda () (interactive)
(org-timestamp-inactive '(16))))
(org-time-stamp-inactive '(16))))
(add-hook 'org-insert-heading-hook
(lambda ()
(if
(or
(string-match "journal" buffer-file-name)
(string-match "therapy" buffer-file-name))
((lambda ()
(interactive)
(org-timestamp-inactive '(16))))
(setq 'org-insert-heading-hook nil)
)))
(setq org-todo-keywords
(after! org
(setq org-todo-keywords
'((sequence
"INBOX(i)"
"TASK(t)" ; A task that needs doing & is ready to do
@ -85,31 +147,29 @@
"YES(y)" ; take action
"NO(n)")) ; don't take action
org-todo-keyword-faces
'(("[-]" . +org-todo-active)
("STRT" . +org-todo-active)
("[?]" . +org-todo-onhold)
("WAIT" . +org-todo-onhold)
("HOLD" . +org-todo-onhold)
("PROJ" . +org-todo-project)
("NO" . +org-todo-cancel)
("KILL" . +org-todo-cancel)))
'(
("INBOX" :foreground "cyan" :weight bold)
("TASK" :foreground "purple" :weight bold)
("PROJ" :foreground "violet" :weight bold)
("LOOP" :foreground "magenta" :weight bold)
("WAIT" :foreground "yellow" :weight bold)
("HOLD" :foreground "orange" :weight bold)
("DONE" :foreground "green" :weight bold)
("KILL" :foreground "grey" :weight bold))))
(setq hl-todo-keyword-faces
'(("HOLD" . "#d0bf8f")
("TODO" . "#cc9393")
("NEXT" . "#dca3a3")
("THEM" . "#dc8cc3")
("PROG" . "#7cb8bb")
("OKAY" . "#7cb8bb")
("DONT" . "#5f7f5f")
("FAIL" . "#8c5353")
("DONE" . "#afd8af")
("NOTE" . "#d0bf8f")
("KLUDGE" . "#d0bf8f")
("HACK" . "#d0bf8f")
("TEMP" . "#d0bf8f")
("FIXME" . "#cc9393")
("XXXX*" . "#cc9393")))
(add-hook 'org-insert-heading-hook
(lambda ()
(if
(or
(string-match "journal.org" buffer-file-name)
(string-match "money" buffer-file-name)
(string-match "therapy.org" buffer-file-name))
((lambda ()
(interactive)
(org-time-stamp-inactive '(16))
(newline)))
(setq org-insert-heading-hook nil)
)))
(setq org-capture-templates '(("t" "inbox" entry (file+headline "~/enc/org/phil.org" "Inbox") "* TODO %i%?")
("i" "idea" entry (file+headline "~/enc/org/phil.org" "Ideas") "* %?")
@ -128,6 +188,87 @@
:BIRTHDAY:
:END:")))
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
(defun org-super-links-quick-related ()
(interactive)
(let ((org-super-links-link-prefix "\nrelated: "))
(org-super-links-link)))
(setq org-super-links-related-into-drawer t)
(setq org-super-links-related-drawer-default-name "RELATED"
org-super-links-link-prefix 'org-super-links-link-prefix-timestamp)
(setq org-export-with-broken-links t) ;; avoiding error on export
(global-unset-key (kbd "C-c l"))
(global-set-key (kbd "C-c l l") 'org-super-links-link)
(global-set-key (kbd "C-c l s") 'org-super-links-store-link)
(global-set-key (kbd "C-c l i") 'org-super-links-insert-drawer-link)
(global-set-key (kbd "C-c l r") 'org-super-links-quick-related)
(global-set-key (kbd "C-c l d") 'org-super-links-delete-link)
(org-super-agenda-mode)
(setq super-agenda-groups
'(;; Each group has an implicit boolean OR operator between its selectors.
(:name "Today" ; Optionally specify section name
:time-grid t ; Items that appear on the time grid
)
(:name "DEADLINES" :deadline t :order 1)
(:name "Focus | [A]" :tag "Focus" :priority "A" :order 2 :face (:append t :weight bold))
;; (:name "Important" :priority "A" :order 4)
;; (:name "Habits" :habit t :order 3)
;; (:name "Shopping" :tag "Besorgung" :order 8)
;; Boolean AND group matches items that match all subgroups
;; :and (:tag "shopping" :tag "@town")
;; Multiple args given in list with implicit OR
;; :tag ("food" "dinner"))
;; :habit t
;; :tag "personal")
(:name "Started" :and (:todo "TASK" :not (:tag "someday") :not (:priority "C") :not (:priority "B") ) :order 10)
;;(:name "Space-related (non-moon-or-planet-related)"
;; ;; Regexps match case-insensitively on the entire entry
;; :and (:regexp ("space" "NASA")
;; ;; Boolean NOT also has implicit OR between selectors
;; :not (:regexp "moon" :tag "planet")))
;;(:name "BWG" :tag "@BWG" :order 16)
;; (:name "read" :tag "2read" :order 22)
;; Groups supply their own section names when none are given
(:name "Someday" :and ( :todo ("WAIT" "HOLD" "INBOX") :tag "someday" :not (:priority "C") :not (:priority "B"))
;; Show this group at the end of the agenda (since it has the
;; highest number). If you specified this group last, items
;; with these todo keywords that e.g. have priority A would be
;; displayed in that group instead, because items are grouped
;; out in the order the groups are listed.
:order 25)
;; "other items": an auto-group with order 99 ----------------------------
(:name "Prio ≤ B" :priority<= "B"
;; Show this section after "Today" and "Important", because
;; their order is unspecified, defaulting to 0. Sections
;; are displayed lowest-number-first.
:order 105)
(:name "reward"
:tag ("reward" "lp")
:order 110
)
(:name "Waiting…" :todo "WAIT" :order 118) ; Set order of this section
;; After the last group, the agenda will display items that didn't
;; match any of these groups, with the default order position of 99
))
(defun my-super-agenda()
"generates my super-agenda"
(interactive)
(org-super-agenda-mode)
(let
((org-super-agenda-groups super-agenda-groups))
(org-agenda nil "a")
)
)
(org-wild-notifier-mode)
(setq org-wild-notifier-alert-time '(10))
@ -139,6 +280,8 @@
(setq org-outline-path-complete-in-steps nil)
(setq org-refile-use-outline-path t)
(setq org-contacts-files '("~/enc/org/people.org"))
(define-prefix-command 'org-roam-map)
(global-set-key "\C-r" 'org-roam-map)
(define-key org-roam-map "o" 'org-roam-buffer-toggle)
@ -156,44 +299,20 @@
(setq org-roam-capture-templates
'(("n" "default" plain
"%?"
:if-new (file+head "%<%Y.%m.%d.%H\:%M>-${slug}.org" "#+title: ${title}\n")
:if-new (file+head "${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: \n")
:empty-lines 1
:unnarrowed t)
("j" "journal" plain
"%?"
:if-new (file+head "journal/journal-%<%Y.%m.%d.%H\:%M>-${slug}.org" "#+title: ${title}\n")
:if-new (file+head "journal/journal-${slug}.org" "#+title: ${title}\n#+category: 📔${title}\n#+filetags: 📔\n")
:empty-lines 1
:unnarrowed t)
("t" "Therapy" plain
"
* Sytuacja
** Myśli
** Emocje
** Zachowania
** Argumenty potwierdzające myśli
** Argumenty podważające
** Myśli alternatywne
** Emocje alternatywne-
** Zachowania alternatywne
"
:if-new (file+head "therapy/therapy-%<%Y.%m.%d.%H\:%M>-${slug}.org" "#+title: ${title}\n")
"#+title: ${title}\n"
:if-new (file+head "therapy/therapy-${slug}.org" "#+title: ${title}\n#+category: 📗 ${title}\n#+filetags: 📗\n")
:empty-lines 1
:unnarrowed)))
(use-package! websocket
:after org-roam)
(use-package! org-roam-ui
:after org-roam ;; or :after org
;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t
org-roam-ui-follow t
org-roam-ui-update-on-save t
org-roam-ui-open-on-start t))
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/elgantt/")
(setq elgantt-header-type 'outline
@ -231,12 +350,230 @@
org-agenda-insert-diary-extract-time t
org-log-into-drawer t
org-clock-into-drawer t
org-agenda-log-mode-items '(closed clock state))
org-agenda-log-mode-items '(closed clock state)
org-agenda-prefix-format "%l %i %c %s %t")
(setq org-agenda-compact-blocks t)
(setq org-agenda-use-tag-inheritance (quote (agenda)));; agenda performance
(setq org-agenda-span 1)
(add-hook 'org-agenda-mode-hook '(lambda () (hl-line-mode 1)))
(setq org-agenda-custom-commands
(quote (("x" "Phil's view" agenda ""
((org-agenda-prefix-format " %i %b %-12:c %s %t "))))))
((org-agenda-prefix-format " %i %-12:c %s %t "))))))
(setq org-agenda-todo-ignore-with-date nil)
(setq org-agenda-todo-ignore-deadlines (quote far))
(setq org-agenda-todo-ignore-scheduled (quote future))
(setq org-agenda-skip-deadline-if-done t)
(setq org-agenda-skip-scheduled-if-done t)
(setq org-agenda-text-search-extra-files (quote (agenda-archives)))
(setq org-agenda-log-mode-items (quote (state)))
;(setq org-agenda-skip-additional-timestamps-same-entry t)
(setq org-agenda-skip-additional-timestamps-same-entry nil)
(setq org-agenda-search-headline-for-time nil)
(setq org-agenda-window-setup 'current-window)
(setq org-agenda-include-diary t)
(setq org-agenda-repeating-timestamp-show-all t)
(setq org-agenda-show-all-dates t)
(setq org-agenda-sorting-strategy
(quote ((agenda habit-down time-up user-defined-up priority-down category-keep)
(todo priority-down category-keep)
(tags priority-down category-keep)
(search category-keep))))
(setq org-agenda-start-on-weekday nil)
(setq org-agenda-skip-timestamp-if-deadline-is-shown t)
(setq org-agenda-cmp-user-defined 'bh/agenda-sort)
;;(setq org-agenda-tags-column -102)
(setq org-tags-column -101); for powerplantwin 23" TFT turned 90
; degrees; should *not* differ between
; systems! Otherwise Org-files gets
; re-formatted after switching
; system
;;(when (my-system-type-is-windows)
;; ;;(setq org-agenda-tags-column -103);; for 23" TFT turned 90 degrees
;; (setq org-agenda-tags-column -117);; for 24" TFT turned 90 degrees
;; )
;;(when (my-system-is-sting)
;; (setq org-agenda-tags-column -117);; -117 for 23" TFT sting, rotated 90°
;; )
(setq org-agenda-tags-column (- (- (window-total-width) 3))) ;; total width minus 3
(define-key org-agenda-mode-map (kbd "C-p") 'my-scroll-down-half)
(define-key org-agenda-mode-map (kbd "C-n") 'my-scroll-up-half)
(setq org-agenda-skip-scheduled-if-deadline-is-shown nil)
;;(setq org-agenda-skip-deadline-prewarning-if-scheduled t)
(setq org-global-properties (quote (("STYLE_ALL" . "habit"))))
(setq org-habit-graph-column 100)
(defun org-agenda-sharpie ()
"Censor the text of items in the agenda."
(interactive)
(let (regexp old-heading new-heading properties)
;; Save face properties of line in agenda to reapply to changed text
(setq properties (text-properties-at (point)))
;; Go to source buffer
(org-with-point-at (org-find-text-property-in-string 'org-marker
(buffer-substring (line-beginning-position)
(line-end-position)))
;; Save old heading text and ask for new text
(line-beginning-position)
(unless (org-at-heading-p)
;; Not sure if necessary
(org-back-to-heading))
(setq old-heading (when (looking-at org-complex-heading-regexp)
(match-string 4))))
(unless old-heading
(error "Can't find heading. How can this be?"))
;; Back to agenda buffer
(setq new-heading (read-from-minibuffer "Overwrite visible heading with: "))
(add-text-properties 0 (length new-heading) properties new-heading)
;; Replace agenda text
(save-excursion
(let ((inhibit-read-only t))
(goto-char (line-beginning-position))
(when (search-forward old-heading (line-end-position))
(replace-match new-heading 'fixedcase 'literal))))))
(setq org-export-initial-scope 'subtree)
(setq org-export-with-broken-links t)
(with-eval-after-load 'ox-latex
;;(message (concat "################################################\norg-latex-classes = [" org-latex-classes "]"))
(add-to-list 'org-latex-classes
'("scrartcl"
"\\documentclass\[a4paper,parskip=half\]\{scrartcl\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
(add-to-list 'org-latex-classes
'("detego"
"\\documentclass\[a4paper,parskip=half,11pt,headinclude=false,footinclude=false\]\{scrartcl\}
\\usepackage\[ngerman,american\]\{babel\}\\usepackage\{eurosym\}\\usepackage\{xspace\}\\usepackage\[usenames,dvipsnames\]\{xcolor\}
\\usepackage\[protrusion=true,factor=900\]\{microtype\}\\usepackage\{enumitem\}
\\definecolor\{DispositionColor\}\{RGB\}\{0,54,90\}
\\usepackage\{helvet\}
\\renewcommand\{\\familydefault\}\{\\sfdefault\}
\\DeclareRobustCommand\{\\myacro\}\[1\]\{\\textsc\{\\lowercase\{#1\}\}\} %% abbrevations using small caps
\\usepackage{scrlayer-scrpage} \\rehead{\\includegraphics\[height=1cm\]{{c:/Users/karl.voit/.emacs.d/bin/images/Detego-Logo-209x41.png}}} \\pagestyle{scrheadings} %% Logo in header
\\newenvironment{NOTES}{}{} %% declares org-reveal environment in PDF output
\\usepackage[space]{grffile} %% enable spaces in filenames of includegraphics
%% colorful headings:
%\\setheadsepline\{.4pt\}\[\\color\{DispositionColor\}\]
\\renewcommand\{\\headfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\renewcommand\{\\pnumfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\addtokomafont\{disposition\}\{\\color\{DispositionColor\}\}
\\addtokomafont\{caption\}\{\\color\{DispositionColor\}\\footnotesize\}
\\addtokomafont\{captionlabel\}\{\\color\{DispositionColor\}\}
\\usepackage\{enumitem\}
\\setlist\{noitemsep\} %% kills the space between items
"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
(add-to-list 'org-latex-classes
'("rise"
"\\documentclass\[a4paper,parskip=half,11pt,headinclude=false,footinclude=false\]\{scrartcl\}
\\usepackage\[ngerman,american\]\{babel\}\\usepackage\{eurosym\}\\usepackage\{xspace\}\\usepackage\[usenames,dvipsnames\]\{xcolor\}
\\usepackage\[protrusion=true,factor=900\]\{microtype\}\\usepackage\{enumitem\}
\\definecolor\{DispositionColor\}\{RGB\}\{0,54,90\}
\\usepackage\{helvet\}
\\renewcommand\{\\familydefault\}\{\\sfdefault\}
\\DeclareRobustCommand\{\\myacro\}\[1\]\{\\textsc\{\\lowercase\{#1\}\}\} %% abbrevations using small caps
\\usepackage{scrlayer-scrpage} \\rehead{\\includegraphics\[height=1cm\]{{c:/Users/karl.voit/.emacs.d/bin/images/RISE_logo_202x500.jpeg}}} \\pagestyle{scrheadings} %% Logo in header
\\newenvironment{NOTES}{}{} %% declares org-reveal environment in PDF output
\\usepackage[space]{grffile} %% enable spaces in filenames of includegraphics
%% colorful headings:
%\\setheadsepline\{.4pt\}\[\\color\{DispositionColor\}\]
\\renewcommand\{\\headfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\renewcommand\{\\pnumfont\}\{\\normalfont\\sffamily\\color\{DispositionColor\}\}
\\addtokomafont\{disposition\}\{\\color\{DispositionColor\}\}
\\addtokomafont\{caption\}\{\\color\{DispositionColor\}\\footnotesize\}
\\addtokomafont\{captionlabel\}\{\\color\{DispositionColor\}\}
\\usepackage\{enumitem\}
\\setlist\{noitemsep\} %% kills the space between items
"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
(add-to-list 'org-latex-classes
'("lyrics"
"\\documentclass\[a4paper,parskip=half\]\{scrartcl\}
\\renewcommand*\\sfdefault\{lcmss\} \\renewcommand*\\familydefault\{\\sfdefault\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
(add-to-list 'org-latex-classes
'("lyrics2"
"\\documentclass\[a4paper,parskip=half,twocolumn\]\{scrartcl\}
\\renewcommand*\\sfdefault\{lcmss\} \\renewcommand*\\familydefault\{\\sfdefault\}"
("\\section\{%s\}" . "\\section*\{%s\}")
("\\subsection\{%s\}" . "\\subsection*\{%s\}")
("\\subsubsection\{%s\}" . "\\subsubsection*\{%s\}")))
(add-to-list 'org-latex-classes
'("memoirbook"
"\\documentclass[a5paper,12pt]{memoir}"
;; "\\semiisopage[8]"
;; "\\hypersetup{colorlinks=true,linkcolor={Blue},urlcolor={Blue}}" ;; genera un problema al exportar
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
'(org-export-latex-default-class "memoir")
);; with-eval-after-load
(use-package ox-asciidoc
;;:ensure t ;; install package if not found OR: (setq use-package-always-ensure t)
:defer 110
)
(defun my-org-copy-region-as-markdown ()
"Copy the region (in Org) to the system clipboard as Markdown."
(interactive)
(if (use-region-p)
(let* ((region
(buffer-substring-no-properties
(region-beginning)
(region-end)))
(markdown
(org-export-string-as region 'md t '(:with-toc nil))))
(gui-set-selection 'CLIPBOARD markdown))))
(setq doom-snippets-enable-short-helpers t)
@ -245,3 +582,21 @@
("png" . "sxiv")
("mkv" . "mpv")
("mp4" . "mpv")))
(mode-icons-mode)
(add-hook 'dired-mode-hook #'mode-icons--mode-disable) ;; with mode-icons, visiting a dir with dired takes up *lots* of CPU for =mode-icons-reset= (performance-issue)
(add-to-list 'auto-mode-alist '("\\.[Cc][Ss][Vv]\\'" . csv-mode))
(autoload 'csv-mode "csv-mode"
"Major mode for editing comma-separated value files." t)
;; To open files with .journal extension in hledger-mode
(add-to-list 'auto-mode-alist '("\\.journal\\'" . hledger-mode))
;; Provide the path to you journal file.
;; The default location is too opinionated.
(setq hledger-jfile "~/enc/org/hledger/2023.journal")
;;; Auto-completion for account names
;; For company-mode users,
(add-to-list 'company-backends 'hledger-company)

View file

@ -3,8 +3,10 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ignored-local-variable-values '((org-ql-ask-unsafe-queries)))
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
'(org-safe-remote-resources
'("\\`https://bajsicki\\.com/org-html-themes/org/theme-readtheorg\\.setup\\'")))
'("\\`https://lvxnox\\.com/org-html-themes/org/theme-readtheorg\\.setup\\'" "\\`https://bajsicki\\.com/org-html-themes/org/theme-readtheorg\\.setup\\'")))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View file

@ -1,66 +1,195 @@
;;; init.el -*- lexical-binding: t; -*-
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
company
ivy
:completion
company ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
doom
doom-dashboard
doom-quit
(emoji +unicode)
hl-todo
ligatures
modeline
ophints
(popup +defaults)
treemacs
unicode
vi-tilde-fringe
workspaces
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
;;hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
indent-guides ; highlighted indent columns
(ligatures +extra +iosevka) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
treemacs ; a project drawer, like neotree but cooler
unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
file-templates
fold
(format +onsave)
snippets
word-wrap
:editor
;;(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent
:emacs
dired
electric
undo
vc
:emacs
dired ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
(undo +tree) ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
vterm
:term
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
grammar ; tasing grammar mistake every you make
:tools
(eval +overlay)
lookup
lsp
magit
pdf
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
lsp ; M-x vscode
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
;;tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:lang
common-lisp
data
emacs-lisp
(haskell +lsp)
latex
(org +pretty)
plantuml
raku
shipsweb
rust
yaml
zig
:os
(:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:config
;literate
(default +bindings +smartparens)
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
clojure ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
json ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
javascript ; all(hope(abandon(ye(who(enter(here))))))
julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
org ; organize your plain life in plain text
php ; perl's insecure younger brother
plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
web ; the tubes
yaml ; JSON, but readable
zig ; C, but simpler
)
:email
;;(mu4e +org +gmail)
;;notmuch
;;(wanderlust +gmail)
:app
calendar
;;emms
everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate
(default +bindings +smartparens))

View file

@ -15,27 +15,45 @@
(package! fish-mode)
(package! typescript-mode)
(package! wc-mode)
(package! ivy)
(package! ivy-xref)
(package! plantuml-mode)
(package! csv-mode)
(package! dired-open)
;; (package! helm-xref)
;; Fix for org-roam link issue
(package! org :pin "ca873f7")
(package! org-auto-tangle)
(package! org-modern)
(package! org-ql)
(package! org-sidebar
:recipe (
:host github
:repo "alphapapa/org-sidebar"
))
(package! org-contacts)
(package! org-bullets)
(package! org-download)
(package! org-cliplink)
(package! org-roam :pin "ca873f7")
(package! org-ql)
(package! org-roam)
(package! org-super-agenda)
(package! org-wild-notifier)
(unpin! org-roam)
(package! org-roam-ui)
(package! org-depend
:recipe (
:host github
:repo "fgeller/org-mode"
:files ("contrib/lisp/org-depend.el")))
(package! org-edna)
(package! org-super-links
:recipe (
:type git
:host github
:repo "toshism/org-super-links"
:branch "develop"
))
(package! elgantt
:recipe (:host github :repo "legalnonsense/elgantt"))
(package! mode-icons)
(package! qrencode)
(package! hledger-mode)

View file

@ -21,7 +21,7 @@ set VISUAL "emacsclient -c -a emacs"
set QT_QPA_PLATFORMTHEME "qt6ct"
set SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
set GNUPGHOME "~/enc/keys/gnupg"
set LEDGER_FILE "~/enc/org/hledger/2023.journal"
#+end_src
* Manpager
@ -241,27 +241,6 @@ alias .5='cd ../../../../..'
#+begin_src fish
alias vim='nvim'
#+end_src
** emacs
Aliases for [[https://github.com/doomemacs/doomemacs][Doom Emacs]].
*** em
Opens emacs in the terminal.
#+begin_src fish
alias em='/usr/bin/emacs -nw'
#+end_src
*** emacs
Calls ~emacsclient -c -a 'emacs'~.
#+begin_src fish
alias emacs="emacsclient -c -a 'emacs'"
#+end_src
*** doom
These aliases call the ~doom~ script from ~~/.config/emacs/bin~.
#+begin_src fish
alias doomsync="~/.config/emacs/bin/doom sync"
alias doomdoctor="~/.config/emacs/bin/doom doctor"
alias doomupgrade="~/.config/emacs/bin/doom upgrade"
alias doompurge="~/.config/emacs/bin/doom purge"
#+end_src
** exa
These bindings change the way ~ls~ behaves by calling ~exa~ instead.
#+begin_src fish
@ -319,7 +298,6 @@ Ask for confirmation before overwriting files.
#+begin_src fish
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
#+end_src
** df, free
Make the output human-readable by default.

View file

@ -6,6 +6,9 @@ set TERM "xterm-256color"
set EDITOR "emacsclient -t -a ''"
set VISUAL "emacsclient -c -a emacs"
set QT_QPA_PLATFORMTHEME "qt6ct"
set SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
set GNUPGHOME "~/enc/keys/gnupg"
set LEDGER_FILE "~/enc/org/hledger/2023.journal"
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
@ -164,15 +167,6 @@ alias .5='cd ../../../../..'
alias vim='nvim'
alias em='/usr/bin/emacs -nw'
alias emacs="emacsclient -c -a 'emacs'"
alias doomsync="~/.config/emacs/bin/doom sync"
alias doomdoctor="~/.config/emacs/bin/doom doctor"
alias doomupgrade="~/.config/emacs/bin/doom upgrade"
alias doompurge="~/.config/emacs/bin/doom purge"
alias ls='exa -al --color=always --group-directories-first'
alias la='exa -a --color=always --group-directories-first'
alias ll='exa -l --color=always --group-directories-first'
@ -200,7 +194,6 @@ alias fgrep='fgrep --color=auto'
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
alias df='df -h'
alias free='free -m'

View file

@ -32,12 +32,14 @@ Config {
, persistent = True
, iconRoot = ".config/xmonad/xpm/" -- default: "."
, commands = [
Run UnsafeXMonadLog
, Run StdinReader
-- Echos a "penguin" icon in front of the kernel output.
-- Run Com "echo" ["<fn=3>\xf17c</fn>"] "penguin" 3600
-- Get kernel version (script found in .local/bin)
-- , Run Com ".local/bin/kernel" [] "kernel" 36000
-- Cpu usage in percent
Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: <total>%","-H","50","--high","red"] 20
, Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: <total>%","-H","50","--high","red"] 20
-- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M <usedratio>%"] 20
-- Disk space free
@ -59,8 +61,7 @@ Config {
-- Script that dynamically adjusts xmobar padding depending on number of trayer icons.
, Run Com ".config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20
-- Prints out the left side items such as workspaces, layout, etc.
, Run UnsafeStdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%UnsafeStdinReader% }{ <box type=Bottom width=2 mb=2 color=#b5bd68><fc=#b5bd68><action=`alacritty -e htop`>%cpu%</action></fc></box> <box type=Bottom width=2 mb=2 color=#e6c547><fc=#e6c547><action=`alacritty -e htop`>%memory%</action></fc></box> <box type=Bottom width=2 mb=2 color=#81a2be><fc=#81a2be>%disku%</fc></box> <box type=Bottom width=2 mb=2 color=#b294bb><fc=#b294bb>%uparrow% %uptime%</fc></box> <box type=Bottom width=2 mb=2 color=#ff3334><fc=#ff3334>%baticon% %battery%</fc></box> <box type=Bottom width=2 mb=2 color=#9ec400><fc=#9ec400><action=`emacsclient -c -a 'emacs' --eval '(doom/window-maximize-buffer(dt/year-calendar))'`>%date%</action></fc></box> %trayerpad%"
, template = "%UnsafeXMonadLog% }{ <box type=Bottom width=2 mb=2 color=#b5bd68><fc=#b5bd68>%cpu%</fc></box> <box type=Bottom width=2 mb=2 color=#e6c547><fc=#e6c547>%memory%</fc></box> <box type=Bottom width=2 mb=2 color=#81a2be><fc=#81a2be>%disku%</fc></box> <box type=Bottom width=2 mb=2 color=#b294bb><fc=#b294bb>%uparrow% %uptime%</fc></box> <box type=Bottom width=2 mb=2 color=#ff3334><fc=#ff3334>%baticon% %battery%</fc></box> <box type=Bottom width=2 mb=2 color=#9ec400><fc=#9ec400>%date%</fc></box> %trayerpad%"

View file

@ -23,38 +23,23 @@ Config { font = "xft:Ubuntu:weight=bold:size=8:antialias=true:hinting
, persistent = True
, iconRoot = ".xmonad/xpm/" -- default: "."
, commands = [
-- Echos a "penguin" icon in front of the kernel output.
Run Com "echo" ["<fn=3>\xf17c</fn>"] "penguin" 3600
-- Get kernel version (script found in .local/bin)
, Run Com ".local/bin/kernel" [] "kernel" 36000
-- Cpu usage in percent
, Run Cpu ["-t", "<fn=2>\xf108</fn> cpu: (<total>%)","-H","50","--high","red"] 20
-- Ram used number and percent
, Run Memory ["-t", "<fn=2>\xf233</fn> mem: <used>M (<usedratio>%)"] 20
-- Disk space free
, Run DiskU [("/", "<fn=2>\xf0c7</fn> /: <free> free")] [] 60
, Run DiskU [("/home/", "<fn=2>\xf0c7</fn> /home: <free> free")] [] 60
-- Echos an "up arrow" icon in front of the uptime output.
, Run Com "echo" ["<fn=2>\xf0aa</fn>"] "uparrow" 3600
-- Uptime
, Run Uptime ["-t", "uptime: <days>d <hours>h"] 360
-- Echos a "bell" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf0f3</fn>"] "bell" 3600
-- Check for pacman updates (script found in .local/bin)
, Run Com ".local/bin/pacupdate" [] "pacupdate" 36000
-- Echos a "battery" icon in front of the pacman updates.
, Run Com "echo" ["<fn=2>\xf242</fn>"] "baticon" 3600
-- Battery
, Run BatteryP ["BAT0"] ["-t", "<acstatus><watts> (<left>%)"] 360
-- Time and date
, Run Date "<fn=2>\xf017</fn> %b %d %Y - (%H:%M) " "date" 50
-- Script that dynamically adjusts xmobar padding depending on number of trayer icons.
, Run Com ".config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20
-- Prints out the left side items such as workspaces, layout, etc.
, Run UnsafeXMonadLog
, Run XMonadLog
]
, sepChar = "%"
, alignSep = "}{"
, template = " <icon=haskell_20.xpm/> <fc=#666666>|</fc> %UnsafeXmonadLog% }{ <box type=Bottom width=2 mb=2 color=#51afef><fc=#51afef>%penguin% <action=`alacritty -e htop`>%kernel%</action> </fc></box> <box type=Bottom width=2 mb=2 color=#ecbe7b><fc=#ecbe7b><action=`alacritty -e htop`>%cpu%</action></fc></box> <box type=Bottom width=2 mb=2 color=#ff6c6b><fc=#ff6c6b><action=`alacritty -e htop`>%memory%</action></fc></box> <box type=Bottom width=2 mb=2 color=#a9a1e1><fc=#a9a1e1><action=`alacritty -e htop`>%disku%</action></fc></box> <box type=Bottom width=2 mb=2 color=#98be65><fc=#98be65>%uparrow% <action=`alacritty -e htop`>%uptime%</action></fc></box> <box type=Bottom width=2 mb=2 color=#c678dd><fc=#c678dd>%bell% <action=`alacritty -e sudo pacman -Syu`>%pacupdate%</action></fc></box> <box type=Bottom width=2 mb=2 color=#da8548><fc=#da8548>%baticon% <action=`alacritty -e sudo pacman -Syu`>%battery%</action></fc></box> <box type=Bottom width=2 mb=2 color=#46d9ff><fc=#46d9ff><action=`emacsclient -c -a 'emacs' --eval '(doom/window-maximize-buffer(dt/year-calendar))'`>%date%</action></fc></box> %trayerpad%"
, template = "<fc=#666666>|</fc> %XmonadLog }{ <box type=Bottom width=2 mb=2 color=#51afef><fc=#51afef>%penguin% <action=`alacritty -e htop`>%kernel%</action> </fc></box> <box type=Bottom width=2 mb=2 color=#ecbe7b><fc=#ecbe7b><action=`alacritty -e htop`>%cpu%</action></fc></box> <box type=Bottom width=2 mb=2 color=#ff6c6b><fc=#ff6c6b><action=`alacritty -e htop`>%memory%</action></fc></box> <box type=Bottom width=2 mb=2 color=#a9a1e1><fc=#a9a1e1><action=`alacritty -e htop`>%disku%</action></fc></box> <box type=Bottom width=2 mb=2 color=#98be65><fc=#98be65>%uparrow% <action=`alacritty -e htop`>%uptime%</action></fc></box> <box type=Bottom width=2 mb=2 color=#c678dd><fc=#c678dd>%bell% </fc></box> <box type=Bottom width=2 mb=2 color=#da8548><fc=#da8548>%baticon% %battery%</fc></box> <box type=Bottom width=2 mb=2 color=#46d9ff><fc=#46d9ff>%date%</fc></box> %trayerpad%"
}

View file

@ -19,10 +19,10 @@
- [[#border-width-and-spacing][Border Width and Spacing]]
- [[#layouts-1][Layouts]]
- [[#theming-for-tabs-sublayout][Theming for tabs (sub)layout]]
- [[#clickable-workspaces-in-xmobar][Clickable workspaces in XMobar]]
- [[#workspace-definitions][Workspace definitions]]
- [[#manage-hook][Manage Hook]]
- [[#startup-hook][Startup Hook]]
- [[#pretty-print-for-xmobar][Pretty Print for XMobar]]
- [[#main-xmonad-loop][Main XMonad loop]]
- [[#xmobar][XMobar]]
- [[#xmonad--managehook][XMonad & manageHook]]
@ -131,6 +131,7 @@ import XMonad.Prompt.OrgMode
#+begin_src haskell
import XMonad.Util.Dmenu
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.NamedActions
import XMonad.Util.NamedScratchpad
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
@ -212,11 +213,6 @@ myTabTheme = def { fontName = "xft:Iosevka-9"
#+end_src
** Clickable workspaces in XMobar
#+begin_src haskell
mySB = statusBarProp "xmobar" (clickablePP xmobarPP)
#+end_src
** Workspace definitions
#+begin_src haskell
@ -224,13 +220,9 @@ myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9",
"e",
"w", "g", "d", "b", "j", "f", "o", "u",
"r", "s", "t", "h", "v", "y", "n", "a", "i", "l",
"x", "c", "m", "k", "q", "z", "p"
]
"x", "c", "m", "k", "q", "z", "p"]
myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y)
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
where i = fromJust $ M.lookup ws myWorkspaceIndices
#+end_src
** Manage Hook
@ -311,23 +303,67 @@ Emacs daemon for emacsclient.
spawnOn "e" "/usr/bin/emacsclient"
spawnOn "j" "keepassxc"
#+end_src
** Pretty Print for XMobar
#+begin_src haskell
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta " "
, ppTitleSanitize = xmobarStrip
, ppCurrent = xmobarBorder "Top" "#8be9fd" 2
, ppHidden = white
, ppHiddenNoWindows = lowWhite
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- | Windows should have *some* title, which should not not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#ff79c6" ""
blue = xmobarColor "#bd93f9" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""
#+end_src
#+begin_src haskell
xmobar0 = statusBarProp "xmobar -x 0 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
xmobar1 = statusBarProp "xmobar -x 1 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
xmobar2 = statusBarProp "xmobar -x 2 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
#+end_src
* Main XMonad loop
#+begin_src haskell
main :: IO ()
main = do
#+end_src
** XMobar
Launching three instances of xmobar on their monitors.
#+begin_src haskell
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
#+begin_src haskell :tangle no
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/xmobarrc")
#+end_src
** XMonad & manageHook
#+begin_src haskell
xmonad $ ewmh $ docks $ def
xmonad
$ ewmh
$ docks
$ withSB (xmobar0 <> xmobar1 <> xmobar2)
$ def
{ manageHook = myManageHook <+> manageDocks
#+end_src
*** handleEventHook
@ -352,26 +388,30 @@ This lets alacritty be swallowed when it opens a GUI application.
, borderWidth = myBorderWidth
, normalBorderColor = colorBack
, focusedBorderColor = color15
, logHook = updatePointer (0.5, 0.5) (0, 0)
}
#+end_src
*** logHook
Define logHook. ppOutput streams into the three instances of XMobar.
#+begin_src haskell
, logHook = dynamicLogWithPP xmobarPP
#+begin_src haskell :tangle no
, logHook = dynamicLogWithPP
{ ppOutput = \x -> hPutStrLn xmproc0 x
>> hPutStrLn xmproc1 x
>> hPutStrLn xmproc2 x
}
#+end_src
**** Colors/ clicks
#+begin_src haskell
#+begin_src haskell :tangle no
, ppCurrent = xmobarColor color06 "" . wrap
("<box type=Bottom width=2 mb=1 color=" ++ color06 ++ ">") "</box>"
, ppVisible = xmobarColor color06 "" . clickable
, ppVisible = xmobarColor color06 ""
, ppHidden = xmobarColor color05 "" . wrap
("<box type=Top width=2 mt=1 color=" ++ color05 ++ ">") "</box>" . clickable
, ppHiddenNoWindows = xmobarColor color05 "" . clickable
("<box type=Top width=2 mt=1 color=" ++ color05 ++ ">") "</box>"
, ppHiddenNoWindows = xmobarColor color05 ""
#+end_src
**** Window Title, Separators, etc.
#+begin_src haskell
#+begin_src haskell :tangle no
-- Title of active window
, ppTitle = xmobarColor colorFore "" . shorten 48
-- Separator character

View file

@ -62,6 +62,7 @@ import XMonad.Prompt.OrgMode
import XMonad.Util.Dmenu
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.NamedActions
import XMonad.Util.NamedScratchpad
import XMonad.Util.Run (runProcessWithInput, safeSpawn, spawnPipe)
@ -107,19 +108,11 @@ myTabTheme = def { fontName = "xft:Iosevka-9"
, activeTextColor = colorBack
, inactiveTextColor = colorFore }
mySB = statusBarProp "xmobar" (clickablePP xmobarPP)
myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9",
"e",
"w", "g", "d", "b", "j", "f", "o", "u",
"r", "s", "t", "h", "v", "y", "n", "a", "i", "l",
"x", "c", "m", "k", "q", "z", "p"
]
myWorkspaceIndices = M.fromList $ zipWith (,) myWorkspaces [1..] -- (,) == \x y -> (x,y)
clickable ws = "<action=xdotool key super+"++show i++">"++ws++"</action>"
where i = fromJust $ M.lookup ws myWorkspaceIndices
"x", "c", "m", "k", "q", "z", "p"]
myManageHook = manageSpawn <> composeAll
[ className =? "confirm" --> doFloat
@ -133,7 +126,6 @@ myManageHook = manageSpawn <> composeAll
, className =? "splash" --> doFloat
, className =? "toolbar" --> doFloat
, className =? "zoom" --> doFloat
, className =? "lxqt-openssh-askpass" --> doFloat
, className =? "Yad" --> doCenterFloat
, (className =? "firefox" <&&> resource =? "Dialog") --> doFloat -- Float Firefox Dialog
, isFullscreen --> doFullFloat
@ -161,22 +153,54 @@ myStartupHook = do
spawnOnce "/usr/bin/emacs --daemon"
spawnOnOnce "1" "firefox-developer-edition"
spawnOnOnce "2" "evolution"
spawnOnOnce "3" "discord"
spawnOnOnce "6" "google-chrome-stable --profile-directory='Profile 1'"
spawnOnOnce "9" "steam"
spawnOnOnce "e" "/usr/bin/emacsclient"
spawnOnOnce "j" "keepassxc ~/enc/keys/Passwords.kdbx"
spawnOn "1" "firefox-developer-edition"
spawnOn "2" "evolution"
spawnOn "9" "steam"
spawnOn "3" "discord"
spawnOn "6" "google-chrome-stable"
spawnOn "e" "/usr/bin/emacsclient"
spawnOn "j" "keepassxc"
myXmobarPP :: PP
myXmobarPP = def
{ ppSep = magenta " "
, ppTitleSanitize = xmobarStrip
, ppCurrent = xmobarBorder "Top" "#8be9fd" 2
, ppHidden = white
, ppHiddenNoWindows = lowWhite
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- | Windows should have *some* title, which should not not exceed a
-- sane length.
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
blue, lowWhite, magenta, red, white, yellow :: String -> String
magenta = xmobarColor "#ff79c6" ""
blue = xmobarColor "#bd93f9" ""
white = xmobarColor "#f8f8f2" ""
yellow = xmobarColor "#f1fa8c" ""
red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" ""
xmobar0 = statusBarProp "xmobar -x 0 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
xmobar1 = statusBarProp "xmobar -x 1 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
xmobar2 = statusBarProp "xmobar -x 2 ~/.config/xmobar/xmobarrc" (pure myXmobarPP)
main :: IO ()
main = do
xmproc0 <- spawnPipe ("xmobar -x 0 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
xmproc1 <- spawnPipe ("xmobar -x 1 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
xmproc2 <- spawnPipe ("xmobar -x 2 $HOME/.config/xmobar/tomorrow-night-xmobarrc")
xmonad $ ewmh $ docks $ def
xmonad
$ ewmh
$ docks
$ withSB (xmobar0 <> xmobar1 <> xmobar2)
$ def
{ manageHook = myManageHook <+> manageDocks
, handleEventHook = swallowEventHook (className =? "Alacritty" <||> className =? "st-256color" <||> className =? "XTerm") (return True)
@ -196,30 +220,8 @@ main = do
, borderWidth = myBorderWidth
, normalBorderColor = colorBack
, focusedBorderColor = color15
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = \x -> hPutStrLn xmproc0 x
>> hPutStrLn xmproc1 x
>> hPutStrLn xmproc2 x
, ppCurrent = xmobarColor color06 "" . wrap
("<box type=Bottom width=2 mb=1 color=" ++ color06 ++ ">") "</box>"
, ppVisible = xmobarColor color06 "" . clickable
, ppHidden = xmobarColor color05 "" . wrap
("<box type=Top width=2 mt=1 color=" ++ color05 ++ ">") "</box>" . clickable
, ppHiddenNoWindows = xmobarColor color05 "" . clickable
-- Title of active window
, ppTitle = xmobarColor colorFore "" . shorten 48
-- Separator character
, ppSep = "<fc=" ++ color09 ++ "><fn=1> | </fn></fc>"
-- Urgent workspace
, ppUrgent = xmobarColor color02 "" . wrap "!" "!"
-- Adding # of windows on current workspace to the bar
, ppExtras = [windowCount]
-- order of things in xmobar
, ppOrder = \(ws:l:t:ex) -> [ws,l]++ex++[t]
} >> updatePointer (0.5, 0.5) (0.0, 0.0) }
, logHook = updatePointer (0.5, 0.5) (0, 0)
}
`additionalKeysP`
[ ("M-s 1", (windows $ W.greedyView $ myWorkspaces !! 0))
@ -328,7 +330,7 @@ main = do
, ("C-S-M1-j", onGroup W.focusUp')
, ("C-S-M1-y", onGroup W.focusDown')
, ("C-M1-S-0", sequence_ [spawn "xmonad --recompile", spawn "xmonad --restart"])
, ("C-M1-S-0", sequence_ [spawn "xmonad --restart", spawn "xmonad --recompile"])
, ("M-S-M1-C-0", io exitSuccess)
, ("S-C-M1-q", kill1)
, ("M-S-C-M1-q", killAll)
@ -337,16 +339,14 @@ main = do
, ("M-e", spawn "emacsclient -c -a 'emacs'")
, ("M-<Return>", spawn "alacritty")
, ("M-S-<F11>", spawn "feh --randomize --bg-fill /usr/share/backgrounds/archlinux/*")
, ("M-<Print>", spawn "dm-maim")
, ("<Print>", spawn "flameshot gui")
, ("M-c i", orgPromptRefileTo def "Inbox" "TODO" "~/enc/org/phil.org")
, ("M-c i", orgPrompt def "TODO" "~/enc/org/inbox.org")
, ("M-c l", orgPromptPrimary def "LINK" "~/enc/org/inbox.org")
, ("M-c n", orgPrompt def "NOTE" "~/enc/org/inbox.org")
, ("M-c p", orgPromptRefile def "TODO" "~/enc/org/phil.org")
, ("M-c n", orgPromptRefileTo def "Inbox" "NOTE" "~/enc/org/phil.org")
, ("M-c l", orgPromptPrimary def "" "~/enc/org/bookmarks.org")
-- Time! Timestamps!
, ("M-w l", spawn "sleep 0.5 && xdotool type \"$(date +'%Y.%m.%d %H:%M:%S %Z')\"")
, ("M-w e", spawn "sleep 0.5 && xdotool type \"$(TZ=America/New_York date +'%Y.%m.%d %H:%M:%S %Z')\"")