[download]

config/ranger/rifle.conf

   1 # Syntax:
   2 #   <condition1> , <condition2> , ... = command
   3 #
   4 # The command can contain these environment variables:
   5 #   $1-$9 | The n-th selected file
   6 #   $@    | All selected files
   7 #
   8 # If you use the special command "ask", rifle will ask you what program to run.
   9 #
  10 # Prefixing a condition with "!" will negate its result.
  11 # These conditions are currently supported:
  12 #   match <regexp> | The regexp matches $1
  13 #   ext <regexp>   | The regexp matches the extension of $1
  14 #   mime <regexp>  | The regexp matches the mime type of $1
  15 #   name <regexp>  | The regexp matches the basename of $1
  16 #   path <regexp>  | The regexp matches the absolute path of $1
  17 #   has <program>  | The program is installed (i.e. located in $PATH)
  18 #   env <variable> | The environment variable "variable" is non-empty
  19 #   file           | $1 is a file
  20 #   directory      | $1 is a directory
  21 #   number <n>     | change the number of this command to n
  22 #   terminal       | stdin, stderr and stdout are connected to a terminal
  23 #   X              | A graphical environment is available (darwin, Xorg, or Wayland)
  24 #
  25 # There are also pseudo-conditions which have a "side effect":
  26 #   flag <flags>  | Change how the program is run. See below.
  27 #   label <label> | Assign a label or name to the command so it can
  28 #                 | be started with :open_with <label> in ranger
  29 #                 | or `rifle -p <label>` in the standalone executable.
  30 #   else          | Always true.
  31 #
  32 # Flags are single characters which slightly transform the command:
  33 #   f | Fork the program, make it run in the background.
  34 #     |   New command = setsid $command >& /dev/null &
  35 #   r | Execute the command with root permissions
  36 #     |   New command = sudo $command
  37 #   t | Run the program in a new terminal.  If $TERMCMD is not defined,
  38 #     | rifle will attempt to extract it from $TERM.
  39 #     |   New command = $TERMCMD -e $command
  40 # Note: The "New command" serves only as an illustration, the exact
  41 # implementation may differ.
  42 # Note: When using rifle in ranger, there is an additional flag "c" for
  43 # only running the current file even if you have marked multiple files.
  44 
  45 ext x?html?, has chromium, X, flag f = chromium "$@"
  46 ext x?html?, has luakit,   X, flag f = luakit   "$@"
  47 ext x?html?, has surf,     X, flag f = surf     "$1"
  48 ext x?html?, has elinks,   terminal  = elinks   "$@"
  49 ext x?html?, has lynx,     terminal  = lynx     "$@"
  50 ext x?html?, has w3m,      terminal  = w3m      "$@"
  51 
  52 ext 1,   has man,    terminal  = man      "$1"
  53 ext exe, has wine,   X, flag f = wine     "$1"
  54 
  55 ext swf, has ruffle,     X, flag f = ruffle     "$1"
  56 ext swf, has lightspark, X, flag f = lightspark "$1"
  57 
  58 ext godot, has godot, X, flag f = godot    "$1"
  59 ext tscn,  has godot, X, flag f = godot    "$1"
  60 
  61 path Mail/.+$, has mutt, terminal = mutt -f  "$1"
  62 ext  mbox,     has mutt, terminal = mutt -f  "$1"
  63 
  64 mime ^text, X, flag f = gvim     "$@"
  65 mime ^text, terminal  = vim      "$@"
  66 
  67 mime ^image/svg,               X, flag f = xdg-open "$@"
  68 mime ^image/svg, has inkscape, X, flag f = inkscape "$@"
  69 mime ^image,     has sxiv,     X, flag f = sxiv     "$@"
  70 mime ^image,     has krita,    X, flag f = krita    "$@"
  71 mime ^image,     has gimp,     X, flag f = gimp     "$@"
  72 
  73 mime ^audio|ogg$|^video, X, flag f = mpv      "$@"
  74 mime ^audio|ogg$|^video, terminal  = mpv      "$@"
  75 
  76 ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has 7z  = 7z -p l  "$1" | numfmt --invalid=ignore --to=iec --field=3,4,5 | $PAGER
  77 ext gz|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als = als -e   "$@" | $PAGER
  78 
  79 label open,   X, flag f = xdg-open "$@"
  80 label editor, terminal  = $EDITOR  "$@"
  81 label pager,  terminal  = $PAGER   "$@"
  82 
  83 # vim: ft=config