aboutsummaryrefslogtreecommitdiff
path: root/1337x
diff options
context:
space:
mode:
authorsinanmohd <pcmsinan@gmail.com>2023-03-08 15:03:16 +0530
committersinanmohd <pcmsinan@gmail.com>2023-03-11 19:05:05 +0530
commitffcf654084c70df62319131c91e8e65a189176f2 (patch)
treea38b2bea1cfba697e6ff2ec7011f04072afc73ec /1337x
parentfaae5f57edd6cdee64c185164011cb4b789c7ee6 (diff)
1337x, yts: wayland support
Diffstat (limited to '1337x')
-rwxr-xr-x1337x11
1 files changed, 7 insertions, 4 deletions
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" ] &&