summaryrefslogtreecommitdiffstats
path: root/.config/ranger/rifle.conf
diff options
context:
space:
mode:
Diffstat (limited to '.config/ranger/rifle.conf')
-rw-r--r--.config/ranger/rifle.conf256
1 files changed, 0 insertions, 256 deletions
diff --git a/.config/ranger/rifle.conf b/.config/ranger/rifle.conf
deleted file mode 100644
index babdcda..0000000
--- a/.config/ranger/rifle.conf
+++ /dev/null
@@ -1,256 +0,0 @@
1# vim: ft=cfg
2#
3# This is the configuration file of "rifle", ranger's file executor/opener.
4# Each line consists of conditions and a command. For each line the conditions
5# are checked and if they are met, the respective command is run.
6#
7# Syntax:
8# <condition1> , <condition2> , ... = command
9#
10# The command can contain these environment variables:
11# $1-$9 | The n-th selected file
12# $@ | All selected files
13#
14# If you use the special command "ask", rifle will ask you what program to run.
15#
16# Prefixing a condition with "!" will negate its result.
17# These conditions are currently supported:
18# match <regexp> | The regexp matches $1
19# ext <regexp> | The regexp matches the extension of $1
20# mime <regexp> | The regexp matches the mime type of $1
21# name <regexp> | The regexp matches the basename of $1
22# path <regexp> | The regexp matches the absolute path of $1
23# has <program> | The program is installed (i.e. located in $PATH)
24# env <variable> | The environment variable "variable" is non-empty
25# file | $1 is a file
26# directory | $1 is a directory
27# number <n> | change the number of this command to n
28# terminal | stdin, stderr and stdout are connected to a terminal
29# X | $DISPLAY is not empty (i.e. Xorg runs)
30#
31# There are also pseudo-conditions which have a "side effect":
32# flag <flags> | Change how the program is run. See below.
33# label <label> | Assign a label or name to the command so it can
34# | be started with :open_with <label> in ranger
35# | or `rifle -p <label>` in the standalone executable.
36# else | Always true.
37#
38# Flags are single characters which slightly transform the command:
39# f | Fork the program, make it run in the background.
40# | New command = setsid $command >& /dev/null &
41# r | Execute the command with root permissions
42# | New command = sudo $command
43# t | Run the program in a new terminal. If $TERMCMD is not defined,
44# | rifle will attempt to extract it from $TERM.
45# | New command = $TERMCMD -e $command
46# Note: The "New command" serves only as an illustration, the exact
47# implementation may differ.
48# Note: When using rifle in ranger, there is an additional flag "c" for
49# only running the current file even if you have marked multiple files.
50
51#-------------------------------------------
52# Websites
53#-------------------------------------------
54# Rarely installed browsers get higher priority; It is assumed that if you
55# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
56# other hand are often only installed as fallback browsers.
57ext x?html?, has surf, X, flag f = surf -- file://"$1"
58ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
59ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
60ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
61ext x?html?, has dwb, X, flag f = dwb -- "$@"
62ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
63ext x?html?, has luakit, X, flag f = luakit -- "$@"
64ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
65ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
66ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
67ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
68ext x?html?, has midori, X, flag f = midori -- "$@"
69ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
70ext x?html?, has chromium, X, flag f = chromium -- "$@"
71ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
72ext x?html?, has opera, X, flag f = opera -- "$@"
73ext x?html?, has firefox, X, flag f = firefox -- "$@"
74ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
75ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
76ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
77ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
78ext x?html?, has elinks, terminal = elinks "$@"
79ext x?html?, has links2, terminal = links2 "$@"
80ext x?html?, has links, terminal = links "$@"
81ext x?html?, has lynx, terminal = lynx -- "$@"
82ext x?html?, has w3m, terminal = w3m "$@"
83
84#-------------------------------------------
85# Misc
86#-------------------------------------------
87# Define the "editor" for text files as first action
88mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
89mime ^text, label pager = "$PAGER" -- "$@"
90!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
91!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
92
93ext 1 = man "$1"
94ext s[wmf]c, has zsnes, X = zsnes "$1"
95ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
96ext nes, has fceux, X = fceux "$1"
97ext exe = wine "$1"
98name ^[mM]akefile$ = make
99
100#--------------------------------------------
101# Code
102#-------------------------------------------
103ext py = python -- "$1"
104ext pl = perl -- "$1"
105ext rb = ruby -- "$1"
106ext js = node -- "$1"
107ext sh = sh -- "$1"
108ext php = php -- "$1"
109
110#--------------------------------------------
111# Audio without X
112#-------------------------------------------
113mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
114mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
115mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
116ext midi?, terminal, has wildmidi = wildmidi -- "$@"
117
118#--------------------------------------------
119# Video/Audio with a GUI
120#-------------------------------------------
121mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
122mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
123mime ^video, has mpv, X, flag f = mpv -- "$@"
124mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
125mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
126mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
127mime ^video, has mplayer, X, flag f = mplayer -- "$@"
128mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
129mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
130mime ^video|audio, has totem, X, flag f = totem -- "$@"
131mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
132
133#--------------------------------------------
134# Video without X:
135#-------------------------------------------
136mime ^video, terminal, !X, has mpv = mpv -- "$@"
137mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
138mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
139
140#-------------------------------------------
141# Documents
142#-------------------------------------------
143ext pdf, has llpp, X, flag f = llpp "$@"
144ext pdf, has zathura, X, flag f = zathura -- "$@"
145ext pdf, has mupdf, X, flag f = mupdf "$@"
146ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
147ext pdf, has apvlv, X, flag f = apvlv -- "$@"
148ext pdf, has xpdf, X, flag f = xpdf -- "$@"
149ext pdf, has evince, X, flag f = evince -- "$@"
150ext pdf, has atril, X, flag f = atril -- "$@"
151ext pdf, has okular, X, flag f = okular -- "$@"
152ext pdf, has epdfview, X, flag f = epdfview -- "$@"
153ext pdf, has qpdfview, X, flag f = qpdfview "$@"
154ext pdf, has open, X, flag f = open "$@"
155
156ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
157
158ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
159ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
160ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
161ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
162ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
163
164ext djvu, has zathura,X, flag f = zathura -- "$@"
165ext djvu, has evince, X, flag f = evince -- "$@"
166ext djvu, has atril, X, flag f = atril -- "$@"
167ext djvu, has djview, X, flag f = djview -- "$@"
168
169ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
170ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
171
172#-------------------------------------------
173# Image Viewing:
174#-------------------------------------------
175mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
176mime ^image/svg, has display, X, flag f = display -- "$@"
177
178mime ^image, has pqiv, X, flag f = pqiv -- "$@"
179mime ^image, has sxiv, X, flag f = sxiv -- "$@"
180mime ^image, has feh, X, flag f = feh -- "$@"
181mime ^image, has mirage, X, flag f = mirage -- "$@"
182mime ^image, has ristretto, X, flag f = ristretto "$@"
183mime ^image, has eog, X, flag f = eog -- "$@"
184mime ^image, has eom, X, flag f = eom -- "$@"
185mime ^image, has nomacs, X, flag f = nomacs -- "$@"
186mime ^image, has geeqie, X, flag f = geeqie -- "$@"
187mime ^image, has gwenview, X, flag f = gwenview -- "$@"
188mime ^image, has gimp, X, flag f = gimp -- "$@"
189ext xcf, X, flag f = gimp -- "$@"
190
191#-------------------------------------------
192# Archives
193#-------------------------------------------
194
195# avoid password prompt by providing empty password
196ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
197# This requires atool
198ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
199ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
200ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
201ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
202
203# Listing and extracting archives without atool:
204ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
205ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
206ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
207ext zip, has unzip = unzip -l "$1" | less
208ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
209ext ace, has unace = unace l "$1" | less
210ext ace, has unace = for file in "$@"; do unace e "$file"; done
211ext rar, has unrar = unrar l "$1" | less
212ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
213
214#-------------------------------------------
215# Flag t fallback terminals
216#-------------------------------------------
217# Rarely installed terminal emulators get higher priority; It is assumed that
218# if you install a rare terminal emulator, you probably use it.
219# gnome-terminal/konsole/xterm on the other hand are often installed as part of
220# a desktop environment or as fallback terminal emulators.
221mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@"
222mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
223mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
224mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@"
225mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@"
226#mime ^ranger/x-terminal-emulator, has cool-retro-term = cool-retro-term -e "$@"
227mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"'
228#mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@"
229mime ^ranger/x-terminal-emulator, has guake = guake -ne "$@"
230mime ^ranger/x-terminal-emulator, has tilda = tilda -c "$@"
231mime ^ranger/x-terminal-emulator, has st = st -e "$@"
232mime ^ranger/x-terminal-emulator, has terminator = terminator -x "$@"
233mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
234mime ^ranger/x-terminal-emulator, has pantheon-terminal = pantheon-terminal -e "$@"
235mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@"
236mime ^ranger/x-terminal-emulator, has mate-terminal = mate-terminal -x "$@"
237mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@"
238mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@"
239mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
240mime ^ranger/x-terminal-emulator, has xterm = xterm -e "$@"
241
242#-------------------------------------------
243# Misc
244#-------------------------------------------
245label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
246label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
247label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
248label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
249
250# Define the editor for non-text files + pager as last action
251 !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
252label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
253label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
254
255# The very last action, so that it's never triggered accidentally, is to execute a program:
256mime application/x-executable = "$1"