summaryrefslogtreecommitdiff
path: root/bm
blob: 98d3f0f1f549c675c7256fa5d256f16b6cabb924 (plain)
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
#!/bin/sh

#{{{ printhelp
printhelp () {
  printf "bm: browser menu script; interface for browsers.\n"
  printf "  -b) basilisk interface\n"
  printf "  -d) firedragon interface\n"
  printf "  -f) firefox interface\n"
  printf "  -l) librewolf interface\n"
  printf "  -q) qutebrowser interface\n"
  printf "  -x) use X11 menu (dmenu)\n"
  printf "  -w) use Wayland menu (tofi)\n"
  printf "  -d ARG) provide menu args\n"
  printf "  -u ARG) provide URL to open\n"
  exit
}
#}}}

#{{{ getopts
unset ARG
while getopts "hbrflqxwd:u:" o; do case "${o}" in
  b) BSC="y" ;;
  r) FDC="y" ;;
  f) FFC="y" ;;
  l) LWC="y" ;;
  q) QBC="y" ;;
  x) ARG="$ARG-x " ;;
  w) ARG="$ARG-w " ;;
  d) ARG="$ARG-d $OPTARG ";;
  u) ARG="$ARG-u $OPTARG " ;;
  *) printhelp ;;
esac done
#}}}

#{{{ main
[ -n "$BSC" ] && bsc $ARG
[ -n "$FDC" ] && fdc $ARG
[ -n "$FFC" ] && ffc $ARG
[ -n "$LWC" ] && lwc $ARG
[ -n "$QBC" ] && qbc $ARG
#}}}