diff --git a/README.md b/README.md index 8747e07..d6e81f6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,32 @@ # utility-set-browser.sh -Set the default browser on Linux \ No newline at end of file +## Setting web browser script + +Copy the file to your local bin folder and make sure it is executable (you may need to create the bin folder beforehand) + +```text +mkdir -p ~/.local/bin +chmod +x ~/.local/bin/set-browser.sh +``` + +The script requires you to know the desktop file name for the browser in question - run the script without argument to get a list of available browser launchers. + +You can find the correct name by searching the folder `/usr/share/applications` as this example shows. + +The command searches the file contents for the string __internet__ which indicates a browser applications, pipes the result through cut and print only the last column. Then use the appropriate file as argument for the script. + +```text +$ grep -rl 'internet' /usr/share/applications | cut -d'/' -f5 +org.midori_browser.Midori.desktop +microsoft-edge-dev.desktop +firefox-developer-edition.desktop +vivaldi-stable.desktop +firefox.desktop +``` + +To set the browser run the script like this +``` +set-browser.sh microsoft-edge-dev.desktop +``` + +Source: https://root.nix.dk/en/utility-scripts/set-browser-script \ No newline at end of file