updating for better ook

This commit is contained in:
tavo-wasd 2024-07-11 12:00:51 -06:00
parent a9fa989189
commit 8f8b576bfb
7 changed files with 206 additions and 208 deletions

View file

@ -12,7 +12,19 @@
; (shell-command "find ~/.config/emacs/elpa/gnupg -type f -exec chmod 600 {} \;")) ; (shell-command "find ~/.config/emacs/elpa/gnupg -type f -exec chmod 600 {} \;"))
;; --- ;; ---
;; --- Preferences --- ;; --- Customization
(defvar custom-font "JetBrains Mono-10.5")
(defvar custom-theme 'doom-gruvbox)
(custom-set-faces
;; '(hl-line ((t (:background "gray20" :underline nil))))
'(mode-line-inactive ((t (:background "#282828" :foreground "#504945" :box nil))))
'(mode-line ((t (:background "#282828" :foreground "#a89984" :box nil))))
'(org-block ((t (:background "#282828"))))
'(org-quote ((t (:background "#282828"))))
'(default ((t (:background "#1d2021")))))
;; --- Global Preferences ---
(setq custom-file (concat user-emacs-directory "custom.el")) (setq custom-file (concat user-emacs-directory "custom.el"))
(load custom-file 'noerror) (load custom-file 'noerror)
(setq warning-minimum-level :error) (setq warning-minimum-level :error)
@ -24,10 +36,6 @@
(setq-default display-line-numbers-width 3) (setq-default display-line-numbers-width 3)
(delete-selection-mode 1) (delete-selection-mode 1)
(electric-indent-mode 0) (electric-indent-mode 0)
(add-hook 'org-mode-hook (lambda ()
(setq-local electric-pair-inhibit-predicate
`(lambda (c)
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))))
(global-hl-line-mode 1) (global-hl-line-mode 1)
(electric-pair-mode 1) (electric-pair-mode 1)
(column-number-mode) (column-number-mode)
@ -51,7 +59,6 @@
shell-mode-hook shell-mode-hook
eshell-mode-hook)) eshell-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0)))) (add-hook mode (lambda () (display-line-numbers-mode 0))))
;; ---
;; --- Package manager --- ;; --- Package manager ---
(require 'package) (require 'package)
@ -75,65 +82,51 @@
(dolist (pkg '(all-the-icons nerd-icons markdown-mode markdown-preview-mode)) (dolist (pkg '(all-the-icons nerd-icons markdown-mode markdown-preview-mode))
(unless (package-installed-p pkg) (unless (package-installed-p pkg)
(package-install pkg))) (package-install pkg)))
;; ---
;; --- Theming --- ;; --- my/functions ---
(if (eq system-type 'android) (defun my/visual-fill ()
(set-face-attribute 'default nil :height 140) ;; Android (setq visual-fill-column-width 100
(progn ;; Everywhere else visual-fill-column-center-text t)
(set-face-attribute 'default nil :font "JetBrains Mono") (visual-fill-column-mode 1))
(add-to-list 'default-frame-alist '(font . "JetBrains Mono-10.5"))))
(use-package doom-themes (defun my/hide-modeline ()
:init (load-theme 'doom-gruvbox t)) (setq-local mode-line-format nil))
(custom-set-faces (defun my/insert-latex-equation ()
'(default ((t (:background "#1d2021")))) "Insert a LaTeX equation environment."
'(org-block ((t (:background "#282828")))) (interactive)
'(org-quote ((t (:background "#282828"))))) (insert "\\begin{equation}\\label{}\\begin{aligned}\n\n\\end{aligned}\\end{equation}")
(backward-char 28))
(custom-set-faces (defun my/org-open-pdf-in-zathura ()
'(mode-line ((t (:background "#282828" :foreground "#a89984" :box nil)))) "Open the corresponding PDF file in Zathura for the current Org document."
'(mode-line-inactive ((t (:background "#282828" :foreground "#504945" :box nil))))) (interactive)
(when (and (buffer-file-name)
(string-equal (file-name-extension (buffer-file-name)) "org"))
(let* ((org-file (buffer-file-name))
(pdf-file (concat (file-name-sans-extension org-file) ".pdf"))
(pdf-file (expand-file-name pdf-file)))
(if (file-exists-p pdf-file)
(shell-command (concat "zathura " (shell-quote-argument pdf-file)))
(message "PDF file does not exist: %s" pdf-file)))))
(custom-set-faces (defun org-babel-execute:pic (body params)
'(centaur-tabs-selected ((t (:background "#282828" :foreground "#a89984" :box nil)))) "Evaluate pic source code to create a png file
'(centaur-tabs-unselected ((t (:background "#1d2021" :foreground "#504945" :box nil)))) Use with: '#+begin_src pic :file example.png'
) Optional: ':exports none' to avoid showing the source
Optional: ':results silent' to avoid outputting #+RESULTS:"
;; (custom-set-faces (or (cdr (assoc :file params))
;; '(hl-line ((t (:background "gray20" :underline nil))))) (error "You must specify output file :file [IMAGE.png]"))
;; --- (let* ((quoted-text (replace-regexp-in-string "'" "'\\\\''" body))
(body-with-v (replace-regexp-in-string "\\\\v" "VERTICAL" quoted-text))
(use-package paren :ensure nil (cmd (concat "echo '" body-with-v "' | "
:init (setq show-paren-delay 0) "preconv | sed \'s/VERTICAL/\\\\v/g\' | "
:config (show-paren-mode +1)) "pic2graph -density 200 2>/dev/null"))
(image (shell-command-to-string cmd)))
(use-package dashboard image))
:ensure t (setq org-babel-default-header-args:pic '((:results . "file")))
:init
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(if (eq system-type 'android)
(progn ;; Android
(setq dashboard-startupify-list '(dashboard-insert-banner dashboard-insert-items))
(setq dashboard-startup-banner "~/.config/emacs/banner.txt"))
(progn ;; Everywhere else
(setq dashboard-startupify-list '(dashboard-insert-banner
dashboard-insert-banner-title
dashboard-insert-items))
(setq dashboard-startup-banner "~/.config/emacs/banner.txt")
(setq dashboard-banner-logo-title "✨ M'illumino d'immenso ✨")))
(setq dashboard-items '((agenda . 5)
(bookmarks . 5)
(recents . 20)))
:config
(dashboard-setup-startup-hook))
(setq initial-buffer-choice (lambda () (get-buffer-create dashboard-buffer-name)))
;; --- Modes
(use-package evil (use-package evil
:init :init
(setq evil-want-integration t (setq evil-want-integration t
@ -143,35 +136,26 @@
evil-undo-system 'undo-redo) evil-undo-system 'undo-redo)
:config :config
(evil-mode 1)) (evil-mode 1))
(use-package evil-collection (use-package evil-collection
:after evil :after evil
:config :config
(evil-collection-init)) (evil-collection-init))
(if (eq system-type 'android) (use-package dashboard
(message "Android device, ignoring centaur-tabs") ;; Android :ensure t
(progn ;; Everywhere else :init
(use-package centaur-tabs (setq dashboard-startup-banner "~/.config/emacs/banner.txt")
:demand (setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-items '((agenda . 5) (bookmarks . 5) (recents . 20)))
(setq dashboard-startupify-list '(dashboard-insert-banner dashboard-insert-items))
:config :config
(centaur-tabs-mode t) (dashboard-setup-startup-hook))
:bind (setq initial-buffer-choice (lambda () (get-buffer-create dashboard-buffer-name)))
("C-<iso-lefttab>" . centaur-tabs-backward)
("C-<tab>" . centaur-tabs-forward))
(setq centaur-tabs-cycle-scope 'tabs)
(setq centaur-tabs-set-modified-marker t)
(setq centaur-tabs-modified-marker "*")
(add-hook 'pdf-view-mode-hook 'centaur-tabs-local-mode)))
(add-hook 'dashboard-mode-hook 'centaur-tabs-local-mode)
(add-hook 'dashboard-mode-hook 'my/visual-fill) (add-hook 'dashboard-mode-hook 'my/visual-fill)
(add-hook 'org-agenda-mode-hook 'centaur-tabs-local-mode)
(add-hook 'dired-mode-hook 'centaur-tabs-local-mode)
(defun my/hide-modeline ()
(setq-local mode-line-format nil))
(add-hook 'dashboard-mode-hook 'my/hide-modeline) (add-hook 'dashboard-mode-hook 'my/hide-modeline)
(add-hook 'server-after-make-frame-hook 'dashboard-refresh-buffer)
(if (eq system-type 'android) (if (eq system-type 'android)
(message "Android device, ignoring visual-fill") ;; Android (message "Android device, ignoring visual-fill") ;; Android
@ -190,19 +174,68 @@
(add-hook 'pdf-view-mode-hook #'(lambda () (interactive) (display-line-numbers-mode 0))) (add-hook 'pdf-view-mode-hook #'(lambda () (interactive) (display-line-numbers-mode 0)))
(add-hook 'pdf-view-mode-hook 'my/hide-modeline))) (add-hook 'pdf-view-mode-hook 'my/hide-modeline)))
(use-package which-key (use-package dired
:ensure nil
:commands (dired dired-jump)
:bind (("C-x C-j" . dired-jump))
:custom ((dired-listing-switches "-AghoD --group-directories-first --color=auto --time-style=iso"))
:config :config
(setq which-key-idle-delay 0) (evil-collection-define-key 'normal 'dired-mode-map
(which-key-mode)) "h" 'dired-single-up-directory
"l" 'dired-single-buffer))
(use-package dired-single)
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
(use-package dired-open
:config
;; Doesn't work as expected!
;;(add-to-list 'dired-open-functions #'dired-open-xdg t)
(setq dired-open-extensions '(("png" . "sxiv")
("jpg" . "sxiv")
("gif" . "sxiv")
("webp" . "sxiv")
("pdf" . "zathura")
("mp4" . "mpv")
("mkv" . "mpv"))))
(use-package dired-hide-dotfiles
:hook (dired-mode . dired-hide-dotfiles-mode)
:config
(evil-collection-define-key 'normal 'dired-mode-map
"." 'dired-hide-dotfiles-mode))
(if (eq system-type 'android)
(set-face-attribute 'default nil :height 140) ;; Android
(progn ;; Everywhere else
(set-face-attribute 'default nil :font custom-font)
(add-to-list 'default-frame-alist `(font . ,custom-font))))
(use-package doom-themes
:init (load-theme custom-theme t))
;; --- Org Mode --- ;; --- Org Mode ---
(setq org-startup-folded t) (setq org-startup-folded t)
(require 'org-tempo) (require 'org-tempo)
(setq org-src-preserve-indentation t
org-edit-src-content-indentation 0
org-confirm-babel-evaluate nil)
(require 'ob) (require 'ob)
(setq org-babel-load-languages '((pic . t)))
(add-to-list 'org-babel-tangle-lang-exts '("pic" . "pic")) (add-to-list 'org-babel-tangle-lang-exts '("pic" . "pic"))
(if (eq system-type 'android)
(message "Android device, ignoring visual-fill") ;; Android
(add-hook 'org-mode-hook 'my/visual-fill)) ;; Everywhere else
(add-hook 'org-mode-hook
(lambda ()
(setq-local electric-pair-inhibit-predicate
`(lambda (c)
(if (char-equal c ?<) t (,electric-pair-inhibit-predicate c))))
(setq-local org-src-tab-acts-natively t org-src-tab-indentation 4)
(local-set-key (kbd "C-c e") 'my/insert-latex-equation)))
(use-package org-bullets) (use-package org-bullets)
(custom-set-faces (custom-set-faces
'(org-level-1 ((t (:inherit outline-1 :height 1.7)))) '(org-level-1 ((t (:inherit outline-1 :height 1.7))))
@ -210,22 +243,6 @@
'(org-level-3 ((t (:inherit outline-3 :height 1.3)))) '(org-level-3 ((t (:inherit outline-3 :height 1.3))))
'(org-level-4 ((t (:inherit outline-4 :height 1.1))))) '(org-level-4 ((t (:inherit outline-4 :height 1.1)))))
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.35))
(setq org-latex-toc-command "\\clearpage \\tableofcontents \\clearpage")
(setq org-highlight-latex-and-related '(latex script entities))
;; (setq org-startup-with-latex-preview t)
(defun my/visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(if (eq system-type 'android)
(message "Android device, ignoring visual-fill") ;; Android
(progn ;; Everywhere else
(use-package visual-fill-column
:hook (org-mode . my/visual-fill))))
(if (eq system-type 'android) (if (eq system-type 'android)
(progn ;; Android custom org-latex-preview (progn ;; Android custom org-latex-preview
(setq org-format-latex-options (plist-put org-format-latex-options :scale 100)) (setq org-format-latex-options (plist-put org-format-latex-options :scale 100))
@ -246,79 +263,17 @@
(use-package citeproc) (use-package citeproc)
(require 'oc-csl))) (require 'oc-csl)))
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.35))
(setq org-latex-toc-command "\\clearpage \\tableofcontents \\clearpage")
(setq org-highlight-latex-and-related '(latex script entities))
;; (setq org-startup-with-latex-preview t)
(unless (file-directory-p "~/.local/share/emacs/ltximg/") (unless (file-directory-p "~/.local/share/emacs/ltximg/")
(make-directory "~/.local/share/emacs/ltximg/")) (make-directory "~/.local/share/emacs/ltximg/"))
(setq org-preview-latex-image-directory "~/.local/share/emacs/ltximg/") (setq org-preview-latex-image-directory "~/.local/share/emacs/ltximg/")
(defun insert-latex-equation ()
"Insert a LaTeX equation environment."
(interactive)
(insert "\\begin{equation}\\label{}\\begin{aligned}\n\n\\end{aligned}\\end{equation}")
(backward-char 28))
(add-hook 'org-mode-hook
(lambda ()
(local-set-key (kbd "C-c e") 'insert-latex-equation)))
;; Use with: '#+begin_src pic :results file'
;; Optional: ':exports none' to avoid showing the source
(defun org-babel-execute:pic (body params)
(let* ((tmpfile (org-babel-temp-file "pic-" ".png"))
(quoted-text (replace-regexp-in-string "'" "'\\\\''" body))
(body-with-v (replace-regexp-in-string "\\\\v" "VERTICAL" quoted-text))
(cmd (concat "echo '" body-with-v "' | preconv | sed \'s/VERTICAL/\\\\v/g\' | pic2graph -density 200 > " tmpfile)))
(shell-command cmd)
tmpfile))
(setq org-src-preserve-indentation t
org-edit-src-content-indentation 0
org-confirm-babel-evaluate nil)
(add-hook 'org-mode-hook
(lambda ()
(setq-local org-src-tab-acts-natively t
org-src-tab-indentation 4)))
;; ---
;; --- dired ---
(use-package dired
:ensure nil
:commands (dired dired-jump)
:bind (("C-x C-j" . dired-jump))
:custom ((dired-listing-switches "-AghoD --group-directories-first --color=auto --time-style=iso"))
:config
(evil-collection-define-key 'normal 'dired-mode-map
"h" 'dired-single-up-directory
"l" 'dired-single-buffer))
(use-package dired-single)
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
(use-package dired-open
:config
;; Doesn't work as expected!
;;(add-to-list 'dired-open-functions #'dired-open-xdg t)
(setq dired-open-extensions '(("png" . "sxiv")
("jpg" . "sxiv")
("gif" . "sxiv")
("webp" . "sxiv")
("pdf" . "zathura")
("mp4" . "mpv")
("mkv" . "mpv"))))
(use-package dired-hide-dotfiles
:hook (dired-mode . dired-hide-dotfiles-mode)
:config
(evil-collection-define-key 'normal 'dired-mode-map
"H" 'dired-hide-dotfiles-mode))
;; ---
;; --- Org Agenda ---
(setq org-agenda-files (quote ("~/Documents/agenda/archive.org" (setq org-agenda-files (quote ("~/Documents/agenda/archive.org"
"~/Documents/agenda/agenda.org"))) "~/Documents/agenda/agenda.org")))
;; ---
;; --- Keybinds --- ;; --- Keybinds ---
(use-package general (use-package general
@ -331,7 +286,8 @@
:global-prefix "M-SPC") :global-prefix "M-SPC")
(my/leader-keys (my/leader-keys
"c" '(comment-line :wk "Comment lines") "c" '(comment-line :wk "Comment lines")
"p" 'org-latex-preview)) "p" 'org-latex-preview
"b" 'buffer-menu))
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(global-set-key (kbd "C-=") 'text-scale-increase) (global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C-+") 'text-scale-increase) (global-set-key (kbd "C-+") 'text-scale-increase)
@ -342,7 +298,6 @@
(define-key evil-motion-state-map (kbd "RET") nil) (define-key evil-motion-state-map (kbd "RET") nil)
(define-key evil-motion-state-map (kbd "TAB") nil)) (define-key evil-motion-state-map (kbd "TAB") nil))
(setq org-return-follows-link t) (setq org-return-follows-link t)
;; ---
(if (eq system-type 'android) (if (eq system-type 'android)
(progn (progn
@ -354,6 +309,6 @@
(if (string-equal system-type "android") (if (string-equal system-type "android")
(exec-path-from-shell-initialize))))) (exec-path-from-shell-initialize)))))
(add-hook 'server-after-make-frame-hook 'dashboard-refresh-buffer)
(message "init.el loaded successfully") (message "init.el loaded successfully")
;; init.el ends here ;; init.el ends here

View file

@ -19,20 +19,34 @@ grep -rq 'Charging' /sys/class/power_supply/BAT* 2>/dev/null && stat='Charging'
# Get graphical battery level # Get graphical battery level
case 1 in case 1 in
$((bat >= 98)) ) bar="━━━━━━━━━━" ;; $((bat >= 98)) ) icon="󰁹" ;;
$((bat >= 90)) ) bar="━━━━━━━━━─" ;; $((bat >= 90)) ) icon="󰂂" ;;
$((bat >= 80)) ) bar="━━━━━━━━──" ;; $((bat >= 80)) ) icon="󰂁" ;;
$((bat >= 70)) ) bar="━━━━━━━───" ;; $((bat >= 70)) ) icon="󰂀" ;;
$((bat >= 60)) ) bar="━━━━━━────" ;; $((bat >= 60)) ) icon="󰁿" ;;
$((bat >= 50)) ) bar="━━━━━─────" ;; $((bat >= 50)) ) icon="󰁾" ;;
$((bat >= 40)) ) bar="━━━━──────" ;; $((bat >= 40)) ) icon="󰁽" ;;
$((bat >= 30)) ) bar="━━━───────" ;; $((bat >= 30)) ) icon="󰁼" ;;
$((bat >= 20)) ) bar="━━────────" ;; $((bat >= 20)) ) icon="󰁻" ;;
$((bat >= 10)) ) bar="━─────────" ;; $((bat >= 10)) ) icon="󰁺" ;;
$((bat >= 10)) ) bar="──────────" ;; $((bat >= 0)) ) icon="󰂎" ;;
esac esac
# Charging indicator if status file indicates such state # Charging indicator if status file indicates such state
[ "$stat" != "Charging" ] && icon="󰁹" || icon="" if [ "$stat" = "Charging" ] ; then
echo "$icon $bar" icon="$(printf '%s' "$icon" | sed '
s/󰁹/󰂅/;
s/󰂂/󰂋/;
s/󰂁/󰂊/;
s/󰂀/󰢞/;
s/󰁿/󰂉/;
s/󰁾/󰢝/;
s/󰁽/󰂈/;
s/󰁼/󰂇/;
s/󰁻/󰂆/;
s/󰁺/󰢜/;
s/󰂎/󰢟/;
')"
fi
echo "$icon"

View file

@ -7,7 +7,7 @@ vol=$(amixer | grep "Capture" | grep -m 1 -o '[0-9]*[0-9]%')
vol="${vol%\%*}" # Remove percentage sign vol="${vol%\%*}" # Remove percentage sign
# If device is off (muted), notify mute, print volume otherwise # If device is off (muted), notify mute, print volume otherwise
if amixer scontents | grep "Capture" | grep -q "\[off\]"; then echo " ──────────" && exit ; fi if amixer scontents | grep "Capture" | grep -q "\[off\]"; then echo "󰍭 ──────────" && exit ; fi
# Define bar progress with volume # Define bar progress with volume
case 1 in case 1 in

View file

@ -9,38 +9,40 @@ int() { # Type of interface & status
if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then if grep -xq 'up' /sys/class/net/w*/operstate 2>/dev/null ; then
strength="$(awk 'NR==3 {printf("%.0f\n",$3*10/7)}' /proc/net/wireless)" strength="$(awk 'NR==3 {printf("%.0f\n",$3*10/7)}' /proc/net/wireless)"
case 1 in case 1 in
$((strength >= 100)) ) bar="━━━━━━━━━━" ;; $((strength >= 85)) ) icon="󰤨" ;;
$((strength >= 90)) ) bar="━━━━━━━━━─" ;; $((strength >= 65)) ) icon="󰤥" ;;
$((strength >= 80)) ) bar="━━━━━━━━──" ;; $((strength >= 45)) ) icon="󰤢" ;;
$((strength >= 70)) ) bar="━━━━━━━───" ;; $((strength >= 25)) ) icon="󰤟" ;;
$((strength >= 60)) ) bar="━━━━━━────" ;; $((strength >= 0)) ) icon="󰤯" ;;
$((strength >= 50)) ) bar="━━━━━─────" ;;
$((strength >= 40)) ) bar="━━━━──────" ;;
$((strength >= 30)) ) bar="━━━───────" ;;
$((strength >= 20)) ) bar="━━────────" ;;
$((strength >= 10)) ) bar="━─────────" ;;
$((strength >= 0)) ) bar="──────────" ;;
esac esac
echo "󰖩 $bar" echo "$icon"
return 0 return 0
fi fi
# If down interfaces, exit with icon # If down interfaces, exit with icon
grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null && echo "󰖪 ──────────" && return 0 grep -xq 'down' /sys/class/net/w*/operstate 2>/dev/null && echo "󰤮" && return 0
grep -xq 'down' /sys/class/net/e*/operstate 2>/dev/null && echo "󰲛" && return 0 grep -xq 'down' /sys/class/net/e*/operstate 2>/dev/null && echo "󰲛" && return 0
} }
# Run 'int' # Run 'int'
info=$(int) icon=$(int)
# Check if a VPN is enabled # Check if a VPN is enabled
vpn="$( \ vpn="$( \
sed "s/.*//" /sys/class/net/tun*/operstate 2>/dev/null sed "s/.*//" /sys/class/net/tun*/operstate 2>/dev/null
sed "s/.*//" /sys/class/net/wg*/operstate 2>/dev/null \ sed "s/.*//" /sys/class/net/wg*/operstate 2>/dev/null \
)" )"
# If so, change icon # If so, change icon
[ -n "$vpn" ] && info="$(printf "$info" | sed 's/󰛳//' | sed 's/󰖩//')" if [ -n "$vpn" ] ; then
icon="$(printf '%s' "$icon" | sed '
s/󰤨/󰤪/;
s/󰤥/󰤧/;
s/󰤢/󰤤/;
s/󰤟/󰤡/;
s/󰤯/󰤬/;
')"
fi
# Print $info # Print $info
printf "%s" "$info" printf "%s" "$icon"

View file

@ -55,7 +55,7 @@ short_time() {
short_path() { short_path() {
curr_path="$(pwd | sed 's/\/data\/data\/com.termux\/files\/home/~/g;s/\/home\/[A-Za-z]*/~/g')" curr_path="$(pwd | sed 's/\/data\/data\/com.termux\/files\/home/~/g;s/\/home\/[A-Za-z]*/~/g')"
if [ "${#curr_path}" -gt 25 ] ; then if [ "${#curr_path}" -gt 10 ] ; then
curr_path="${curr_path##*/}" curr_path="${curr_path##*/}"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then
curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)" curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)"
@ -71,11 +71,15 @@ short_path() {
printf '%s' "$curr_path" printf '%s' "$curr_path"
} }
[ -e "/data/data/com.termux" ] && HOSTNAME=""
[ "${HOSTNAME:=$(hostname -s)}" = "laptop" ] && HOSTNAME="󰌢"
[ "${HOSTNAME:=$(hostname -s)}" = "desktop" ] && HOSTNAME="󰇅"
PS1=' PS1='
$(tput setaf 240)╭─$(tput setaf 7)$(tput setab 7)$(tput setaf 238)$?\ $(tput setaf 240)╭─$(tput setaf 7)$(tput setab 7)$(tput setaf 238)$?\
$(tput setaf 7)$(tput setab 108)\ $(tput setaf 7)$(tput setab 108)\
$(tput setaf 235)$(tput setab 108) \ $(tput setaf 235)$(tput setab 108) \
${USER:=$(id -un)}@${HOSTNAME:=$(hostname -s)} \ ${HOSTNAME} \
$(tput setaf 108)$(tput setab 66)\ $(tput setaf 108)$(tput setab 66)\
$(tput setab 66)$(tput setaf 235)$(short_path) $(tput sgr0)\ $(tput setab 66)$(tput setaf 235)$(short_path) $(tput sgr0)\
$(tput setaf 66)\ $(tput setaf 66)\

View file

@ -40,7 +40,7 @@ short_time() {
short_path() { short_path() {
curr_path="$(pwd | sed 's/\/data\/data\/com.termux\/files\/home/~/g;s/\/home\/[A-Za-z]*/~/g')" curr_path="$(pwd | sed 's/\/data\/data\/com.termux\/files\/home/~/g;s/\/home\/[A-Za-z]*/~/g')"
if [ "${#curr_path}" -gt 25 ] ; then if [ "${#curr_path}" -gt 10 ] ; then
curr_path="${curr_path##*/}" curr_path="${curr_path##*/}"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then
curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)" curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)"
@ -56,11 +56,15 @@ short_path() {
printf '%s' "$curr_path" printf '%s' "$curr_path"
} }
[ -e "/data/data/com.termux" ] && HOSTNAME=""
[ "${HOSTNAME:=$(hostname -s)}" = "laptop" ] && HOSTNAME="󰌢"
[ "${HOSTNAME:=$(hostname -s)}" = "desktop" ] && HOSTNAME="󰇅"
PS1=' PS1='
$(tput setaf 240)╭─$(tput setaf 7)$(tput setab 7)$(tput setaf 238)$?\ $(tput setaf 240)╭─$(tput setaf 7)$(tput setab 7)$(tput setaf 238)$?\
$(tput setaf 7)$(tput setab 108)\ $(tput setaf 7)$(tput setab 108)\
$(tput setaf 235)$(tput setab 108) \ $(tput setaf 235)$(tput setab 108) \
${USER:=$(id -un)}@${HOSTNAME:=$(hostname -s)} \ ${HOSTNAME} \
$(tput setaf 108)$(tput setab 66) \ $(tput setaf 108)$(tput setab 66) \
$(tput setab 66)$(tput setaf 235)$(short_path) $(tput sgr0)\ $(tput setab 66)$(tput setaf 235)$(short_path) $(tput sgr0)\
$(tput setaf 66)\ $(tput setaf 66)\

19
snippets/academic.org Normal file
View file

@ -0,0 +1,19 @@
#+title: {{Title}}
#+author: {{Author}}
#+options: toc:nil
#+latex_header: \usepackage[margin=1in]{geometry}
#+latex_header: \usepackage[spanish]{babel}
#+latex_header: \AtBeginDocument{\selectlanguage{spanish}}
#+latex_header: \usepackage{multicol,lipsum}
#+cite_export: csl ~/.config/snippets/acs.csl
#+bibliography: bibliography.bib
#+begin_abstract
{{Abstract}}
#+end_abstract
* Sección
* Referencias
#+print_bibliography: