Ranger refuses to open in $HOME when opened with DWM shortcut

1

I'm currently using DWM as my window manager, and for convenience I'd like to be able to open a seperate instance of my terminal (ST) that automatically opens ranger for me.

I mapped a custom command in DWM that runs the following command: "st ranger".

I noticed however, that no matter what I try, ranger (only when opened in this way) will only open itself in my ST directory (which is $HOME/st) as if it were the starting directory. If I were to open ranger within an already existing terminal instance, it starts up and behaves exactly as one would expect.

I tried all sorts of modifications to this command to try to force ranger to open in my $HOME directory, such as "st ranger $HOME" and "st ranger --cmd='cd $HOME'" and a slew of other variations. Whenever I apply these commands through my DWM keybind my terminal quickly opens and closes with a brief error message saying that my $HOME directory is undefined. It will only open if my ST directory is in my home folder. If I move the ST directory elsewhere it gives me a similar error.

Can anyone explain why this is happening and how I could possibly fix it?

Daniel Mestre

Posted 2018-12-06T21:36:49.010

Reputation: 11

1Yes, when I echo $HOME, I get "/home/dkmestre" – Daniel Mestre – 2018-12-06T21:48:48.707

Strange. I'll do some more research. – Ben M. – 2018-12-06T21:50:45.263

Thanks, I've been doing some digging myself, and I can't quite pin down if it's a ranger issue, dwm issue, or an ST issue (although I honestly doubt it's ST). – Daniel Mestre – 2018-12-06T21:53:39.903

I also doubt it's to do with ST. I use ST and Ranger myself, though not dwm. If I had to put money on it, I'd go with a ranger issue. Still haven't been able to recreate the issue or turn up anything, unfortunately. – Ben M. – 2018-12-08T05:32:45.453

No answers