-2

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.

FedKad
  • 13,420
Nick
  • 53

2 Answers2

2

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
FedKad
  • 13,420
1
[Desktop Entry]

Name=Ranger

Exec=gnome-terminal -- ranger

Type=Application

works for me.

Credit: https://askubuntu.com/a/1183018/248158

DK Bose
  • 44,553