How to I start ranger directly from my file manager? [closed]

How do I make ranger start directly from my file manager, instead of first opening the terminal and then starting the application?

I have written this below code in my .desktop file:

#!/bin/bash
[Desktop Entry]
Name=Ranger
Exec=/bin/bash -c 'ranger'
Terminal=True
Type=Application

But, it doesn't seem to work. How do I fix it?

I tried adding bash at the end like this:

Exec="/bin/bash -c 'ranger';bash"

But, this doesn't seem to work either.

3

2 Answers

Remove

#!/bin/bash

from the beginning of file.

Change the Terminal line to:

Terminal=true

(lowercase true).

And

Exec=/bin/bash -c 'ranger'

to

Exec=/usr/bin/ranger

or whatever is the full path of the ranger command.

Another option would be to change the Exec command like this:

Exec=/usr/bin/gnome-terminal --active -- /usr/bin/ranger

If you need full screen terminal, you can try the --maximize and --full-screen options of gnome-terminal. Please, close all terminals before testing!

To find out the full path of gnome-terminal run the command:

whereis gnome-terminal
13
[Desktop Entry]
Name=Ranger
Exec=gnome-terminal -- ranger
Type=Application

works for me.

Credit:

3

You Might Also Like