summaryrefslogtreecommitdiff
path: root/glide
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2025-10-29 10:57:51 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2025-10-29 10:57:51 -0700
commit193b13df74ebad6ac31a20002f5b9ce894d4afc9 (patch)
tree894fc67b64031a75dfc45968d468e0ae73464b05 /glide
parent03ee911e637588145848ea097a17295605b62155 (diff)
better glide, still not working well
Diffstat (limited to 'glide')
-rw-r--r--glide/glide.ts23
1 files changed, 19 insertions, 4 deletions
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);