diff options
| -rw-r--r-- | emacs/init.el | 2 | ||||
| -rw-r--r-- | glide/glide.ts | 23 |
2 files changed, 20 insertions, 5 deletions
diff --git a/emacs/init.el b/emacs/init.el index 352c82f..0dee210 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -1235,7 +1235,7 @@ changes." racket-mode rustic sdcv shelldon sideline-eglot sideline-flycheck sideline-flymake sideline-lsp symon tempel-collection treemacs tuareg vcl-mode - vertico visible-mark vterm winum)) + vertico visible-mark winum)) '(pyim-assistant-scheme 'cangjie) '(safe-local-variable-values '((LEXICAL-binding . t))) '(scroll-bar-mode nil) diff --git a/glide/glide.ts b/glide/glide.ts index 54048c6..502f088 100644 --- a/glide/glide.ts +++ b/glide/glide.ts @@ -34,10 +34,25 @@ glide.keymaps.set("normal", "gp", async () => { "mpv", url ], {}); - // const proc = await glide.process.spawn("xmessage", ["test from glide"], - // {}); - // console.log("opened kitty with pid", proc.pid); - console.log("opened mpv with url", url); + console.log("opened mpv with url: ", url); +}) +// same thing but w/ no video +glide.keymaps.set("normal", "gP", async () => { + const cur_url = new URL(glide.ctx.url).toString(); + const url = cur_url.replace("inv.nadeko.net", "youtube.com").replace( + /watch\?.*v=([a-zA-Z0-9\-_]*).*/, 'watch?v=$1' + ); + if (!url.includes("youtube")) { + console.log("refused to open url with mpv: ", url); + return + } + const proc = await glide.process.spawn("nohup", [ + "mpv", + "--no-video", + "--force-window", + url + ], {}); + console.log("opened mpv (audio only) with url: ", url); }) glide.prefs.set("privacy.trackingprotection.enabled", true); |
