-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.

3
  • 1
    VTC because "I am using ElementaryOS, which is a flavor of ubuntu."
    – DK Bose
    Feb 2, 2020 at 15:25
  • This site only supports Ubuntu and its official flavors. Elementary OS is off-topic here.
    – DK Bose
    Feb 2, 2020 at 15:26
  • Elementary OS is also ubuntu itself. Mr.DK Bose, why are you so rude in all your posts?
    – Nick
    Feb 2, 2020 at 16:28

2 Answers 2

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
13
  • ok, this worked but it looks very ugly. :(( This is how it looks like when executed from inside the terminal: i.stack.imgur.com/rTL1n.png and This is how it looks like when executed your way: i.stack.imgur.com/2CoUi.png So how do I get it to look like how it looks when executed from inside the terminal?
    – Nick
    Feb 2, 2020 at 13:58
  • btw, my only mistake was using capital T in true, other things kept the same worked as well. :)) I just tried it. :) I am not sure which is a better approach though.
    – Nick
    Feb 2, 2020 at 14:16
  • Can you change the Exec line like this? Exec=/usr/bin/gnome-terminal --active -- /usr/bin/ranger
    – FedKad
    Feb 2, 2020 at 14:23
  • this one isn't working. :(
    – Nick
    Feb 2, 2020 at 14:35
  • 1
    I am using ElementaryOS, which is a flavor of ubuntu.
    – Nick
    Feb 2, 2020 at 14:42
1
[Desktop Entry]

Name=Ranger

Exec=gnome-terminal -- ranger

Type=Application

works for me.

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

3
  • sorry, this didn't work for me but the above answer worked.
    – Nick
    Feb 2, 2020 at 14:02
  • well, but it looks very ugly and is not what I expected. so I am waiting on the other answer's owner to reply back on how to fix the ugliness.
    – Nick
    Feb 2, 2020 at 14:09
  • if you could please see my reply to the first answer and tell me how to fix the ugliness, that would be really helpful.
    – Nick
    Feb 2, 2020 at 14:17

Not the answer you're looking for? Browse other questions tagged .