diff options
| author | Thomas Ulmer <thomasmulmer02@gmail.com> | 2025-10-29 10:57:51 -0700 |
|---|---|---|
| committer | Thomas Ulmer <thomasmulmer02@gmail.com> | 2025-10-29 10:57:51 -0700 |
| commit | 193b13df74ebad6ac31a20002f5b9ce894d4afc9 (patch) | |
| tree | 894fc67b64031a75dfc45968d468e0ae73464b05 | |
| parent | 03ee911e637588145848ea097a17295605b62155 (diff) | |
better glide, still not working well
| -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); |
