cp /usr/share/applications/ranger.desktop ~/.local/share/applications/ranger.desktop
nvim ~/.local/share/applications/ranger.desktop
Change these parameters to the respective values
Terminal=false
Exec=alacritty -e ranger
Then, make sure you have ranger.desktop as your default for inode/directory using xdg-mime.
xdg-mime default ranger.desktop inode/directory
Lastly! run:
update-desktop-database ~/.local/share/applications