Browse Source

emacs doom configuration, emojis, wake on lan and more

main
Yigit Colakoglu 4 years ago
parent
commit
b313cbf70c
61 changed files with 2586 additions and 4438 deletions
  1. +8
    -1
      .config/X11/xinitrc
  2. +2
    -0
      .config/config.env.default
  3. +7
    -0
      .config/doom/cli.el
  4. +426
    -132
      .config/doom/config.el
  5. +46
    -0
      .config/doom/custom.el
  6. +48
    -29
      .config/doom/init.el
  7. +913
    -0
      .config/doom/lisp/bison-mode.el
  8. +38
    -1
      .config/doom/packages.el
  9. +13
    -0
      .config/doom/templates/template.c
  10. +13
    -0
      .config/doom/templates/template.cpp
  11. +35
    -0
      .config/doom/templates/template.el
  12. +12
    -0
      .config/doom/templates/template.h
  13. +0
    -0
      .config/doom/templates/template.html
  14. +12
    -0
      .config/doom/templates/template.java
  15. +13
    -0
      .config/doom/templates/template.org
  16. +14
    -0
      .config/doom/templates/template.py
  17. +7
    -0
      .config/doom/templates/template.sh
  18. +3
    -5
      .config/doom/templates/template.tex
  19. +126
    -112
      .config/doom/themes/doom-material-ocean-theme.el
  20. +1
    -0
      .config/mutt/muttrc
  21. +0
    -2
      .config/nextcloud/nextcloud
  22. +0
    -5
      .config/nvim/plugin/plugins.vim
  23. +8
    -7
      .config/vim/vimrc
  24. +8
    -0
      .config/zsh/.zshrc
  25. +8
    -0
      .config/zsh/aliases
  26. +22
    -0
      .local/bin/backup
  27. +1
    -0
      .local/bin/calconsync
  28. +13
    -9
      .local/bin/check-updates
  29. +14
    -0
      .local/bin/dmenu-emoji
  30. +2
    -0
      .local/bin/dmenu-logout
  31. +9
    -4
      .local/bin/dmenu-refresh
  32. +107
    -0
      .local/bin/dmenu-web
  33. +318
    -0
      .local/bin/dmenu-xrandr
  34. +10
    -4
      .local/bin/dmenu_run_history
  35. +0
    -11
      .local/bin/dmenu_surf
  36. +8
    -1
      .local/bin/doom
  37. +62
    -0
      .local/bin/e
  38. +0
    -53
      .local/bin/menu-surfraw
  39. +3
    -0
      .local/share/dwm/autostart.sh
  40. +0
    -3810
      .local/share/nerdfont_icons
  41. +0
    -14
      .local/share/vim/templates/skeleton.c
  42. +0
    -14
      .local/share/vim/templates/skeleton.cpp
  43. +0
    -13
      .local/share/vim/templates/skeleton.h
  44. +0
    -13
      .local/share/vim/templates/skeleton.hpp
  45. +0
    -13
      .local/share/vim/templates/skeleton.java
  46. +0
    -15
      .local/share/vim/templates/skeleton.py
  47. +0
    -2
      .local/share/vim/templates/skeleton.sh
  48. +10
    -4
      .local/src/dmenu/config.h
  49. +1
    -1
      .local/src/dmenu/config.mk
  50. +162
    -0
      .local/src/dmenu/dmenu.c
  51. +4
    -0
      .local/src/dwm/config.def.h
  52. +11
    -1
      .local/src/dwm/config.h
  53. +12
    -2
      .local/src/dwm/dwm.c
  54. +16
    -14
      .local/src/dwm/keybinds.h
  55. +8
    -7
      .local/src/dwm/rules.h
  56. +10
    -2
      .local/src/dwmblocks/config.h
  57. +12
    -134
      .local/src/st/config.h
  58. BIN
      .local/src/st/st
  59. BIN
      .local/src/st/st.o
  60. BIN
      .local/src/st/x.o
  61. +10
    -3
      .profile

+ 8
- 1
.config/X11/xinitrc View File

@ -6,7 +6,13 @@ pkill -f "bash /sbin/clipmenud"
pkill -f "/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh" pkill -f "/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh"
pkill -f devmon pkill -f devmon
echo "$DBUS_SESSION_BUS_ADDRESS" > /tmp/bus-session
cat << EOF > "$XDG_CACHE_HOME/dbus_settings"
export DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS
export DBUS_SESSION_BUS_PID=$DBUS_SESSION_BUS_PID
export DBUS_SESSION_BUS_WINDOWID=$DBUS_SESSION_BUS_WINDOWID
EOF
chmod +x "$XDG_CACHE_HOME/dbus_settings"
rm -rf $XDG_RUNTIME_DIR/day_cache rm -rf $XDG_RUNTIME_DIR/day_cache
export XSESSION_PID="$$" export XSESSION_PID="$$"
@ -14,6 +20,7 @@ export XSESSION_PID="$$"
source ~/.config/config.env source ~/.config/config.env
pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell pactl upload-sample /usr/share/sounds/freedesktop/stereo/bell.oga x11-bell
pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY pactl load-module module-x11-bell sample=x11-bell display=$DISPLAY
xset b 100 xset b 100


+ 2
- 0
.config/config.env.default View File

@ -1,5 +1,7 @@
# vim:ft=bash # vim:ft=bash
# This file is used by my dotfiles in some core functions
#!/bin/sh #!/bin/sh
export ETH_IT=enp2s0 export ETH_IT=enp2s0


+ 7
- 0
.config/doom/cli.el View File

@ -0,0 +1,7 @@
;;; cli.el -*- lexical-binding: t; -*-
(setq org-confirm-babel-evaluate nil)
(defun doom-shut-up-a (orig-fn &rest args)
(quiet! (apply orig-fn args)))
(advice-add 'org-babel-execute-src-block :around #'doom-shut-up-a)

+ 426
- 132
.config/doom/config.el View File

