From ffcf654084c70df62319131c91e8e65a189176f2 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Wed, 8 Mar 2023 15:03:16 +0530 Subject: 1337x, yts: wayland support --- 1337x | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '1337x') diff --git a/1337x b/1337x index 772c48d..67596c9 100755 --- a/1337x +++ b/1337x @@ -2,6 +2,7 @@ url_1337x="https://1337x.to" proxy_1337x="https://1337x.torrentbay.to" +menu="dmenu" die() { @@ -58,23 +59,25 @@ main() out= query= - dep_check "dmenu" - + [ -z "$DISPLAY" ] && + menu="bemenu" if [ "$#" -gt 0 ] && [ "$1" = "-o" ] then out=true shift fi + dep_check "$menu" + curl -Is "$url_1337x" > /dev/null || url_1337x="$proxy_1337x" - query="${*:-$(printf "" | dmenu -p " ")}" + query="${*:-$(printf "" | "$menu" -p " ")}" [ -z "$query" ] && die "please enter a query" fetch="$(search_1337x "$query")" - select="$(echo "$fetch" | sed -e's/^.*\///g' | tr '-' ' ' | dmenu -l 25 -p " " | tr ' ' '-')" + select="$(echo "$fetch" | sed -e's/^.*\///g' | tr '-' ' ' | "$menu" -l 25 -p " " | tr ' ' '-')" magnet="$(magnet_1337x "$(echo "$fetch" | grep "$select")")" [ -z "$magnet" ] && -- cgit v1.2.3