desbma / rsop

Simple, fast & configurable tool to open and preview files
MIT License
22 stars 3 forks source link

[Looked into "Usage with ranger"] How to use rsop in ranger? #2

Closed kohane27 closed 1 year ago

kohane27 commented 1 year ago

Hello there. Hope you're doing well. Thank you for creating rsop.

I understand that it may be a stupid question, but please bear with me.

I've looked into the Usage with ranger but still can't figure out how to use rsop in ranger.

What I've tried

  1. Remove the original entire content of rifle.conf and add the following in rifle.conf:
ext * = rso "$@"

The reason is that, we're using rsop to match against all extensions, hence the above syntax.

  1. Remove the original content of scope.sh and replace with the following:
RSOP_MODE=open COLUMNS="$2" LINES="$3" exec rsop "$1"

So the entire content of scope.sh becomes the above one line.

  1. Open ranger again

  2. Navigate to rc.conf and ranger has the following error output:

Loader work process failed: Getting preview of /home/username/.config/ranger/scope.sh (Percent: 0)

2023-04-21-20-00-38

  1. When I tried to open the file with l, the following output occurs:
nothing to repeat at position 2

2023-04-21-20-00-43

Any input is much appreciated. Thank you.

desbma commented 1 year ago

Hi, thanks for the kind words.

The instructions were incorrect in the README, I have updated them.

For scope.sh, you need:

#!/bin/sh
RSOP_MODE=preview COLUMNS="$2" LINES="$3" exec rsop "$1"
kohane27 commented 1 year ago

Apologies for my late reply. Just tested and it works perfectly now. Thank you for looking into this issue!