diff --git a/.gitmodules b/.gitmodules index 68e262b..cc1834f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "custom/org-ql"] path = custom/org-ql url = https://github.com/alphapapa/org-ql +[submodule "custom/ts.el"] + path = custom/ts.el + url = https://github.com/alphapapa/ts.el diff --git a/config.org b/config.org index b5471ce..e4155ec 100644 --- a/config.org +++ b/config.org @@ -20,6 +20,7 @@ (use-package exwm) (require 'exwm-config) (exwm-config-default) +(fringe-mode '(10 . 0)) #+END_SRC ** Naming Windows #+BEGIN_SRC emacs-lisp @@ -173,12 +174,20 @@ (defun youtube-split () (interactive) - (split-window (selected-window) 526 t t)) + (if-let (buf (get-buffer "youtube")) + (switch-to-buffer buf) + (launch-program-with-name "firefox" "youtube")) + (split-window (selected-window) 472 t t) + (switch-window)) + - (defun big-youtube-split () (interactive) - (split-window (selected-window) 630 t t)) + (if-let (buf (get-buffer "youtube")) + (switch-to-buffer buf) + (launch-program-with-name "firefox" "youtube")) + (split-window (selected-window) 630 t t) + (switch-window)) #+END_SRC ** Disable simulation keys on an emacs window #+BEGIN_SRC emacs-lisp @@ -201,12 +210,14 @@ (interactive) (exwm-input--fake-key ?\C-t)) (define-key *root-map* (kbd "C-t") 'annoying-key-thing) + (define-key *root-map* (kbd "C-b") 'previous-buffer) (define-key *root-map* (kbd "t") 'transpose-chars) (define-key *root-map* (kbd "c") 'multi-term) (define-key *root-map* (kbd "C-p") 'exwmx-launch-program) (define-key *root-map* (kbd "e") (quickrun-lambda "emacs" "emacs")) (define-key *root-map* (kbd "s") (quickrun-lambda "steam" nil)) (define-key *root-map* (kbd "q") (quickrun-lambda "qutebrowser" nil)) + (define-key *root-map* (kbd "V") (quickrun-lambda "VBoxManage startvm \"Windows 7\"" "VirtualBox Machine")) (define-key *root-map* (kbd "r") 'exwmx-name-buffer) (define-key *root-map* (kbd "C-n") 'switch-window) (define-key *root-map* (kbd ")") (lambda () (interactive) (shell-command "sleep 2s ; xset dpms force off"))) @@ -237,7 +248,6 @@ ** Multimonitor support #+BEGIN_SRC emacs-lisp (require 'exwm-randr) -(setq exwm-randr-workspace-output-plist '(2 "DP1" 3 "DP1")) (exwm-randr-enable) #+END_SRC ** Keybindings @@ -271,9 +281,8 @@ (,(kbd "s-$") . (lambda () (interactive) (exwm-workspace-move-window 3))))) (defun dvorak? () - (string= (shell-command-to-string "setxkbmap -v | grep symbols") - "symbols: pc+de(neo_dvorak)+inet(evdev)+terminate(ctrl_alt_bksp) - ")) + (string-match-p "de(neo_dvorak)" + (shell-command-to-string "setxkbmap -v | grep symbols"))) (defun set-keyboard (layout) (shell-command (format "setxkbmap %s" layout))) @@ -313,14 +322,15 @@ (defvar wallpaper-path "/home/benson/.emacs.d/res/digital_space_universe_4k_8k-wide.jpg") (defvar live-wallpaper-path "/home/benson/MEGA/pictures/wallpapers/videos/bg.mp4") - (setq i3-string "Xephyr -br -ac -noreset -resizeable -screen 1920x1080 :1 & sleep 1s; DISPLAY=:1 i3") + (setq i3-string "Xephyr -br -ac -noreset -resizeable -screen 1920x1080 :8 & sleep 1s; DISPLAY=:8 i3") + (setq xfce4-string "Xephyr -br -ac -noreset -resizeable -screen 1920x1080 :8 & sleep 1s; DISPLAY=:8 xfce4-session") + (setq kde-string "Xephyr -br -ac -noreset -resizeable -screen 1920x1080 :8 & sleep 1s; DISPLAY=:8 startkde") (defvar exwm-startup-programs '("megasync" ("compton -f -i .7 -b") ("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1") ("/usr/lib/notification-daemon-1.0/notification-daemon") ("nm-applet") - ;(i3-string) )) (defvar hard-drive-space "") @@ -328,6 +338,14 @@ (interactive) (launch-program i3-string)) + (defun launch-xfce () + (interactive) + (launch-program xfce4-string)) + + (defun launch-kde () + (interactive) + (launch-program kde-string)) + (defun lock-screen () (interactive) (let ((res (shell-command-to-string "pgrep i3lock-fancy"))) @@ -455,15 +473,17 @@ (defun my/setup-screens () (interactive) - (let ((result (shell-command-to-string "xrandr --query | grep -e connected | grep -v -e disconnected -e eDP1 | cut -d ' ' -f 1 | tr -d \"\\n\""))) - (setq exwm-randr-workspace-output-plist `(2 ,result 3 ,result)) - (when (> (length result) 0) - (let* ((response (completing-read (format "Monitor %s detected. Resolution? " result) '("2560x1440" "1920x1080" "3840x2160") nil t "^")) + (let ((primary (shell-command-to-string "xrandr --query | grep ' connected' | grep eDP | cut -d ' ' -f 1 | tr -d '\n'")) + (secondary (shell-command-to-string "xrandr --query | grep ' connected' | grep -v eDP | cut -d ' ' -f 1 | tr -d '\n'"))) + (setq exwm-randr-workspace-output-plist `(0 ,primary 1 ,primary 2 ,secondary 3 ,secondary)) + (when (and (> (length secondary) 0) + (string= "yes" (completing-read (format "Monitor %s detected. Setup? " secondary) '("yes" "no")))) + (let* ((response (completing-read (format "Resolution for %s? " secondary) '("2560x1440" "1920x1080" "3840x2160") nil t "^")) (length (string-to-number (substring response 0 4))) (height (string-to-number (substring response 5 9)))) - (shell-command (format "xrandr --output %s --mode %s --above eDP1" result response)) - (let ((pos (completing-read "Position? " (mapcar #'number-to-string (list 0 (/ (- length 1920) 2) 1200)) nil t "^"))) - (shell-command (format "xrandr --output eDP1 --pos %sx%s" pos height)))))) + (shell-command (format "xrandr --output %s --mode %s --above %s" secondary response primary)) + (let ((pos (completing-read "Position? " '("right-of" "above") nil t "^"))) + (shell-command (format "xrandr --output %s --%s %s" primary pos secondary)))))) (setup-wallpaper)) (add-hook 'exwm-init-hook 'my/setup-screens) @@ -531,10 +551,14 @@ ** Multi-term #+BEGIN_SRC emacs-lisp (use-package multi-term) + (define-key term-mode-map (kbd "M-'") 'scroll-down) + (unbind-key (kbd "C-t") term-mode-map) (add-hook 'term-mode-hook (lambda () (add-to-list 'term-bind-key-alist '("M-[" . multi-term-prev)) - (add-to-list 'term-bind-key-alist '("M-]" . multi-term-next)))) + (add-to-list 'term-bind-key-alist '("M-]" . multi-term-next)) + (add-to-list 'term-bind-key-alist '("M-'" . scroll-down)) + (add-to-list 'term-bind-key-alist '("C-t" . *root-map*)))) #+END_SRC ** resize-window #+BEGIN_SRC emacs-lisp @@ -982,7 +1006,7 @@ (kill-local-variable 'mode-line-format)) #+END_SRC **** Config - #+BEGIN_SRC emacs-lisp + #+BEGIN_SRC emacs-lisp# (use-package powerline) (use-package airline-themes) @@ -1097,6 +1121,7 @@ (mode . comint-mode) (mode . makefile-gmake-mode))) ("code" (or (mode . clojure-mode) + (mode . csharp-mode) (mode . c++-mode) (mode . c-mode) (mode . scala-mode) @@ -1143,7 +1168,7 @@ ;(add-hook 'exwm-workspace-switch-hook 'ibuffer) #+END_SRC -*** Ace jump +** Ace jump #+BEGIN_SRC emacs-lisp (use-package ace-jump-mode) (global-set-key (kbd "C-c SPC") 'ace-jump-mode) @@ -1233,7 +1258,7 @@ (file "~/MEGA/org/checklists/mornings.org")) ("Cn" "Nightly routine" entry (file "~/MEGA/org/entries/routines.org") (file "~/MEGA/org/checklists/nights.org")) - ("y" "Elfeed YouTube" entry (file+olp "~/MEGA/org/agenda/agenda.org" "leisure" "Videos") + ("y" "Elfeed YouTube" entry (file+olp "~/MEGA/org/agenda/agenda.org" "rewards" "Videos") "* TODO %(identity elfeed-link-org-capture)") ("p" "Protocol" entry (file "~/MEGA/org/agenda/refile.org") "* STUFF %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?") @@ -1423,9 +1448,9 @@ (setq org-agenda-sticky t) (setq org-todo-keywords - '((sequence "STUFF(s)" "SOMEDAY(P)" "|") - (sequence "TODO(t)" "ONE(o)" "NEXT(n)" "READ(r)" "HABIT(H)" "|" "DONE(d!)") - (sequence "PROJECT(p)" "ETERNAL(e)" "|" "COMPLETE(c)") + '((sequence "STUFF(s)" "SOMEDAY(P)" "INACT(i)" "|") + (sequence "TODO(t)" "ONE(o)" "NEXT(n)" "HABIT(H)" "|" "DONE(d!)") + (sequence "PROJECT(p)" "SEQUENTIAL(S)" "ETERNAL(e)" "|" "COMPLETE(c)") (sequence "WAIT(w@/!)" "HOLD(h)" "TICKLER())" "FORGOTTEN(f)" "|" "ABANDON(a@/!)") (sequence "TOP" "|"))) @@ -1436,9 +1461,11 @@ ("WAIT" :foreground "yellow" :weight bold) ("HOLD" :foreground "red" :weight bold) ("PROJECT" :foreground "white" :weight bold) + ("SEQUENTIAL" :foreground "white" :weight bold) ("ABANDON" :foreground "dark gray" :weight bold) ("FORGOTTEN" :foreground "dark gray" :weight bold) - ("TOP" :foreground "royal blue" :weight bold))) + ("TOP" :foreground "royal blue" :weight bold) + ("INACT" :foreground "dark gray" :weight bold))) (setq org-todo-state-tags-triggers (quote (("HOLD" ("HOLD" . t)) @@ -1447,7 +1474,7 @@ (setq org-use-fast-todo-selection t) - ;(setq org-agenda-files (quote ("~/MEGA/org/agenda"))) + ;(setq org-agenda-files (quote ("~/MEGA/org/agenda/dallas.org"))) (org-agenda-load-file-list) ; Targets include this file and any file contributing to the agenda - up to 9 levels deep @@ -1484,6 +1511,7 @@ #+END_SRC **** My Project code #+BEGIN_SRC emacs-lisp + (defun my/is-part-of-subtree () (save-excursion (and (not (= 1 (org-current-level))) @@ -1496,22 +1524,37 @@ (defun my/is-standalone-task () - (and (not (member (org-get-todo-state) '("WAIT" "PROJECT" "SOMEDAY" "TICKLER"))) - (not (member "ARCHIVE" (org-get-tags-at))) + (and (not (member (org-get-todo-state) '("HOLD" "PROJECT" "SOMEDAY" "TICKLER" "SEQUENTIAL"))) + (not (member "ARCHIVE" (org-get-tags))) (not (my/is-part-of-subtree)) (not (my/is-a-project)))) + (defun my/no-children () + (save-excursion + (let ((curr-indent (org-current-level))) + (while (and (outline-next-heading) + (< curr-indent (org-current-level)) + (if (member "ARCHIVE" (org-get-tags)) + (progn + (org-end-of-subtree) + (outline-next-heading)) + t) + (not (org-get-todo-state)))) + (>= curr-indent + (org-current-level))))) + + (defun my/is-unactionable-task () + (or (member "NOT_TASKS" (org-get-tags)) + (member (org-get-todo-state) (cons "INACT" org-done-keywords)))) + (defun my/is-a-task () (save-excursion - (or (equal "ONE" (org-get-todo-state)) - (and (org-get-todo-state) - (not (member "NOT_TASKS" (org-get-tags-at))) - (let ((curr-indent (org-current-level))) - (while (and (outline-next-heading) - (not (member "ARCHIVE" (org-get-tags-at))) - (not (org-get-todo-state)))) - (>= curr-indent - (org-current-level))))))) + (and (not (member "NOT_TASKS" (org-get-tags))) + (or (and (equal "ONE" (org-get-todo-state)) + (not (my/has-non-done-task))) + (and (org-get-todo-state) + (not (member (org-get-todo-state) '("SOMEDAY" "WAIT"))) + (my/no-children)))))) (defun my/has-subtask () (save-excursion @@ -1519,6 +1562,11 @@ has-subtask) (while (and (not has-subtask) (outline-next-heading) + (if (member "ARCHIVE" (org-get-tags)) + (progn + (org-end-of-subtree) + (outline-next-heading)) + t) (< (point) subtree-end)) (when (org-get-todo-state) (setq has-subtask t))) @@ -1537,12 +1585,12 @@ (defun my/is-next-task () (let ((todo (org-get-todo-state))) - (or (equal todo "NEXT") - (and (member todo '("TODO" "ONE")) + (or ;;(equal todo "NEXT") + (and (member todo '("TODO" "ONE" "NEXT")) (or (org-get-scheduled-time (point)) (org-get-deadline-time (point))))))) - (defun my/has-active-task () + (defun my/has-non-done-task () (save-excursion (let ((subtree-end (save-excursion (org-end-of-subtree t))) has-next-task) @@ -1557,10 +1605,10 @@ (save-excursion (let ((todo (org-get-todo-state))) (when todo - (or (member todo '("PROJECT" "ETERNAL" "HOLD")) + (or (member todo '("PROJECT" "ETERNAL" "HOLD" "SEQUENTIAL")) (and (equal todo "ONE") - (my/has-active-task)) - (and (member todo '("TODO" "WAIT" "SOMEDAY")) + (my/has-non-done-task)) + (and (member todo '("TODO")) (my/has-subtask))))))) (defvar my/ambiguous-projects-default-to-stuck t) @@ -1569,9 +1617,9 @@ (save-excursion (let ((subtree-end (save-excursion (org-end-of-subtree t))) has-next-task has-active-project) + (outline-next-heading) (while (and (not (and has-next-task has-active-project)) - (outline-next-heading) (< (point) subtree-end)) (cond ((and (my/is-a-task) (my/is-next-task)) @@ -1579,7 +1627,27 @@ ((and (my/is-a-project) (eq (my/get-project-type file (point) nil) 'active)) - (setq has-stuck-project t)))) + (setq has-active-project t))) + (org-end-of-subtree t t)) + (or has-next-task + has-active-project)))) + + (defun my/active-sequential-project (file point) + (save-excursion + (let ((subtree-end (save-excursion (org-end-of-subtree t))) + has-next-task has-active-project) + (outline-next-heading) + (while (and (not (or has-next-task + has-active-project)) + (< (point) subtree-end)) + (cond ((and (my/is-a-task) + (my/is-next-task)) + (setq has-next-task t)) + ((and (my/is-a-project) + (eq (my/get-project-type file (point) nil) + 'active)) + (setq has-active-project t))) + (org-end-of-subtree t t)) (or has-next-task has-active-project)))) @@ -1587,22 +1655,23 @@ (save-excursion (let ((subtree-end (save-excursion (org-end-of-subtree t))) has-task has-next-task has-project has-stuck-project) + (outline-next-heading) (while (and (not (and has-next-task has-stuck-project)) - (outline-next-heading) (< (point) subtree-end)) - ;; (unless (member "ARCHIVE" (org-get-tags-at)) + ;; (unless (member "ARCHIVE" (org-get-tags)) (cond ((my/is-a-project) (setq has-project t) (when (eq (my/get-project-type file (point) t) 'stuck) - (setq has-stuck-project t)) - (org-end-of-subtree t t)) + (setq has-stuck-project t))) ((my/is-a-task) (setq has-task t) (when (or (my/is-next-task) (equal (org-get-todo-state) "WAIT")) (setq has-next-task t))) - ));; ) + ) + (org-end-of-subtree t t) + );; ) (or (and has-next-task (not has-stuck-project)) (and (not has-task) @@ -1620,6 +1689,10 @@ ((equal todo "WAIT") 'wait) ((org-time> (org-entry-get (point) "SCHEDULED") (org-matcher-time "")) 'delayed) ;;((my/is-a-task) nil) + ((equal "SEQUENTIAL" (org-get-todo-state)) + (if (my/active-sequential-project file point) + 'active + 'stuck)) (ambiguous-to-stuck (if (my/generous-active-project file point) 'active @@ -1629,18 +1702,49 @@ 'active 'stuck))))))) + ;; (defun my/show-stuck-projects () + ;; "Only show subtrees that are stuck projects" + ;; (save-restriction + ;; (widen) + ;; (let ((subtree-end (save-excursion (org-end-of-subtree t)))) + ;; (unless (or (and (my/is-a-task) + ;; (my/is-standalone-task) + ;; (not (org-get-scheduled-time (point))) + ;; (not (org-get-deadline-time (point)))) + ;; (eq (my/get-project-type buffer-file-name (point) t) + ;; 'stuck)) + ;; subtree-end)))) + + (defvar my/stuck-projects-flag nil) + (defun my/show-stuck-projects () "Only show subtrees that are stuck projects" (save-restriction (widen) (let ((subtree-end (save-excursion (org-end-of-subtree t)))) - (unless (or (and (my/is-a-task) - (my/is-standalone-task) - (not (org-get-scheduled-time (point))) - (not (org-get-deadline-time (point)))) - (eq (my/get-project-type buffer-file-name (point) t) - 'stuck)) - subtree-end)))) + (if (and my/stuck-projects-flag + (< (point) my/stuck-projects-flag)) + (if (or (my/is-next-task) + (my/is-unactionable-task) + (and (not (my/is-a-task)) + (not (eq (my/get-project-type buffer-file-name (point) t) + 'stuck)))) + subtree-end + nil) + (setq my/stuck-projects-flag nil) + (cond ((and (my/is-a-task) + (my/is-standalone-task) + (not (org-get-scheduled-time (point))) + (not (org-get-deadline-time (point)))) + nil) + ((eq (my/get-project-type buffer-file-name + (point) t) + 'stuck) + (when (or (null my/stuck-projects-flag) + (< stuck-projects-flag subtree-end)) + (setq my/stuck-projects-flag subtree-end)) + nil) + (t subtree-end)))))) (defvar my/done-projects-flag nil) @@ -1659,6 +1763,15 @@ nil) next-headline))))) + (defun my/org-agenda-reset-vars () + (interactive) + (setq my/stuck-projects-flag nil + my/done-projects-flag nil + my/next-task-flag nil)) + + (add-to-list 'org-agenda-finalize-hook + #'my/org-agenda-reset-vars) + (defun my/show-active-projects () "Only show subtrees that are stuck projects" (save-restriction @@ -1742,6 +1855,26 @@ (when (or (my/is-a-project) (member (org-get-todo-state) '("SOMEDAY" "WAIT" "HABIT" nil))) next-headline))))) + + (defvar my/next-task-flag nil) + ;; (setq my/next-task-flag nil) + + (defun my/has-next-todo () + (save-excursion + (let ((end-of-subtree (save-excursion (org-end-of-subtree t))) + flag) + (while (and (not flag) + (outline-next-heading) + (< (point) next-headline)) + (when (string= (org-get-todo-state) "NEXT") + (setq flag (point)))) + flag))) + + (defun my/show-leaf-tasks () + (let ((next-headline (save-excursion (org-end-of-subtree t)))) + (unless (or (string= "NEXT" (org-get-todo-state)) + (my/has-next-todo)) + next-headline))) #+END_SRC **** Views #+BEGIN_SRC emacs-lisp @@ -1789,6 +1922,18 @@ (add-hook 'org-agenda-finalize-hook #'org-agenda-delete-empty-compact-blocks) + (defun org-agenda-add-separater-between-project () + (setq buffer-read-only nil) + (save-excursion + (goto-char (point-min)) + (let ((start-pos (point)) + (previous t)) + (re-search-forward " +agenda: +[^\\. ]" nil t) + (while (re-search-forward " +agenda: +[^\\. ]" nil t) + (beginning-of-line) + (insert "=============================================\n") + (forward-line))))) + ;; I don't think this code is necessary ;; (add-to-list 'org-agenda-entry-types :deadlines*) @@ -1842,7 +1987,7 @@ (agenda "" ((org-agenda-skip-function 'my/agenda-custom-skip) (org-agenda-span 'day) - (org-agenda-show-log t) + ;(org-agenda-show-log t) (org-agenda-skip-deadline-if-done t) (org-agenda-skip-scheduled-if-done t) (org-super-agenda-groups '((:name "Overdue" :and (:deadline past :log nil :not (:tag "Work"))) @@ -1853,8 +1998,8 @@ :not (:deadline today))))) (:name "Work Related" :tag "WORK") )))))) - ("c" "Access Comms" todo "TODO" - ((org-agenda-files '("~/MEGA/org/entries/comms.org")))) + ("c" "Access Comms" tags-todo "+COMMS/!TODO" + ((org-agenda-files '("~/MEGA/org/agenda/agenda.org" "~/MEGA/org/entries/comms.org")))) ("P" "Time to panic" ((tags-todo "+MOTIVATION/!TOP" ((org-agenda-overriding-header "Remember your motivation") @@ -1867,6 +2012,11 @@ (org-agenda-overriding-header "Next Tasks list") (org-tags-match-list-sublevels t) (org-agenda-sorting-strategy '(deadline-up)))) + ("L" "Leaf Task List" tags-todo "-REFILE-HOLD-WAIT" + ((org-agenda-skip-function 'my/show-leaf-tasks) + (org-tags-match-list-sublevels 'indented) + (org-agenda-overriding-header "Next Tasks list") + (org-agenda-finalize-hook '(org-agenda-add-separater-between-project)))) ("r" "Review Tasks" ((todo "TODO" ((org-agenda-files '("~/MEGA/org/entries/reviews.gpg")) @@ -1896,7 +2046,8 @@ ("t" "Today" agenda "" ((org-agenda-skip-function 'my/agenda-custom-skip) (org-agenda-span 'day) - (org-agenda-show-log t))) + (org-agenda-start-with-log-mode '(closed clock)) + (org-agenda-clockreport-mode t))) ("C" . "Categories") ("Cb" "Bus tasks" tags-todo "BUS") ("Cr" "Articles to read" tags-todo "READ") @@ -2565,6 +2716,141 @@ #+BEGIN_SRC emacs-lisp (show-paren-mode t) #+END_SRC +*** lsp-mode + #+begin_src emacs-lisp + (use-package lsp-mode) + (use-package lsp-ui) + + (use-package lsp-java) + (use-package dap-mode + :config + (dap-mode t) + (dap-ui-mode t)) + (require 'dap-java) + + ;; (defhydra dap-hydra (:color pink :hint nil :foreign-keys run) + ;; ;; " + ;; ;; ^Stepping^ ^Switch^ ^Breakpoints^ ^Eval + ;; ;; ^^^^^^^^----------------------------------------------------------------------------------------- + ;; ;; _n_: Next _ss_: Session _bt_: Toggle _ee_: Eval + ;; ;; _i_: Step in _st_: Thread _bd_: Delete _er_: Eval region + ;; ;; _o_: Step out _sf_: Stack frame _ba_: Add _es_: Eval thing at point + ;; ;; _c_: Continue _sl_: List locals _bc_: Set condition _eii_: Inspect + ;; ;; _r_: Restart frame _sb_: List breakpoints _bh_: Set hit count _eir_: Inspect region + ;; ;; _Q_: Disconnect _sS_: List sessions _bl_: Set log message _eis_: Inspect thing at point + ;; ;; " + ;; ("n" dap-next) + ;; ("i" dap-step-in) + ;; ("o" dap-step-out) + ;; ("c" dap-continue) + ;; ("r" dap-restart-frame) + ;; ("ss" dap-switch-session) + ;; ("st" dap-switch-thread) + ;; ("sf" dap-switch-stack-frame) + ;; ("sl" dap-ui-locals) + ;; ("sb" dap-ui-breakpoints) + ;; ("sS" dap-ui-sessions) + ;; ("bt" dap-breakpoint-toggle) + ;; ("ba" dap-breakpoint-add) + ;; ("bd" dap-breakpoint-delete) + ;; ("bc" dap-breakpoint-condition) + ;; ("bh" dap-breakpoint-hit-condition) + ;; ("bl" dap-breakpoint-log-message) + ;; ("ee" dap-eval) + ;; ("er" dap-eval-region) + ;; ("es" dap-eval-thing-at-point) + ;; ("eii" dap-ui-inspect) + ;; ("eir" dap-ui-inspect-region) + ;; ("eis" dap-ui-inspect-thing-at-point) + ;; ("q" nil "quit" :color blue) + ;; ("Q" dap-disconnect :color red)) + + (use-package lsp-rust) + (use-package lsp-python) + #+end_src +*** Rainbow delimiters + #+begin_src emacs-lisp + (use-package rainbow-delimiters) + (rainbow-delimiters-mode) + (add-hook 'prog-mode-hook #'rainbow-delimiters-mode) + (add-hook 'org-mode-hook #'rainbow-delimiters-mode) + + (let ((rainbow-purple "#9E1CB2") + (rainbow-blue "#1194f6") + (rainbow-green "#47B04B") + (rainbow-yellow "#FFED18") + (rainbow-orange "#E7B500") + (rainbow-red "#C90067") + (rainbow-7 "#00AA5D") + (rainbow-8 "#FE7380")) + (custom-set-faces + `(rainbow-delimiters-depth-1-face ((t (:foreground ,rainbow-purple)))) + `(rainbow-delimiters-depth-2-face ((t (:foreground ,rainbow-green)))) + `(rainbow-delimiters-depth-3-face ((t (:foreground ,rainbow-blue)))) + `(rainbow-delimiters-depth-4-face ((t (:foreground ,rainbow-red)))) + `(rainbow-delimiters-depth-5-face ((t (:foreground ,rainbow-yellow)))) + `(rainbow-delimiters-depth-6-face ((t (:foreground ,rainbow-blue)))) + `(rainbow-delimiters-depth-7-face ((t (:foreground ,rainbow-red)))) + `(rainbow-delimiters-depth-8-face ((t (:foreground ,rainbow-8)))) + `(rainbow-delimiters-depth-9-face ((t (:foreground ,rainbow-purple)))) + `(rainbow-delimiters-depth-10-face ((t (:foreground ,rainbow-blue)))) + `(rainbow-delimiters-depth-11-face ((t (:foreground ,rainbow-green)))) + `(rainbow-delimiters-depth-12-face ((t (:foreground ,rainbow-yellow)))))) + #+end_src +*** C# + #+BEGIN_SRC emacs-lisp + (use-package csharp-mode) + (use-package omnisharp) + (add-hook 'csharp-mode-hook 'omnisharp-mode) + #+END_SRC +*** React js + #+BEGIN_SRC emacs-lisp + (use-package rjsx-mode) + #+END_SRC +*** Golang + #+BEGIN_SRC emacs-lisp + (use-package go-mode) + (add-hook 'go-mode-hook + (lambda () + (add-hook 'before-save-hook 'gofmt-before-save) + (setq tab-width 4) + (setq indent-tabs-mode 1))) + #+END_SRC +*** Elpy + #+BEGIN_SRC emacs-lisp + (use-package elpy) + (elpy-enable) + #+END_SRC +*** EIN + #+BEGIN_SRC emacs-lisp + (use-package ein) + (add-to-list 'exec-path + "/home/benson/anaconda3/bin/") + #+END_SRC +*** Web-mode + #+BEGIN_SRC emacs-lisp + (use-package web-mode) + (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) + (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) + + (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) + (setq web-mode-auto-close-style 2) + #+END_SRC +*** Processing + #+BEGIN_SRC emacs-lisp + (use-package processing-mode) + + (setq processing-location "/usr/bin/processing-java") + #+END_SRC +*** Treemacs + #+BEGIN_SRC emacs-lisp + (use-package treemacs) + #+END_SRC ** Freekeys #+BEGIN_SRC emacs-lisp# (use-package free-keys) @@ -2689,17 +2975,6 @@ #+END_SRC -** Elpy - #+BEGIN_SRC emacs-lisp - (use-package elpy) - (elpy-enable) - #+END_SRC -** EIN -#+BEGIN_SRC emacs-lisp - (use-package ein) - (add-to-list 'exec-path - "/home/benson/anaconda3/bin/") -#+END_SRC ** Ledger mode #+BEGIN_SRC emacs-lisp (use-package ledger-mode @@ -2732,20 +3007,6 @@ (report-name (ledger-report-read-name))) (ledger-report report-name nil))) #+END_SRC -** Web-mode - #+BEGIN_SRC emacs-lisp - (use-package web-mode) - (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) - (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) - - (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) - (setq web-mode-auto-close-style 2) - #+END_SRC ** ediff #+BEGIN_SRC emacs-lisp (setq ediff-window-setup-function 'ediff-setup-windows-plain) @@ -2760,39 +3021,10 @@ mouse-wheel-scroll-amount '(1) mouse-wheel-progressive-speed nil) #+END_SRC -** Processing -#+BEGIN_SRC emacs-lisp -(use-package processing-mode) - -(setq processing-location "/usr/bin/processing-java") -#+END_SRC ** AUR PKGBUILD #+BEGIN_SRC emacs-lisp (use-package pkgbuild-mode) #+END_SRC -** Golang - #+BEGIN_SRC emacs-lisp - (use-package go-mode) - (add-hook 'go-mode-hook - (lambda () - (add-hook 'before-save-hook 'gofmt-before-save) - (setq tab-width 4) - (setq indent-tabs-mode 1))) - #+END_SRC -** React js - #+BEGIN_SRC emacs-lisp - (use-package rjsx-mode) - #+END_SRC -** Treemacs - #+BEGIN_SRC emacs-lisp - (use-package treemacs) - #+END_SRC -** C# - #+BEGIN_SRC emacs-lisp - (use-package csharp-mode) - (use-package omnisharp) - (add-hook 'csharp-mode-hook 'omnisharp-mode) - #+END_SRC ** Eyebrowse #+BEGIN_SRC emacs-lisp (use-package eyebrowse @@ -2819,35 +3051,6 @@ (require 're-builder) (setq reb-re-syntax 'string) #+end_src -** Rainbow delimiters - #+begin_src emacs-lisp - (use-package rainbow-delimiters) - (rainbow-delimiters-mode) - (add-hook 'prog-mode-hook #'rainbow-delimiters-mode) - (add-hook 'org-mode-hook #'rainbow-delimiters-mode) - - (let ((rainbow-purple "#9E1CB2") - (rainbow-blue "#1194f6") - (rainbow-green "#47B04B") - (rainbow-yellow "#FFED18") - (rainbow-orange "#E7B500") - (rainbow-red "#C90067") - (rainbow-7 "#00AA5D") - (rainbow-8 "#FE7380")) - (custom-set-faces - `(rainbow-delimiters-depth-1-face ((t (:foreground ,rainbow-purple)))) - `(rainbow-delimiters-depth-2-face ((t (:foreground ,rainbow-green)))) - `(rainbow-delimiters-depth-3-face ((t (:foreground ,rainbow-blue)))) - `(rainbow-delimiters-depth-4-face ((t (:foreground ,rainbow-red)))) - `(rainbow-delimiters-depth-5-face ((t (:foreground ,rainbow-yellow)))) - `(rainbow-delimiters-depth-6-face ((t (:foreground ,rainbow-blue)))) - `(rainbow-delimiters-depth-7-face ((t (:foreground ,rainbow-red)))) - `(rainbow-delimiters-depth-8-face ((t (:foreground ,rainbow-8)))) - `(rainbow-delimiters-depth-9-face ((t (:foreground ,rainbow-purple)))) - `(rainbow-delimiters-depth-10-face ((t (:foreground ,rainbow-blue)))) - `(rainbow-delimiters-depth-11-face ((t (:foreground ,rainbow-green)))) - `(rainbow-delimiters-depth-12-face ((t (:foreground ,rainbow-yellow)))))) - #+end_src ** new-text-color #+begin_src emacs-lisp (custom-set-faces @@ -2863,6 +3066,165 @@ (global-set-key (kbd "C-v") 'scrollkeeper-down) (global-set-key (kbd "M-v") 'scrollkeeper-up) #+end_src +** set-default-directory + #+begin_src emacs-lisp + (defun set-default-directory (dir) + (interactive "f") + (setq default-directory dir)) + #+end_src +** hydra + #+begin_src emacs-lisp + (use-package hydra) + #+end_src +** org-mru-clock + #+begin_src emacs-lisp + (use-package org-mru-clock) + #+end_src +** org-clock-convenience + #+begin_src emacs-lisp + (defun my/org-clock-move-to-other () + (interactive) + (forward-char 6) + (while (condition-case nil + (progn + (previous-line) + (org-clock-convenience-goto-ts) + nil) + (error t)))) + + (defun my/org-clock-move-up () + (interactive) + (org-clock-convenience-timestamp-up) + (my/org-clock-move-to-other) + (org-clock-convenience-timestamp-up)) + + (use-package org-clock-convenience + :ensure t + :bind (:map org-agenda-mode-map + ("" . org-clock-convenience-timestamp-up) + ("" . org-clock-convenience-timestamp-down) + ("" . org-clock-convenience-timestamp-up) + ("" . org-clock-convenience-timestamp-down) + ("ö" . org-clock-convenience-fill-gap) + ("é" . org-clock-convenience-fill-gap-both))) + #+end_src +** org-clock-consisitency + #+begin_src emacs-lisp + (setq org-agenda-clock-consistency-checks + '(:max-duration "10:00" + :min-duration 0 + :max-gap 0 + :gap-ok-around ("4:00") + ;; :default-face ((:background "DarkRed") + ;; (:foreground "white")) + ;; :overlap-face nil + ;; :gap-face ((:background "DarkRed") + ;; (:foreground "white")) + ;; :no-end-time-face nil + ;; :long-face nil + ;; :short-face nil + )) + #+end_src +** org-clock stfuf + #+begin_src emacs-lisp + (org-clock-persistence-insinuate) + (setq org-clock-in-resume t) + #+end_src +** org-edna + #+begin_src emacs-lisp + (use-package org-edna) + (org-edna-load) + #+end_src +** org agenda goto headline AND narrow + #+begin_src emacs-lisp + (defun my/org-agenda-narrow () + (interactive) + (org-agenda-switch-to) + (org-narrow-to-subtree) + (org-cycle) + (org-cycle)) + (define-key org-agenda-mode-map (kbd "S-") 'my/org-agenda-narrow) + #+end_src +** World time include Taiwan + #+begin_src emacs-lisp + ;; (("America/Los_Angeles" "Seattle") + ;; ("America/New_York" "New York") + ;; ("Europe/London" "London") + ;; ("Europe/Paris" "Paris") + ;; ("Asia/Calcutta" "Bangalore") + ;; ("Asia/Tokyo" "Tokyo")) + (setq display-time-world-list + '(("Asia/Taipei" "Taiwan"))) + #+end_src +** org-brain + #+begin_src emacs-lisp + (use-package org-brain :ensure t + :init + (global-set-key (kbd "M-'") 'org-brain-visualize) + (setq org-brain-path "~/MEGA/org/brain/") + ;; For Evil users + (with-eval-after-load 'evil + (evil-set-initial-state 'org-brain-visualize-mode 'emacs)) + :config + (setq org-id-track-globally t) + (setq org-id-locations-file "~/.emacs.d/.org-id-locations") + (push '("b" "Brain" plain (function org-brain-goto-end) + "* %i%?" :empty-lines 1) + org-capture-templates) + (setq org-brain-visualize-default-choices 'all) + (setq org-brain-title-max-length 0) + (define-key org-brain-visualize-mode-map (kbd "^") 'org-brain-visualize-back)) + #+end_src +** Open links with firefox + #+begin_src emacs-lisp + (setq browse-url-browser-function 'browse-url-firefox) + #+end_src +** indent-guide + #+begin_src emacs-lisp + (use-package indent-guide) + (ident-guide-global-mode) + #+end_src +** org-export + #+begin_src emacs-lisp + (require 'ox-latex) + (require 'ox-beamer) + #+end_src +** desktop-environment + #+begin_src emacs-lisp + (use-package desktop-environment) + (desktop-environment-mode) + #+end_src +** arch-linux + #+begin_src emacs-lisp + (use-package arch-packer) + #+end_src +** My org traversal function + #+begin_src emacs-lisp + (defmacro traverse-org-headlines (headline &rest body) + (declare (indent defun)) + (let ((buffer-symbol (make-symbol "buffer"))) + `(let (,buffer-symbol) + (org-check-agenda-file ,(cadr headline)) + (setq ,buffer-symbol (if (file-exists-p ,(cadr headline)) + (org-get-agenda-file-buffer ,(cadr headline)) + (error "No such file %s" ,(cadr headline)))) + (with-current-buffer ,buffer-symbol + (while (and (not (eobp)) + (outline-next-heading)) + ,@body))))) + + (defmacro traverse-org-files (files &rest body) + (declare (indent defun)) + (let ((file-symbol (make-symbol "file"))) + `(dolist (,file-symbol ,(cadr files)) + (traverse-org-headlines (,(car files) ,file-symbol) + ,@body)))) + + + (insert (format "%s" (macroexpand-all + ' (traverse-org-files (a org-agenda-files) + (+ 1 2))))) + #+end_src * Broken ** mu4e *** General config diff --git a/custom.el b/custom.el index bc0ffb9..b1d04c8 100644 --- a/custom.el +++ b/custom.el @@ -13,7 +13,7 @@ ("~/MEGA/org/agenda/agenda.org" "~/MEGA/org/agenda/reference.org" "~/MEGA/org/agenda/refile.org"))) '(package-selected-packages (quote - (scrollkeeper elfeed-org elfeed rg ag dumb-jump rainbow-delimiters org-super-agenda htmlize exwm-x keyfreq org-jira eyebrowse omnisharp omnisharp-emacs typescript-mode csharp-mode restclient rjsx-mode go-mode go treemacs org-timeline plantuml-mode pkgbuild-mode airline-themes powerline magit-svn ein emacs-ipython-notebook processing-mode web-mode ledger-mode elpy skewer-mode js2-mode dired-narrow pdf-tools yaml-mode clj-refactor paredit geiser magit ensime yasnippet irony company dired-du ox-reveal oauth2 org-caldav calfw-org calfw-gcal calfw-ical calfw org-bullets ace-jump-mode switch-window counsel smex ivy helm counsel-projectile helm-projectile projectile slime pulseaudio-control evil undo-tree multi-term swiper color-theme-modern org org-plus-contrib use-package exwm)))) + (hyperbole eclim alert gscholar-bibtex org-noter pdf-tools md4rd arch-packer interleave sx desktop-environment org-journal-list indent-guide org-board org-brain org-edna org-clock-csv org-clock-convenience org-mru-clock lsp-ui dap-mode lsp-python lsp-rust lsp-java lsp-ruby lsp-mode smart-jump scrollkeeper elfeed-org elfeed rg ag dumb-jump rainbow-delimiters org-super-agenda htmlize exwm-x keyfreq org-jira eyebrowse omnisharp omnisharp-emacs typescript-mode csharp-mode restclient rjsx-mode go-mode go treemacs org-timeline plantuml-mode pkgbuild-mode airline-themes powerline magit-svn ein emacs-ipython-notebook processing-mode web-mode ledger-mode elpy skewer-mode js2-mode dired-narrow yaml-mode clj-refactor paredit geiser magit ensime yasnippet irony company dired-du ox-reveal oauth2 org-caldav calfw-org calfw-gcal calfw-ical calfw org-bullets ace-jump-mode switch-window counsel smex ivy helm counsel-projectile helm-projectile projectile slime pulseaudio-control evil undo-tree multi-term swiper color-theme-modern org org-plus-contrib use-package exwm)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/custom/ts.el b/custom/ts.el new file mode 160000 index 0000000..b4ddb3f --- /dev/null +++ b/custom/ts.el @@ -0,0 +1 @@ +Subproject commit b4ddb3f2ef20b70d1053719d58ec77ba2c563b45 diff --git a/elfeed.org b/elfeed.org index 8282f3e..c8a4468 100644 --- a/elfeed.org +++ b/elfeed.org @@ -72,6 +72,7 @@ **** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCuCkxoKLYO_EQ2GeFtbM_bw][Half as Interesting]] **** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC9RM-iSvTu1uPJb8X5yp3EQ][Wendover Productions]] **** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCBsuOBu-dxj5bx1KMgmar5g][TheHappieCat]] +**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UConVfxXodg78Tzh5nNu85Ew][Welch Labs]] *** ASMR :asmr: **** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC768XN2ZjMYtNsPT6hcvbCA][Dana ASMR]] @@ -188,7 +189,6 @@ *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCNGSLqZab4TkgY8cnJQxgtA][psyfile]] *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCH4BNI0-FOK2dMXoFtViWHw][It's Okay To Be Smart]] *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCJ0yBou72Lz9fqeMXh9mkog][Physics Videos by Eugene Khutoryansky]] -*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UConVfxXodg78Tzh5nNu85Ew][Welch Labs]] *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCRIxFJ5UicWOUdoUYyJTD1Q][Gbay99]] *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCw26dm5ytO00bdWU3FEx9Jw][Shan-chan]] *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCt9ez6CnUQCFEUnxeBGlR9w][FamilyJules]] diff --git a/exwm-x/exwmx-appconfig b/exwm-x/exwmx-appconfig index 09f483c..2ac0b85 100644 --- a/exwm-x/exwmx-appconfig +++ b/exwm-x/exwmx-appconfig @@ -1,9 +1,11 @@ -(:command "qutebrowser" :alias "qutebrowser" :pretty-name "qutebrowser" :paste-key "C-v" :class "qutebrowser" :instance "qutebrowser" :title "DuckDuckGo — Privacy, simplified. - qutebrowser" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "5a90ddb8976a59d030137fc4414e2918") -(:command "emacs" :alias "emacs" :pretty-name "emacs" :paste-key "C-v" :class "Emacs" :instance "emacs" :title "emacs@ArchLinuvo" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys t :ignore-simulation-keys nil :eval nil :key "d174de6e20bb093cb298146666b92ac1") -(:command "youtube" :alias "youtube" :pretty-name "youtube" :paste-key "C-v" :class "Firefox" :instance "youtube" :title "(4) Water & Dust Resistant PC Case - WHO NEEDS THIS?? - YouTube - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "e63021d849994bb88d64a4d86ed1f4e6") -(:command "school" :alias "school" :pretty-name "school" :paste-key "C-v" :class "Firefox" :instance "school" :title "Pocket: Log In - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "45308901feaebc917a2ff5e74187ea33") -(:command "Navigator" :alias "Navigator" :pretty-name "Navigator" :paste-key "C-v" :class "Firefox" :instance "Navigator" :title "mkropat/jumpapp: A run-or-raise application switcher for any X11 desktop - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "b5686ca42c47fd5dec0b9efe8739ce94") -(:command "pcmanfm" :alias "pcmanfm" :pretty-name "pcmanfm" :paste-key "C-v" :class "Pcmanfm" :instance "pcmanfm" :title "exwm-x" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "50e978cd291dcc11f145ca5835193ae1") -(:command "firefox" :alias "firefox" :pretty-name "firefox" :paste-key "C-v" :class "Firefox" :instance "firefox" :title "Text from Minibuffer - GNU Emacs Lisp Reference Manual - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "b6160ae814a3ea99d1a7636d9c636519") -(:command "work" :alias "work" :pretty-name "work" :paste-key "C-v" :class "Firefox" :instance "work" :title "Pocket: Log In - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "ca58c8720d794df8d0b88c6dceea8c69") +(:command "mgtv" :alias "mgtv" :pretty-name "mgtv" :paste-key "C-v" :class "mgtv" :instance "mgtv" :title "哆啦A梦第二季 第70集 - 视频在线观看 - 哆啦A梦 第二季 - 芒果TV - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "618647de63882e1c4e7209cd22bea289") (:command "steam" :alias "Steam" :pretty-name "Steam" :paste-key "C-v" :class "Steam" :instance "Steam" :title "Steam" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "a68f5a036e9cd3dd4c8ae09a73f8d3db") +(:command "work" :alias "work" :pretty-name "work" :paste-key "C-v" :class "Firefox" :instance "work" :title "Pocket: Log In - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "ca58c8720d794df8d0b88c6dceea8c69") +(:command "firefox" :alias "firefox" :pretty-name "firefox" :paste-key "C-v" :class "Firefox" :instance "firefox" :title "Text from Minibuffer - GNU Emacs Lisp Reference Manual - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "b6160ae814a3ea99d1a7636d9c636519") +(:command "pcmanfm" :alias "pcmanfm" :pretty-name "pcmanfm" :paste-key "C-v" :class "Pcmanfm" :instance "pcmanfm" :title "exwm-x" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "50e978cd291dcc11f145ca5835193ae1") +(:command "Navigator" :alias "Navigator" :pretty-name "Navigator" :paste-key "C-v" :class "Firefox" :instance "Navigator" :title "mkropat/jumpapp: A run-or-raise application switcher for any X11 desktop - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "b5686ca42c47fd5dec0b9efe8739ce94") +(:command "school" :alias "school" :pretty-name "school" :paste-key "C-v" :class "Firefox" :instance "school" :title "Pocket: Log In - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "45308901feaebc917a2ff5e74187ea33") +(:command "youtube" :alias "youtube" :pretty-name "youtube" :paste-key "C-v" :class "Firefox" :instance "youtube" :title "(4) Water & Dust Resistant PC Case - WHO NEEDS THIS?? - YouTube - Mozilla Firefox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "e63021d849994bb88d64a4d86ed1f4e6") +(:command "emacs" :alias "emacs" :pretty-name "emacs" :paste-key "C-v" :class "Emacs" :instance "emacs" :title "emacs@ArchLinuvo" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys t :ignore-simulation-keys nil :eval nil :key "d174de6e20bb093cb298146666b92ac1") +(:command "qutebrowser" :alias "qutebrowser" :pretty-name "qutebrowser" :paste-key "C-v" :class "qutebrowser" :instance "qutebrowser" :title "DuckDuckGo — Privacy, simplified. - qutebrowser" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "5a90ddb8976a59d030137fc4414e2918") +(:command "VirtualBox Machine" :alias "VirtualBox Machine" :pretty-name "VirtualBox Machine" :paste-key "C-v" :class "VirtualBox Machine" :instance "VirtualBox Machine" :title "Windows 7 [Running] - Oracle VM VirtualBox" :floating nil :size-and-position default :workspace current-workspace :add-prefix-keys nil :remove-prefix-keys nil :ignore-simulation-keys nil :eval nil :key "9032cdf6364297438c1892d892122db3") diff --git a/my-redefs.org b/my-redefs.org index a7ec0ea..1114918 100644 --- a/my-redefs.org +++ b/my-redefs.org @@ -1,3 +1,216 @@ +* Filter by top heading, but only top todo heading + #+begin_src emacs-lisp + (defun my/org-find-parent (pos) + (save-excursion + (with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer)) + (when pos (goto-char pos)) + ;; Skip up to the topmost parent. + (while (save-excursion + (org-up-heading-safe) + (org-get-todo-state)) + (org-up-heading-safe)) + (ignore-errors (nth 4 (org-heading-components)))))) + + (defun org-agenda-filter-by-top-headline (strip) + "Keep only those lines that are descendants from the same top headline. + The top headline is that of the current line." + (interactive "P") + (if org-agenda-filtered-by-top-headline + (progn + (setq org-agenda-filtered-by-top-headline nil + org-agenda-top-headline-filter nil) + (org-agenda-filter-show-all-top-filter)) + (let ((toph (my/org-find-parent (org-get-at-bol 'org-hd-marker)))) + (if toph (org-agenda-filter-top-headline-apply toph strip) + (error "No top-level headline at point"))))) + #+end_src +* org-timeline at beginning of agenda buffer + #+BEGIN_SRC emacs-lisp + (defun org-timeline-insert-timeline () + "Insert graphical timeline into agenda buffer." + (unless (buffer-narrowed-p) + (goto-char (point-min)) + (while (and (not (eq (get-text-property (line-beginning-position) 'org-agenda-type) 'agenda)) + (not (eobp))) + (forward-line)) + (forward-line) + (unless (eobp) + (let ((inhibit-read-only t)) + (insert (org-timeline--generate-timeline)) + (insert (propertize (concat "\n" (make-string (/ (window-width) 2) ?─)) 'face 'org-time-grid) "\n")) + ;; enable `font-lock-mode' in agenda view to display the "chart" + (font-lock-mode)))) + #+END_SRC +* org-caldav bug +#+BEGIN_SRC emacs-lisp + (defun org-caldav-skip-function (backend) + (when (eq backend 'icalendar) + (org-map-entries + (lambda () + (let ((pt (save-excursion (apply 'org-agenda-skip-entry-if org-caldav-skip-conditions)))) + (when (or pt + ;;(org-get-repeat) + ) ;; No repeating tasks + (org-todo 'none) + (let ((current-prefix-arg '(4))) + (call-interactively 'org-schedule) + (call-interactively 'org-deadline)))))))) +#+END_SRC +* Another org-caldav bug +https://github.com/org-trello/org-trello/issues/258 +#+BEGIN_SRC emacs-lisp + + (defun url-http-end-of-document-sentinel (proc why) + ;; Sentinel used to handle (i) terminated old HTTP/0.9 connections, + ;; and (ii) closed connection due to reusing a HTTP connection which + ;; we believed was still alive, but which the server closed on us. + ;; We handle case (ii) by calling `url-http' again. + (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" + (process-buffer proc)) + (url-http-idle-sentinel proc why) + (when (buffer-name (process-buffer proc)) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cond ((not (looking-at "HTTP/")) + (if url-http-no-retry + ;; HTTP/0.9 just gets passed back no matter what + (url-http-activate-callback) + ;; Call `url-http' again if our connection expired. + (erase-buffer) + (let ((url-request-method url-http-method) + (url-request-extra-headers url-http-extra-headers) + (url-request-data url-http-data) + (url-using-proxy (url-find-proxy-for-url + url-current-object + (url-host url-current-object)))) + (when url-using-proxy + (setq url-using-proxy + (url-generic-parse-url url-using-proxy))) + (if (string= "https" (url-type url-current-object)) + (setq url-gateway-method 'tls)) + (url-http url-current-object url-callback-function + url-callback-arguments (current-buffer))))) + ((url-http-parse-headers) + (url-http-activate-callback)))))) + +#+END_SRC +* I don't like the help window behavior + #+BEGIN_SRC emacs-lisp + (defun my/goto-variable (var &optional file) + (when (eq file 'C-source) + (setq file (help-C-file-name var 'var))) + (let* ((location (find-variable-noselect var file)) + (position (cdr location))) + (switch-to-buffer (car location)) + (run-hooks 'find-function-after-hook) + (if position + (progn + ;; Widen the buffer if necessary to go to this position. + (when (or (< position (point-min)) + (> position (point-max))) + (widen)) + (goto-char position)) + (message "Unable to find location in file")))) + + (define-button-type 'help-variable-def + :supertype 'help-xref + 'help-function #'my/goto-variable + 'help-echo (purecopy "mouse-2, RET: find variable's definition")) + + (defun my/goto-function (fun &optional file type) + (or file + (setq file (find-lisp-object-file-name fun type))) + (if (not file) + (message "Unable to find defining file") + (require 'find-func) + (when (eq file 'C-source) + (setq file + (help-C-file-name (indirect-function fun) 'fun))) + ;; Don't use find-function-noselect because it follows + ;; aliases (which fails for built-in functions). + (let ((location + (find-function-search-for-symbol fun type file))) + (switch-to-buffer (car location)) + (run-hooks 'find-function-after-hook) + (if (cdr location) + (goto-char (cdr location)) + (message "Unable to find location in file"))))) + + (define-button-type 'help-function-def + :supertype 'help-xref + 'help-function #'my/goto-function + 'help-echo (purecopy "mouse-2, RET: find function's definition")) + #+END_SRC +* Org agenda supposedly has an option to make no timestamp on a date mean the end of the day + However, the behavior reflected is not so. Therefore, I have added some code to manually add the end-of-day timestamp manually + #+BEGIN_SRC emacs-lisp + (setq org-sort-agenda-notime-is-late t) + + (defun my-org-agenda-entry-get-agenda-timestamp (pom) + "Retrieve timestamp information for sorting agenda views. + Given a point or marker POM, returns a cons cell of the timestamp + and the timestamp type relevant for the sorting strategy in + `org-agenda-sorting-strategy-selected'." + (let (ts ts-date-type) + (save-match-data + (cond ((org-em 'scheduled-up 'scheduled-down + org-agenda-sorting-strategy-selected) + (setq ts (org-entry-get pom "SCHEDULED") + ts-date-type " scheduled")) + ((org-em 'deadline-up 'deadline-down + org-agenda-sorting-strategy-selected) + (setq ts (org-entry-get pom "DEADLINE") + ts-date-type " deadline")) + ((org-em 'ts-up 'ts-down + org-agenda-sorting-strategy-selected) + (setq ts (org-entry-get pom "TIMESTAMP") + ts-date-type " timestamp")) + ((org-em 'tsia-up 'tsia-down + org-agenda-sorting-strategy-selected) + (setq ts (org-entry-get pom "TIMESTAMP_IA") + ts-date-type " timestamp_ia")) + ((org-em 'timestamp-up 'timestamp-down + org-agenda-sorting-strategy-selected) + (setq ts (or (org-entry-get pom "SCHEDULED") + (org-entry-get pom "DEADLINE") + (org-entry-get pom "TIMESTAMP") + (org-entry-get pom "TIMESTAMP_IA")) + ts-date-type "")) + (t (setq ts-date-type ""))) + (cons (when ts + (ignore-errors + (org-time-string-to-seconds + (if (string-match-p ":" ts) + ts + (let ((s (substring ts 0 (1- (length ts))))) ;; Added code here + (concat s + " 23:59>")))))) + ts-date-type)))) + + (advice-add 'org-agenda-entry-get-agenda-timestamp + :override + #'my-org-agenda-entry-get-agenda-timestamp) + #+END_SRC +* org-mru-clock + Include the tags dammit + #+begin_src emacs-lisp + (defun org-mru-clock-format-entry () + "Return the parent heading string appended to the heading at point." + (let* ((this (org-get-heading 'no-tags 'no-todo)) + (parent + (save-excursion + (org-up-heading-safe) + (concat (org-get-heading 'no-tags 'no-todo) + " " + (string-join (org-get-tags-at) ",")))) + (parent-post (if parent + (format " (%s)" parent) + "")) + (with-parent (concat this parent-post))) + (if org-mru-clock-keep-formatting + with-parent + (substring-no-properties with-parent)))) + #+end_src * Scan Tags Indent #+BEGIN_SRC emacs-lisp (defun get-parent-indent-level () @@ -177,170 +390,41 @@ (org-hide-archived-subtrees (point-min) (point-max))) (nreverse rtn))) #+END_SRC -* org-timeline at beginning of agenda buffer - #+BEGIN_SRC emacs-lisp - (defun org-timeline-insert-timeline () - "Insert graphical timeline into agenda buffer." - (unless (buffer-narrowed-p) - (goto-char (point-min)) - (while (and (not (eq (get-text-property (line-beginning-position) 'org-agenda-type) 'agenda)) - (not (eobp))) - (forward-line)) - (forward-line) - (unless (eobp) - (let ((inhibit-read-only t)) - (insert (org-timeline--generate-timeline)) - (insert (propertize (concat "\n" (make-string (/ (window-width) 2) ?─)) 'face 'org-time-grid) "\n")) - ;; enable `font-lock-mode' in agenda view to display the "chart" - (font-lock-mode)))) - #+END_SRC -* org-caldav bug -#+BEGIN_SRC emacs-lisp - (defun org-caldav-skip-function (backend) - (when (eq backend 'icalendar) - (org-map-entries - (lambda () - (let ((pt (save-excursion (apply 'org-agenda-skip-entry-if org-caldav-skip-conditions)))) - (when (or pt - ;;(org-get-repeat) - ) ;; No repeating tasks - (org-todo 'none) - (let ((current-prefix-arg '(4))) - (call-interactively 'org-schedule) - (call-interactively 'org-deadline)))))))) -#+END_SRC -* Another org-caldav bug -https://github.com/org-trello/org-trello/issues/258 -#+BEGIN_SRC emacs-lisp - - (defun url-http-end-of-document-sentinel (proc why) - ;; Sentinel used to handle (i) terminated old HTTP/0.9 connections, - ;; and (ii) closed connection due to reusing a HTTP connection which - ;; we believed was still alive, but which the server closed on us. - ;; We handle case (ii) by calling `url-http' again. - (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" - (process-buffer proc)) - (url-http-idle-sentinel proc why) - (when (buffer-name (process-buffer proc)) - (with-current-buffer (process-buffer proc) - (goto-char (point-min)) - (cond ((not (looking-at "HTTP/")) - (if url-http-no-retry - ;; HTTP/0.9 just gets passed back no matter what - (url-http-activate-callback) - ;; Call `url-http' again if our connection expired. - (erase-buffer) - (let ((url-request-method url-http-method) - (url-request-extra-headers url-http-extra-headers) - (url-request-data url-http-data) - (url-using-proxy (url-find-proxy-for-url - url-current-object - (url-host url-current-object)))) - (when url-using-proxy - (setq url-using-proxy - (url-generic-parse-url url-using-proxy))) - (if (string= "https" (url-type url-current-object)) - (setq url-gateway-method 'tls)) - (url-http url-current-object url-callback-function - url-callback-arguments (current-buffer))))) - ((url-http-parse-headers) - (url-http-activate-callback)))))) - -#+END_SRC -* I don't like the help window behavior - #+BEGIN_SRC emacs-lisp - (defun my/goto-variable (var &optional file) - (when (eq file 'C-source) - (setq file (help-C-file-name var 'var))) - (let* ((location (find-variable-noselect var file)) - (position (cdr location))) - (switch-to-buffer (car location)) - (run-hooks 'find-function-after-hook) - (if position - (progn - ;; Widen the buffer if necessary to go to this position. - (when (or (< position (point-min)) - (> position (point-max))) - (widen)) - (goto-char position)) - (message "Unable to find location in file")))) - - (define-button-type 'help-variable-def - :supertype 'help-xref - 'help-function #'my/goto-variable - 'help-echo (purecopy "mouse-2, RET: find variable's definition")) - - (defun my/goto-function (fun &optional file type) - (or file - (setq file (find-lisp-object-file-name fun type))) - (if (not file) - (message "Unable to find defining file") - (require 'find-func) - (when (eq file 'C-source) - (setq file - (help-C-file-name (indirect-function fun) 'fun))) - ;; Don't use find-function-noselect because it follows - ;; aliases (which fails for built-in functions). - (let ((location - (find-function-search-for-symbol fun type file))) - (switch-to-buffer (car location)) - (run-hooks 'find-function-after-hook) - (if (cdr location) - (goto-char (cdr location)) - (message "Unable to find location in file"))))) - - (define-button-type 'help-function-def - :supertype 'help-xref - 'help-function #'my/goto-function - 'help-echo (purecopy "mouse-2, RET: find function's definition")) - #+END_SRC -* Org agenda supposedly has an option to make no timestamp on a date mean the end of the day - However, the behavior reflected is not so. Therefore, I have added some code to manually add the end-of-day timestamp manually - #+BEGIN_SRC emacs-lisp - (setq org-sort-agenda-notime-is-late t) - - (defun my-org-agenda-entry-get-agenda-timestamp (pom) - "Retrieve timestamp information for sorting agenda views. - Given a point or marker POM, returns a cons cell of the timestamp - and the timestamp type relevant for the sorting strategy in - `org-agenda-sorting-strategy-selected'." - (let (ts ts-date-type) - (save-match-data - (cond ((org-em 'scheduled-up 'scheduled-down - org-agenda-sorting-strategy-selected) - (setq ts (org-entry-get pom "SCHEDULED") - ts-date-type " scheduled")) - ((org-em 'deadline-up 'deadline-down - org-agenda-sorting-strategy-selected) - (setq ts (org-entry-get pom "DEADLINE") - ts-date-type " deadline")) - ((org-em 'ts-up 'ts-down - org-agenda-sorting-strategy-selected) - (setq ts (org-entry-get pom "TIMESTAMP") - ts-date-type " timestamp")) - ((org-em 'tsia-up 'tsia-down - org-agenda-sorting-strategy-selected) - (setq ts (org-entry-get pom "TIMESTAMP_IA") - ts-date-type " timestamp_ia")) - ((org-em 'timestamp-up 'timestamp-down - org-agenda-sorting-strategy-selected) - (setq ts (or (org-entry-get pom "SCHEDULED") - (org-entry-get pom "DEADLINE") - (org-entry-get pom "TIMESTAMP") - (org-entry-get pom "TIMESTAMP_IA")) - ts-date-type "")) - (t (setq ts-date-type ""))) - (cons (when ts - (ignore-errors - (org-time-string-to-seconds - (if (string-match-p ":" ts) - ts - (let ((s (substring ts 0 (1- (length ts))))) ;; Added code here - (concat s - " 23:59>")))))) - ts-date-type)))) - - (advice-add 'org-agenda-entry-get-agenda-timestamp - :override - #'my-org-agenda-entry-get-agenda-timestamp) - #+END_SRC +* gdb window layout custom + #+begin_src emacs-lisp + (defun gdb-setup-windows () + "Layout the window pattern for option `gdb-many-windows'." + (gdb-get-buffer-create 'gdb-locals-buffer) + (gdb-get-buffer-create 'gdb-stack-buffer) + (gdb-get-buffer-create 'gdb-breakpoints-buffer) + (set-window-dedicated-p (selected-window) nil) + (switch-to-buffer gud-comint-buffer) + (delete-other-windows) + (let ((win0 (selected-window)) + (win1 (split-window nil ( / ( * (window-height) 3) 4))) + (win2 (split-window nil ( / (window-height) 3))) + (win3 (split-window-right))) + (gdb-set-window-buffer (gdb-locals-buffer-name) nil win3) + (select-window win2) + (set-window-buffer + win2 + (if gud-last-last-frame + (gud-find-file (car gud-last-last-frame)) + (if gdb-main-file + (gud-find-file gdb-main-file) + ;; Put buffer list in window if we + ;; can't find a source file. + (list-buffers-noselect)))) + (setq gdb-source-window (selected-window)) + (let ((win4 (split-window-right))) + (gdb-set-window-buffer + (gdb-get-buffer-create 'gdb-disassembly-buffer) nil win4)) + (select-window win1) + (gdb-set-window-buffer (gdb-stack-buffer-name)) + (let ((win5 (split-window-right))) + (gdb-set-window-buffer (if gdb-show-threads-by-default + (gdb-threads-buffer-name) + (gdb-breakpoints-buffer-name)) + nil win5)) + (select-window win0))) + #+end_src diff --git a/res/001.jpg b/res/001.jpg new file mode 100644 index 0000000..f693ab2 Binary files /dev/null and b/res/001.jpg differ diff --git a/res/2000px-Archlinux-icon-crystal-64.svg.png b/res/2000px-Archlinux-icon-crystal-64.svg.png new file mode 100644 index 0000000..3ee1e38 Binary files /dev/null and b/res/2000px-Archlinux-icon-crystal-64.svg.png differ diff --git a/res/55604-1.jpg b/res/55604-1.jpg new file mode 100644 index 0000000..0dfae57 Binary files /dev/null and b/res/55604-1.jpg differ diff --git a/res/9zpVhD7.png b/res/9zpVhD7.png new file mode 100644 index 0000000..226c6e9 Binary files /dev/null and b/res/9zpVhD7.png differ diff --git a/res/Cities.jpg b/res/Cities.jpg new file mode 100644 index 0000000..fbf091e Binary files /dev/null and b/res/Cities.jpg differ diff --git a/res/KMA_Star.png b/res/KMA_Star.png new file mode 100644 index 0000000..59d51b6 Binary files /dev/null and b/res/KMA_Star.png differ diff --git a/res/Ocean.jpg b/res/Ocean.jpg new file mode 100644 index 0000000..871181a Binary files /dev/null and b/res/Ocean.jpg differ diff --git a/res/icon41-512.png b/res/icon41-512.png new file mode 100644 index 0000000..372b14f Binary files /dev/null and b/res/icon41-512.png differ diff --git a/res/illustration-cute-snowflake_53876-2949.jpg b/res/illustration-cute-snowflake_53876-2949.jpg new file mode 100644 index 0000000..7b5680d Binary files /dev/null and b/res/illustration-cute-snowflake_53876-2949.jpg differ diff --git a/res/snowflake-512.png b/res/snowflake-512.png new file mode 100644 index 0000000..96cc05f Binary files /dev/null and b/res/snowflake-512.png differ diff --git a/res/windows_10_hero_4k-wallpaper-1920x1080.jpg b/res/windows_10_hero_4k-wallpaper-1920x1080.jpg new file mode 100644 index 0000000..3966d73 Binary files /dev/null and b/res/windows_10_hero_4k-wallpaper-1920x1080.jpg differ