Update README.md

This commit is contained in:
root 2024-01-03 10:28:52 +01:00
parent 4011242035
commit b9bfb58b7e

View file

@ -1,3 +1,32 @@
# utility-set-browser.sh
Set the default browser on Linux
## 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