Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-12-08 05:05:28

mw3modderman
Member
Registered: 2021-12-08
Posts: 4

Ranger File Manager as Default File Manager Errors

I could not get Ranger to be my default file manager using every tutorial I could find. Help is appreciated - I'll describe my attempts below:

1. In Default Application -> Utilities -> Other... -> EITHER ranger "%s" OR xfce4-terminal -x ranger "%s"
- Click Open Desktop Folder Icon Result: "Failed to execute default File Manager. Input/output error."

2. In Default Application -> Utilities -> Other... xfce4-terminal -T ranger -x /home/user/.scripts/Ranger_Default_File_Manager.sh "%s"
2.1 Ranger_Default_File_Manger.sh is just "ranger $@" AND "zsh"
- Click Open Desktop Folder Icon Result: "Inaccessible paths: home/user/Desktop/Folder"
  - The "/" before "home" is missing for some reason? So I tried adding a slash to "ranger /$@"
    - Click Open Desktop Folder Icon Result: "Inaccessible paths: /file:///home/ertecturing/Desktop/Folder"
      - The problem is that "file:///" should be "file:////" (4 slashes), I've tested manually it with 4 slashes & it works, but don't know how to automate it to have 4 slashes.

3. In Default Application -> Utilities -> Other... -> ranger.desktop
3.1 Desktop File Configuration: Terminal=false AND Exec=xfce4-terminal -x ranger %F
- Click Open Desktop Folder Icon Result: "Failed to execute default File Manager. Input/output error."

NOTE: I can get Ranger to work as file/folder opener by right-clicking a desktop file/folder and selecting open with ranger, but I don't want to have to right-click an icon & pick ranger every time.

Offline

#2 2021-12-08 11:46:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,486

Re: Ranger File Manager as Default File Manager Errors

Hello and welcome.

Try a script like this:

#!/bin/bash

OUT=$(sed -e 's/\/{3}/\/{4}/g' $1)
xfce4-terminal -T "Ranger File Manager" -e ranger $OUT 

Edit: cleaned up sed command

Last edited by ToZ (2021-12-08 11:48:42)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-12-08 21:27:53

mw3modderman
Member
Registered: 2021-12-08
Posts: 4

Re: Ranger File Manager as Default File Manager Errors

ToZ wrote:

Hello and welcome.

Try a script like this:

#!/bin/bash

OUT=$(sed -e 's/\/{3}/\/{4}/g' $1)
xfce4-terminal -T "Ranger File Manager" -e ranger $OUT 

Edit: cleaned up sed command

I played with some ideas you gave me, but not solved so far.

1. I set my default file manager to:
  /home/ertecturing/.scripts/Ranger_Default_File_Manager.sh "%s"

2. Shell Script set to:
  OUT=$(sed -e 's/\/\/\//\/\/\/\//g' $1)
  xfce4-terminal -T "Ranger File Manager" -e ranger $OUT
    OUT is not recognized by ranger in any context I've tried. Just outputs blank lines.

3. Found a functional sed command
  echo $@ | sed "s/\/\/\//\/\/\/\//g" >> ~/Desktop/file
    - Adds the 4th "/" slash to "file:////" in output file, but I can't get it to work the way that you were suggesting.
      - Anytime I set OUT = $@ | sed "s/\/\/\//\/\/\/\//g" it just outputs blank lines when tested on text file. And terminal will just close if tried there.

Last edited by mw3modderman (2021-12-08 21:29:51)

Offline

#4 2021-12-08 23:29:47

mw3modderman
Member
Registered: 2021-12-08
Posts: 4

Re: Ranger File Manager as Default File Manager Errors

Offline

#5 2021-12-09 00:03:07

mw3modderman
Member
Registered: 2021-12-08
Posts: 4

Re: Ranger File Manager as Default File Manager Errors

Additional Solution for Spaces:

1. `OUT=$(echo "$@" | sed "s:///:////:g" | sed "s/%20/ /g")`
2. `xfce4-terminal -T "Ranger File Manager" -x ranger "$OUT"`

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.013 seconds, 7 queries executed - Memory usage: 535.58 KiB (Peak: 536.42 KiB) ]