-
Notifications
You must be signed in to change notification settings - Fork 0
/
search
executable file
·51 lines (46 loc) · 1.05 KB
/
search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
search=$(cat ~/.cache/search-hist | tac | rofi -dmenu -p "Search")
if [ -z "$search" ]; then
exit
fi
# delete a line that ONLY contains the search and no other text
sed -i "/^$search$/d" ~/.cache/search-hist
echo $search >> ~/.cache/search-hist
words=$(echo $search | cut -d " " -f 2-)
first_word=$(echo $search | cut -d " " -f 1)
case "$first_word" in
"1")
$BROWSER "https://1337x.to/search/$words/1/"
;;
"rl")
$BROWSER "https://rutracker.org/forum/tracker.php?nm=$words&f=1992,2059"
;;
"r")
$BROWSER "https://rutracker.org/forum/tracker.php?nm=$words"
;;
"a")
$BROWSER "https://wiki.archlinux.org/index.php?search=$words"
;;
"h")
$BROWSER "$words"
;;
"o")
$BROWSER "https://osu.ppy.sh/beatmapsets?m=0&q=$words"
;;
"y")
$BROWSER "https://www.youtube.com/results?search_query=$words"
;;
"w")
$BROWSER "https://www.wolframalpha.com/input/?i=$words"
;;
"t")
1337x-torrent "$words"
;;
"n")
~/.scripts/nyaa·si "$words"
;;
"") exit ;;
*)
$BROWSER "https://duckduckgo.com/$first_word $words"
;;
esac