From f43f62d8a2d4de66e232f030bb8148d9cd3052b0 Mon Sep 17 00:00:00 2001 From: harryvederci <26745575+harryvederci@users.noreply.github.com> Date: Tue, 22 Mar 2022 18:14:12 +0000 Subject: [PATCH] Ignore query params in linkhandler case statement. Not sure if changing it to a bash script breaks your stuff, as I just copy-pasted what I like into my own config. --- .local/bin/linkhandler | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index fa74cafb..779a60fc 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # Feed script a url or file location. # If an image, it will view in sxiv, @@ -9,7 +9,11 @@ # If no url given. Opens browser. For using script as $BROWSER. [ -z "$1" ] && { "$BROWSER"; exit; } -case "$1" in + +link_without_query_params="$(echo "$1" | cut -d? -f1)" + + +case "$link_without_query_params" in *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*) setsid -f mpv -quiet "$1" >/dev/null 2>&1 ;; *png|*jpg|*jpe|*jpeg|*gif)