-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfmarks
executable file
·56 lines (47 loc) · 961 Bytes
/
fmarks
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
52
53
54
55
56
#!/bin/sh
# fast way to open often visited pages just edit pages.txt
# works with surf and firefox, if no option is passed to fmarks, it assumes surf
#------------------------------------------------------------------------------
# files
#------------------------------------------------------------------------------
PAGES=$HOME/repos/bookmarks/pages.txt
#------------------------------------------------------------------------------
usage () {
echo "Usage: $0 [-h] [-f]"
}
fflag=0
sflag=0
while :
do
case $1 in
-h)
usage
exit 0
;;
-f)
fflag=1
break
;;
*)
if [ $# -eq 0 ]; then
sflag=1
break;
else
usage
exit 1
fi
;;
esac
done
if [ $sflag -eq 1 ]; then
URL=$(dmenu -l 10 < "$PAGES")
if [ -n "$URL" ]; then
surf -sg "$URL" &
fi
fi
if [ $fflag -eq 1 ]; then
URL=$(dmenu -l 10 < "$PAGES")
if [ -n "$URL" ]; then
firefox -new-tab "$URL" 2>/dev/null
fi
fi