This commit is contained in:
fz0x1 2024-11-25 15:58:26 +01:00
parent 1e64a7d670
commit 5dcaeaa961
3 changed files with 393 additions and 0 deletions

377
global/.emacs.d/init.el Normal file
View file

@ -0,0 +1,377 @@
(menu-bar-mode -1)
(tool-bar-mode -1)
(setq make-backup-files nil) ;; Отключить резервные копии
(setq auto-save-default nil) ;; Отключить автосохранение
(require 'package)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
;; Установить, если `use-package` отсутствует
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; Enable use-package
(eval-when-compile
(require 'use-package))
(use-package org
:pin gnu)
(use-package gruvbox-theme
:config
(load-theme 'gruvbox-dark-medium t))
(use-package ace-window
:bind ("M-o" . ace-window))
(use-package org-bullets
:hook (org-mode . org-bullets-mode))
(setq aw-dispatch-always t)
(setq use-package-always-ensure t)
;; Must do this so the agenda knows where to look for my files
(setq org-agenda-files '("~/org"))
;; When a TODO is set to a done state, record a timestamp
(setq org-log-done 'time)
;; Follow the links
;; (setq org-return-follows-link t)
;; Associate all org files with org mode
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;; Make the indentation look nicer
(add-hook 'org-mode-hook 'org-indent-mode)
;; Remap the change priority keys to use the UP or DOWN key
(define-key org-mode-map (kbd "C-c <up>") 'org-priority-up)
(define-key org-mode-map (kbd "C-c <down>") 'org-priority-down)
;; Shortcuts for storing links, viewing the agenda, and starting a capture
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(define-key global-map "\C-cc" 'org-capture)
(global-set-key (kbd "C-c n") (lambda () (interactive) (find-file "~/org/notes.org")))
(global-set-key (kbd "C-c w") (lambda () (interactive) (find-file "~/org/work-log.org")))
;; When you want to change the level of an org item, use SMR
(define-key org-mode-map (kbd "C-c C-g C-r") 'org-shiftmetaright)
;; Hide the markers so you just see bold text as BOLD-TEXT and not *BOLD-TEXT*
(setq org-hide-emphasis-markers t)
;; Wrap the lines in org mode so that things are easier to read
(add-hook 'org-mode-hook 'visual-line-mode)
(setq initial-buffer-choice
(lambda ()
(let ((agenda-buffer (org-agenda nil "a")))
(get-buffer "*Org Agenda*"))))
(setq org-agenda-window-setup 'only-window)
(setq org-agenda-include-diary t)
(let* ((variable-tuple
(cond ((x-list-fonts "JetBrainsMono Nerd Font") '(:font "JetBrainsMono Nerd Font"))
(nil (warn "Cannot find JetBrainsMono Nerd Font. Please install it."))))
(base-font-color (face-foreground 'default nil 'default))
(headline `(:inherit default :weight bold :foreground ,base-font-color)))
(custom-theme-set-faces
'user
`(org-level-8 ((t (,@headline ,@variable-tuple))))
`(org-level-7 ((t (,@headline ,@variable-tuple))))
`(org-level-6 ((t (,@headline ,@variable-tuple))))
`(org-level-5 ((t (,@headline ,@variable-tuple))))
`(org-level-4 ((t (,@headline ,@variable-tuple :height 1.0))))
`(org-level-3 ((t (,@headline ,@variable-tuple :height 1.1))))
`(org-level-2 ((t (,@headline ,@variable-tuple :height 1.2))))
`(org-level-1 ((t (,@headline ,@variable-tuple :height 1.3))))
`(org-document-title ((t (,@headline ,@variable-tuple :height 1.4 :underline nil))))))
(setq org-capture-templates
'(
("j" "Work Log Entry"
entry (file+datetree "~/org/work-log.org")
"* %?"
:empty-lines 0)
("n" "Note"
entry (file+headline "~/org/notes.org" "Random Notes")
"** %?"
:empty-lines 0)
("n" "Grocery list"
entry (file+headline "~/org/grocery.org" "Grocery list")
"** %?"
:empty-lines 0)
("g" "General To-Do"
entry (file+headline "~/org/todos.org" "General Tasks")
"* TODO [#B] %?\n:Created: %T\n "
:empty-lines 0)
;; ("m" "Meeting"
;; entry (file+datetree "~/org/meetings.org")
;; "* %? :meeting:%^g \n:Created: %T\n** Attendees\n*** \n** Notes\n** Action Items\n*** TODO [#A] "
;; :tree-type week
;; :clock-in t
;; :clock-resume t
;; :empty-lines 0)
("c" "Code To-Do"
entry (file+headline "~/org/todos.org" "Code Related Tasks")
"* TODO [#B] %?\n:Created: %T\n%i\n%a\nProposed Solution: "
:empty-lines 0)
))
(setq org-todo-keywords
'((sequence "TODO(t)" "PLANNING(p)" "IN-PROGRESS(i@/!)" "VERIFYING(v!)" "BLOCKED(b@)" "|" "DONE(d!)" )
))
(setq org-todo-keyword-faces
'(
("TODO" . (:foreground "GoldenRod" :weight bold))
("PLANNING" . (:foreground "DeepPink" :weight bold))
("IN-PROGRESS" . (:foreground "Cyan" :weight bold))
("VERIFYING" . (:foreground "DarkOrange" :weight bold))
("BLOCKED" . (:foreground "Red" :weight bold))
("DONE" . (:foreground "LimeGreen" :weight bold))
("OBE" . (:foreground "LimeGreen" :weight bold))
("WONT-DO" . (:foreground "LimeGreen" :weight bold))
))
;; Tags
(setq org-tag-alist '(
;; context
(:startgroup)
("@shop" . ?s)
("@home" . ?h)
("@outdoor" . ?o)
("@any" . ?a)
("@meeting" . ?m)
(:endgroup)
;; basic tags
(:startgroup)
("chores" . ?C)
("meeting" . ?M)
("finance" . ?F)
("sport" . ?S)
("code" . ?O)
("social" . ?I)
("productivity" . ?P)
("study" . ?U)
("privacy" . ?R)
("family" . ?A)
("travel" . ?T)
("life" . ?L)
("health" . ?H)
("friends" . ?E)
("hobby" . ?B)
("research" . ?G)
(:endgroup)
;; Special tags
("CRITICAL" . ?X)
;; other tags
("backend")
("broken_code")
("frontend")
("hike")
("cycle")
("pkm")
("pentest")
("immigration")
("devops")
("pet")
("accomplishment")
))
;; Tag colors
(setq org-tag-faces
'(
("@home" . (:foreground "mediumPurple1" :weight bold))
("@outdoor" . (:foreground "royalblue1" :weight bold))
("@shop" . (:foreground "forest green" :weight bold))
("QA" . (:foreground "sienna" :weight bold))
("chores" . (:foreground "yellow1" :weight bold))
("sport" . (:foreground "green yellow" :weight bold))
("finance" . (:foreground "tomato" :weight bold))
("privacy" . (:foreground "dark olive green" :weight bold))
("study" . (:foreground "aquamarine" :weight bold))
("productivity" . (:foreground "violet" :weight bold))
("family" . (:foreground "medium violet red" :weight bold))
("health" . (:foreground "DarkOrange1" :weight bold))
("code" . (:foreground "snow3" :weight bold))
("travel" . (:foreground "salmon4" :weight bold))
("life" . (:foreground "goldenrod1" :weight bold))
("friends" . (:foreground "plum4" :weight bold))
("hobby" . (:foreground "SeaGreen1" :weight bold))
("social" . (:foreground "RoyalBlue1" :weight bold))
("research" . (:foreground "deep sky blue" :weight bold))
("meeting" . (:foreground "magenta" :weight bold))
("CRITICAL" . (:foreground "red1" :weight bold))
)
)
;; Agenda View "d"
(defun air-org-skip-subtree-if-priority (priority)
"Skip an agenda subtree if it has a priority of PRIORITY.
PRIORITY may be one of the characters ?A, ?B, or ?C."
(let ((subtree-end (save-excursion (org-end-of-subtree t)))
(pri-value (* 1000 (- org-lowest-priority priority)))
(pri-current (org-get-priority (thing-at-point 'line t))))
(if (= pri-value pri-current)
subtree-end
nil)))
(setq org-agenda-skip-deadline-if-done t)
(setq org-agenda-custom-commands
'(
;; Daily Agenda & TODOs
("d" "Daily agenda and all TODOs"
;; Display items with priority A
((tags "PRIORITY=\"A\""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
;; View 7 days in the calendar view
(agenda "" ((org-agenda-span 7)))
;; Display items with priority B (really it is view all items minus A & C)
(alltodo ""
((org-agenda-skip-function '(or (air-org-skip-subtree-if-priority ?A)
(air-org-skip-subtree-if-priority ?C)
(org-agenda-skip-if nil '(scheduled deadline))))
(org-agenda-overriding-header "ALL normal priority tasks:")))
;; Display items with pirority C
(tags "PRIORITY=\"C\""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "Low-priority Unfinished tasks:")))
)
;; Don't compress things (change to suite your tastes)
((org-agenda-compact-blocks nil)))
;; My Super View
("j" "My Super View"
(
(agenda ""
(
(org-agenda-remove-tags t)
(org-agenda-span 7)
)
)
(alltodo ""
(
;; Remove tags to make the view cleaner
(org-agenda-remove-tags t)
(org-agenda-prefix-format " %t %s")
(org-agenda-overriding-header "CURRENT STATUS")
;; Define the super agenda groups (sorts by order)
(org-super-agenda-groups
'(
;; Filter where tag is CRITICAL
(:name "Critical Tasks"
:tag "CRITICAL"
:order 0
)
;; Filter where TODO state is IN-PROGRESS
(:name "Currently Working"
:todo "IN-PROGRESS"
:order 1
)
;; Filter where TODO state is PLANNING
(:name "Planning Next Steps"
:todo "PLANNING"
:order 2
)
;; Filter where TODO state is BLOCKED or where the tag is obstacle
(:name "Problems & Blockers"
:todo "BLOCKED"
:order 3
)
;; Filter where tag is research
(:name "Research Required"
:tag "research"
:order 4
)
;; Filter where tag is chores
(:name "Chores"
:tag "chores"
:order 5
)
;; Filter where tag is meeting and priority is A (only want TODOs from meetings)
(:name "Meeting Action Items"
:and (:tag "meeting" :priority "A")
:order 6
)
;; Filter where state is TODO and the priority is A and the tag is not meeting
(:name "Other Important Items"
:and (:todo "TODO" :priority "A" :not (:tag "meeting"))
:order 7
)
;; Filter where state is TODO and priority is B
(:name "General Backlog"
:and (:todo "TODO" :priority "B")
:order 8
)
;; Filter where the priority is C or less (supports future lower priorities)
(:name "Non Critical"
:priority<= "C"
:order 9
)
;; Filter where TODO state is VERIFYING
(:name "Currently Being Verified"
:todo "VERIFYING"
:order 10
)
)
)
)
)
))
))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; 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.
'(package-selected-packages '(gruvbox-theme ace-window)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; 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.
'(org-document-title ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif" :height 1.6 :underline nil))))
'(org-level-1 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif" :height 1.5))))
'(org-level-2 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif" :height 1.3))))
'(org-level-3 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif" :height 1.2))))
'(org-level-4 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif" :height 1.1))))
'(org-level-5 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif"))))
'(org-level-6 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif"))))
'(org-level-7 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif"))))
'(org-level-8 ((t (:inherit default :weight bold :foreground "#ebdbb2" :family "Sans Serif")))))

5
linux/scripts/bin/lock.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env sh
pkill -u "$USER" -USR1 dunst
~/.config/i3/i3lock
pkill -u "$USER" -USR2 dunst

View file

@ -0,0 +1,11 @@
#!/usr/bin/env sh
connected_monitors=$(xrandr | grep " connected" | awk '{ print $1 }')
if echo "$connected_monitors" | grep -q "HDMI"; then
xrandr --output DP-2 --off
xrandr --output HDMI-0 --mode 2560x1440 --rate 165.00 --dpi 120
# xrandr --output eDP-1 --left-of HDMI-1-0
xrandr --output HDMI-0 --primary
else
xrandr --output DP-2 --mode 2560x1600 --rate 240.00 --dpi 160
fi