Nick Corona
Nick Corona

Reputation: 45

How do I get Ranger to open HTML files in Google Chrome instead of Firefox?

I'm using Ranger as my default file manager on Linux Mint. I can't figure out how to make Ranger open HTML files in Google Chrome.

Upvotes: 3

Views: 1757

Answers (3)

Amin Hemati Nik
Amin Hemati Nik

Reputation: 517

As a simpler alternative solution, execute:

$ ranger --copy-config rifle

then edit ~/.config/ranger/rifle.conf and just comment out the line containing Firefox option:

ext x?html?, has opera,            X, flag f = opera -- "$@"
#ext x?html?, has firefox,          X, flag f = firefox -- "$@"
ext x?html?, has seamonkey,        X, flag f = seamonkey -- "$@"

Upvotes: 0

Flavio Oliveira
Flavio Oliveira

Reputation: 419

Press r

0 | firefox -- "$@"                                                                                                                                                                                                                           
1 | chromium -- "$@"                                                                                                                                                                                                                          
2 | google-chrome -- "$@"                                                                                                                                                                                                                     
3 | w3m "$@"                                                                                                                                                                                                                                  
4 | ${VISUAL:-$EDITOR} -- "$@"                                                                                                                                                                                                                
5 | "$PAGER" -- "$@"                                                                                                                                                                                                                          
6 | xdg-open -- "$@"                                                                                                                                                                                                                          
8 | mkdir -p -- ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash; mv -- "$@" ${XDG_DATA_DIR:-$HOME/.ranger}/ranger-trash 

:open_with vim

Instead type a number I typed vim, and it's working.

Upvotes: 0

DasEarl
DasEarl

Reputation: 231

Copy the example rifle.conf

gunzip -c /usr/share/doc/ranger/config/rifle.conf.gz > .config/ranger/rifle.conf

And add ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@" above line 57

If you want to open a new window everytime, add --new-window to the command

Ranger config

Upvotes: 2

Related Questions