diff options
author | sinanmohd <pcmsinan@gmail.com> | 2023-03-08 15:03:16 +0530 |
---|---|---|
committer | sinanmohd <pcmsinan@gmail.com> | 2023-03-11 19:05:05 +0530 |
commit | ffcf654084c70df62319131c91e8e65a189176f2 (patch) | |
tree | a38b2bea1cfba697e6ff2ec7011f04072afc73ec /1337x | |
parent | faae5f57edd6cdee64c185164011cb4b789c7ee6 (diff) |
1337x, yts: wayland support
Diffstat (limited to '1337x')
-rwxr-xr-x | 1337x | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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" ] && |