1
0
Fork 0
dotfiles-server/.config/lf/rifle.conf

86 lines
3.4 KiB
Plaintext

# vim: ft=cfg
#-------------------------------------------
# Environment checks
#-------------------------------------------
#-------------------------------------------
# Websites
#-------------------------------------------
ext x?html?, has lynx, terminal = lynx -- "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#-------------------------------------------
# Misc
#-------------------------------------------
label editor, mime ^text|x-empty$ = ${VISUAL:-$EDITOR} -- "$@"
label pager, mime ^text|x-empty$ = $PAGER -- "$@"
label editor, ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = ${VISUAL:-$EDITOR} -- "$@"
label pager, ext xml|json|csv|tex|py|pl|rb|rs|js|sh|php|dart = $PAGER -- "$@"
#--------------------------------------------
# Audio without X
#-------------------------------------------
#--------------------------------------------
# Video/Audio with a GUI
#-------------------------------------------
#--------------------------------------------
# Video without X:
#-------------------------------------------
#-------------------------------------------
# Documents
#-------------------------------------------
ext docx?, has catdoc, terminal = catdoc -- "$@" | $PAGER
ext sc, has sc, = sc -- "$@"
#-------------------------------------------
# Images
#-------------------------------------------
#-------------------------------------------
# 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 -- "$@"
# 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
#-------------------------------------------
#-------------------------------------------
# Flag t fallback terminals
#-------------------------------------------
#-------------------------------------------
# Fallback
#-------------------------------------------
else = ask
label open, has xdg-open = xdg-open "$@"
label open, has open = open -- "$@"
######################################################################
# 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"