diff --git a/README.org b/README.org index 38450f8f..c0e75f6d 100644 --- a/README.org +++ b/README.org @@ -265,9 +265,9 @@ Probably the prettiest and best modeline I've found. :ensure t :init (doom-modeline-mode 1) - (setq doom-modeline-height 30 + (setq doom-modeline-height 25 doom-modeline-bar-width 3 - all-the-icons-scale-factor 1.0 + all-the-icons-scale-factor 0.9 doom-modeline-hud nil doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-encoding nil @@ -1814,6 +1814,7 @@ These two packages created by Prot are interesting to me and may help to make su Builtin webbrowser for emacs. Trying it out as a text only browser for things. #+begin_src emacs-lisp +(setq home-directory "~/") (defun chris/eww-mpv () "Launch the url in mpv" (interactive) @@ -1826,11 +1827,39 @@ Builtin webbrowser for emacs. Trying it out as a text only browser for things. (goto-char pt) (let ((url (get-text-property (point) 'shr-url))) (if (start-process "mpv" "mpv-output" "mpv" url) - (message (concat"mpv started => " url)) + (message (concat "mpv started => " url)) (message "mpv failed, maybe this isn't a link?")))))) +;; (defun chris/) + +(defun chris/eww-video-dl () + "Download the video at the url" + (interactive) + (let ((pt (avy-with ace-link-eww + (avy-process + (mapcar #'cdr (ace-link--eww-collect)) + (avy--style-fn avy-style))))) + + (when (number-or-marker-p pt) + (goto-char pt) + (let ((url (get-text-property (point) 'shr-url))) + (if (start-process + "yt-dlp" + "yt-dlp-output" + "yt-dlp" "-o" (concat home-directory "Videos/%(title)s.%(ext)s") url) + (message (concat "downloading => " url)) + (message "idk this failed I guess...")) + (pop-to-buffer "yt-dlp-output") + (comint-mode) + (evil-normal-state) + (general-def 'normal comint-mode-map + "q" 'kill-buffer-and-window))))) + +(setq eww-search-prefix "https://search.tfcconnection.org/search?q=") + (general-def 'normal eww-mode-map - "gv" 'chris/eww-mpv) + "gv" 'chris/eww-mpv + "gV" 'chris/eww-video-dl) #+end_src ** Completion diff --git a/init.el b/init.el index f195b224..36e22c4f 100644 --- a/init.el +++ b/init.el @@ -108,9 +108,9 @@ :ensure t :init (doom-modeline-mode 1) - (setq doom-modeline-height 30 + (setq doom-modeline-height 25 doom-modeline-bar-width 3 - all-the-icons-scale-factor 1.0 + all-the-icons-scale-factor 0.9 doom-modeline-hud nil doom-modeline-buffer-file-name-style 'file-name doom-modeline-buffer-encoding nil @@ -1394,6 +1394,7 @@ All my (performant) foldings needs are met between this and `org-show-subtree' (add-hook 'imenu-after-jump-hook #'pulsar-recenter-top) (add-hook 'imenu-after-jump-hook #'pulsar-reveal-entry)) +(setq home-directory "~/") (defun chris/eww-mpv () "Launch the url in mpv" (interactive) @@ -1406,11 +1407,39 @@ All my (performant) foldings needs are met between this and `org-show-subtree' (goto-char pt) (let ((url (get-text-property (point) 'shr-url))) (if (start-process "mpv" "mpv-output" "mpv" url) - (message (concat"mpv started => " url)) + (message (concat "mpv started => " url)) (message "mpv failed, maybe this isn't a link?")))))) +;; (defun chris/) + +(defun chris/eww-video-dl () + "Download the video at the url" + (interactive) + (let ((pt (avy-with ace-link-eww + (avy-process + (mapcar #'cdr (ace-link--eww-collect)) + (avy--style-fn avy-style))))) + + (when (number-or-marker-p pt) + (goto-char pt) + (let ((url (get-text-property (point) 'shr-url))) + (if (start-process + "yt-dlp" + "yt-dlp-output" + "yt-dlp" "-o" (concat home-directory "Videos/%(title)s.%(ext)s") url) + (message (concat "downloading => " url)) + (message "idk this failed I guess...")) + (pop-to-buffer "yt-dlp-output") + (comint-mode) + (evil-normal-state) + (general-def 'normal comint-mode-map + "q" 'kill-buffer-and-window))))) + +(setq eww-search-prefix "https://search.tfcconnection.org/search?q=") + (general-def 'normal eww-mode-map - "gv" 'chris/eww-mpv) + "gv" 'chris/eww-mpv + "gV" 'chris/eww-video-dl) (use-package vertico :init diff --git a/templates b/templates index 3bf6be6e..bbaadc4c 100644 --- a/templates +++ b/templates @@ -1,4 +1,4 @@ -;; -*- mode: lisp -* +;; -*- lisp-data -*- fundamental-mode ;; Available everywhere @@ -70,13 +70,11 @@ c-mode :condition (re-search-backward "^\\w*$" (line-beginning-position) 'noerro (inc "#include <" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) ">") (incc "#include \"" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) "\"") -c++-mode - -(Q_PROP "Q_PROPERTY(" (p "type") " " (p "name") " READ " (p "name") " WRITE set" (p "name") " NOTIFY " (p "name") "CHANGED)") - org-mode (title "#+title: " p n "#+author: Chris Cochrun" n n) +(drawer ":" p ":" n r ":end:") +(begin "#+begin_" (s name) n> r> n "#+end_" name) (quote "#+begin_quote" n> r> n> "#+end_quote") (example "#+begin_example" n> r> n> "#+end_example") (center "#+begin_center" n> r> n> "#+end_center") @@ -93,3 +91,29 @@ web-mode (div "
" n> r> n> "
" n) (input "") (label "