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?