| 1 |
#!/bin/bash |
|---|
| 2 |
# |
|---|
| 3 |
# This source code is free software; you can redistribute it and/or |
|---|
| 4 |
# modify it under the terms of the GNU General Public License as published |
|---|
| 5 |
# by the Free Software Foundation; either version 2 of the License, |
|---|
| 6 |
# or (at your option) any later version. |
|---|
| 7 |
# |
|---|
| 8 |
# (c) Copyright 2006 AlpT (@freaknet.org) |
|---|
| 9 |
|
|---|
| 10 |
# |
|---|
| 11 |
# `CB_EXT_PROG[x]' defines the program or function associated to the file |
|---|
| 12 |
# extensions listed in `CB_EXT_EXTS[x]'. |
|---|
| 13 |
# |
|---|
| 14 |
# `CB_EXT_PROG_II[x]' is the relative second action program or function. |
|---|
| 15 |
# |
|---|
| 16 |
# |
|---|
| 17 |
# The global variables (like $CB_MEDIA_PLAYER) and the global functions (like |
|---|
| 18 |
# cb_pdf) are taken from closebracket.conf |
|---|
| 19 |
# |
|---|
| 20 |
|
|---|
| 21 |
cbe=0 |
|---|
| 22 |
|
|---|
| 23 |
# ] untarra and cd to `basename "$1" .tar.bz2` |
|---|
| 24 |
((cbe++)) |
|---|
| 25 |
CB_EXT_PROG[$cbe]='cb_untarra' |
|---|
| 26 |
CB_EXT_PROG_II[$cbe]='cb_tarra' |
|---|
| 27 |
CB_EXT_EXTS[$cbe]='.tar.bz2 .tbz2 .tar .tar.gz .tgz .zip .rar .cbr' |
|---|
| 28 |
|
|---|
| 29 |
# Launch mplayer when "$1" is a video/mp3 |
|---|
| 30 |
((cbe++)) |
|---|
| 31 |
CB_EXT_PROG[$cbe]="$CB_MEDIA_PLAYER" |
|---|
| 32 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 33 |
CB_EXT_EXTS[$cbe]='.mpg .mpeg .avi .mp3 .ogg .wav .wmv .wmk .mov .ogm |
|---|
| 34 |
.ogg .mid .mp4 .mkv .flv' |
|---|
| 35 |
((cbe++)) |
|---|
| 36 |
CB_EXT_PROG[$cbe]='abiword' |
|---|
| 37 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 38 |
CB_EXT_EXTS[$cbe]='.abw .doc' |
|---|
| 39 |
|
|---|
| 40 |
# .htm: Open $CB_BROWSER on X, $CB_TEXT_BROWSER on tty |
|---|
| 41 |
((cbe++)) |
|---|
| 42 |
CB_EXT_PROG[$cbe]='cb_htm' |
|---|
| 43 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 44 |
CB_EXT_EXTS[$cbe]='.htm .html .xml .shtml' |
|---|
| 45 |
|
|---|
| 46 |
((cbe++)) |
|---|
| 47 |
CB_EXT_PROG[$cbe]="$CB_EDITOR" |
|---|
| 48 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 49 |
CB_EXT_EXTS[$cbe]='.php .php3' |
|---|
| 50 |
|
|---|
| 51 |
# ] launches gqview when "$1" is an image, ][ launches gimp |
|---|
| 52 |
((cbe++)) |
|---|
| 53 |
CB_EXT_PROG[$cbe]='cb_img_viewer' |
|---|
| 54 |
CB_EXT_PROG_II[$cbe]='cb_img_editor' |
|---|
| 55 |
CB_EXT_EXTS[$cbe]='.psd .xpm .tiff .gif .png .jpeg .bmp .jpg .ppm' |
|---|
| 56 |
|
|---|
| 57 |
# Launch bittorrent when "$1" is a .torrent. bittorrent-gtk when DISPLAY is |
|---|
| 58 |
# set, otherwise bittorrent-curses |
|---|
| 59 |
((cbe++)) |
|---|
| 60 |
CB_EXT_PROG[$cbe]='cb_bittorrent' |
|---|
| 61 |
CB_EXT_PROG_II[$cbe]='bittorrent-curses' |
|---|
| 62 |
CB_EXT_EXTS[$cbe]='.torrent' |
|---|
| 63 |
|
|---|
| 64 |
# Launch xpdf when "$1" is a .torrent |
|---|
| 65 |
# if we are in tty, convert the pdf to html and use links |
|---|
| 66 |
((cbe++)) |
|---|
| 67 |
CB_EXT_PROG[$cbe]='cb_pdf' |
|---|
| 68 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 69 |
CB_EXT_EXTS[$cbe]='.pdf' |
|---|
| 70 |
|
|---|
| 71 |
((cbe++)) |
|---|
| 72 |
CB_EXT_PROG[$cbe]='ghostview' |
|---|
| 73 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 74 |
CB_EXT_EXTS[$cbe]='.ps' |
|---|
| 75 |
|
|---|
| 76 |
((cbe++)) |
|---|
| 77 |
CB_EXT_PROG[$cbe]='emerge' |
|---|
| 78 |
CB_EXT_PROG_II[$cbe]="$CB_EDITOR" |
|---|
| 79 |
CB_EXT_EXTS[$cbe]='.ebuild' |
|---|
| 80 |
|
|---|
| 81 |
((cbe++)) |
|---|
| 82 |
CB_EXT_PROG[$cbe]='xsvg' |
|---|
| 83 |
CB_EXT_PROG_II[$cbe]='inkscape' |
|---|
| 84 |
CB_EXT_EXTS[$cbe]='.svg' |
|---|
| 85 |
|
|---|
| 86 |
((cbe++)) |
|---|
| 87 |
CB_EXT_PROG[$cbe]='xdvi' |
|---|
| 88 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 89 |
CB_EXT_EXTS[$cbe]='.dvi' |
|---|
| 90 |
|
|---|
| 91 |
((cbe++)) |
|---|
| 92 |
CB_EXT_PROG[$cbe]='gvim' |
|---|
| 93 |
CB_EXT_PROG_II[$cbe]='vim' |
|---|
| 94 |
CB_EXT_EXTS[$cbe]='.tex' |
|---|
| 95 |
|
|---|
| 96 |
((cbe++)) |
|---|
| 97 |
CB_EXT_PROG[$cbe]='wine' |
|---|
| 98 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 99 |
CB_EXT_EXTS[$cbe]='.exe' |
|---|
| 100 |
|
|---|
| 101 |
((cbe++)) |
|---|
| 102 |
CB_EXT_PROG[$cbe]='djview' |
|---|
| 103 |
CB_EXT_PROG_II[$cbe]='' |
|---|
| 104 |
CB_EXT_EXTS[$cbe]='.djvu' |
|---|