summaryrefslogtreecommitdiff
path: root/home/config/ranger/rifle.conf
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--home/config/ranger/rifle.conf44
1 files changed, 44 insertions, 0 deletions
diff --git a/home/config/ranger/rifle.conf b/home/config/ranger/rifle.conf
new file mode 100644
index 0000000..ab9a0e9
--- /dev/null
+++ b/home/config/ranger/rifle.conf
@@ -0,0 +1,44 @@
+# vim: ft=cfg
+
+# web
+ext x?html?, has librewolf, X, flag f = librewolf -- "$@"
+ext x?html?, has firefox, X, flag f = firefox -- "$@"
+
+# editor
+mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
+!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
+
+# misc
+ext 1 = man "$1"
+ext exe = wine "$1"
+
+# scripts
+ext py = python3 -- "$1"
+ext pl = perl -- "$1"
+ext rb = ruby -- "$1"
+ext js = node -- "$1"
+ext sh = sh -- "$1"
+ext php = php -- "$1"
+
+# media
+mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
+mime ^video, has mpv, X, flag f = mpv -- "$@"
+
+# documents
+ext pdf, has zathura, X, flag f = zathura -- "$@"
+ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
+
+# images
+mime ^image, has imv, X, flag f = imv -- "$@"
+ext xcf, X, flag f = gimp -- "$@"
+
+# fallbacks
+mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
+mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
+
+# xdg-open
+label open, has xdg-open = xdg-open -- "$@"
+label open, has open = open -- "$@"
+
+# execute
+mime application/x-executable = "$1"