-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathw3m-pmenu
33 lines (27 loc) · 1.07 KB
/
w3m-pmenu
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
#!/bin/bash
# pmenu based bookmarks manager, using simple text bookmarks file containing 1 bookmark per line, you can have put tag after the url (with space inbetween)
BROWSER=w3m
BOOKMARKS=~/.config/lariza/bookmarks
shopt -s lastpipe
pmenu -p "OPEN_WITH_W3M: " < $BOOKMARKS | read -a url
[[ ! $url ]] && exit
case "${url[0]}" in
*.*|*:*|*/*) $BROWSER "${url[0]}" ;;
aw|awiki) archwiki "${url[@]:1}" ;;
wi|wiki) wikipedia "${url[@]:1}" ;;
imdb) imdb "${url[@]:1}" ;;
aur) aur "${url[@]:1}" ;;
pkg) archpkg "${url[@]:1}" ;;
ddg) duckduckgo -j "${url[@]:1}" ;;
go|google) google "${url[@]:1}" ;;
map) google -m "${url[@]:1}" ;;
image) google -i "${url[@]:1}" ;;
video) google -v "${url[@]:1}" ;;
news) google -n "${url[@]:1}" ;;
yt|youtube) youtube "${url[@]:1}" ;;
ebay) ebay "${url[@]:1}" ;;
pubmed) pubmed "${url[@]:1}" ;;
git|github) github "${url[@]:1}" ;;
def) notify-send -t 9999999 "$( sdcv --data-dir ~/dic/english/ "${url[@]:1}" )" ;;
*) duckduckgo -j "${url[@]}" ;;
esac