summaryrefslogtreecommitdiff
path: root/etc/aliases/suffix
blob: 9a2f1bced726f9e0d322d587f3473c55f2e732c4 (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
42
43
## Sufix aliases
## Like, enter "somefile.ogg" and zsh will automatically open it using $audio_app
## vim:ft=zsh
# part 1: what filetypes to open whith what app?
# List of filetypes covered by aliases
filetypes=(archive audio document emul image midi office raw video web)

# File extensions
archive_formats=(tar.bz2 tar.gz tar bz2 gz zip rar)
audio_formats=(aif aifc aiff amr amr au awb awb axa flac gsm kar m3u m3u m4a mid
	midi mp2 mp3 mpega mpga oga ogg pls ra ra ram rm sd2 sid snd spx wav wax wma)
document_formats=(pdf ps)
emul_formats=(exe)
image_formats=(art bmp cdr cdt cpt djv djvu gif ico ief jng jpe jpeg jpg pat pbm
	pcx pgm png pnm ppm psd ras rgb svg svgz tif tiff wbmp xbm xpm xwd)
midi_formats=(mid s3m)
office_formats=(doc odt ott rtf sxw)
raw_formats=(conf ini log txt htm html xhtml c cpp lst)
video_formats=(3gp asf asx avi axv dif dl dv fli flv gl lsf lsx mng mov movie mp4
	mpe mpeg mpg mpv mxu ogv qt wm wmv wmx wvx)
web_formats=(com de net org)

# Applications
archive_app='extr'
audio_app='mplayer'
document_app='kpdf'
emul_app='wine'
image_app='feh'
midi_app='timidity'
office_app='openoffice'
raw_app='vim'
video_app='mplayer'
web_app='x-www-browser'

# part 2: create the aliases
for meta in $filetypes; {
	for format in $(eval echo -n "$"${meta}_formats); {
		eval alias -s $format="$"${meta}_app
	}
	unset ${meta}_{formats,app}
}

unset filetypes meta format