diff options
-rw-r--r-- | init.el | 19 | ||||
-rw-r--r-- | lisp/acdw-circe.el | 10 | ||||
-rw-r--r-- | lisp/acdw-ytel.el | 35 |
3 files changed, 51 insertions, 13 deletions
diff --git a/init.el b/init.el index 366f0f1..7e517d6 100644 --- a/init.el +++ b/init.el | |||
@@ -1059,6 +1059,7 @@ specific to most general, they are these: | |||
1059 | #'enable-circe-new-day-notifier | 1059 | #'enable-circe-new-day-notifier |
1060 | #'circe-chat@set-prompt | 1060 | #'circe-chat@set-prompt |
1061 | #'topsy-mode)) | 1061 | #'topsy-mode)) |
1062 | (:bind "C-c C-s" #'circe-command-SLAP)) | ||
1062 | 1063 | ||
1063 | (autoload 'circe-nick-color-reset "circe-color-nicks") | 1064 | (autoload 'circe-nick-color-reset "circe-color-nicks") |
1064 | (add-hook 'modus-themes-after-load-theme-hook | 1065 | (add-hook 'modus-themes-after-load-theme-hook |
@@ -1759,6 +1760,9 @@ browser defined in `browse-url-secondary-browser-function'." | |||
1759 | 1760 | ||
1760 | (:option (append completion-styles) 'orderless | 1761 | (:option (append completion-styles) 'orderless |
1761 | orderless-component-separator #'orderless-escapable-split-on-space | 1762 | orderless-component-separator #'orderless-escapable-split-on-space |
1763 | orderless-matching-styles '(orderless-literal | ||
1764 | orderless-regexp | ||
1765 | orderless-flex) | ||
1762 | orderless-style-dispatchers '(acdw/orderless-dispatch)) | 1766 | orderless-style-dispatchers '(acdw/orderless-dispatch)) |
1763 | 1767 | ||
1764 | (:advise orderless-regexp :filter-args | 1768 | (:advise orderless-regexp :filter-args |
@@ -2156,7 +2160,7 @@ the default is \"/\"." | |||
2156 | 2160 | ||
2157 | (setup (:straight super-save) | 2161 | (setup (:straight super-save) |
2158 | (:option auto-save-default nil | 2162 | (:option auto-save-default nil |
2159 | super-save-auto-save-when-idle t | 2163 | super-save-auto-save-when-idle nil |
2160 | super-save-exclude '(".gpg") | 2164 | super-save-exclude '(".gpg") |
2161 | super-save-remote-files nil) | 2165 | super-save-remote-files nil) |
2162 | (auto-save-visited-mode -1) | 2166 | (auto-save-visited-mode -1) |
@@ -2315,17 +2319,8 @@ If used with a numeric prefix argument N, N backticks will be inserted." | |||
2315 | (executable-find "mpv")) | 2319 | (executable-find "mpv")) |
2316 | ;; This might need to be changed depending on whether the instance goes down. | 2320 | ;; This might need to be changed depending on whether the instance goes down. |
2317 | (:option ytel-invidious-api-url "https://invidious.snopyta.org") | 2321 | (:option ytel-invidious-api-url "https://invidious.snopyta.org") |
2318 | (:bind "y" | 2322 | (:bind "v" #'acdw/ytel-current-video-link |
2319 | (defun ytel-watch () ; This could possibly use `browse-url'. | 2323 | "w" #'acdw/ytel-copy-link)) |
2320 | "Stream video at point in mpv." | ||
2321 | (interactive) | ||
2322 | (let* ((video (ytel-get-current-video)) | ||
2323 | (id (ytel-video-id video))) | ||
2324 | (start-process "ytel mpv" nil | ||
2325 | "mpv" | ||
2326 | (concat "https://www.youtube.com/watch?v=" id) | ||
2327 | "--ytdl-format=bestvideo[height<=?720]+bestaudio/best") | ||
2328 | (message "Starting streaming..."))))) | ||
2329 | 2324 | ||
2330 | (setup (:straight zzz-to-char) | 2325 | (setup (:straight zzz-to-char) |
2331 | 2326 | ||
diff --git a/lisp/acdw-circe.el b/lisp/acdw-circe.el index e85587b..d6f5b90 100644 --- a/lisp/acdw-circe.el +++ b/lisp/acdw-circe.el | |||
@@ -9,6 +9,7 @@ | |||
9 | (require 'circe) | 9 | (require 'circe) |
10 | 10 | ||
11 | ;;; Chat commands | 11 | ;;; Chat commands |
12 | |||
12 | (defun circe-command-SHORTEN (url) | 13 | (defun circe-command-SHORTEN (url) |
13 | "Shorten URL using `0x0-shorten-uri'." | 14 | "Shorten URL using `0x0-shorten-uri'." |
14 | (interactive "sURL to shorten: ") | 15 | (interactive "sURL to shorten: ") |
@@ -17,11 +18,18 @@ | |||
17 | (let ((short-url (0x0-shorten-uri (0x0--choose-server) url))) | 18 | (let ((short-url (0x0-shorten-uri (0x0--choose-server) url))) |
18 | (circe-command-SAY short-url))) | 19 | (circe-command-SAY short-url))) |
19 | 20 | ||
21 | (defun circe-command-SLAP (nick) | ||
22 | "Slap NICK around a bit with a large trout." | ||
23 | (interactive "sWho we slappin' today, boss? ") | ||
24 | (circe-command-ME (concat "slaps " | ||
25 | (string-trim nick) | ||
26 | " around a bit with a large trout"))) | ||
27 | |||
20 | ;;; Hooks | 28 | ;;; Hooks |
21 | 29 | ||
22 | (defun circe-chat@set-prompt () | 30 | (defun circe-chat@set-prompt () |
23 | "Set the prompt to the buffer name, shortening it." | 31 | "Set the prompt to the buffer name, shortening it." |
24 | (interactive) ; set interactive to unfuck the prompt when need be | 32 | (interactive) ; set interactive to unfuck the prompt when need be |
25 | (lui-set-prompt | 33 | (lui-set-prompt |
26 | (propertize | 34 | (propertize |
27 | (concat | 35 | (concat |
diff --git a/lisp/acdw-ytel.el b/lisp/acdw-ytel.el new file mode 100644 index 0000000..01e6187 --- /dev/null +++ b/lisp/acdw-ytel.el | |||
@@ -0,0 +1,35 @@ | |||
1 | ;;; acdw-ytel.el --- bespoke functions for ytel -*- lexical-binding: t -*- | ||
2 | |||
3 | ;;; Commentary: | ||
4 | |||
5 | ;; Extra code for the ytel package: | ||
6 | ;; https://github.com/gRastello/ytel | ||
7 | |||
8 | ;;; Code: | ||
9 | |||
10 | (require 'ytel) | ||
11 | |||
12 | (defun acdw/ytel-current-video-link () | ||
13 | "Get the link of the video at point." | ||
14 | (let* ((video (ytel-get-current-video)) | ||
15 | (id (ytel-video-id video))) | ||
16 | (concat "https://www.youtube.com/watch?v=" id))) | ||
17 | |||
18 | (defun acdw/ytel-watch () ; This could possibly use `browse-url'. | ||
19 | "Stream video at point in mpv." | ||
20 | (interactive) | ||
21 | (start-process "ytel mpv" nil | ||
22 | "mpv" | ||
23 | (acdw/ytel-current-video-link) | ||
24 | "--ytdl-format=bestvideo[height<=?720]+bestaudio/best") | ||
25 | (message "Starting streaming...")) | ||
26 | |||
27 | (defun acdw/ytel-copy-link () | ||
28 | "Copy link of the video at point." | ||
29 | (interactive) | ||
30 | (let ((link (acdw/ytel-current-video-link))) | ||
31 | (kill-new link) | ||
32 | (message "Copied %s to kill-ring" link))) | ||
33 | |||
34 | (provide 'acdw-ytel) | ||
35 | ;;; acdw-ytel.el ends here | ||