all repos

dotfiles @ 3bad26598355d78a7586e6f059a98137bbfa6159

my dotfiles

config/ranger/rifle.conf (view raw)

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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# vim: ft=cfg
#== Websites
ext x?html?, has firefox,          X, flag f = firefox -- "$@"
ext x?html?, has qutebrowser,      X, flag f = qutebrowser -- "$@"
ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
ext x?html?, has chromium,         X, flag f = chromium -- "$@"
ext x?html?, has google-chrome,    X, flag f = google-chrome -- "$@"
ext x?html?, has w3m,              terminal  = w3m "$@"

#== Misc
mime ^text,  label editor = ${EDITOR} -- "$@"
mime ^text,  label pager  = "$PAGER" -- "$@"
!mime ^text, label editor, ext json|csv|tex|py|rb|js|sh = ${EDITOR} -- "$@"
!mime ^text, label pager,  ext json|csv|tex|py|rb|js|sh = "$PAGER" -- "$@"
name ^[mM]akefile$ = make

#== Scripts
ext py  = python -- "$1"
ext rb  = ruby   -- "$1"
ext js  = node   -- "$1"
ext sh  = sh     -- "$1"

#== Video/Audio
mime ^video,       has mpv,      X, flag f = mpv -- "$@"
mime ^video,       has mpv,      X, flag f = mpv --fs -- "$@"
mime ^video,       has mplayer2, X, flag f = mplayer2 -- "$@"
mime ^video,       has mplayer2, X, flag f = mplayer2 -fs -- "$@"
mime ^video,       has mplayer,  X, flag f = mplayer -- "$@"
mime ^video,       has mplayer,  X, flag f = mplayer -fs -- "$@"
mime ^video|audio, has vlc,      X, flag f = vlc -- "$@"

#== Documents
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
ext pdf, has zathura,       X, flag f = zathura -- "$@"
ext djvu, has zathura,      X, flag f = zathura -- "$@"
ext epub, has zathura,      X, flag f = zathura -- "$@"

#== Images
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image, has feh,          X, flag f = feh      -- "$@"
mime ^image, has ristretto,    X, flag f = ristretto "$@"
mime ^image, has gimp,         X, flag f = gimp     -- "$@"
ext xcf,                       X, flag f = gimp     -- "$@"

#== Archives
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,     has atool = atool --list --each -- "$@" | "$PAGER"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,  has atool = atool --extract --each -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
ext zip, has unzip = unzip -l "$1" | less
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
ext rar, has unrar = unrar l "$1" | less
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done

#== Fonts
mime ^font, has fontforge, X, flag f = fontforge "$@"

#== Terminals
mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"

#== Misc
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"

#== Generic file openers
label open, has xdg-open = xdg-open -- "$@"
label open, has open     = open -- "$@"

              !mime ^text, !ext json|csv|tex|py|rb|js|sh  = ask
label editor, !mime ^text, !ext json|csv|tex|py|rb|js|sh  = ${EDITOR} -- "$@"
label pager,  !mime ^text, !ext json|csv|tex|py|rb|js|sh  = "$PAGER" -- "$@"
mime application/x-executable = "$1"
label trash, has trash-put = trash-put -- "$@"
label trash = mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash