Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-11-18 18:46:57

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

[CLOSED]Directory-menu goodie panel - open in terminal starting ranger

Subject ; xfce4-panel goodie directorie-menu (d-m)
Option  ; Open file in terminal with ranger support.

Hello,
I recently started to use ranger. I find it handy. Navigating trough scripts and see the content in a quick way and finally edit.
It would be cool to use d-m with ranger.

I do now, go to d-m > open in terminal > with alias fm > open ranger >  navigate > edit

As lazy as i am.
I am wondering if it is possible to open into ranger when opening the terminal with d-m.

I can't find out where i should look for the config to make a change to d-m.

Running arcolinux i3.       Thanks in advance.

Last edited by spnzdg (2019-11-19 23:36:53)

Offline

#2 2019-11-18 23:20:29

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

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

spnzdg wrote:

I am wondering if it is possible to open into ranger when opening the terminal with d-m.

The places plugin executes the default terminal emulator and default file manager as defined in Settings Manager > Preferred Applications. If you change the default file browser to:

xfce4-terminal -T ranger -x ranger "%s"

...it will start ranger in a terminal window for you.

However, everywhere else that the default file manager is executed, it will do the same. Otherwise, the running of the default terminal or file manager is harded coded into the plugin.


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 2019-11-19 09:09:56

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

Ah ok clear. Thanks for the explanation.

Offline

#4 2019-11-19 11:16:24

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

When i leave "%s", it works. The Pref.application adds it after save. That's nice.

With these settings, the terminal closes completely when closing ranger.
Can i prevent terminal close, when i close ranger.

In a normal situation. Opening ranger, i can close it and work further in the terminal.

Offline

#5 2019-11-19 11:48:23

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

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

spnzdg wrote:

Can i prevent terminal close, when i close ranger.

Create a script with the following content (assuming bash as the shell):

#!/bin/bash
ranger $@
bash

...and make it executable. For the File Manager preference string, use:

xfce4-terminal -T ranger -x /path/to/script

...replace /path/to/script with the actual path to and name of your script.


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

#6 2019-11-19 13:40:49

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

Thanks for suggestion for the .sh.

For me:

#!/bin/zsh
ranger $@
zsh

---------------------------------------------

Next described  happens for a while now,  (if this need a new topic, i can create it). It's a wee bit related.

I don't know what i did in the past, when i want to open a file in Thunar from another application, Catfish opens.
When i search in catfish and want to open Thunar from there, Catfish opens.
When i remove catfish. All is working fine.

These are some lines i found related to catfish and thunar.   [ /usr/share/ ]

$ grep -rni --color=auto catfish

# highlighted from the search
directory=org.xfce.Catfish.desktop;ranger.desktop;thunar.desktop;vifm.desktop
inode/directory=org.xfce.Catfish.desktop;ranger.desktop;thunar.desktop;vifm.desktop;

$ sudo grep -rni --color=auto thunar

inode/directory=org.xfce.Catfish.desktop;ranger.desktop;thunar.desktop;vifm.desktop;
thunar.desktop:191:Exec=thunar %F
thunar.desktop:192:Icon=Thunar

Something to do with xdg-open mime-type ? Can't find a satisfying answer on the net, yet.

Need more info: let me know.
arcolinux i3


Thanks.

Last edited by spnzdg (2019-11-19 13:41:45)

Offline

#7 2019-11-19 16:51:35

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

Sorry, the .sh script does not work with preferred Applications settings (pref-app).


Made script executable. Tried User Dir as path. Tried Root location.
It starts up the terminal in normal mode.

following step from terminal.

  sh startup-ranger.sh 

Ranger runs as expected.

When i close it with (q) it gives this comment:

         The option named `ranger' does not exist

And brings back the terminal in a normal state. Everything worked with his commend.

The question is still, why it does not launch from the pref-app. 
Is it the way the pref-app handles the command in a different way then the terminal itself?

Offline

#8 2019-11-19 23:36:17

spnzdg
Member
From: Amsterdam
Registered: 2019-08-29
Posts: 23

Re: [CLOSED]Directory-menu goodie panel - open in terminal starting ranger

After some thought, i think i need two terminals for what i want to approach.

I  installed terminator.
Settings terminator:

command = start ranger when terminal start.
command = restart ranger when session (q) quit.

At this point i discovered that i put terminator in a loop with the commands.

Which made terminator a fixed cli-file-manager.  that's ok for the moment.
i cannot right-click in ranger to access the settings of terminator.  [that's not a issue] but funny.


I can work with this setup for the moment. [closed]

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 547.59 KiB (Peak: 548.44 KiB) ]