@ -1,160 +1,454 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!
;; __ _______ _____ _____
;; \ \ / / ____| ____|_ _|
;; \ V /| _| | _| | |
;; | | | |___| |___ | |
;; |_| |_____|_____| |_|
;; Yeet's Doom Emacs configuration
;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
;; Global Configuration
(setq user-full-name "Yigit Colakoglu" (setq user-full-name "Yigit Colakoglu"
user-mail-address "yigit@yigitcolakoglu.com")
user-mail-address "yigit@yigitcolakoglu.com")
(add-to-list 'default-frame-alist
'(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist
'(ns-appearance . light))
(setq org-directory "~/Documents/org/")
(setq org-journal-dir "~/Documents/org/journal/")
(setq display-line-numbers-type 'relative)
(setq twittering-allow-insecure-server-cert t)
(setq +ivy-buffer-preview t)
(global-auto-revert-mode t) (global-auto-revert-mode t)
(global-subword-mode 1) ; Iterate through CamelCase words
(setq-default
delete-by-moving-to-trash t ; Delete files to trash
window-combination-resize t ; take new window space from all other windows (not just current)
x-stretch-cursor t) ; Stretch cursor to the glyph width
(setq undo-limit 80000000 ; Raise undo-limit to 80Mb
evil-want-fine-undo t ; By default while in insert all changes are one big blob. Be more granular
auto-save-default t ; Nobody likes to loose work, I certainly don't
truncate-string-ellipsis "") ; Unicode ellispis are nicer than "...", and also save /precious/ space
;; Experimental, delete if you don't like it
(setq evil-vsplit-window-right t
evil-split-window-below t)
(require 'bison-mode)
(after! bison-mode-hook
(setq imenu-create-index-function
(lambda ()
(let ((end))
(beginning-of-buffer)
(re-search-forward "^%%")
(forward-line 1)
(setq end (save-excursion (re-search-forward "^%%") (point)))
(loop while (re-search-forward "^\\([a-z].*?\\)\\s-*\n?\\s-*:" end t)
collect (cons (match-string 1) (point)))))))
(defadvice! prompt-for-buffer (&rest _)
:after '(evil-window-split evil-window-vsplit)
(+ivy/switch-buffer))
(use-package! ox-hugo
:after ox
)
(use-package! elfeed-org
:after elfeed
:config
(elfeed-org)
(setq rmh-elfeed-org-files (list "~/.doom.d/elfeed.org"))
)
(use-package! deft
:hook deft-mode-hook
:init
(setq deft-directory org-directory)
(setq deft-recursive t)
)
(use-package! hl-todo
:hook (prog-mode . hl-todo-mode)
:config
(setq hl-todo-keyword-faces
`(
("PROJ" . ,(face-foreground 'error))
("SOMEDAY" . ,(face-foreground 'warning))
("TODO" . ,(face-foreground 'warning))
("PROG" . ,(face-foreground 'error))
("NEXT" . ,(face-foreground 'error))
("WAIT" . ,(face-foreground 'warning))
("CANCEL" . ,(face-foreground 'error))
("DELEGATED" . ,(face-foreground 'error))
("IDEA" . ,(face-foreground 'warning))
("GOAL" . ,(face-foreground 'warning))
("DUD" . ,(face-foreground 'error))
("RD" . ,(face-foreground 'warning))
("RDING" . ,(face-foreground 'warning))
("RDNOTE" . ,(face-foreground 'warning))
("TMPDROP" . ,(face-foreground 'warning))
("DROP" . ,(face-foreground 'error))
("FNSHED" . ,(face-foreground 'success))
("DONE" . ,(face-foreground 'success)))))
(use-package! engrave-faces-latex
:after ox-latex)
(use-package! org-ol-tree
:commands org-ol-tree)
(use-package! org-chef
:commands (org-chef-insert-recipe org-chef-get-recipe-from-url))
(use-package! org-pretty-table
:commands (org-pretty-table-mode global-org-pretty-table-mode))
(use-package! aas :commands aas-mode)
(use-package! laas
:hook (LaTeX-mode . laas-mode)
:config
(defun laas-tex-fold-maybe ()
(unless (equal "/" aas-transient-snippet-key)
(+latex-fold-last-macro-a)))
(add-hook 'aas-post-snippet-expand-hook #'laas-tex-fold-maybe))
(use-package! calfw-org
:after calfw)
(use-package! org-agenda
:defer
:init
(setq org-agenda-files (list
(concat org-directory "projects.org")
(concat org-directory "monthly_habits.org")
(concat org-directory "quarterly_habits.org")
(concat org-directory "personal.org")
(concat org-directory "taxes.org")
(concat org-directory "birthdays_and_important_days.org")
(concat org-directory "reading_list.org")
(concat org-directory "school.org")
(concat org-directory "daily_habits.org")
(concat org-directory "weekly_habits.org")
(concat org-directory "reflections/2021_refl.org")
(concat org-directory "someday.org")
(concat org-directory "projects/2021/")
org-journal-dir))
:config
(setq org-habit-show-habits-only-for-today t)
;; Org Agenda Files
;; org agenda
(setq org-agenda-time-grid
(quote
((daily today remove-match)
(700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300)
"......" "----------------")))
)
(use-package! org-super-agenda
:after org-agenda
:init
;; for some reason org-agenda evil bindings were being weird with j and k
(map! :map org-agenda-keymap "j" #'org-agenda-next-line)
(map! :map org-agenda-mode-map "j" #'org-agenda-next-line)
(map! :map org-super-agenda-header-map "j" #'org-agenda-next-line)
(map! :map org-agenda-keymap "k" #'org-agenda-previous-line)
(map! :map org-agenda-mode-map "k" #'org-agenda-previous-line)
(map! :map org-super-agenda-header-map "k" #'org-agenda-previous-line)
(map! :map org-super-agenda-header-map "k" #'org-agenda-previous-line)
(map! :map org-super-agenda-header-map "k" #'org-agenda-previous-line)
(setq org-agenda-custom-commands '(
("r" "Main View"
((agenda "" ((org-agenda-span 'day)
(org-agenda-start-day "+0d")
(org-agenda-overriding-header "")
(org-super-agenda-groups
'((:name "Today"
:time-grid t
:date today
:order 1
:scheduled today
:todo "TODAY")))))
(alltodo "" ((org-agenda-overriding-header "")
(org-super-agenda-groups
'(
(:discard (:habit))
(:todo "PROJ")
(:todo "PROG")
(:todo "NEXT")
(:todo "WAIT")
(:todo "RD")
(:todo "RDING")
(:todo "RDNOTE")
(:name "Important" :priority "A")
(:todo "TODO")
(:todo "GOAL")
(:discard (:todo "IDEA"))
(:discard (:todo "RD"))
(:discard (:todo "TMPDROP"))
(:discard (:todo "SOMEDAY"))
))))))
("w" "Someday and Idea"
((alltodo "" ((org-agenda-overriding-header "")
(org-super-agenda-groups
'(
(:todo "IDEA")
(:todo "SOMEDAY")
(:discard (:todo "PROJ"))
(:discard (:todo "PROG"))
(:discard (:todo "NEXT"))
(:discard (:todo "WAIT"))
(:discard (:todo "RDNOTE"))
(:discard (:todo "RD"))
(:discard (:todo "RDING"))
(:discard (:todo "TODO"))
(:discard (:todo "GOAL"))
)
)))))))
:config
(org-super-agenda-mode))
;; Org Roam
(use-package! org-roam
:commands (org-roam-insert org-roam-find-file org-roam)
:init
(setq org-roam-directory (concat org-directory "roam"))
(setq org-roam-buffer-width 0.2)
(map! :leader
:prefix "n"
:desc "Org-Roam-Insert" "i" #'org-roam-insert
:desc "Org-Roam-Find" "/" #'org-roam-find-file
:desc "Org-Roam-Buffer" "r" #'org-roam)
)
;; Attempt to remove lag
(setq key-chord-two-keys-delay 0.7)
(add-hook! 'org-mode-hook (company-mode -1))
(add-hook! 'org-capture-mode-hook (company-mode -1))
(after! org (load! "org-conf.el"))
(setq baby-blue '("#d2ecff" "#d2ecff" "brightblue"))
;; Better window management
(map! :map evil-window-map
"SPC" #'rotate-layout
;; Navigation
"<left>" #'evil-window-left
"<down>" #'evil-window-down
"<up>" #'evil-window-up
"<right>" #'evil-window-right
;; Swapping windows
"C-<left>" #'+evil/window-move-left
"C-<down>" #'+evil/window-move-down
"C-<up>" #'+evil/window-move-up
"C-<right>" #'+evil/window-move-right)
(after! company
(setq company-idle-delay 0.2
company-minimum-prefix-length 2))
(after! evil-escape (evil-escape-mode -1))
(after! evil (setq evil-ex-substitute-global t)) ; I like my s/../.. to by global by default
(setq emojify-emoji-set "twemoji-v2")
(setq-default history-length 1000)
(setq-default prescient-history-length 1000)
(set-company-backend!
'(text-mode
markdown-mode
gfm-mode)
'(:seperate
company-ispell
company-files
company-yasnippet))
(setq (setq
doom-theme 'doom-challenger-deep
doom-font (font-spec :family "CaskaydiaCove Nerd Font Mono" :size 16 :weight 'regular)
default-directory "~"
dart-format-on-save t
web-mode-markup-indent-offset 2
web-mode-code-indent-offset 2
web-mode-css-indent-offset 2
mac-command-modifier 'meta
js-indent-level 2
typescript-indent-level 2
json-reformat:indent-width 2
prettier-js-args '("--single-quote")
projectile-project-search-path '("~/Projects/")
dired-dwim-target t
org-ellipsis ""
org-bullets-bullet-list '("·")
org-tags-column -80
org-agenda-files (ignore-errors (directory-files +org-dir t "\\.org$" t))
org-log-done 'time
css-indent-offset 2
org-refile-targets (quote ((nil :maxlevel . 1)))
org-capture-templates '(("x" "Note" entry
(file+olp+datetree "journal.org")
"**** [ ] %U %?" :prepend t :kill-buffer t)
("t" "Task" entry
(file+headline "tasks.org" "Inbox")
"* [ ] %?\n%i" :prepend t :kill-buffer t))
+doom-dashboard-banner-file (expand-file-name "logo.png" doom-private-dir)
+org-capture-todo-file "tasks.org"
org-super-agenda-groups '((:name "Today"
:time-grid t
:scheduled today)
(:name "Due today"
:deadline today)
(:name "Important"
:priority "A")
(:name "Overdue"
:deadline past)
(:name "Due soon"
:deadline future)
(:name "Big Outcomes"
:tag "bo")))
(add-hook! reason-mode
(add-hook 'before-save-hook #'refmt-before-save nil t))
(add-hook!
js2-mode 'prettier-js-mode
(add-hook 'before-save-hook #'refmt-before-save nil t))
default-directory "~"
web-mode-markup-indent-offset 4
ispell-dictionary "en-custom"
web-mode-code-indent-offset 4
web-mode-css-indent-offset 4
js-indent-level 4
json-reformat:indent-width 4
prettier-js-args '("--single-quote")
projectile-project-search-path '("~/Projects/")
dired-dwim-target t
nand-hdl-directory "~/Projects/nand2tetris"
css-indent-offset 2)
(setq auth-sources
'((:source "~/.config/emacs/.authinfo.gpg")))
(defun insert-current-date () (interactive) (defun insert-current-date () (interactive)
(insert (shell-command-to-string "echo -n $(date +%Y-%m-%d)")))
(insert (shell-command-to-string "echo -n $(date +%Y-%m-%d)")))
;; We expect the encoding to be LF UTF-8, so only show the modeline when this is not the case
(defun doom-modeline-conditional-buffer-encoding ()
(setq-local doom-modeline-buffer-encoding
(unless (and (memq (plist-get (coding-system-plist buffer-file-coding-system) :category)
'(coding-category-undecided coding-category-utf-8))
(not (memq (coding-system-eol-type buffer-file-coding-system) '(1 2))))
t)))
(add-hook 'after-change-major-mode-hook #'doom-modeline-conditional-buffer-encoding)
(map! :ne "M-/" #'comment-or-uncomment-region) (map! :ne "M-/" #'comment-or-uncomment-region)
(map! :ne "SPC / r" #'deadgrep) (map! :ne "SPC / r" #'deadgrep)
(map! :ne "SPC n b" #'org-brain-visualize) (map! :ne "SPC n b" #'org-brain-visualize)
(map! :ne "SPC i d" #'insert-current-date) (map! :ne "SPC i d" #'insert-current-date)
;; (def-package! parinfer ; to configure it
;; :bind (("C-," . parinfer-toggle-mode)
;; ("<tab>" . parinfer-smart-tab:dwim-right)
;; ("S-<tab>" . parinfer-smart-tab:dwim-left))
;; :hook ((clojure-mode emacs-lisp-mode common-lisp-mode lisp-mode) . parinfer-mode)
;; :config (setq parinfer-extensions '(defaults pretty-parens evil paredit)))
(after! org
(set-face-attribute 'org-link nil
:weight 'normal
:background nil)
(set-face-attribute 'org-code nil
:foreground "#a9a1e1"
:background nil)
(set-face-attribute 'org-date nil
:foreground "#5B6268"
:background nil)
(set-face-attribute 'org-level-1 nil
:foreground "steelblue2"
:background nil
:height 1.2
:weight 'normal)
(set-face-attribute 'org-level-2 nil
:foreground "slategray2"
:background nil
:height 1.0
:weight 'normal)
(set-face-attribute 'org-level-3 nil
:foreground "SkyBlue2"
:background nil
:height 1.0
:weight 'normal)
(set-face-attribute 'org-level-4 nil
:foreground "DodgerBlue2"
:background nil
:height 1.0
:weight 'normal)
(set-face-attribute 'org-level-5 nil
:weight 'normal)
(set-face-attribute 'org-level-6 nil
:weight 'normal)
(set-face-attribute 'org-document-title nil
:foreground "SlateGray1"
:background nil
:height 1.75
:weight 'bold)
(setq org-fancy-priorities-list '("" "" "" "")))
(after! web-mode
(add-to-list 'auto-mode-alist '("\\.njk\\'" . web-mode)))
(defun +data-hideshow-forward-sexp (arg)
(let ((start (current-indentation)))
(forward-line)
(unless (= start (current-indentation))
(require 'evil-indent-plus)
(let ((range (evil-indent-plus--same-indent-range)))
(goto-char (cadr range))
(end-of-line)))))
(add-to-list 'hs-special-modes-alist '(yaml-mode "\\s-*\\_<\\(?:[^:]+\\)\\_>" "" "#" +data-hideshow-forward-sexp nil))
(setq org-directory "~/Documents/org/")
;; zoom in/out like we do everywhere else.
(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)
(global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease)
(global-set-key (kbd "<C-wheel-up>") 'text-scale-increase)
(setq +magit-hub-features t) (setq +magit-hub-features t)
(setq calc-angle-mode 'rad ; radians are rad
calc-symbolic-mode t) ; keeps expressions like \sqrt{2} irrational for as long as possible
(use-package! calctex
:commands calctex-mode
:init
(add-hook 'calc-mode-hook #'calctex-mode)
:config
(setq calctex-additional-latex-packages "
\\usepackage[usenames]{xcolor}
\\usepackage{soul}
\\usepackage{adjustbox}
\\usepackage{amsmath}
\\usepackage{amssymb}
\\usepackage{siunitx}
\\usepackage{cancel}
\\usepackage{mathtools}
\\usepackage{mathalpha}
\\usepackage{xparse}
\\usepackage{arevmath}"
calctex-additional-latex-macros
(concat calctex-additional-latex-macros
"\n\\let\\evalto\\Rightarrow"))
(defadvice! no-messaging-a (orig-fn &rest args)
:around #'calctex-default-dispatching-render-process
(let ((inhibit-message t) message-log-max)
(apply orig-fn args)))
;; Fix hardcoded dvichop path (whyyyyyyy)
(let ((vendor-folder (concat (file-truename doom-local-dir)
"straight/"
(format "build-%s" emacs-version)
"/calctex/vendor/")))
(setq calctex-dvichop-sty (concat vendor-folder "texd/dvichop")
calctex-dvichop-bin (concat vendor-folder "texd/dvichop")))
(unless (file-exists-p calctex-dvichop-bin)
(message "CalcTeX: Building dvichop binary")
(let ((default-directory (file-name-directory calctex-dvichop-bin)))
(call-process "make" nil nil nil))))
(defun greedily-do-daemon-setup ()
(require 'org)
(when (require 'elfeed nil t)
(run-at-time nil (* 8 60 60) #'elfeed-update)))
;; Open new clients in the dashboard
(when (daemonp)
(add-hook 'emacs-startup-hook #'greedily-do-daemon-setup)
(add-hook! 'server-after-make-frame-hook (switch-to-buffer +doom-dashboard-name)))
(set-popup-rule! "^\\*Org Agenda" :side 'bottom :size 0.90 :select t :ttl nil) (set-popup-rule! "^\\*Org Agenda" :side 'bottom :size 0.90 :select t :ttl nil)
(set-popup-rule! "^CAPTURE.*\\.org$" :side 'bottom :size 0.90 :select t :ttl nil)
(set-popup-rule! "^\\*org-brain" :side 'right :size 1.00 :select t :ttl nil) (set-popup-rule! "^\\*org-brain" :side 'right :size 1.00 :select t :ttl nil)
(defun my-open-calendar ()
(sp-local-pair
'(org-mode)
"<<" ">>"
:actions '(insert))
(setq +zen-text-scale 0.8)
(use-package! lexic
:commands lexic-search lexic-list-dictionary
:config
(map! :map lexic-mode-map
:n "q" #'lexic-return-from-lexic
:nv "RET" #'lexic-search-word-at-point
:n "a" #'outline-show-all
:n "h" (cmd! (outline-hide-sublevels 3))
:n "o" #'lexic-toggle-entry
:n "n" #'lexic-next-entry
:n "N" (cmd! (lexic-next-entry t))
:n "p" #'lexic-previous-entry
:n "P" (cmd! (lexic-previous-entry t))
:n "E" (cmd! (lexic-return-from-lexic) ; expand
(switch-to-buffer (lexic-get-buffer)))
:n "M" (cmd! (lexic-return-from-lexic) ; minimise
(lexic-goto-lexic))
:n "C-p" #'lexic-search-history-backwards
:n "C-n" #'lexic-search-history-forwards
:n "/" (cmd! (call-interactively #'lexic-search))))
(defadvice! +lookup/dictionary-definition-lexic (identifier &optional arg)
:override #'+lookup/dictionary-definition
(interactive
(list (or (doom-thing-at-point-or-region 'word)
(read-string "Look up in dictionary: "))
current-prefix-arg))
(lexic-search identifier nil nil t))
;; Hooks
(add-hook 'nand-hdl-mode-hook 'yas-minor-mode)
(defun after-org-mode-load ()
(interactive) (interactive)
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-source "Green") ; org-agenda source
)))
(setq olivetti-body-width 0.8)
(olivetti-mode)
)
(add-hook! 'org-mode-hook 'after-org-mode-load)
;; Auto-Insert
(autoload 'yas-expand-snippet "yasnippet")
(defun my-autoinsert-yas-expand()
"Replace text in yasnippet template."
(yas-expand-snippet (buffer-string) (point-min) (point-max)))
(setq-default auto-insert-directory "~/.config/doom/templates")
(auto-insert-mode 1) ;;; Adds hook to find-files-hook
(setq-default auto-insert-query nil) ;;; If you don't want to be prompted before insertion
(define-auto-insert "\\.el$" ["template.el" my-autoinsert-yas-expand])
(define-auto-insert "\\.c$" ["template.c" my-autoinsert-yas-expand])
(define-auto-insert "\\.cpp$" ["template.cpp" my-autoinsert-yas-expand])
(define-auto-insert "\\.h$" ["template.h" my-autoinsert-yas-expand])
(define-auto-insert "\\.cc$" ["template.cpp" my-autoinsert-yas-expand])
(define-auto-insert "\\.tex$" ["template.tex" my-autoinsert-yas-expand])
(define-auto-insert "\\.org$" ["template.org" my-autoinsert-yas-expand])
(define-auto-insert "\\.py$" ["template.py" my-autoinsert-yas-expand])
(define-auto-insert "\\.java$" ["template.java" my-autoinsert-yas-expand])
(define-auto-insert "\\.sh$" ["template.sh" my-autoinsert-yas-expand])
(define-auto-insert "\\.html$" ["template.html" my-autoinsert-yas-expand])
(setq yas-snippet-dirs
'("~/.config/doom/snippets"))
;; Appearance
(delq! t custom-theme-load-path) ;; Don't prompt on startup
(setq doom-theme 'doom-material-ocean)
(setq
doom-big-font (font-spec :family "CasaydiaCove Nerd Font" :size 22)
doom-font (font-spec :family "CaskaydiaCove Nerd Font" :size 16)
doom-variable-pitch-font (font-spec :family "Overpass" :size 16)
doom-unicode-font (font-spec :family "JuliaMono")
doom-serif-font (font-spec :family "IBM Plex Mono" :weight 'light))
(setq +doom-dashboard-banner-file (expand-file-name "logo.png" doom-private-dir))

+ 46
- 0
.config/doom/custom.el View File

@ -0,0 +1,46 @@
(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.
'(ansi-color-names-vector
["#1E1C31" "#FF8080" "#95FFA4" "#FFE9AA" "#91DDFF" "#C991E1" "#AAFFE4" "#CBE3E7"])
'(custom-safe-themes
'("01d5e0971bfe4b70669ba03f632c68ac7e5b9e0bc5eaf760a780d88ca271dae2" default))
'(fci-rule-color "#858FA5")
'(jdee-db-active-breakpoint-face-colors (cons "#100E23" "#906CFF"))
'(jdee-db-requested-breakpoint-face-colors (cons "#100E23" "#95FFA4"))
'(jdee-db-spec-breakpoint-face-colors (cons "#100E23" "#565575"))
'(objed-cursor-color "#FF8080")
'(pdf-view-midnight-colors (cons "#CBE3E7" "#1E1C31"))
'(rustic-ansi-faces
["#1E1C31" "#FF8080" "#95FFA4" "#FFE9AA" "#91DDFF" "#C991E1" "#AAFFE4" "#CBE3E7"])
'(vc-annotate-background "#1E1C31")
'(vc-annotate-color-map
(list
(cons 20 "#95FFA4")
(cons 40 "#b8f7a6")
(cons 60 "#dbf0a8")
(cons 80 "#FFE9AA")
(cons 100 "#ffd799")
(cons 120 "#ffc488")
(cons 140 "#FFB378")
(cons 160 "#eda79b")
(cons 180 "#db9cbd")
(cons 200 "#C991E1")
(cons 220 "#db8bc0")
(cons 240 "#ed85a0")
(cons 260 "#FF8080")
(cons 280 "#d4757d")
(cons 300 "#aa6a7a")
(cons 320 "#805f77")
(cons 340 "#858FA5")
(cons 360 "#858FA5")))
'(vc-annotate-very-old-color nil))
(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.
)
(put 'projectile-ripgrep 'disabled nil)

+ 48
- 29
.config/doom/init.el View File

@ -3,43 +3,46 @@
(doom! :feature (doom! :feature
;debugger ; FIXME stepping through code, to help you add bugs
:completion :completion
(company ; the ultimate code completion backend (company ; the ultimate code completion backend
+tng
+auto ; as-you-type code completion +auto ; as-you-type code completion
+childframe) ; a nicer company UI. Emacs +26 only! +childframe) ; a nicer company UI. Emacs +26 only!
(ivy (ivy
+fuzzy); a search engine for love and life
+icons
+childframe
+prescient
+fuzzy) ; a search engine for love and life
:ui :ui
deft deft
workspaces ; tab emulation, persistence & separate workspaces workspaces ; tab emulation, persistence & separate workspaces
doom ; what makes DOOM look the way it does doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs doom-dashboard ; a nifty splash screen for Emacs
modeline ; a snazzy Atom-inspired mode-line
modeline ; a snazzy Atom-inspired mode-line
ophints ; highlight the region an operation acts on
doom-quit ; DOOM quit-message prompts when you quit Emacs doom-quit ; DOOM quit-message prompts when you quit Emacs
ophints ; display visual hints when editing in evil ophints ; display visual hints when editing in evil
hl-todo ; highlight TODO/FIXME/NOTE tags hl-todo ; highlight TODO/FIXME/NOTE tags
nav-flash ; blink the current line after jumping nav-flash ; blink the current line after jumping
treemacs ; a project drawer, like neotree but cooler treemacs ; a project drawer, like neotree but cooler
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond eob
(popup ; tame sudden yet inevitable temporary windows (popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix +all ; catch all popups that start with an asterix
+defaults) ; default popup rules +defaults) ; default popup rules
vc-gutter ; vcs diff in the fringe
vi-tilde-fringe ; fringe tildes to mark beyond EOB
window-select ; visually switch windows
;;(ligatures +extra) ; ligatures and symbols to make your code pretty again
(window-select +numbers) ; visually switch windows
zen ; distraction-free coding or writing
:emacs :emacs
(dired
+icons); making dired pretty [functional]
(dired +icons); making dired pretty [functional]
electric ; smarter, keyword-based electric-indent electric ; smarter, keyword-based electric-indent
(ibuffer +icons) ; interactive buffer management
(undo +tree) ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree vc ; version-control and Emacs, sitting in a tree
:term :term
eshell ; a consistent, cross-platform shell (WIP)
vterm
vterm ; the best terminal emulation in Emacs
:editor :editor
@ -50,20 +53,25 @@
snippets ; my elves. They type so I don't have to snippets ; my elves. They type so I don't have to
;;parinfer ; turn lisp into python, sort of ;;parinfer ; turn lisp into python, sort of
rotate-text ; cycle region at point between text candidates rotate-text ; cycle region at point between text candidates
(format) ; automated prettiness
rotate-text ; cycle region at point between text candidates
:tools :tools
taskrunner ; taskrunner for gradle, make etc
eval ; run code, run (also, repls) eval ; run code, run (also, repls)
gist ; interacting with github gists gist ; interacting with github gists
(lookup ; helps you navigate your code and documentation
+devdocs ; ...on devdocs.io online
+docsets) ; ...or in Dash docsets locally
;macos ; MacOS-specific commands
make ; run make tasks from Emacs make ; run make tasks from Emacs
magit ;
(magit +forge) ; a git porcelain for Emacs
pass ; password manager for nerds pass ; password manager for nerds
;pdf ; pdf enhancements
;rgb ; creating color strings
tmux ; an API for interacting with tmux
pdf ; pdf enhancements
rgb ; creating color strings
debugger ; FIXME stepping through code, to help you add bugs
lsp ; Language Server Protocol
direnv ; be direct about your environment
docker ; port everything to containers
editorconfig ; let someone else argue about tabs vs spaces
ein ; tame Jupyter notebooks with emacs
;;tmux ; an API for interacting with tmux
upload ; map local to remote projects via ssh/ftp upload ; map local to remote projects via ssh/ftp
flycheck flycheck
flyspell flyspell
@ -80,14 +88,18 @@
;; elixir ; erlang done right ;; elixir ; erlang done right
;; elm ; care for a cup of TEA? ;; elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses emacs-lisp ; drown in parentheses
;;ess ; emacs speaks statistics
ess ; emacs speaks statistics
go ; the hipster dialect go ; the hipster dialect
;; (haskell +intero) ; a language that's lazier than I am ;; (haskell +intero) ; a language that's lazier than I am
;; hy ; readability of scheme w/ speed of python ;; hy ; readability of scheme w/ speed of python
(java +meghanada) ; the poster child for carpal tunnel syndrome
javascript ; all(hope(abandon(ye(who(enter(here))))))
(java +lsp) ; the poster child for carpal tunnel syndrome
(javascript +lsp) ; all(hope(abandon(ye(who(enter(here))))))
(julia +lsp) ; a better, faster MATLAB
;; julia ; a better, faster MATLAB ;; julia ; a better, faster MATLAB
latex ; writing papers in Emacs has never been so fun
(latex ; writing papers in Emacs has never been so fun
+latexmk ; what else would you use?
+cdlatex ; quick maths symbols
+fold) ; fold the clutter away nicities
;; ledger ; an accounting system in Emacs ;; ledger ; an accounting system in Emacs
;; lua ; one-based indices? one-based indices ;; lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore markdown ; writing docs for people to ignore
@ -95,8 +107,13 @@
;; ocaml ; an objective camel ;; ocaml ; an objective camel
(org ; organize your plain life in plain text (org ; organize your plain life in plain text
+attach ; custom attachment system +attach ; custom attachment system
+journal
+babel ; running code in org +babel ; running code in org
+hugo
+hugo ; Write hugo posts in org-mode
+gnuplot ; Who doesn't love plots
+roam ; roam around your notes
+pandoc ; export-with-pandoc support
+pretty ; yessss my pretties! (nice unicode symbols)
+capture ; org-capture in and outside of Emacs +capture ; org-capture in and outside of Emacs
+export ; Exporting org to whatever you want +export ; Exporting org to whatever you want
+present) ; Emacs for presentations +present) ; Emacs for presentations
@ -119,18 +136,20 @@
;; toward a specific purpose. They may have additional dependencies and ;; toward a specific purpose. They may have additional dependencies and
;; should be loaded late. ;; should be loaded late.
:app :app
(:if (executable-find "mu") (mu4e +org +gmail))
;;(:if (executable-find "mu") (mu4e +org +gmail))
;;notmuch ;;notmuch
;;(wanderlust +gmail) ;;(wanderlust +gmail)
calendar ; A dated approach to timetabling calendar ; A dated approach to timetabling
;;emms ; Multimedia in Emacs is music to my ears ;;emms ; Multimedia in Emacs is music to my ears
everywhere ; *leave* Emacs!? You must be joking. everywhere ; *leave* Emacs!? You must be joking.
irc ; how neckbeards socialize
;;irc ; how neckbeards socialize
(rss +org) ; emacs as an RSS reader (rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
twitter ; twitter client https://twitter.com/vnought
:config :config
;; The default module set reasonable defaults for Emacs. It also provides ;; The default module set reasonable defaults for Emacs. It also provides
;; a Spacemacs-inspired keybinding scheme, a custom yasnippet library, ;; a Spacemacs-inspired keybinding scheme, a custom yasnippet library,
;; and additional ex commands for evil-mode. Use it as a reference for ;; and additional ex commands for evil-mode. Use it as a reference for
;; your own modules. ;; your own modules.
(default +bindings +snippets +evil-commands))
(default +bindings +snippets +evil-commands +smartparens))
(add-load-path! "lisp/")

+ 913
- 0
.config/doom/lisp/bison-mode.el View File

@ -0,0 +1,913 @@
;;; bison-mode.el --- Major mode for editing bison, yacc and lex files.
;; Copyright (C) 1998 Eric Beuscher
;;
;; Author: Eric Beuscher <beuscher@eecs.tulane.edu>
;; Created: 2 Feb 1998
;; Version: 0.2
;; Keywords: bison-mode, yacc-mode
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;; Commentary:
;;;; I wrote this since I saw one mode for yacc files out there roaming the
;;;; world. I was daunted by the fact the it was written in 1990, and Emacs
;;;; has evolved so much since then (this I assume based on its evolution since
;;;; i started using it). So I figured if i wanted one, I should make it
;;;; myself. Please excuse idiosyncrasies, as this was my first major mode
;;;; of this kind. The indentation code may be a bit weird, I am not sure,
;;;; it was my first go at doing Emacs indentation, so I look at how other
;;;; modes did it, but then basically did what I thought was right
;;;; I hope this is useful to other hackers, and happy Bison/Yacc hacking
;;;; If you have ideas/suggestions/problems with this code, I can be reached at
;;;; beuscher@eecs.tulane.edu
;;;; Eric --- Sat Mar 7 1:40:20 CDT 1998
;;;; Bison Sections:
;;;; there are five sections to a bison file (if you include the area above the
;;;; C declarations section. most everything in this file either does
;;;; actions based on which section you are deemed to be in, or based on an
;;;; assumption that the function will only be called from certain sections.
;;;; the function `bison--section-p' is the section parser
;;;; Indentation:
;;;; indentations are done based on the section of code you are in. there is
;;;; a procedure `bison--within-braced-c-expression-p' that checks for being in
;;;; C code. if you are within c-code, indentations should occur based on
;;;; how you have your C indentation set up. i am pretty sure this is the
;;;; case.
;;;; there are four variables, which control bison indentation within either
;;;; the bison declarations section or the bison grammar section
;;;; `bison-rule-separator-column'
;;;; `bison-rule-separator-column'
;;;; `bison-decl-type-column'
;;;; `bison-decl-token-column'
;;;; flaw: indentation works on a per-line basis, unless within braced C sexp,
;;;; i should fix this someday
;;;; and to make matters worse, i never took out c-indent-region, so that is
;;;; still the state of the `indent-region-function' variable
;;;; Electricity:
;;;; by default, there are electric -colon, -pipe, -open-brace, -close-brace,
;;;; -semicolon, -percent, -less-than, -greater-than
;;;; the indentation caused by these work closely with the 4 indentation
;;;; variables mentioned above.
;;;; any of these can be turned off individually by setting the appropriate
;;;; `bison-electric-...' variable. or all of them can be turned off by
;;;; setting `bison-all-electricity-off'
;;;; todo: should make available a way to use C-electricity if in C sexps
;;; Code:
(require 'cc-mode)
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.y\\'" . bison-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.l\\'" . flex-mode))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.jison\\'" . jison-mode))
;; *************** internal vars ***************
(defvar bison--declarers '("%union" "%token" "%type"
"%left" "%right" "%nonassoc")
"commands which can declare a token or state type")
(defvar bison--word-constituent-re "\\(\\sw\\|_\\)")
(defvar bison--production-re
(concat "^" bison--word-constituent-re "+:"))
(defvar bison--pre-c-decls-section 0
"section before c-declarations-section, if that section exists")
(defvar bison--c-decls-section 1
"section denoted by %{ and $} for c-declarations at the top of a bison file")
(defvar bison--bison-decls-section 2
"section before the rules section")
(defvar bison--grammar-rules-section 3
"section delimited by %%'s where productions and rules are enumerated")
(defvar bison--c-code-section 4
"section after the second %% where c-code can be placed")
(defvar bison--c-decls-section-opener "%{")
(defvar bison--c-decls-section-closer "%}")
(defvar bison--grammar-rules-section-delimeter "%%")
;; *************** user-definable vars ***************
(defvar bison-rule-separator-column 8
"column for rule and production separators \"|\" and \";\"")
(defvar bison-rule-enumeration-column 16
"column for beginning enumeration of a production's rules")
(defvar bison-decl-type-column 8
"columnn in which tokens' and states' types should be when declared")
(defvar bison-decl-token-column 24
"column in which tokens and states are listed when declared,
as with %token, %type, ...")
(defvar bison-all-electricity-off nil
"non-nil means all electric keys will be disabled,
nil means that a bison-electric-* key will be on or off based on the individual
key's electric variable")
;;; i know lisp has the dual name spaces, but i find it more aesthetically
;;; pleasing to not take advantage of that
(defvar bison-electric-colon-v t
"non-nil means use an electric colon")
(defvar bison-electric-pipe-v t
"non-nil means use an electric pipe")
(defvar bison-electric-open-brace-v t
"non-nil means use an electric open-brace")
(defvar bison-electric-close-brace-v t
"non-nil means use an electric close-brace")
(defvar bison-electric-semicolon-v t
"non-nil means use an electric semicolon")
(defvar bison-electric-percent-v t
"non-nil means use an electric percent")
(defvar bison-electric-less-than-v t
"non-nil means use an electric less-than")
(defvar bison-electric-greater-than-v t
"non-nil means use an electric greater-than")
(defconst bison-font-lock-keywords
(append
(list
(cons (concat "^\\(" (regexp-opt bison--declarers) "\\)")
'(1 font-lock-keyword-face))
)
c-font-lock-keywords)
"Default expressions to highlight in Bison mode")
;; *************** utilities ***************
(defun just-no-space ()
"Delete all spaces and tabs around point, leaving no spaces."
(interactive "*")
(skip-chars-backward " \t")
(delete-region (point) (progn (skip-chars-forward " \t") (point)))
t)
(defun previous-white-space-p ()
"return t if there is whitespace between the beginning of the line and the
current (point)"
(save-excursion
(let ((current-point (point)))
(beginning-of-line)
(if (re-search-forward "\\s " current-point t)
t
nil))))
(defun previous-non-ws-p ()
"return t if there are non-whitespace characters between beginning of line
and \(point\)"
(save-excursion
(let ((current-point (point)))
(beginning-of-line)
(re-search-forward "[^ \t]" current-point t)
)))
(defun following-non-ws-p ()
"return t if there are non-whitespace characters on the line"
(save-excursion
(let ((current-point (point)))
(end-of-line)
(re-search-backward "[^ \t]+" current-point t)
)))
(defun line-of-whitespace-p ()
"return t if the line consists of nothiing but whitespace, nil otherwise"
(save-excursion
(let ((eol (progn (end-of-line) (point))))
(beginning-of-line) ;; should already be there anyway
(not (re-search-forward "[^ \t\n]" eol t)))))
;; *************** bison-mode ***************
;;;###autoload
(define-derived-mode bison-mode c-mode "Bison"
"Major mode for editing bison/yacc files."
;; try to set the indentation correctly
(setq c-basic-offset 4)
(c-set-offset 'knr-argdecl-intro 0)
;; remove auto and hungry anything
(c-toggle-auto-hungry-state -1)
(c-toggle-auto-newline -1)
(c-toggle-hungry-state -1)
(use-local-map bison-mode-map)
(define-key bison-mode-map ":" 'bison-electric-colon)
(define-key bison-mode-map "|" 'bison-electric-pipe)
(define-key bison-mode-map "{" 'bison-electric-open-brace)
(define-key bison-mode-map "}" 'bison-electric-close-brace)
(define-key bison-mode-map ";" 'bison-electric-semicolon)
(define-key bison-mode-map "%" 'bison-electric-percent)
(define-key bison-mode-map "<" 'bison-electric-less-than)
(define-key bison-mode-map ">" 'bison-electric-greater-than)
(define-key bison-mode-map [tab] 'bison-indent-line)
(make-local-variable 'indent-line-function)
(setq indent-line-function 'bison-indent-new-line)
(make-local-variable 'comment-start)
(make-local-variable 'comment-end)
(setq comment-start "/*"
comment-end "*/")
(make-local-variable 'font-lock-keywords)
(setq font-lock-keywords nil)
(set (make-local-variable 'font-lock-defaults) '(bison-font-lock-keywords)))
;; *************** section parsers ***************
(defun bison--section-p ()
"Return the section that user is currently in"
(save-excursion
(let ((bound (point)))
(goto-char (point-min))
(bison--section-p-helper bound))))
(defun bison--section-p-helper (bound)
(if (re-search-forward
(concat "^" bison--c-decls-section-opener)
bound t)
(if (re-search-forward
(concat "^" bison--c-decls-section-closer)
bound t)
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
bound t)
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
bound t)
bison--c-code-section
bison--grammar-rules-section)
bison--bison-decls-section)
bison--c-decls-section)
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
bound t)
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
bound t)
bison--c-code-section
bison--grammar-rules-section)
(if (re-search-forward
(concat "^" bison--c-decls-section-opener)
nil t)
bison--pre-c-decls-section
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
nil t)
bison--bison-decls-section
bison--pre-c-decls-section)))))
;; *************** syntax parsers ***************
(defun bison--production-p ()
"return t if the \(point\) rests immediately after a production"
(save-excursion
(let ((current-point (point)))
(beginning-of-line)
(let ((position (re-search-forward
bison--production-re current-point t)))
(and position
(not (previous-white-space-p))
(= position current-point))))))
(defun bison--find-production-opener ()
"return and goto the point of the nearest production opener above \(point\)"
(re-search-backward bison--production-re nil t))
(defun bison--find-next-production ()
"return the position of the beginning of the next production,
or nil if there isnt one"
(save-excursion
(if (re-search-forward bison--production-re nil t)
(progn
(beginning-of-line)
(point))
nil)))
(defun bison--find-grammar-end ()
"return the position of the end of the grammar rules (assuming we are within
the grammar rules section), or nil if there isnt one"
(save-excursion
(if (re-search-forward
(concat "^" bison--grammar-rules-section-delimeter)
nil t)
(progn
(beginning-of-line)
(point))
nil)))
(defun bison--find-grammar-begin ()
"return the position of the beginning of the grammar rules (assuming we are
within the grammar rules section), or nil if there isnt one"
(save-excursion
(if (re-search-backward
(concat "^" bison--grammar-rules-section-delimeter)
nil t)
(point)
nil)))
(defun bison--within-started-production-p ()
"is used by bison-electric-* functions to determine actions
return t if within a production, nil if not
a point is within a production if there is some non whitespace text before
either the beginnings of another production or the end of the grammar rules"
(save-excursion
(let ((bound (cond ((bison--find-next-production))
((bison--find-grammar-end))
(t nil))))
(if bound
(let ((sval (re-search-forward
(concat "\\(\\s \\|" ;; whitespace or
;; comments
(regexp-quote comment-start)
"\\(.\\|\n\\)*" ;; comment body
(regexp-quote comment-end)
"\\)+") ;; end or
bound t)))
(if sval
(not (= sval bound))
nil))
nil))))
(defun bison--within-some-sexp-p (starter ender)
"return t if the \(point\) is within the sexp marked by the re's STARTER and
ENDER"
(save-excursion
(let ((current-point (point)))
(if (re-search-backward starter nil t) ;; find nearest starter
;; look for ender, if found, then not within sexp
(progn
(goto-char (match-end 0))
(not (re-search-forward ender current-point t)))))))
(defun bison--within-c-comment-p ()
"return t if the point is within a c comment delimited by \"/*\" \"*/\""
(bison--within-some-sexp-p (regexp-quote comment-start)
(regexp-quote comment-end)))
(defun bison--within-string-p (&optional point)
"
start from the beginning of the buffer and toggle state as un-escaped \"'s are
found."
(let ((point (or point (point)))
(in-p nil))
(save-excursion
(goto-char (point-min))
(while (re-search-forward "[^\\]\"" point t)
(setq in-p (not in-p)))
in-p)))
;;; bison--within-braced-c-expression-p
;;; new and improved, no more recursion, does not break when literal strings
;;; contain un-matched braces
(defun bison--within-braced-c-expression-p (section)
"return t if the point is within an sexp delimited by braces \({,}\)
"
(save-excursion
(bison--within-braced-c-expression-p-h section (point))))
(defun bison--within-braced-c-expression-p-h (section low-pt)
"
Notes:
save excursion is done higher up, so i dont concern myself here.
"
(cond ((= section bison--pre-c-decls-section) nil)
((= section bison--c-decls-section)
(let ((opener (save-excursion (search-backward "%{"))))
(bison--within-braced-c-expression-p-h-h opener low-pt)))
((= section bison--bison-decls-section)
(let ((opener (save-excursion
(or (search-backward "%}" nil t)
(point-min)))))
(bison--within-braced-c-expression-p-h-h opener low-pt)))
((= section bison--grammar-rules-section)
(let ((opener (save-excursion (bison--find-production-opener))))
(if opener
(bison--within-braced-c-expression-p-h-h opener low-pt)
nil)))
((= section bison--c-code-section)
t)))
(defun bison--within-braced-c-expression-p-h-h (high-pt low-pt)
"
Notes:
HIGH-PT goes toward (point-min), LOW-PT goes toward (point-max)
save excursion is done higher up, so i dont concern myself here.
"
(let ((pt (point)))
(let ((success nil) (count 1) (done nil))
;; loop until open brace found, that is not in comment or string literal
(while (and (not done)
(re-search-backward "[^%]{" high-pt t count)) ;find nearest
;starter
(goto-char (match-end 0))
(if (or (bison--within-c-comment-p)
(bison--within-string-p))
(setq count (+ count 1))
(progn
(setq success t)
(setq done t))))
(if success
(let ((end-pt
(condition-case nil
(progn
(backward-char)
(forward-sexp)
(point))
(error nil))))
(if end-pt
(if (> end-pt low-pt)
t ; then in braced-c-exp
nil)
t)) ; if no sexp close brace, then w/in
nil))))
(defun bison--bison-decl-opener-p (bol eol)
"return t if the current line is a bison declaration starter
\(i.e. has a %type, %token, %right, ...\)"
(save-excursion
(goto-char bol)
(re-search-forward
(concat "^" (regexp-opt (copy-sequence bison--declarers))) eol t)))
(defun bison--production-opener-p (bol eol)
"return t if the current line is a line that introduces a new production"
(save-excursion
(goto-char bol)
(re-search-forward bison--production-re eol t)))
(defun bison--find-bison-semicolon ()
"return the position of next semicolon not within braces, nil otherwise"
(save-excursion
(if (search-forward ";" nil t)
(if (not (bison--within-braced-c-expression-p (bison--section-p)))
(point)
(bison--find-bison-semicolon))
nil)))
(defun bison--within-production-body-p (section)
"return t if the \(point\) is within the body of a production
this procedure will fail if it is in a production header"
(save-excursion
(if (= section bison--grammar-rules-section)
(let ((current-point (point)))
(if (re-search-backward bison--production-re nil t)
t
nil))
nil)))
(defun bison--production-alternative-p (bol eol section)
"return t if the current line contains a \"|\" used to designate a rule
alternative"
(save-excursion
(goto-char bol)
(if (search-forward "|" eol t)
(not (bison--within-braced-c-expression-p section))
nil)))
;; *************** indent functions ***************
(defun bison--handle-indent-c-sexp (section indent-column bol)
(let* ((o-brace (re-search-backward "[^%]{" bol t))
)
(if o-brace
(if (save-excursion
(goto-char o-brace)
(bison--within-braced-c-expression-p section))
(c-indent-line)
(if (= (current-indentation) o-brace) ;; if o-brace is first char
(if (not (= o-brace indent-column)) ;; but not in right spot
(progn
(back-to-indentation)
(just-no-space)
(indent-to-column indent-column))
;; else all is good
)
;; else, non-ws before o-brace, leave it alone
))
(c-indent-line))))
(defun bison-indent-new-line (&optional c-sexp)
"Indent a fresh line of bison code
assumes indenting a new line, i.e. at column 0
"
(interactive)
(let* ((section (bison--section-p))
(c-sexp (or c-sexp (bison--within-braced-c-expression-p section)))
)
(cond
(c-sexp
(cond
((= section bison--grammar-rules-section)
(c-indent-line
(save-excursion
(forward-line -1)
(let ((bol (save-excursion (beginning-of-line) (point)))
(eol (save-excursion (end-of-line) (point))))
(if (bison--production-opener-p bol eol)
(list
(cons 'defun-block-intro
(progn
(re-search-forward bison--production-re) ; SIGERR
(- (re-search-forward "[^ \t]") ; SIGERR
1))))
nil)))))
(t (c-indent-line))))
((= section bison--pre-c-decls-section)
(c-indent-line))
((= section bison--bison-decls-section)
(indent-to-column bison-decl-token-column))
((= section bison--grammar-rules-section)
(indent-to-column
(save-excursion
(let* ((bound (or (save-excursion (bison--find-production-opener))
(bison--find-grammar-begin)))
(prev-semi (search-backward ";" bound t))
)
(if prev-semi
(if (bison--within-braced-c-expression-p section) ; CRACK
bison-rule-enumeration-column
0)
(if (save-excursion (bison--find-production-opener))
bison-rule-enumeration-column
0))))))
((= section bison--c-code-section)) ;;leave-alone
)))
(defun bison-indent-line ()
"Indent a line of bison code."
(interactive)
(let* ((pos (- (point-max) (point)))
(reset-pt (function (lambda ()
(if (> (- (point-max) pos) (point))
(goto-char (- (point-max) pos))))))
(bol (save-excursion (beginning-of-line) (point)))
(eol (save-excursion (end-of-line) (point)))
)
(let* ((section (bison--section-p))
(c-sexp (bison--within-braced-c-expression-p section))
(ws-line (line-of-whitespace-p))
)
(cond
;; if you are a line of whitespace, let indent-new-line take care of it
(ws-line
(bison-indent-new-line c-sexp))
((= section bison--pre-c-decls-section)
;; leave things alone
)
((= section bison--c-decls-section)
(if c-sexp
(bison--handle-indent-c-sexp section 0 bol)
(if (not (= (current-indentation) 0))
(progn
(back-to-indentation)
(just-no-space)
(funcall reset-pt)))))
((= section bison--bison-decls-section)
(let ((opener (bison--bison-decl-opener-p bol eol)))
(cond
(opener
(goto-char opener)
(skip-chars-forward " \t" eol)
(if (looking-at "{")
(save-excursion
(if (following-non-ws-p)
(progn
(forward-char 1)
(just-no-space)
(newline)
(bison-indent-new-line t))))
(let ((complete-type t))
(if (looking-at "<")
(progn
(setq complete-type nil)
(if (not (= (current-column) bison-decl-type-column))
(progn
(just-no-space)
(indent-to-column bison-decl-type-column))
(and (re-search-forward
(concat "<" bison--word-constituent-re "+>")
eol t)
(setq complete-type t)))))
(and complete-type
(skip-chars-forward " \t" eol)
(looking-at
(concat "\\(" bison--word-constituent-re "\\|'\\)"))
(if (not (= (current-column) bison-decl-token-column))
(progn
(just-no-space)
(indent-to-column bison-decl-token-column))))))
(funcall reset-pt))
(c-sexp
(bison--handle-indent-c-sexp section 0 bol))
(t
(back-to-indentation)
;; only tab in names, leave comments alone
(cond (;; put word-constiuents in bison-decl-token-column
(looking-at bison--word-constituent-re)
(if (not (= (current-column) bison-decl-token-column))
(progn
(just-no-space)
(indent-to-column bison-decl-token-column))))
;; put/keep close-brace in the 0 column
((looking-at "}")
(if (not (= (current-column) 0))
(just-no-space)))
;; leave comments alone
((looking-at (regexp-quote comment-start)) nil)
;; else do nothing
)
(funcall reset-pt)))))
((= section bison--grammar-rules-section)
(cond
((bison--production-opener-p bol eol)
(beginning-of-line)
(re-search-forward bison--production-re);; SIGERR
(if (following-non-ws-p)
(if (> (current-column) bison-rule-enumeration-column)
(progn
(just-no-space)
(newline)
(indent-to-column bison-rule-enumeration-column))
(save-excursion
(re-search-forward bison--word-constituent-re);; SIGERR
(let ((col (current-column)))
(cond ((> col (+ 1 bison-rule-enumeration-column))
(forward-char -1)
(just-no-space)
(indent-to-column bison-rule-enumeration-column))
((< col (+ 1 bison-rule-enumeration-column))
(forward-char -1)
(indent-to-column
bison-rule-enumeration-column)))))))
(funcall reset-pt))
((bison--production-alternative-p bol eol section)
(back-to-indentation);; should put point on "|"
(if (not (= (current-column) bison-rule-separator-column))
(progn
(just-no-space)
(indent-to-column bison-rule-separator-column)))
(forward-char 1)
(if (following-non-ws-p)
(save-excursion
(re-search-forward bison--word-constituent-re);; SIGERR
(let ((col (current-column)))
(cond ((> col (+ 1 bison-rule-enumeration-column))
(forward-char -1)
(just-no-space)
(indent-to-column bison-rule-enumeration-column))
((< col (+ 1 bison-rule-enumeration-column))
(forward-char -1)
(indent-to-column
bison-rule-enumeration-column))))))
(funcall reset-pt))
(c-sexp
(bison--handle-indent-c-sexp
section bison-rule-enumeration-column bol)
(funcall reset-pt))
((bison--within-production-body-p section)
(back-to-indentation)
(if (not (= (current-column) bison-rule-enumeration-column))
(progn
(just-no-space)
(indent-to-column
bison-rule-enumeration-column)))
(funcall reset-pt))
(t
(let ((cur-ind (current-indentation)))
(if (eq (save-excursion (search-backward "}" bol t))
cur-ind)
(if (not (= cur-ind bison-rule-enumeration-column))
(progn
(back-to-indentation)
(just-no-space)
(indent-to-column bison-rule-enumeration-column)
(funcall reset-pt)))
;; else leave alone
)))))
((= section bison--c-code-section)
(c-indent-line))
))))
;; *************** electric-functions ***************
(defun bison-electric-colon (arg)
"If the colon <:> delineates a production,
then insert a semicolon on the next line in the BISON-RULE-SEPARATOR-COLUMN,
put the cursor in the BISON-RULE-ENUMERATION-COLUMN for the beginning
of the rule
else just run self-insert-command
A colon delineates a production by the fact that it is immediately preceded by
a word(alphanumerics or '_''s), and there is no previous white space.
"
(interactive "P")
(self-insert-command (prefix-numeric-value arg))
(if (and bison-electric-colon-v
(not bison-all-electricity-off))
(if (and (= bison--grammar-rules-section (bison--section-p))
(bison--production-p)
(not (bison--within-started-production-p)))
(progn
(save-excursion ; put in a closing semicolon
(newline)
(indent-to-column bison-rule-separator-column)
(insert ";"))
(save-excursion ; remove opening whitespace
(if (re-search-backward
"\\s "
(save-excursion (beginning-of-line) (point))
t)
(just-no-space)))
(if (not (< (current-column) bison-rule-enumeration-column))
(newline))
(indent-to-column bison-rule-enumeration-column)))))
(defun bison-electric-pipe (arg)
"If the pipe <|> is used as a rule separator within a production,
then move it into BISON-RULE-SEPARATOR-COLUMN
indent to BISON-RULE-ENUMERATION-COLUMN on the same line
else just run self-insert-command
"
(interactive "P")
(if (and bison-electric-pipe-v
(not bison-all-electricity-off)
(= bison--grammar-rules-section (bison--section-p))
(line-of-whitespace-p)
)
(progn
(beginning-of-line)
(just-no-space)
(indent-to-column bison-rule-separator-column)
(self-insert-command (prefix-numeric-value arg))
(indent-to-column bison-rule-enumeration-column)
)
(self-insert-command (prefix-numeric-value arg))))
(defun bison-electric-open-brace (arg)
"used for the opening brace of a C action definition for production rules,
if there is only whitespace before \(point\), then put open-brace in
bison-rule-enumeration-column"
(interactive "P")
(if (and bison-electric-open-brace-v
(not bison-all-electricity-off))
(let ((section (bison--section-p)))
(cond ((and (= section bison--grammar-rules-section)
(not (bison--within-braced-c-expression-p section))
(not (previous-non-ws-p)))
(if (not (= (current-column) bison-rule-enumeration-column))
(progn
(just-no-space)
(indent-to-column bison-rule-enumeration-column))))
((and (= section bison--bison-decls-section)
(not (bison--within-braced-c-expression-p section))
(not (previous-non-ws-p)))
(if (not (= (current-column) 0))
(progn
(just-no-space)
(indent-to-column 0)))))))
(self-insert-command (prefix-numeric-value arg)))
(defun bison-electric-close-brace (arg)
"If the close-brace \"}\" is used as the c-declarations section closer
in \"%}\", then make sure the \"%}\" indents to the beginning of the line"
(interactive "P")
(self-insert-command (prefix-numeric-value arg))
(if (and bison-electric-close-brace-v
(not bison-all-electricity-off))
(cond ((search-backward "%}" (- (point) 2) t)
(if (= (bison--section-p) bison--c-decls-section)
(progn
(just-no-space)
(forward-char 2)) ; for "%}"
(forward-char 1)))
)))
(defun bison-electric-semicolon (arg)
"if the semicolon is used to end a production, then place it in
bison-rule-separator-column
a semicolon is deemed to be used for ending a production if it is not found
within braces
this is just self-insert-command as i have yet to write the actual
bison-electric-semicolon function yet
"
(interactive "P")
(self-insert-command (prefix-numeric-value arg)))
(defun bison-electric-percent (arg)
"If the percent is a declarer in the bison declaration's section,
then put it in the 0 column."
(interactive "P")
(if (and bison-electric-percent-v
(not bison-all-electricity-off))
(let ((section (bison--section-p)))
(if (and (= section bison--bison-decls-section)
(not (bison--within-braced-c-expression-p section))
(not (previous-non-ws-p))
(not (= (current-column) 0)))
(just-no-space))))
(self-insert-command (prefix-numeric-value arg)))
(defun bison-electric-less-than (arg)
"If the less-than is a type declarer opener for tokens in the bison
declaration section, then put it in the bison-decl-type-column column."
(interactive "P")
(if (and bison-electric-less-than-v
(not bison-all-electricity-off))
(if (and (= (bison--section-p) bison--bison-decls-section)
(bison--bison-decl-opener-p
(save-excursion (beginning-of-line) (point))
(point)))
(progn
(just-no-space)
(indent-to-column bison-decl-type-column))))
(self-insert-command (prefix-numeric-value arg)))
(defun bison-electric-greater-than (arg)
"If the greater-than is a type declarer closer for tokens in the bison
declaration section, then indent to bison-decl-token-column."
(interactive "P")
(self-insert-command (prefix-numeric-value arg))
(if (and bison-electric-greater-than-v
(not bison-all-electricity-off))
(let ((current-pt (point))
(bol (save-excursion (beginning-of-line) (point))))
(if (and (= (bison--section-p) bison--bison-decls-section)
(bison--bison-decl-opener-p bol (point)))
(if (search-backward "<" bol t)
(if (re-search-forward
(concat "<" bison--word-constituent-re "+>")
current-pt t)
(if (not (following-non-ws-p))
(progn
(just-no-space)
(indent-to-column bison-decl-token-column)))))))))
;;;###autoload
(define-derived-mode jison-mode bison-mode "jison"
"Major mode for editing jison files.")
;;;###autoload
(define-derived-mode flex-mode bison-mode "flex"
"Major mode for editing flex files. (bison-mode by any other name)")
(provide 'bison-mode)
(provide 'jison-mode)
(provide 'flex-mode)
;;; bison-mode.el ends here

+ 38
- 1
.config/doom/packages.el View File

@ -6,7 +6,44 @@
(package! org-fancy-priorities) (package! org-fancy-priorities)
(package! move-text) (package! move-text)
(package! vue-mode) (package! vue-mode)
(package! org-super-agenda)
(package! deadgrep) (package! deadgrep)
(package! sql-indent) (package! sql-indent)
(package! org-brain) (package! org-brain)
(package! calibredb)
(package! nov)
(package! xkcd)
(package! elcord)
(package! tiny)
(package! evil-escape :disable t)
(package! lexic :recipe (:local-repo "lisp/lexic"))
;; Latex Is Clearly Superior Right???
(package! aas :recipe (:host github :repo "ymarco/auto-activating-snippets"))
(package! laas :recipe (:local-repo "lisp/LaTeX-auto-activating-snippets"))
(package! auctex)
(package! calctex :recipe (:host github :repo "johnbcoughlin/calctex"
:files ("*.el" "calctex/*.el" "calctex-contrib/*.el" "org-calctex/*.el" "vendor")))
;; Org-Mode related
(package! org-super-agenda)
(package! org-caldav)
(package! doct
:recipe (:host github :repo "progfolio/doct"))
(package! org-pretty-table
:recipe (:host github :repo "Fuco1/org-pretty-table"))
(package! org-fragtog)
(package! org-appear :recipe (:host github :repo "awth13/org-appear"))
(package! org-pretty-tags)
(package! org-ol-tree :recipe (:host github :repo "Townk/org-ol-tree"))
(package! org-chef) ;; Real chefs use emacs
(package! javadoc-help)
(package! nand-hdl-mode
:recipe (:host github :repo "nverno/nand-hdl-mode"))
(package! browse-kill-ring)
(package! olivetti)
(package! ox-hugo)
(package! polymode)
(package! counsel-org-clock)
(package! mathpix.el :recipe (:host github :repo "jethrokuan/mathpix.el"))

+ 13
- 0
.config/doom/templates/template.c View File

@ -0,0 +1,13 @@
/*
* `(buffer-name)`
*
* Created by `(user-full-name)` on `(format-time-string "%d/%m/%Y")`.
* Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.
*/
#include <stdio.h>
int main(int argc, char *argv[]) {
}

+ 13
- 0
.config/doom/templates/template.cpp View File

@ -0,0 +1,13 @@
/*
* `(buffer-name)`
*
* Created by `user-full-name` on `(format-time-string "%d/%m/%Y")`.
* Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.
*/
#include <iostream>
int main(int argc, char *argv[]) {
}

+ 35
- 0
.config/doom/templates/template.el View File

@ -0,0 +1,35 @@
;;; `(buffer-name)` --- ${1:Description}
;; Author: `user-full-name` `user-mail-address`
;; Keywords: $2
;; URL:
;; Copyright (C) `(format-time-string ""%Y"")`, `user-full-name`, all rights reserved.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;;; Code:
$0
(provide '`(substring (buffer-name) 0 (- (length (buffer-name)) 3))`)
;; Local Variables:
;; coding: utf-8
;; End:
;;; `(buffer-name)` ends here.

+ 12
- 0
.config/doom/templates/template.h View File

@ -0,0 +1,12 @@
/*
* `(buffer-name)`
*
* Created by `(user-full-name)` on `(format-time-string "%d/%m/%Y")`.
* Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.
*/
#ifndef `(replace-regexp-in-string (regexp-quote ".") "_" (buffer-name) nil 'literal))`
#define `(replace-regexp-in-string (regexp-quote ".") "_" (buffer-name) nil 'literal))`
#endif /* `(replace-regexp-in-string (regexp-quote .) _ buffer-name nil 'literal))` */

.local/share/vim/templates/skeleton.html → .config/doom/templates/template.html View File


+ 12
- 0
.config/doom/templates/template.java View File

@ -0,0 +1,12 @@
/*
* `(buffer-name)`
*
* Created by `(user-full-name)` on `(format-time-string "%d/%m/%Y")`.
* Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.
*/
class Untitled {
public static void main(String[] args) {
}
}

+ 13
- 0
.config/doom/templates/template.org View File

@ -0,0 +1,13 @@
# -*- coding:utf-8 -*-
#+LANGUAGE: en
#+TITLE: ${1:`(file-name-nondirectory (buffer-file-name))`}
#+AUTHOR: `user-full-name`
#+EMAIL: `user-mail-address`
#+DATE: `(format-time-string "%Y-%m-%d %a" )`
#+DESCRIPTION:$1
#+KEYWORDS: $2
#+TAGS:$3
#+FILETAGS: $4
#+OPTIONS: H:2 num:nil toc:t \n:t @:t ::t |:t ^:nil -:t f:t *:t <:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil
#+LATEX_HEADER: \usepackage{fontspec}

+ 14
- 0
.config/doom/templates/template.py View File

@ -0,0 +1,14 @@
#!/bin/python
#
# `(buffer-name)`
#
# Created by `(user-full-name)` on `(format-time-string "%d/%m/%Y")`.
# Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.
#
def main():
print("hello world")
if __name__ == "__main__":
main()

+ 7
- 0
.config/doom/templates/template.sh View File

@ -0,0 +1,7 @@
#!/bin/sh
# `(buffer-name)`
#
# Created by `(user-full-name)` on `(format-time-string "%d/%m/%Y")`.
# Copyright `user-mail-address`. `(format-time-string "%Y")`. All rights reserved.

.local/share/vim/templates/skeleton.tex → .config/doom/templates/template.tex View File


+ 126
- 112
.config/doom/themes/doom-material-ocean-theme.el View File

@ -1,4 +1,4 @@
;;; doom-material-theme.el --- inspired by Material Theme by equinusocio -*- no-byte-compile: t; -*-
;;; doom-material-ocean-theme.el --- inspired by VIM Challenger Deep -*- no-byte-compile: t; -*-
(require 'doom-themes) (require 'doom-themes)
;; ;;
@ -6,151 +6,165 @@
"Options for doom-themes" "Options for doom-themes"
:group 'doom-themes) :group 'doom-themes)
(defcustom doom-material-ocean-brighter-modeline nil
"If non-nil, more vivid colors will be used to style the mode-line."
:group 'doom-material-ocean-theme
:type 'boolean)
(defcustom doom-material-ocean-brighter-comments nil
"If non-nil, comments will be highlighted in more vivid colors."
:group 'doom-material-ocean-theme
:type 'boolean)
(defcustom doom-material-ocean-comment-bg doom-material-ocean-brighter-comments
"If non-nil, comments will have a subtle, darker background. Enhancing their
legibility."
:group 'doom-material-ocean-theme
:type 'boolean)
(defcustom doom-material-ocean-padded-modeline doom-themes-padded-modeline (defcustom doom-material-ocean-padded-modeline doom-themes-padded-modeline
"If non-nil, adds a 4px padding to the mode-line.
Can be an integer to determine the exact padding."
"If non-nil, adds a 4px padding to the mode-line. Can be an integer to
determine the exact padding."
:group 'doom-material-ocean-theme :group 'doom-material-ocean-theme
:type '(choice integer boolean)) :type '(choice integer boolean))
;; ;;
(def-doom-theme doom-material-ocean (def-doom-theme doom-material-ocean
"A dark theme inspired by Material Theme by equinusocio"
"A dark theme inspired by VIM Challenger Deep"
;; name default 256 16 ;; name default 256 16
((bg '("#0F111A" nil nil))
(bg-alt '("#00010A" nil nil))
(base0 '("#171F24" "black" "black"))
(base1 '("#1C262B" "#262626" "brightblack"))
(base2 '("#222D32" "#303030" "brightblack"))
(base3 '("#171F24" "#3a3a3a" "brightblack"))
(base4 '("#314048" "#444444" "brightblack"))
(base5 '("#37474F" "#585858" "brightblack"))
(base6 '("#556369" "#626262" "brightblack"))
(base7 '("#737E84" "#767676" "brightblack"))
(base8 '("#9BA3A7" "#a8a8a8" "white"))
(fg '("#E5E9F0" "#e4e4e4" "brightwhite"))
(fg-alt '("#BFC7D5" "#bcbcbc" "white"))
(grey base5)
(red '("#BF616A" "#ff0000" "red"))
(orange '("#f78c6c" "#ff5f00" "brightred"))
(green '("#A3BE8C" "#afff00" "green"))
(teal '("#44b9b1" "#00d7af" "brightgreen"))
(yellow '("#EBCB8B" "#ffd700" "brightyellow"))
(blue '("#88C0D0" "#5fafff" "brightblue"))
(dark-blue '("#81A1C1" "#d7ffff" "blue"))
(magenta '("#A48EAD" "#d787d7" "brightmagenta"))
(violet '("#bb80b3" "#d787af" "magenta"))
(cyan '("#89DDFF" "#5fd7ff" "brightcyan"))
(dark-cyan '("#80cbc4" "#00d7af" "cyan"))
((bg '("#0F111A" "#121212" nil ))
(bg-alt '("#00010A" "#111111" nil ))
(base0 '("#100E23" "#080808" "black" ))
(base1 '("#292F37" "#262626" "brightblack" ))
(base2 '("#3D4551" "#3A3A3A" "brightblack" ))
(base3 '("#4C4B68" "#444466" "brightblack" ))
(base4 '("#565575" "#555577" "brightblack" ))
(base5 '("#858FA5" "#8888AA" "brightblack" ))
(base6 '("#9BA7BF" "#99AABB" "brightblack" ))
(base7 '("#B0BED8" "#BBBBDD" "brightblack" ))
(base8 '("#BAC9E4" "#BBCCEE" "white" ))
(fg-alt '("#B2B2B2" "#BBBBBB" "brightwhite" ))
(fg '("#CBE3E7" "#CCEEEE" "white" ))
(grey base4)
(red '("#FF8080" "#FF8888" "red" ))
(orange '("#FFB378" "#FFBB77" "brightred" ))
(green '("#95FFA4" "#99FFAA" "green" ))
(teal '("#63F2F1" "#66FFFF" "brightgreen" ))
(yellow '("#FFE9AA" "#FFEEAA" "yellow" ))
(blue '("#91DDFF" "#99DDFF" "brightblue" ))
(dark-blue '("#65B2FF" "#66BBFF" "blue" ))
(magenta '("#C991E1" "#CC99EE" "magenta" ))
(violet '("#906CFF" "#9966FF" "brightmagenta"))
(cyan '("#AAFFE4" "#AAFFEE" "brightcyan" ))
(dark-cyan '("#62D196" "#66DD99" "cyan" ))
;; face categories -- required for all themes ;; face categories -- required for all themes
(highlight magenta)
(vertical-bar base2)
(selection base4)
(builtin blue)
(comments base6)
(doc-comments base6)
(constants orange)
(functions blue)
(keywords cyan)
(methods blue)
(operators cyan)
(type magenta)
(strings green)
(highlight violet)
(vertical-bar base1)
(selection violet)
(builtin magenta)
(comments (if doom-material-ocean-brighter-comments dark-blue base4))
(doc-comments (if doom-material-ocean-brighter-comments (doom-darken dark-cyan 0.3) base5) )
(constants cyan)
(functions magenta)
(keywords red)
(methods magenta)
(operators teal)
(type blue)
(strings yellow)
(variables yellow) (variables yellow)
(numbers orange) (numbers orange)
(region base3)
(region base2)
(error red) (error red)
(warning yellow) (warning yellow)
(success green) (success green)
(vc-modified blue)
(vc-modified orange)
(vc-added green) (vc-added green)
(vc-deleted red) (vc-deleted red)
;; custom categories ;; custom categories
(modeline-bg base2)
(modeline-bg-alt (doom-darken bg 0.01))
(modeline-fg base8)
(modeline-fg-alt comments)
(hidden `(,(car bg) "black" "black"))
(-modeline-bright doom-material-ocean-brighter-modeline)
(-modeline-pad (-modeline-pad
(when doom-material-ocean-padded-modeline (when doom-material-ocean-padded-modeline
(if (integerp doom-material-ocean-padded-modeline) doom-material-ocean-padded-modeline 4))))
(if (integerp doom-material-ocean-padded-modeline) doom-material-ocean-padded-modeline 4)))
;; --- base faces ------------------------
(((lazy-highlight &override) :background base4 :foreground fg :distant-foreground fg :bold bold)
(doom-modeline-buffer-path :foreground green :weight 'bold)
(doom-modeline-buffer-major-mode :inherit 'doom-modeline-buffer-path)
(modeline-fg nil)
(modeline-fg-alt base5)
;; highlight-thing highlight-symbol
(highlight-symbol-face :background region :distant-foreground fg-alt)
(modeline-bg
(if -modeline-bright
base3
`(,(doom-darken (car bg) 0.1) ,@(cdr base0))))
(modeline-bg-l
(if -modeline-bright
base3
`(,(doom-darken (car bg) 0.15) ,@(cdr base0))))
(modeline-bg-inactive `(,(car bg) ,@(cdr base1)))
(modeline-bg-inactive-l (doom-darken bg 0.1)))
;; highlight-thing
(highlight-thing :background region :distant-foreground fg-alt)
(mode-line
:background modeline-bg :foreground modeline-fg
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg)))
(mode-line-inactive
:background modeline-bg-alt :foreground modeline-fg-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-alt)))
;; --- extra faces ------------------------
(((secondary-selection &override) :background base0)
(elscreen-tab-other-screen-face :background "#353a42" :foreground "#1e2022")
(fringe :background base2)
((line-number &override) :foreground base4)
((line-number-current-line &override) :foreground fg)
;; --- major-mode faces ------------------------
;; man-mode
(Man-overstrike :inherit 'bold :foreground magenta)
(Man-underline :inherit 'underline :foreground blue)
(font-lock-comment-face
:foreground comments
:background (if doom-material-ocean-comment-bg (doom-lighten bg 0.05)))
(font-lock-doc-face
:inherit 'font-lock-comment-face
:foreground doc-comments)
;; org-mode
((org-block &override) :background base2)
((org-block-background &override) :background base2)
((org-block-begin-line &override) :background base2)
(doom-modeline-bar :background (if -modeline-bright modeline-bg highlight))
;; --- plugin faces -------------------
(mode-line
:background modeline-bg :foreground modeline-fg
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg)))
(mode-line-inactive
:background modeline-bg-inactive :foreground modeline-fg-alt
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive)))
(mode-line-emphasis
:foreground (if -modeline-bright base8 highlight))
(solaire-mode-line-face
:inherit 'mode-line
:background modeline-bg-l
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-l)))
(solaire-mode-line-inactive-face
:inherit 'mode-line-inactive
:background modeline-bg-inactive-l
:box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive-l)))
;; --- major-mode faces -------------------
;; css-mode / scss-mode ;; css-mode / scss-mode
(css-proprietary-property :foreground orange) (css-proprietary-property :foreground orange)
(css-property :foreground green) (css-property :foreground green)
(css-selector :foreground blue) (css-selector :foreground blue)
;; dired-k
(dired-k-commited :foreground base4)
(dired-k-modified :foreground vc-modified)
(dired-k-ignored :foreground cyan)
(dired-k-added :foreground vc-added)
;; ivy
(ivy-current-match :background base5)
;; js2-mode
(js2-jsdoc-tag :foreground magenta)
(js2-object-property :foreground yellow)
(js2-object-property-access :foreground cyan)
(js2-function-param :foreground violet)
(js2-jsdoc-type :foreground base8)
(js2-jsdoc-value :foreground cyan)
;; lsp
(lsp-headerline-breadcrumb-symbols-face :foreground base7)
;; rainbow-delimiters
(rainbow-delimiters-depth-1-face :foreground magenta)
(rainbow-delimiters-depth-2-face :foreground orange)
(rainbow-delimiters-depth-3-face :foreground green)
(rainbow-delimiters-depth-4-face :foreground cyan)
(rainbow-delimiters-depth-5-face :foreground violet)
(rainbow-delimiters-depth-6-face :foreground yellow)
(rainbow-delimiters-depth-7-face :foreground blue)
(rainbow-delimiters-depth-8-face :foreground teal)
(rainbow-delimiters-depth-9-face :foreground dark-cyan)
;; rjsx-mode
(rjsx-tag :foreground red)
(rjsx-attr :foreground yellow :slant 'italic :weight 'medium)
;; markdown-mode
(markdown-markup-face :foreground base5)
(markdown-header-face :inherit 'bold :foreground red)
((markdown-code-face &override) :background (doom-lighten base3 0.05))
;; outline (affects org-mode)
((outline-1 &override) :foreground blue :background nil)
;; org-mode
((org-block &override) :background base1)
((org-block-begin-line &override) :background base1 :foreground comments)
(org-hide :foreground hidden)
(org-link :foreground orange :underline t :weight 'bold)
;; tooltip ;; tooltip
(tooltip :background (doom-darken bg-alt 0.2) :foreground fg)))
(tooltip :background base0 :foreground fg))
;; --- extra variables ---------------------
;; ()
)
(provide 'doom-material-ocean-theme)
;;; doom-material-ocean-theme.el ends here

+ 1
- 0
.config/mutt/muttrc View File

@ -2,6 +2,7 @@
source /home/yigit/.config/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc source /home/yigit/.config/mutt/accounts/1-yigitcolakoglu@hotmail.com.muttrc
source /home/yigit/.config/mutt/colors.muttrc source /home/yigit/.config/mutt/colors.muttrc
source /home/yigit/.config/mutt/keys.muttrc source /home/yigit/.config/mutt/keys.muttrc
set editor="/usr/bin/nvim"
set mailcap_path = /home/yigit/.config/mutt/mailcap:$mailcap_path set mailcap_path = /home/yigit/.config/mutt/mailcap:$mailcap_path
set mime_type_query_command = "file --mime-type -b %s" set mime_type_query_command = "file --mime-type -b %s"
set date_format="%y/%m/%d %I:%M%p" set date_format="%y/%m/%d %I:%M%p"


+ 0
- 2
.config/nextcloud/nextcloud View File

@ -15,8 +15,6 @@ declare -A mappings
mappings=( mappings=(
["$NEXTCLOUD_URL/Documents"]="$HOME/Documents" ["$NEXTCLOUD_URL/Documents"]="$HOME/Documents"
["$NEXTCLOUD_URL/Photos"]="$HOME/Pictures" ["$NEXTCLOUD_URL/Photos"]="$HOME/Pictures"
["$NEXTCLOUD_URL/Private"]="$HOME/Nextcloud/Private"
["$NEXTCLOUD_URL/Books"]="$HOME/Nextcloud/Books"
["$NEXTCLOUD_URL/InstantUpload"]="$HOME/Nextcloud/InstantUpload" ["$NEXTCLOUD_URL/InstantUpload"]="$HOME/Nextcloud/InstantUpload"
["$NEXTCLOUD_URL/Past Papers"]="$HOME/Nextcloud/Past Papers" ["$NEXTCLOUD_URL/Past Papers"]="$HOME/Nextcloud/Past Papers"
["$NEXTCLOUD_URL/InstantUpload"]="$HOME/Nextcloud/InstantUpload" ["$NEXTCLOUD_URL/InstantUpload"]="$HOME/Nextcloud/InstantUpload"


+ 0
- 5
.config/nvim/plugin/plugins.vim View File

@ -5,7 +5,6 @@ Plug 'kaicataldo/material.vim'
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'
Plug 'mengelbrecht/lightline-bufferline' Plug 'mengelbrecht/lightline-bufferline'
Plug 'lambdalisue/nerdfont.vim' Plug 'lambdalisue/nerdfont.vim'
Plug 'vimwiki/vimwiki'
" Addons " Addons
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
@ -45,8 +44,4 @@ Plug 'leafgarland/typescript-vim'
Plug 'vim-scripts/cool.vim' Plug 'vim-scripts/cool.vim'
Plug 'justinmk/vim-syntax-extra' Plug 'justinmk/vim-syntax-extra'
Plug 'arrufat/vala.vim' Plug 'arrufat/vala.vim'
" Syntax errors
Plug 'ntpeters/vim-better-whitespace'
call plug#end() call plug#end()

+ 8
- 7
.config/vim/vimrc View File

@ -1,3 +1,10 @@
"" __ _______ _____ _____
"" \ \ / / ____| ____|_ _|
"" \ V /| _| | _| | |
"" | | | |___| |___ | |
"" |_| |_____|_____| |_|
"" Yeet's vim configuration
" XDG Base Directory Specification " XDG Base Directory Specification
set runtimepath^=$XDG_CONFIG_HOME/vim set runtimepath^=$XDG_CONFIG_HOME/vim
set runtimepath+=$XDG_DATA_HOME/vim set runtimepath+=$XDG_DATA_HOME/vim
@ -207,17 +214,11 @@ packadd termdebug
if has("autocmd") if has("autocmd")
" Use skeleton files " Use skeleton files
augroup templates augroup templates
autocmd BufNewFile *.* silent! execute '0r ~/.local/share/vim/templates/skeleton.'.expand("<afile>:e")
autocmd BufNewFile *.* silent! execute '0r ~/.config/vim/templates/skeleton.'.expand("<afile>:e")
autocmd BufNewFile * %substitute#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge autocmd BufNewFile * %substitute#\[:VIM_EVAL:\]\(.\{-\}\)\[:END_EVAL:\]#\=eval(submatch(1))#ge
augroup END augroup END
autocmd BufWinLeave *.tex !texclear %:p " Run texclear on exit autocmd BufWinLeave *.tex !texclear %:p " Run texclear on exit
autocmd BufRead calcurse-note.* :set filetype=markdown " Use markdown for calcurse notes autocmd BufRead calcurse-note.* :set filetype=markdown " Use markdown for calcurse notes
" Enable Goyo by default for mutt writing
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo | set bg=light
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
endif endif

+ 8
- 0
.config/zsh/.zshrc View File

@ -1,3 +1,11 @@
## __ _______ _____ _____
## \ \ / / ____| ____|_ _|
## \ V /| _| | _| | |
## | | | |___| |___ | |
## |_| |_____|_____| |_|
## Yeet's zsh configuration
#zmodload zsh/zprof #zmodload zsh/zprof
eval "$(direnv hook zsh)" >> $XDG_RUNTIME_DIR/direnv eval "$(direnv hook zsh)" >> $XDG_RUNTIME_DIR/direnv
#welcome.sh #welcome.sh


+ 8
- 0
.config/zsh/aliases View File

@ -14,6 +14,7 @@ alias ls="ls --color"
alias yay="yay --sudoloop" alias yay="yay --sudoloop"
alias lf=lf-ueberzug alias lf=lf-ueberzug
alias vimorig=$(which vim) alias vimorig=$(which vim)
alias vim=nvim alias vim=nvim
weechat(){ weechat(){
@ -57,3 +58,10 @@ alias bon="sudo bash -c 'rc-service bluetooth start && rfkill unblock bluetooth'
alias cx="chmod +x" alias cx="chmod +x"
alias lights_on="curl 'http://yeetclock/setcolor?R=136&G=192&B=208'" alias lights_on="curl 'http://yeetclock/setcolor?R=136&G=192&B=208'"
alias v="nvim"
alias m='e --eval "(progn (magit-status) (delete-other-windows))"'
alias mt="m -t"
alias et="e -t"

+ 22
- 0
.local/bin/backup View File

@ -11,6 +11,24 @@ readonly SSH_KEY="/home/yigit/.ssh/id_skeleton"
readonly RSYNC_PROFILE="$SSH_USER@$SSH_HOST:~/snapshots" readonly RSYNC_PROFILE="$SSH_USER@$SSH_HOST:~/snapshots"
alias ssh_cmd="ssh -i \"$SSH_KEY\" $SSH_USER@$SSH_HOST" alias ssh_cmd="ssh -i \"$SSH_KEY\" $SSH_USER@$SSH_HOST"
[ -f "$XDG_CACHE_HOME/dbus_settings" ] && "$XDG_CACHE_HOME/dbus_settings" # Load the dbus settings for current session
displays="$(ps -u $(id -u) -o pid= \
| xargs -I PID -r cat /proc/PID/environ 2> /dev/null \
| tr '\0' '\n' \
| grep ^DISPLAY=: \
| sort -u \
| xargs \
| cut -d ":" -f2)"
notify() {
IFS="\n"
for x in $displays; do
export DISPLAY=$x
notify-send --app-name="$1" "$2"
done ;
}
notify " Periodic backup" "Backup is starting"
DEVICE=tatooine DEVICE=tatooine
OPT="-aPh" OPT="-aPh"
@ -41,3 +59,7 @@ ssh_cmd rm -f "~/snapshots/$DEVICE/last" < /dev/null
# Create new symlink to latest snapshot for the next backup to hardlink # Create new symlink to latest snapshot for the next backup to hardlink
ssh -i "$SSH_KEY" $SSH_USER@$SSH_HOST ln -s "~/snapshots/$DEVICE/$date" "~/snapshots/$DEVICE/last" < /dev/null ssh -i "$SSH_KEY" $SSH_USER@$SSH_HOST ln -s "~/snapshots/$DEVICE/$date" "~/snapshots/$DEVICE/last" < /dev/null
pidof slock > /dev/null && {
shutdown -h now
}

+ 1
- 0
.local/bin/calconsync View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
pidof emacs && emacsclient -e '(org-caldav-sync)' # Sync emacs-caldav as well
eval "$(grep -h -- \ eval "$(grep -h -- \
"^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\)=" \ "^\s*\(export \)\?\(MBSYNCRC\|PASSWORD_STORE_DIR\|NOTMUCH_CONFIG\|GNUPGHOME\|XDG_DATA_HOME\|XDG_CONFIG_HOME\)=" \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \


+ 13
- 9
.local/bin/check-updates View File

@ -1,19 +1,23 @@
#!/bin/sh #!/bin/sh
case "$(readlink -f /sbin/init)" in
*systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
esac
[ -f "$XDG_CACHE_HOME/dbus_settings" ] && "$XDG_CACHE_HOME/dbus_settings" # Load the dbus settings for current session
ping -q -c 1 example.org > /dev/null || exit ping -q -c 1 example.org > /dev/null || exit
pgrepoutput="$(pgrep -a X\(org\|wayland\))"
displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)"
displays="$(ps -u $(id -u) -o pid= \
| xargs -I PID -r cat /proc/PID/environ 2> /dev/null \
| tr '\0' '\n' \
| grep ^DISPLAY=: \
| sort -u \
| xargs \
| cut -d ":" -f2)"
notify() { notify() {
[ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do
export DISPLAY=$x
notify-send --app-name="auto-update" "$1" "$2"
done ;
IFS="\n"
for x in $displays; do
export DISPLAY=$x
notify-send --app-name="$1" "$2"
done ;
} }
notify " Repository Sync" "Checking for package updates..." notify " Repository Sync" "Checking for package updates..."


+ 14
- 0
.local/bin/dmenu-emoji View File

@ -0,0 +1,14 @@
#!/bin/sh
chosen=$(cut -d ';' -f1 ~/.local/share/emoji | dmenu -i -l 10 | sed "s/ .*//")
[ -z "$chosen" ] && exit
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "$chosen" | xclip -selection clipboard
printf %s "$chosen" | xdotool type --clearmodifiers --file -
notify-send -a "Character copied to clipboard" "'$chosen' copied to clipboard." &
fi

+ 2
- 0
.local/bin/dmenu-logout View File

@ -35,6 +35,8 @@ selection=$(printf '%s' "$items" | $DMENU)
case $selection in case $selection in
logout) logout)
firefox-sync &
kill -9 "$DBUS_SESSION_BUS_PID"
kill -9 "$XSESSION_PID" kill -9 "$XSESSION_PID"
;; ;;
hibernate) hibernate)


+ 9
- 4
.local/bin/dmenu-refresh View File

@ -16,8 +16,9 @@ dunst
clipmenud clipmenud
quark quark
devmon devmon
emacs
mpd mpd
mpd-mpris"
mpDris2"
# Open menu # Open menu
selection=$(printf '%s' "$items" | $DMENU) selection=$(printf '%s' "$items" | $DMENU)
@ -43,14 +44,18 @@ case $selection in
mpd & mpd &
mpd-mpris & mpd-mpris &
;; ;;
mpd-mpris)
kill -9 $(pidof mpd-mpris)
mpd-mpris &
mpDris2)
kill -9 $(pidof mpDris2)
mpDris2 &
;; ;;
dunst) dunst)
kill -9 $(pidof dunst) kill -9 $(pidof dunst)
dunst & dunst &
;; ;;
emacs)
emacsclient -e '(kill-emacs)'
emacs --daemon && emacsclient -c --eval "(delete-frame)"
;;
devmon) devmon)
pkill -f devmon pkill -f devmon
~/.local/bin/devmon --exec-on-drive "/sbin/notify-send '禍 drive mounted' '%l (%f) at %d '" \ ~/.local/bin/devmon --exec-on-drive "/sbin/notify-send '禍 drive mounted' '%l (%f) at %d '" \


+ 107
- 0
.local/bin/dmenu-web View File

@ -0,0 +1,107 @@
#!/bin/sh
# title: dmenu_websearch <http://efe.kim/dmenu_websearch.html>
# license: CC0
# author: Sunur Efe Vural <efe@efe.kim>
# version: Mar 22, 2019
# dependencies: dmenu, xdotool, hexdump, xprop, setxkbmap, coreutils.
# A browser-independent address bar with bookmark support. When the
# cursor is on a web browser it acts as the address bar of that browser.
engine='https://anon.sx/search?q=%s'
bookmarks="$HOME/.local/share/bookmarks"
gotourl() {
if [ "$nbrowser" = surf ]
then
xprop -id "$winid" -f _SURF_GO 8s -set _SURF_GO "$choice"
elif [ -n "$winid" ] && [ -z "$nbrowser" ]
then
#change layout to us cuz xdotool spasms with non-latin layouts
layout=$(setxkbmap -query | awk '/^layout:/{ print $2 }')
setxkbmap -layout us
xdotool key --clearmodifiers "$shortcut"\
type --clearmodifiers --delay 2 "$choice"
xdotool key --clearmodifiers Return
setxkbmap -layout "$layout"
elif [ -n "$nbrowser" ]
then
$nbrowser "$choice"
else $BROWSER "$choice"
fi
}
searchweb() {
#convert search query to percent encoding and insert it into url
choice=$(echo "$choice" | hexdump -v -e '/1 " %02x"')
choice=$(echo "$engine" | sed "s/%s/${choice% 0a}/;s/[[:space:]]/%/g")
gotourl
}
xprop -root | grep '^_NET_ACTIVE_WINDOW' && {
winid=$(xprop -root _NET_ACTIVE_WINDOW | sed 's/.*[[:space:]]//')
class=$(xprop -id "$winid" WM_CLASS | awk -F'\"' '{ print $(NF - 1) }')
case "$class" in
Firefox) nbrowser='firefox' ;;
#Firefox) shortcut='ctrl+l' ;; # alternative method, uses xdotool
IceCat) nbrowser='icecat' ;;
Chromium) nbrowser='chromium' ;;
Chrome) nbrowser='chrome' ;;
Opera) nbrowser='opera' ;;
Vivaldi) nbrowser='vivaldi' ;; # not tested
Brave) nbrowser='brave' ;; # not tested
Conkeror) nbrowser='conkeror' ;; # not tested
Palemoon) nbrowser='palemoon' ;; # not tested
Iceweasel) nbrowser='iceweasel' ;; # not tested
qutebrowser) nbrowser='qutebrowser' ;;
Midori) nbrowser='midori' ;; # not that good
Luakit) nbrowser='luakit' ;; # uses the last window instance
Uzbl|Vimb) shortcut='o' ;;
Links) shortcut='g' ;;
Netsurf*|Epiphany|Dillo|Konqueror|Arora) shortcut='ctrl+l' ;;
Surf) nbrowser='surf' ; uricur=$(xprop -id "$winid" _SURF_URI |\
awk -F'\"' '{ print $( NF - 1 ) }') ;;
*) pid=$(xprop -id "$winid" _NET_WM_PID | awk '{ print $3 }')
while pgrep -oP "$pid" >/dev/null
do
pid=$(pgrep -oP "$pid")
done
pname=$(awk '/^Name\:/{ print $NF }' /proc/"$pid"/status) ||
winid="" ;;
esac
[ -n "$pname" ] && case "$pname" in
w3m) shortcut="U" ;;
lynx|elinks|links) shortcut="g" ;;
*) winid="" ;;
esac
}
tmpfile=$(mktemp /tmp/dmenu_websearch.XXXXXX)
trap 'rm "$tmpfile"' 0 1 15
printf '%s\n%s\n' "$uricur" "$1" > "$tmpfile"
cat "$bookmarks" >> "$tmpfile"
sed -i -E '/^(#|$)/d' "$tmpfile"
choice=$(dmenu -i -p "Go:" -w "$winid" < "$tmpfile") || exit 1
# Detect links without protocol (This is WIP)
protocol='^(https?|ftps?|mailto|about|file):///?'
checkurl() {
grep -Fx "$choice" "$tmpfile" &&
choice=$(echo "$choice" | awk '{ print $1 }') && return 0
[ ${#choice} -lt 4 ] && return 1
echo "$choice" | grep -Z ' ' && return 1
echo "$choice" | grep -EiZ "$protocol" && return 0
echo "$choice" | grep -FZ '..' && return 1
prepath=$(echo "$choice" | sed 's/(\/|#|\?).*//')
echo "$prepath" | grep -FvZ '.' && return 1
echo "$prepath" | grep -EZ '^([[:alnum:]~_:-]+\.?){1,3}' && return 0
}
if checkurl
then
echo "$choice" | grep -EivZ "$protocol" &&
choice="http://$choice"
gotourl
else searchweb
fi

+ 318
- 0
.local/bin/dmenu-xrandr View File

@ -0,0 +1,318 @@
#!/usr/bin/zsh
#
# Setup outputs with xrandr as a backend and dmenu as a frontend
#
# external commands: cat, cut, dmenu, grep, sed, xrandr
# Released under GPLv2
#
# TODO: add dpi support
typeset XRANDR_TXT # readonly; stdout of running xrandr without any options
typeset -A OUTPUT_CONFIGURED # key=connected output name
typeset -a DISCONNECT_OUTPUTS
typeset OPT_MODE='auto'
typeset OPT_ROTATION='normal'
typeset -ir EXIT_CLEAN=7
typeset -ir ERR_BAD_ARGS=257
typeset -ir ERR_BAD_SELECTION=258
typeset -ir ERR_NO_OPTIONS=259
if ! command -v cat &>/dev/null; then
echo 'coreutils seem to be missing. You'\''re gonna have a bad time.' >&2
exit 255
elif ! command -v grep &>/dev/null; then
echo 'grep seems to be missing. You'\''re gonna have a bad time.' >&2
exit 255
elif ! command -v xrandr &>/dev/null; then
echo 'Ran xrandr-dmenu without xrandr? You'\''re gonna have a bad time.' >&2
exit 255
elif ! command -v dmenu &>/dev/null; then
echo 'Ran xrandr-dmenu without dmenu? You'\''re gonna have a bad time.' >&2
exit 255
elif ! xset q &>/dev/null; then
echo 'Woah there, cowboy! You need to run this from inside X!' >&2
exit 1
fi
XRANDR_TXT="$(xrandr)" || exit $?
function () {
typeset opt
typeset output
typeset help_msg="usage: xrandr-dmenu [options]
Setup X outputs position, mode, etc
Input 'exit' or press 'ESC' at any point to cancel.
Options:
-m Select mode for outputs
-M Use current mode for outputs
-r Select rotation for outputs
-R Use current rotation for outputs"
while getopts mMrRh opt; do
case "${opt}" in
('m') OPT_MODE='change' ;;
('M') OPT_MODE='no_change' ;;
('r') OPT_ROTATION='change' ;;
('R') OPT_ROTATION='no_change' ;;
('h')
echo "${help_msg}"
exit 0
;;
('?')
echo "${help_msg}"
exit 1
;;
esac
done
for output in $(grep ' connected' <<< "${XRANDR_TXT}" | cut -d ' ' -f 1); do
OUTPUT_CONFIGURED[${output}]='false'
done
for output ($(grep ' disconnected' <<< "${XRANDR_TXT}" | cut -d ' ' -f 1)) {
DISCONNECTED_OUTPUTS+=("${output}")
}
} "$@"
typeset -r XRANDR_TXT
typeset -r OPT_MODE
typeset -r OPT_ROTATION
typeset -r DISCONNECTED_OUTPUTS
function main() {
typeset prompt
typeset menu
typeset output
typeset mode
typeset rotation
typeset position
typeset xrandr_cmd
# set primary output
prompt='Select primary output:'
output="$(menu_select "${prompt}" ${(k)=OUTPUT_CONFIGURED})" || bail $?
position='--primary'
mode="$(select_mode ${output})" || bail $?
rotation="$(select_rotation ${output})" || bail $?
OUTPUT_CONFIGURED[${output}]='true'
xrandr_cmd="xrandr --output ${output} ${position} ${rotation} ${mode}"
# set additional outputs
prompt='Select next output:'
while ! all_outputs_configured; do
menu="$(list_unconfigured_outputs)"
output="$(menu_select ${prompt} ${=menu})" || bail $?
position="$(select_position ${output})" || bail $?
if [[ "${position}" != '--off' ]]; then
mode="$(select_mode ${output})" || bail $?
rotation="$(select_rotation ${output})" || bail $?
fi
OUTPUT_CONFIGURED[${output}]='true'
xrandr_cmd+=" --output ${output} ${position} ${rotation} ${mode}"
done
# forcibly '--off' disconnected outputs
for output in ${DISCONNECTED_OUTPUTS}; do
xrandr_cmd+=" --output ${output} --off"
done
# do the deed
if ! ${=xrandr_cmd}; then
echo "Failed to execute xrandr command:\n${xrandr_cmd}"
bail 255
fi
}
################################################################################
# Uses dmenu to select the position of a given output relative to an already
# configured output. --same-as and --off are considered a position.
# Prints in the form of xrandr option (eg, '--right-of DP1') to stdout
# Global variables:
# ERR_BAD_ARG
# Arguments:
# $1=name of output to configure
# Returns:
# ERR_BAD_ARG for no $1
################################################################################
function select_position() {
[[ -z $1 ]] && return "${ERR_BAD_ARG}"
typeset output
typeset prompt
typeset -a menu
typeset anchor
typeset position
typeset selection
output="$1"
prompt="Select position of ${output}:"
for anchor in $(list_configured_outputs); do
for position in 'left of' 'right of' 'above' 'below' 'same as'; do
menu+=("${position} ${anchor}")
done
done
menu+=('off')
selection="$(menu_select "${prompt}" ${menu})" || return $?
case "${selection[(w)1]}" in
(left|right|same) echo "--${selection/ /-}" ;;
(above|below|mirror|off) echo "--${selection}" ;;
esac
}
################################################################################
# Uses dmenu to display the detected mode options for a given output and lets
# the user select a mode to use. Prints choice in xrandr option format
# (eg, '--mode 800x600' or '--auto') to stdout
# Global variables:
# XRANDR_TXT
# OPT_MODE
# ERR_BAD_ARGS
# Arguments:
# $1 - name of which output we are working with
# Returns:
# ERR_BAD_ARGS
################################################################################
function select_mode() {
[[ -z $1 ]] && return "${ERR_BAD_ARGS}"
typeset output
typeset prompt
typeset menu
typeset selection
output="$1"
prompt="Select mode for ${output}:"
if [[ "${OPT_MODE}" == 'auto' ]]; then
echo '--auto'
elif [[ "${OPT_MODE}" == 'no_change' ]]; then
echo ''
else
# TODO: make this not ugly. A better sed should negate the need for cut/grep
menu="$(echo \"${XRANDR_TXT}\" \
| sed -n '/^'${output}' /,/^[^ ]/ s/ * //p' \
| cut -d ' ' -f 1 \
| grep x \
| cat <(echo auto) -)"
selection="$(menu_select "${prompt}" ${=menu})" || return $?
if [[ 'auto' == "${selection}" ]]; then
echo '--auto'
else
echo "--mode ${selection}"
fi
fi
}
################################################################################
# Uses dmenu to select the rotation of a given output. Prints the selection in
# xrandr option format (eg '--rotate inverted') to stdout
# Global variables:
# OPT_ROTATION
# ERR_BAD_ARGS
# Arguments:
# $1 - name of which output we are working with
# Returns:
# ERR_BAD_ARGS
################################################################################
function select_rotation() {
[[ -z $1 ]] && return "${ERR_BAD_ARGS}"
typeset menu
typeset prompt
prompt="Select rotation of $1:"
menu=('normal' 'inverted' 'left' 'right')
if [[ "${OPT_ROTATION}" == 'normal' ]]; then
echo '--rotate normal'
elif [[ "${OPT_ROTATION}" == 'no_change' ]]; then
echo ''
else
echo -n "--rotate ${selection}"
menu_select "${prompt}" ${menu} || return $?
fi
}
################################################################################
# Uses dmenu to select an option. Undisplayed 'exit' option or pressing 'ESC'
# will return code ${EXIT_CLEAN} to trigger an abort to the script. Validates to
# make sure the selection is an option. If there is only 1 option, it will
# automatically choose it. Prints selection to stdout
# Global variables:
# none
# Arguments:
# $1=prompt
# $2+=menu items
# Returns:
# ERR_BAD_ARGS=bad arguments
# EXIT_CLEAN=user requested exit
################################################################################
function menu_select() {
[[ -z "$2" ]] && return ${ERR_BAD_ARGS}
typeset selection
typeset prompt
typeset -a menu
prompt="$1"
shift
menu=($*)
if [[ ${#menu} == 1 ]]; then
echo "${menu}"
else
while [[ -z "${menu[(r)${selection}]}" ]]; do
echo "${(F)menu}" | dmenu -p "${prompt}" | read selection
[[ "${(L)selection}" == 'exit' ]] || [[ -z "${selection}" ]] \
&& return ${EXIT_CLEAN}
done
echo "${selection}"
fi
}
function list_configured_outputs() {
typeset -a list
typeset output
for output in ${(k)OUTPUT_CONFIGURED}; do
${OUTPUT_CONFIGURED[$output]} && list+=("${output}")
done
echo "${(F)list}"
}
function list_unconfigured_outputs() {
typeset -a list
typeset output
for output in ${(k)OUTPUT_CONFIGURED}; do
${OUTPUT_CONFIGURED[$output]} || list+=("${output}")
done
echo "${(F)list}"
}
function all_outputs_configured() {
typeset config
for config in ${OUTPUT_CONFIGURED}; do
$config || return 257
done
return 0
}
function bail() {
[[ "$1" == ${EXIT_CLEAN} ]] && exit 0 || exit "$1"
}
main
################################################################################
# vim filetype=zsh autoindent expandtab shiftwidth=2 tabstop=2
# End
#

+ 10
- 4
.local/bin/dmenu_run_history View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
termcmd="st -c \"dmenu-st\" -e"
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then if [ -d "$cachedir" ]; then
cache=$cachedir/dmenu_run cache=$cachedir/dmenu_run
@ -15,7 +16,7 @@ if stest -dqr -n "$cache" $PATH; then
fi fi
unset IFS unset IFS
awk -v histfile=$historyfile '
cmd=$(awk -v histfile=$historyfile '
BEGIN { BEGIN {
while( (getline < histfile) > 0 ) { while( (getline < histfile) > 0 ) {
sub("^[0-9]+\t","") sub("^[0-9]+\t","")
@ -23,8 +24,12 @@ awk -v histfile=$historyfile '
x[$0]=1 x[$0]=1
} }
} !x[$0]++ ' "$cache" \ } !x[$0]++ ' "$cache" \
| dmenu "$@" \
| awk -v histfile=$historyfile '
| dmenu "$@")
case $cmd in
*\! ) ${termcmd} "$(printf "%s" "${cmd}" | cut -d'!' -f1)";;
* ) echo "$cmd" | awk -v histfile=$historyfile '
BEGIN { BEGIN {
FS=OFS="\t" FS=OFS="\t"
while ( (getline < histfile) > 0 ) { while ( (getline < histfile) > 0 ) {
@ -47,4 +52,5 @@ awk -v histfile=$historyfile '
print history[f],f | "sort -t '\t' -k1rn >" histfile print history[f],f | "sort -t '\t' -k1rn >" histfile
} }
' \ ' \
| while read cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done
| while read cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done ;;
esac

+ 0
- 11
.local/bin/dmenu_surf View File

@ -1,11 +0,0 @@
#!/bin/sh
lines=12
blacklist='google'
selection=$(echo "" | dmenu -p "Enter URL")
if [ ! -z "$selection" ]
then
$BROWSER $selection
fi

+ 8
- 1
.local/bin/doom View File

@ -4,4 +4,11 @@
dunstify -r 57 -a "ξ Doom Emacs" "Running \"doom $@\"" dunstify -r 57 -a "ξ Doom Emacs" "Running \"doom $@\""
$XDG_CONFIG_HOME/emacs/bin/doom $@ $XDG_CONFIG_HOME/emacs/bin/doom $@
dunstify -r 57 -a "ξ Doom Emacs" "Finished \"doom $@\""
if [ "$?" = "0" ]; then
dunstify -r 57 -a "ξ Doom Emacs" "Finished \"doom $@\""
emacsclient -e '(kill-emacs)'
emacs --daemon && emacsclient -c --eval "(delete-frame)"
else
dunstify -r 57 -a "ξ Doom Emacs" "Failed \"doom $@\""
fi

+ 62
- 0
.local/bin/e View File

@ -0,0 +1,62 @@
#!/bin/bash
force_tty=false
force_wait=false
stdin_mode=""
args=()
while :; do
case "$1" in
-t | -nw | --tty)
force_tty=true
shift ;;
-w | --wait)
force_wait=true
shift ;;
-m | --mode)
stdin_mode=" ($2-mode)"
shift 2 ;;
-h | --help)
echo -e "\033[1mUsage: e [-t] [-m MODE] [OPTIONS] FILE [-]\033[0m
Emacs client convenience wrapper.
\033[1mOptions:\033[0m
\033[0;34m-h, --help\033[0m Show this message
\033[0;34m-t, -nw, --tty\033[0m Force terminal mode
\033[0;34m-w, --wait\033[0m Don't supply \033[0;34m--no-wait\033[0m to graphical emacsclient
\033[0;34m-\033[0m Take \033[0;33mstdin\033[0m (when last argument)
\033[0;34m-m MODE, --mode MODE\033[0m Mode to open \033[0;33mstdin\033[0m with
Run \033[0;32memacsclient --help\033[0m to see help for the emacsclient."
exit 0 ;;
--*=*)
set -- "$@" "${1%%=*}" "${1#*=}"
shift ;;
*)
if [ "$#" = 0 ]; then
break; fi
args+=("$1")
shift ;;
esac
done
if [ ! "${#args[*]}" = 0 ] && [ "${args[-1]}" = "-" ]; then
unset 'args[-1]'
TMP="$(mktemp /tmp/emacsstdin-XXX)"
cat > "$TMP"
args+=(--eval "(let ((b (generate-new-buffer \"*stdin*\"))) (switch-to-buffer b) (insert-file-contents \"$TMP\") (delete-file \"$TMP\")${stdin_mode})")
fi
if [ -z "$DISPLAY" ] || $force_tty; then
if [ "$TERM" = "st-256color" ]; then
TERM=xterm-256color emacsclient --tty -create-frame --alternate-editor="nvim" "${args[@]}"
else
emacsclient --tty -create-frame --alternate-editor="nvim" "${args[@]}"
fi
else
if ! $force_wait; then
args+=(--no-wait); fi
emacsclient -create-frame --alternate-editor="nvim" "${args[@]}"
fi

+ 0
- 53
.local/bin/menu-surfraw View File

@ -1,53 +0,0 @@
#!/bin/sh
# Menu Surfraw: https://github.com/TomboFry/menu-surfraw
# Modified version of https://github.com/onespaceman/menu-calc to display
# available elvi to use in surfraw then get the search term afterwards and open
# it in your browser of choice.
# Edit here to change what browser you open links in
usage() {
echo "Usage: $0 [OPTIONS] [ELVIS [SEARCHTERM]]
OPTIONS:
-h, --help Displays this message
ELVIS:
This is the same as surfraw, any Elvi you have installed. Can be left
blank, as you will be prompted for this in dmenu/rofi.
SEARCHTERM:
Again, the same as surfraw, the term you are searching for. Can also be
left blank as you will be prompted for this in dmenu/rofi."
exit
}
case $1 in
"-h"|"--help") usage ;;
esac
# Path to menu application
if [[ -n $(command -v dmenu) ]]; then
menu="$(command -v dmenu )"
elif [[ -n $(command -v rofi) ]]; then
menu="$(command -v rofi)"
else
echo "Rofi or dmenu not found, exiting."
exit
fi
answerA=$(echo "$1")
answerB=$(echo "${@:2}")
# Change what to display in rofi/dmenu
# If both the first prompt and second prompt are not empty, it will finally open
# the search in surfraw
action=$(echo "" | $menu -p "$answerA ")
if [ "$action" = "" ]; then
exit
fi
surfraw -browser=$BROWSER $answerA $action

+ 3
- 0
.local/share/dwm/autostart.sh View File

@ -33,6 +33,9 @@ restart_if_fails "picom --no-fading-openclose"
restart_if_fails "xbanish -s" restart_if_fails "xbanish -s"
# Start emacs
restart_if_fails "emacs --daemon && emacsclient -c --eval \"(delete-frame)\""
~/.local/bin/firefox-sync & ~/.local/bin/firefox-sync &
~/.local/bin/mailsync & ~/.local/bin/mailsync &


+ 0
- 3810
.local/share/nerdfont_icons
File diff suppressed because it is too large
View File


+ 0
- 14
.local/share/vim/templates/skeleton.c View File

@ -1,14 +0,0 @@
/*
* [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
* [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
*
* Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%m/%d/%y')[:END_EVAL:].
* Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
*/
#include <stdio.h>
int main(int argc, char *argv[]) {
}

+ 0
- 14
.local/share/vim/templates/skeleton.cpp View File

@ -1,14 +0,0 @@
/*
* [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
* [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
*
* Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%m/%d/%y')[:END_EVAL:].
* Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
*/
#include <iostream>
int main(int argc, char *argv[]) {
}

+ 0
- 13
.local/share/vim/templates/skeleton.h View File

@ -1,13 +0,0 @@
//
// [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
// [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
//
// Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%m/%d/%y')[:END_EVAL:].
// Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
//
#ifndef [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:]
#define [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:]
#endif /* [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:] */

+ 0
- 13
.local/share/vim/templates/skeleton.hpp View File

@ -1,13 +0,0 @@
//
// [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
// [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
//
// Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%m/%d/%y')[:END_EVAL:].
// Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
//
#ifndef [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:]
#define [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:]
#endif /* [:VIM_EVAL:]substitute(expand('%:t'),'\.',"_","")[:END_EVAL:] */

+ 0
- 13
.local/share/vim/templates/skeleton.java View File

@ -1,13 +0,0 @@
home/home/
home/home/ [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
home/home/ [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
home/home/
home/home/ Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%mhome/%dhome/%y')[:END_EVAL:].
home/home/ Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
home/home/
class Untitled {
public static void main(String[] args) {
}
}

+ 0
- 15
.local/share/vim/templates/skeleton.py View File

@ -1,15 +0,0 @@
#!/bin/python
#
# [:VIM_EVAL:]expand('%:t')[:END_EVAL:]
# [:VIM_EVAL:]expand('%:p:h:t')[:END_EVAL:]
#
# Created by Yigit Colakoglu on [:VIM_EVAL:]strftime('%m/%d/%y')[:END_EVAL:].
# Copyright [:VIM_EVAL:]strftime('%Y')[:END_EVAL:]. Yigit Colakoglu. All rights reserved.
#
def main():
print("hello world")
if __name__ == "__main__":
main()

+ 0
- 2
.local/share/vim/templates/skeleton.sh View File

@ -1,2 +0,0 @@
#!/bin/sh

+ 10
- 4
.local/src/dmenu/config.h View File

@ -1,14 +1,20 @@
/* See LICENSE file for copyright and license details. */
/* Default settings; can be overriden by command line. */
/*
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's dmenu config
*/
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */ /* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = { static const char *fonts[] = {
"JoyPixels:pixelsize=8:antialias=true:autohint=true",
"CaskaydiaCove Nerd Font Mono:size=10", "CaskaydiaCove Nerd Font Mono:size=10",
"Symbola:pixelsize=16:antialias=true:autohint=true",
}; };
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *prompt = "Select an option"; /* -p option; prompt to the left of input field */
static const unsigned int min_lineheight = 27; static const unsigned int min_lineheight = 27;
static unsigned int lineheight = 27; static unsigned int lineheight = 27;
static unsigned int fuzzy = 0; static unsigned int fuzzy = 0;


+ 1
- 1
.local/src/dmenu/config.mk View File

@ -25,7 +25,7 @@ LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) -lm -lXrender
# flags # flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS)
CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
CFLAGS = -w -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS)
LDFLAGS = $(LIBS) LDFLAGS = $(LIBS)
# compiler and linker # compiler and linker


+ 162
- 0
.local/src/dmenu/dmenu.c View File

@ -763,6 +763,156 @@ draw:
drawmenu(); drawmenu();
} }
static void
buttonpress(XEvent *e)
{
struct item *item;
XButtonPressedEvent *ev = &e->xbutton;
int x = 0, y = 0, h = bh, w;
if (ev->window != win)
return;
/* right-click: exit */
if (ev->button == Button3)
exit(1);
if (prompt && *prompt)
x += promptw;
/* input field */
w = (lines > 0 || !matches) ? mw - x : inputw;
/* left-click on input: clear input,
* NOTE: if there is no left-arrow the space for < is reserved so
* add that to the input width */
if (ev->button == Button1 &&
((lines <= 0 && ev->x >= 0 && ev->x <= x + w +
((!prev || !curr->left) ? TEXTW("<") : 0)) ||
(lines > 0 && ev->y >= y && ev->y <= y + h))) {
insert(NULL, -cursor);
drawmenu();
return;
}
/* middle-mouse click: paste selection */
if (ev->button == Button2) {
XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY,
utf8, utf8, win, CurrentTime);
drawmenu();
return;
}
/* scroll up */
if (ev->button == Button4 && prev) {
sel = curr = prev;
calcoffsets();
drawmenu();
return;
}
/* scroll down */
if (ev->button == Button5 && next) {
sel = curr = next;
calcoffsets();
drawmenu();
return;
}
if (ev->button != Button1)
return;
/* disabled below, needs to be fixed */
/*
if (ev->state & ~ControlMask)
return;
*/
if (lines > 0) {
/* vertical list: (ctrl)left-click on item */
w = mw - x;
for (item = curr; item != next; item = item->right) {
y += h;
if (ev->y >= y && ev->y <= (y + h)) {
puts(item->text);
if (!(ev->state & ControlMask))
exit(0);
sel = item;
if (sel) {
sel->id = 1;
drawmenu();
}
return;
}
}
} else if (matches) {
/* left-click on left arrow */
x += inputw;
w = TEXTW("<");
if (prev && curr->left) {
if (ev->x >= x && ev->x <= x + w) {
sel = curr = prev;
calcoffsets();
drawmenu();
return;
}
}
/* horizontal list: (ctrl)left-click on item */
for (item = curr; item != next; item = item->right) {
x += w;
w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
if (ev->x >= x && ev->x <= x + w) {
puts(item->text);
if (!(ev->state & ControlMask))
exit(0);
sel = item;
if (sel) {
sel->id = 1;
drawmenu();
}
return;
}
}
/* left-click on right arrow */
w = TEXTW(">");
x = mw - w;
if (next && ev->x >= x && ev->x <= x + w) {
sel = curr = next;
calcoffsets();
drawmenu();
return;
}
}
}
static void
mousemove(XEvent *e)
{
struct item *item;
XPointerMovedEvent *ev = &e->xmotion;
int x = 0, y = 0, h = bh, w;
if (lines > 0) {
w = mw - x;
for (item = curr; item != next; item = item->right) {
y += h;
if (ev->y >= y && ev->y <= (y + h)) {
sel = item;
calcoffsets();
drawmenu();
return;
}
}
} else if (matches) {
x += inputw + promptw;
w = TEXTW("<");
for (item = curr; item != next; item = item->right) {
x += w;
w = MIN(TEXTW(item->text), mw - x - TEXTW(">"));
if (ev->x >= x && ev->x <= x + w) {
sel = item;
calcoffsets();
drawmenu();
return;
}
}
}
}
static void static void
paste(void) paste(void)
{ {
@ -829,6 +979,12 @@ run(void)
break; break;
cleanup(); cleanup();
exit(1); exit(1);
case ButtonPress:
buttonpress(&ev);
break;
case MotionNotify:
mousemove(&ev);
break;
case Expose: case Expose:
if (ev.xexpose.count == 0) if (ev.xexpose.count == 0)
drw_map(drw, win, 0, 0, mw, mh); drw_map(drw, win, 0, 0, mw, mh);
@ -926,6 +1082,12 @@ setup(void)
/* create menu window */ /* create menu window */
swa.override_redirect = True; swa.override_redirect = True;
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask |
ButtonPressMask | PointerMotionMask;
win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
swa.background_pixel = 0; swa.background_pixel = 0;
swa.border_pixel = 0; swa.border_pixel = 0;
swa.colormap = cmap; swa.colormap = cmap;


+ 4
- 0
.local/src/dwm/config.def.h View File

@ -156,7 +156,11 @@ static Key keys[] = {
{ MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } }, { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
{ MODKEY, XK_space, setlayout, {0} }, { MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
<<<<<<<
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
=======
{ MODKEY, XK_s, togglesticky, {0} },
>>>>>>>
{ MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } },


+ 11
- 1
.local/src/dwm/config.h View File

@ -1,4 +1,11 @@
/* See LICENSE file for copyright and license details. */
/*
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's DWM configuration
*/
typedef struct { typedef struct {
const char *name; const char *name;
@ -61,10 +68,13 @@ static Sp scratchpads[] = {
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
static const char *mouse_dmenu[] = {"/home/yigit/.local/bin/mousemenu", NULL};
/* button definitions */ /* button definitions */
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
static Button buttons[] = { static Button buttons[] = {
/* click event mask button function argument */ /* click event mask button function argument */
{ ClkRootWin, 0, Button3, spawn, {.v = mouse_dmenu} },
{ ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, layoutmenu, {0} }, { ClkLtSymbol, 0, Button3, layoutmenu, {0} },
{ ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} }, { ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1} },


+ 12
- 2
.local/src/dwm/dwm.c View File

@ -57,7 +57,7 @@
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
#define ISVISIBLEONTAG(C, T) ((C->tags & T)) #define ISVISIBLEONTAG(C, T) ((C->tags & T))
#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags])
#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags] || C->issticky)
#define LENGTH(X) (sizeof X / sizeof X[0]) #define LENGTH(X) (sizeof X / sizeof X[0])
#define MOUSEMASK (BUTTONMASK|PointerMotionMask) #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
#define WIDTH(X) ((X)->w + 2 * (X)->bw) #define WIDTH(X) ((X)->w + 2 * (X)->bw)
@ -103,7 +103,7 @@ struct Client {
int bw, oldbw; int bw, oldbw;
unsigned int tags; unsigned int tags;
int ignoresizehints; int ignoresizehints;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isterminal, noswallow;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isterminal, noswallow, issticky;
pid_t pid; pid_t pid;
Client *next; Client *next;
Client *snext; Client *snext;
@ -256,6 +256,7 @@ static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg); static void togglefloating(const Arg *arg);
static void togglescratch(const Arg *arg); static void togglescratch(const Arg *arg);
static void togglefullscr(const Arg *arg); static void togglefullscr(const Arg *arg);
static void togglesticky(const Arg *arg);
static void toggletag(const Arg *arg); static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg); static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus); static void unfocus(Client *c, int setfocus);
@ -2487,6 +2488,15 @@ togglescratch(const Arg *arg)
} }
} }
void
togglesticky(const Arg *arg)
{
if (!selmon->sel)
return;
selmon->sel->issticky = !selmon->sel->issticky;
arrange(selmon);
}
void void
toggletag(const Arg *arg) toggletag(const Arg *arg)
{ {


+ 16
- 14
.local/src/dwm/keybinds.h View File

@ -1,11 +1,11 @@
//
// keybinds.h
// dwm
//
// Created by Yigit Colakoglu on 04/12/21.
// Copyright 2021. Yigit Colakoglu. All rights reserved.
//
//
/*
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's DWM keybinds
*/
#include <X11/XF86keysym.h> #include <X11/XF86keysym.h>
#include "movestack.c" #include "movestack.c"
@ -63,12 +63,13 @@ static const char *udevil_umount[] = {"/home/yigit/.local/bin/dmenu-udevil", "-u
static const char *genpwd[] = {"/home/yigit/.local/bin/genpwd", NULL}; static const char *genpwd[] = {"/home/yigit/.local/bin/genpwd", NULL};
static const char *trackpad[] = {"/home/yigit/.local/bin/toggle_touchpad.sh"}; static const char *trackpad[] = {"/home/yigit/.local/bin/toggle_touchpad.sh"};
static const char *bluetooth[] = {"/home/yigit/.local/bin/dmenu-bluetooth", NULL}; static const char *bluetooth[] = {"/home/yigit/.local/bin/dmenu-bluetooth", NULL};
static const char *url[] = {"/home/yigit/.local/bin/dmenu_surf", NULL};
static const char *web[] = {"/home/yigit/.local/bin/dmenu-web", NULL};
static const char *readbook[] = {"/home/yigit/.local/bin/dmenu-books", NULL}; static const char *readbook[] = {"/home/yigit/.local/bin/dmenu-books", NULL};
static const char *emoji[] = {"/home/yigit/.local/bin/dmenu-emoji", NULL};
static const char *xrandr[] = {"/home/yigit/.local/bin/dmenu-xrandr", NULL};
static const char *record[] = {"/home/yigit/.local/bin/dmenu-record", NULL}; static const char *record[] = {"/home/yigit/.local/bin/dmenu-record", NULL};
static const char *edit[] = {"/home/yigit/.local/bin/dmenu-edit", NULL}; static const char *edit[] = {"/home/yigit/.local/bin/dmenu-edit", NULL};
static const char *surf[] = {"/home/yigit/.local/bin/tabbed_surf", NULL}; static const char *surf[] = {"/home/yigit/.local/bin/tabbed_surf", NULL};
static const char *searx[] = {"/home/yigit/.local/bin/dmenu-searx", NULL};
static const char *youtube[] = {"/home/yigit/.local/bin/ytfzf_dmenu", NULL}; static const char *youtube[] = {"/home/yigit/.local/bin/ytfzf_dmenu", NULL};
/* commands */ /* commands */
@ -139,16 +140,17 @@ static Key keys[] = {
{ 0, XF86XK_AudioPlay, spawn, {.v = play } }, { 0, XF86XK_AudioPlay, spawn, {.v = play } },
{ 0, XF86XK_AudioNext, spawn, {.v = next } }, { 0, XF86XK_AudioNext, spawn, {.v = next } },
{ 0, XK_Print, spawn, {.v = screenshot } }, { 0, XK_Print, spawn, {.v = screenshot } },
{ MODKEY|ShiftMask|Mod1Mask, XK_s, togglesticky, { 0 } },
{ MODKEY, XK_Print, spawn, {.v = windowshot } }, { MODKEY, XK_Print, spawn, {.v = windowshot } },
{ MODKEY|Mod1Mask, XK_Print, spawn, {.v = selectshot } }, { MODKEY|Mod1Mask, XK_Print, spawn, {.v = selectshot } },
{ MODKEY|ShiftMask, XK_e, spawn, {.v = simcrop } },
{ MODKEY|ShiftMask, XK_e, spawn, {.v = emoji } },
{ MODKEY|ShiftMask, XK_s, spawn, {.v = xrandr } },
{ MODKEY, XK_e, spawn, {.v = edit} }, { MODKEY, XK_e, spawn, {.v = edit} },
{ MODKEY, XK_u, spawn, {.v = url} },
{ MODKEY, XK_u, spawn, {.v = web} },
{ MODKEY, XK_r, spawn, {.v = readbook} }, { MODKEY, XK_r, spawn, {.v = readbook} },
{ MODKEY|Mod1Mask, XK_r, spawn, {.v = record } }, { MODKEY|Mod1Mask, XK_r, spawn, {.v = record } },
{ MODKEY|ShiftMask, XK_w, spawn, {.v = wallabag} }, { MODKEY|ShiftMask, XK_w, spawn, {.v = wallabag} },
{ MODKEY, XK_w, spawn, {.v = wiki} }, { MODKEY, XK_w, spawn, {.v = wiki} },
{ MODKEY, XK_g, spawn, {.v = searx} },
{ MODKEY, XK_t, spawn, {.v = online_class} }, { MODKEY, XK_t, spawn, {.v = online_class} },
{ MODKEY|ShiftMask, XK_m, spawn, {.v = mconnect} }, { MODKEY|ShiftMask, XK_m, spawn, {.v = mconnect} },
{ MODKEY|ShiftMask, XK_d, spawn, {.v = udevil} }, { MODKEY|ShiftMask, XK_d, spawn, {.v = udevil} },
@ -156,7 +158,7 @@ static Key keys[] = {
{ MODKEY, XK_y, spawn, {.v = youtube} }, { MODKEY, XK_y, spawn, {.v = youtube} },
{ MODKEY|ShiftMask, XK_g, spawn, {.v = grabcolor} }, { MODKEY|ShiftMask, XK_g, spawn, {.v = grabcolor} },
{ MODKEY, XK_s, togglescratch, {.ui = 0 } }, { MODKEY, XK_s, togglescratch, {.ui = 0 } },
{ MODKEY|ShiftMask, XK_s, togglescratch, {.ui = 1 } },
// { MODKEY|ShiftMask, XK_s, togglescratch, {.ui = 1 } },
{ MODKEY, XK_m, togglescratch, {.ui = 2 } }, { MODKEY, XK_m, togglescratch, {.ui = 2 } },
{ MODKEY|ShiftMask, XK_f, togglescratch, {.ui = 3} }, { MODKEY|ShiftMask, XK_f, togglescratch, {.ui = 3} },
{ MODKEY, XK_n, togglescratch, {.ui = 4} }, { MODKEY, XK_n, togglescratch, {.ui = 4} },


+ 8
- 7
.local/src/dwm/rules.h View File

@ -1,10 +1,11 @@
//
// rules.h
// dwm
//
// Created by Yigit Colakoglu on 04/12/21.
// Copyright 2021. Yigit Colakoglu. All rights reserved.
//
/*
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's DWM rules
*/
#ifndef rules_h #ifndef rules_h
#define rules_h #define rules_h


+ 10
- 2
.local/src/dwmblocks/config.h View File

@ -1,3 +1,11 @@
/*
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's DWMBlocks Config
*/
#define PATH(name) "/home/yigit/.local/bin/status-bar/"name #define PATH(name) "/home/yigit/.local/bin/status-bar/"name
@ -11,12 +19,12 @@ static Block blocks[] = {
// { "", PATH("mpc"), 240, 29}, // { "", PATH("mpc"), 240, 29},
{ "", PATH("bluetooth"), 120, 26}, { "", PATH("bluetooth"), 120, 26},
{ "", PATH("mconnect"), 120, 20}, { "", PATH("mconnect"), 120, 20},
// { "", PATH("todo"), 120, 27},
{ "", PATH("todo"), 120, 27},
{ "", PATH("nextcloud"), 600, 25}, { "", PATH("nextcloud"), 600, 25},
{ "", PATH("cpu-temp"), 30, 17}, { "", PATH("cpu-temp"), 30, 17},
{ "", PATH("memory"), 120, 21}, { "", PATH("memory"), 120, 21},
{ "", PATH("weather"), 60, 16}, { "", PATH("weather"), 60, 16},
// { "", PATH("arch"), 120, 15},
{ "", PATH("arch"), 120, 15},
{ "", PATH("volume"), 5, 14}, { "", PATH("volume"), 5, 14},
{ "", PATH("network"), 120, 13}, { "", PATH("network"), 120, 13},
{ "", PATH("battery"), 60, 12}, { "", PATH("battery"), 60, 12},


+ 12
- 134
.local/src/st/config.h View File

@ -1,28 +1,23 @@
/* See LICENSE file for copyright and license details. */
/* /*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
__ _______ _____ _____
\ \ / / ____| ____|_ _|
\ V /| _| | _| | |
| | | |___| |___ | |
|_| |_____|_____| |_|
Yeet's st config
*/
static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:autohint=true"; static char *font = "CaskaydiaCove Nerd Font Mono:pixelsize=16:antialias=true:autohint=true";
static char *font2[] = { static char *font2[] = {
"Symbola:pixelsize=16:antialias=true:autohint=true",
"Joypixels:pixelsize=16:antialias=true:autohint=true",
}; };
char *iso14755_cmd = "cat /home/yigit/.local/share/nerdfont_icons | dmenu -w \"$WINDOWID\" -p \"Select icon\" -l 10 | cut -d\"(\" -f2 | cut -c 1-4";
char *iso14755_cmd = "dmenu -w \"$WINDOWID\" -p \"Enter unicode\"";
static int borderpx = 2; static int borderpx = 2;
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
* 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/zsh"; static char *shell = "/bin/zsh";
char *utmp = NULL; char *utmp = NULL;
/* scroll program: to enable use a string like "scroll" */ /* scroll program: to enable use a string like "scroll" */
char *scroll = "scroll"; char *scroll = "scroll";
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
@ -36,11 +31,6 @@ char *vtiden = "\033[?6c";
static float cwscale = 1.0; static float cwscale = 1.0;
static float chscale = 1.0; static float chscale = 1.0;
/*
* word delimiter string
*
* More advanced example: L" `'\"()[]{}"
*/
wchar_t *worddelimiters = L" "; wchar_t *worddelimiters = L" ";
/* selection timeouts (in milliseconds) */ /* selection timeouts (in milliseconds) */
@ -54,50 +44,15 @@ int allowaltscreen = 1;
setting the clipboard text */ setting the clipboard text */
int allowwindowops = 0; int allowwindowops = 0;
/*
* draw latency range in ms - from new content/keypress/etc until drawing.
* within this range, st draws when content stops arriving (idle). mostly it's
* near minlatency, but it waits longer for slow updates to avoid partial draw.
* low minlatency will tear/flicker more, as it can "detect" idle too early.
*/
static double minlatency = 8; static double minlatency = 8;
static double maxlatency = 33; static double maxlatency = 33;
/*
* blinking timeout (set to 0 to disable blinking) for the terminal blinking
* attribute.
*/
static unsigned int blinktimeout = 800; static unsigned int blinktimeout = 800;
/*
* thickness of underline and bar cursors
*/
static unsigned int cursorthickness = 2; static unsigned int cursorthickness = 2;
/*
* bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it
*/
static int bellvolume = 0; static int bellvolume = 0;
/* default TERM value */
char *termname = "st-256color"; char *termname = "st-256color";
/*
* spaces per tab
*
* When you are changing this value, don't forget to adapt the »it« value in
* the st.info and appropriately install the st.info in the environment where
* you use this st version.
*
* it#$tabspaces,
*
* Secondly make sure your kernel is not expanding tabs. When running `stty
* -a` »tab0« should appear. You can tell the terminal to not expand tabs by
* running following command:
*
* stty tabs
*/
unsigned int tabspaces = 8; unsigned int tabspaces = 8;
static const char *colorname[] = { static const char *colorname[] = {
@ -129,10 +84,6 @@ static const char *colorname[] = {
/* More special colors */ /* More special colors */
}; };
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 257; unsigned int defaultfg = 257;
unsigned int defaultbg = 256; unsigned int defaultbg = 256;
unsigned int bg = 256, bgUnfocused = 256; unsigned int bg = 256, bgUnfocused = 256;
@ -142,46 +93,19 @@ static unsigned int defaultrcs = 256;
static unsigned int defaultitalic = 7; static unsigned int defaultitalic = 7;
static unsigned int defaultunderline = 7; static unsigned int defaultunderline = 7;
/*
* Default shape of cursor
* 2: Block ("")
* 4: Underline ("_")
* 6: Bar ("|")
* 7: Snowman ("")
*/
static unsigned int cursorshape = 0; static unsigned int cursorshape = 0;
/*
* Default columns and rows numbers
*/
static unsigned int cols = 80; static unsigned int cols = 80;
static unsigned int rows = 24; static unsigned int rows = 24;
/*
* Default colour and shape of the mouse cursor
*/
static unsigned int mouseshape = XC_xterm; static unsigned int mouseshape = XC_xterm;
static unsigned int mousefg = 7; static unsigned int mousefg = 7;
static unsigned int mousebg = 0; static unsigned int mousebg = 0;
/*
* Color used to display font attributes when fontconfig selected a font which
* doesn't match the ones requested.
*/
static unsigned int defaultattr = 11; static unsigned int defaultattr = 11;
/*
* Force mouse select/shortcuts while mask is active (when MODE_MOUSE is set).
* Note that if you want to use ShiftMask with selmasks, set this to an other
* modifier, set to 0 to not use it.
*/
static uint forcemousemod = ShiftMask; static uint forcemousemod = ShiftMask;
/*
* Internal mouse shortcuts.
* Beware that overloading Button1 will disable the selection.
*/
static MouseShortcut mshortcuts[] = { static MouseShortcut mshortcuts[] = {
/* mask button function argument release */ /* mask button function argument release */
{ XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
@ -233,44 +157,10 @@ static Shortcut shortcuts[] = {
{ MODKEY, XK_a, changealpha, {.f = +0.05} }, { MODKEY, XK_a, changealpha, {.f = +0.05} },
}; };
/*
* Special keys (change & recompile st.info accordingly)
*
* Mask value:
* * Use XK_ANY_MOD to match the key no matter modifiers state
* * Use XK_NO_MOD to match the key alone (no modifiers)
* appkey value:
* * 0: no value
* * > 0: keypad application mode enabled
* * = 2: term.numlock = 1
* * < 0: keypad application mode disabled
* appcursor value:
* * 0: no value
* * > 0: cursor application mode enabled
* * < 0: cursor application mode disabled
*
* Be careful with the order of the definitions because st searches in
* this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
* If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
* to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 }; static KeySym mappedkeys[] = { -1 };
/*
* State bits to ignore when matching key or button events. By default,
* numlock (Mod2Mask) and keyboard layout (XK_SWITCH_MOD) are ignored.
*/
static uint ignoremod = Mod2Mask|XK_SWITCH_MOD; static uint ignoremod = Mod2Mask|XK_SWITCH_MOD;
/*
* This is the huge key array which defines all compatibility to the Linux
* world. Please decide about changes wisely.
*/
static Key key[] = { static Key key[] = {
/* keysym mask string appkey appcursor */ /* keysym mask string appkey appcursor */
{ XK_KP_Home, ShiftMask, "\033[2J", 0, -1}, { XK_KP_Home, ShiftMask, "\033[2J", 0, -1},
@ -329,8 +219,7 @@ static Key key[] = {
{ XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0}, { XK_KP_8, XK_ANY_MOD, "\033Ox", +2, 0},
{ XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0}, { XK_KP_9, XK_ANY_MOD, "\033Oy", +2, 0},
{ XK_Up, ShiftMask, "\033[1;2A", 0, 0}, { XK_Up, ShiftMask, "\033[1;2A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0},
{ XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, Mod1Mask, "\033[1;3A", 0, 0}, { XK_Up, ShiftMask|Mod1Mask,"\033[1;4A", 0, 0},
{ XK_Up, ControlMask, "\033[1;5A", 0, 0}, { XK_Up, ControlMask, "\033[1;5A", 0, 0},
{ XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0}, { XK_Up, ShiftMask|ControlMask,"\033[1;6A", 0, 0},
{ XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0}, { XK_Up, ControlMask|Mod1Mask,"\033[1;7A", 0, 0},
@ -484,21 +373,10 @@ static Key key[] = {
{ XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0}, { XK_F35, XK_NO_MOD, "\033[23;5~", 0, 0},
}; };
/*
* Selection types' masks.
* Use the same masks as usual.
* Button1Mask is always unset, to make masks match between ButtonPress.
* ButtonRelease and MotionNotify.
* If no match is found, regular selection is used.
*/
static uint selmasks[] = { static uint selmasks[] = {
[SEL_RECTANGULAR] = Mod1Mask, [SEL_RECTANGULAR] = Mod1Mask,
}; };
/*
* Printable characters in ASCII, used to estimate the advance width
* of single wide characters.
*/
static char ascii_printable[] = static char ascii_printable[] =
" !\"#$%&'()*+,-./0123456789:;<=>?" " !\"#$%&'()*+,-./0123456789:;<=>?"
"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"


BIN
.local/src/st/st View File


BIN
.local/src/st/st.o View File


BIN
.local/src/st/x.o View File


+ 10
- 3
.profile View File

@ -1,5 +1,12 @@
#!/bin/bash #!/bin/bash
## __ _______ _____ _____
## \ \ / / ____| ____|_ _|
## \ V /| _| | _| | |
## | | | |___| |___ | |
## |_| |_____|_____| |_|
## .profile
# Vars for some bugs and applications # Vars for some bugs and applications
export QT_QPA_PLATFORMTHEME="qt5ct" export QT_QPA_PLATFORMTHEME="qt5ct"
export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_AWT_WM_NONREPARENTING=1
@ -25,6 +32,7 @@ export HISTFILE="$XDG_DATA_HOME"/history
export TMUX_PLUGIN_MANAGER_PATH="$XDG_DATA_HOME"/tmux/plugins export TMUX_PLUGIN_MANAGER_PATH="$XDG_DATA_HOME"/tmux/plugins
export BORG_KEYS_DIR="$XDG_DATA_HOME"/keys/borg export BORG_KEYS_DIR="$XDG_DATA_HOME"/keys/borg
export CARGO_HOME="$XDG_DATA_HOME"/cargo export CARGO_HOME="$XDG_DATA_HOME"/cargo
export DOOMDIR="$XDG_CONFIG_HOME"/doom
export GOPATH="$XDG_DATA_HOME"/go export GOPATH="$XDG_DATA_HOME"/go
export ANDROID_HOME="$XDG_DATA_HOME"/Sdk export ANDROID_HOME="$XDG_DATA_HOME"/Sdk
export FLUTTER_HOME="$XDG_DATA_HOME"/flutter export FLUTTER_HOME="$XDG_DATA_HOME"/flutter
@ -48,7 +56,7 @@ export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter
export PYLINTHOME="$XDG_CACHE_HOME"/pylint export PYLINTHOME="$XDG_CACHE_HOME"/pylint
export WGETRC="$XDG_CONFIG_HOME/wgetrc" export WGETRC="$XDG_CONFIG_HOME/wgetrc"
export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
# export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
export RANDFILE="$XDG_DATA_HOME"/openssl/rnd export RANDFILE="$XDG_DATA_HOME"/openssl/rnd
export _Z_DATA="$XDG_DATA_HOME/z" export _Z_DATA="$XDG_DATA_HOME/z"
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
@ -93,8 +101,7 @@ fi
# Start xinit if logged in from tty1 # Start xinit if logged in from tty1
if [ "$DISPLAY" = "" ] && [ "$(tty)" = /dev/tty1 ]; then if [ "$DISPLAY" = "" ] && [ "$(tty)" = /dev/tty1 ]; then
if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ] && [ ! $(command -v dbus-run-session) = "" ]; then if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ] && [ ! $(command -v dbus-run-session) = "" ]; then
# exec dbus-run-session xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
exec xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
exec dbus-run-session xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
else else
exec xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit exec xinit 2> $XDG_RUNTIME_DIR/xinit.err > $XDG_RUNTIME_DIR/xinit
fi fi


Loading…
Cancel
Save