commit cba7a40a4d15ff691d97462c6dd5902dcbc682d3
parent 82474a1a1b96a13acca2731253a18567596e2fd7
Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe>
Date: Sat, 15 Jan 2022 20:17:06 -0500
Added ranger's rifle.conf
Diffstat:
1 file changed, 152 insertions(+), 0 deletions(-)
diff --git a/linux/.config/ranger/rifle.conf b/linux/.config/ranger/rifle.conf
@@ -0,0 +1,152 @@
+#-------------------------------------------
+# Websites
+#-------------------------------------------
+ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
+ext x?html?, has firefox, X, flag f = firefox -- "$@"
+ext x?html?, has elinks, terminal = elinks "$@"
+
+#-------------------------------------------
+# Misc
+#-------------------------------------------
+# Define the "editor" for text files as first action
+mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
+mime ^text, label pager = "$PAGER" -- "$@"
+!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
+!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
+ext sqlite, has sqlitebrowser, X, flag f = sqlitebrowser "$@"
+ext sqlite3, has sqlitebrowser, X, flag f = sqlitebrowser "$@"
+ext db, has sqlitebrowser, X, flag f = sqlitebrowser "$@"
+mime application/x-sqlite3, has sqlitebrowser, X, flag f = sqlitebrowser "$@"
+ext psc, has pseint, X, flag f = pseint "$@"
+mime application/x-hdf, has vitables, X, flag f = vitables "$@"
+
+
+ext 1 = man "$1"
+name ^[mM]akefile$ = make
+
+#--------------------------------------------
+# Scripts
+#-------------------------------------------
+ext py = python -- "$1"
+ext pl = perl -- "$1"
+ext rb = ruby -- "$1"
+ext js = node -- "$1"
+ext sh = sh -- "$1"
+ext php = php -- "$1"
+
+#--------------------------------------------
+# Audio without X
+#-------------------------------------------
+mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
+ext midi?, terminal, has wildmidi = wildmidi -- "$@"
+
+#--------------------------------------------
+# Video/Audio with a GUI
+#-------------------------------------------
+mime ^video, has mpv, X, flag f = mpv -- "$@"
+mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
+mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
+
+#--------------------------------------------
+# Video without X
+#-------------------------------------------
+mime ^video, terminal, !X, has mpv = mpv -- "$@"
+
+#-------------------------------------------
+# Documents
+#-------------------------------------------
+ext pdf, has zathura, X, flag f = zathura -- "$@"
+ext pdf, has xournalpp,X, flag f = xournalpp "$@"
+ext pdf, has mupdf, X, flag f = mupdf "$@"
+ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
+ext pdf, has evince, X, flag f = evince -- "$@"
+
+ext xopp, has xournalpp, X, flag f = xournalpp "$@"
+ext shp, has qgis, X, flag f = qgis "$@"
+
+ext djvu, has zathura,X, flag f = zathura -- "$@"
+ext djvu, has evince, X, flag f = evince -- "$@"
+
+ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
+ext epub, has zathura, X, flag f = zathura -- "$@"
+ext epub, has mupdf, X, flag f = mupdf -- "$@"
+ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
+
+ext cbr, has zathura, X, flag f = zathura -- "$@"
+ext cbz, has zathura, X, flag f = zathura -- "$@"
+
+#-------------------------------------------
+# Images
+#-------------------------------------------
+mime ^image/x-xcf, has gimp, X, flag f = gimp -- "$@"
+mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
+
+mime ^image, has sxiv, X, flag f = sxiv -- "$@"
+mime ^image, has gimp, X, flag f = gimp -- "$@"
+
+#-------------------------------------------
+# Archives
+#-------------------------------------------
+
+# avoid password prompt by providing empty password
+ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
+# This requires atool
+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 -- "$@"
+
+# Listing and extracting archives without atool:
+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 ace, has unace = unace l "$1" | less
+ext ace, has unace = for file in "$@"; do unace e "$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 "$@"
+
+#-------------------------------------------
+# Flag t fallback terminals
+#-------------------------------------------
+mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
+mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
+mime ^ranger/x-terminal-emulator, has xterm = xterm -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 -- "$@"
+
+# Define the editor for non-text files + pager as last action
+ !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
+label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ${VISUAL:-$EDITOR} -- "$@"
+label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
+
+
+######################################################################
+# The actions below are left so low down in this file on purpose, so #
+# they are never triggered accidentally. #
+######################################################################
+
+# Execute a file as program/script.
+mime application/x-executable = "$1"
+
+# Move the file to trash using trash-cli.
+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