Skip to content

Commit d2085e2

Browse files
julesvanriegithub-actions
andauthored
Interactive browser selection for WSL (#330)
* Interactive browser selection for WSL * setup guides generated --------- Co-authored-by: github-actions <github-actions@github.com>
1 parent f6444b6 commit d2085e2

File tree

5 files changed

+70
-168
lines changed

5 files changed

+70
-168
lines changed

WINDOWS.es.md

Lines changed: 10 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -601,88 +601,29 @@ Cuando termines, tu terminal debería lucir así:
601601
:x: Si no, por favor **pídele ayuda a un profesor**.
602602

603603

604-
## Conexión de tu navegador predeterminado con Ubuntu
604+
## Linking your default browser to Ubuntu
605605

606606
Para asegurarnos de que puedas interactuar desde la terminal de Ubuntu con el navegador que tienes instalado en Windows, debemos definirlo como tu navegador predeterminado aquí.
607607

608-
:warning: Tienes que ejecutar al menos uno de los siguientes comandos:
608+
Ejecuta el siguiente comando y sigue las instrucciones. La herramienta te pedirá que elijas uno de los navegadores disponibles en tu sistema. Solo necesitas escribir el **número** que aparece delante del navegador.
609609

610-
<details>
611-
<summary>Google Chrome como tu navegador predeterminado</summary>
612-
613-
Ejecuta este comando:
614-
615-
```bash
616-
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
617-
```
618-
619-
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
620-
621-
```bash
622-
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
623-
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
624-
```
625-
626-
Si no es el caso, ejecuta lo siguiente:
627-
628-
```bash
629-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
630-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
631-
```
632-
</details>
633-
634-
<details>
635-
<summary>Mozilla Firefox como tu navegador predeterminado</summary>
636-
637-
Ejecuta el siguiente comando:
638-
639-
```bash
640-
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
641-
```
642-
643-
Si obtienes un error como este `ls: cannot access...` corre el siguiente comandos:
644-
645-
```bash
646-
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
647-
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
648-
```
649-
650-
Si no es el caso, ejecuta lo siguiente:
651-
652-
```bash
653-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
654-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
655-
```
656-
</details>
657-
658-
<details>
659-
<summary>Microsoft Edge como tu navegador predeterminado</summary>
660-
661-
Ejecuta el siguiente comandos:
610+
```bash
611+
bash -c "$(curl -s https://raw.githubusercontent.com/julesvanrie/wslsetbrowser/refs/heads/main/wslsetbrowser.sh)"
612+
```
662613

663-
```bash
664-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
665-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
666-
```
667-
</details>
614+
Reinicia tu terminal:
668615

669-
Reinicia tu terminal.
616+
```bash
617+
exec zsh
618+
```
670619

671620
Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌":
672621

673622
```bash
674623
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
675624
```
676625

677-
Si no lo hace pero
678-
679-
:heavy_check_mark: sí obtienes este mensaje, puedes continuar :+1:
680-
681-
:x: De lo contrario, escoge un navegador de la lista de arriba y ejecuta el comando correspondiente. Luego no olvides reiniciar tu terminal:
682-
683-
```bash
684-
exec zsh
685-
```
626+
Si no es así, puedes seguir [estas instrucciones](https://github.com/lewagon/setup/blob/master/_partials/es/windows_browser.md) para configurar tu navegador predeterminado manualmente.
686627

687628
No dudes en **pedirle ayuda a tu profesor**.
688629

WINDOWS.md

Lines changed: 9 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -619,114 +619,25 @@ At the end your terminal should look like this:
619619

620620
To be sure that you can interact with your browser installed on Windows from your Ubuntu terminal, we need to set it as your default browser there.
621621

622-
:warning: You need to execute at least one of the following commands below:
622+
Run the following command and follow the instructions. The tool will prompt you to choose one of the browsers that are available on your system. You just need to type in the **number** that is shown in front of the browser.
623623

624-
<details>
625-
<summary>Google Chrome as your default browser</summary>
626-
627-
Run the command:
628-
629-
```bash
630-
ls /mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe
631-
```
632-
633-
Did you get an error like `ls: cannot access...`?
634-
635-
<details>
636-
<summary>Yes, I had an error</summary>
637-
638-
Run the following commands:
639-
640-
```bash
641-
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
642-
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
643-
```
644-
</details>
645-
646-
<details>
647-
<summary>No, everything was fine</summary>
648-
649-
Run the following commands:
650-
651-
```bash
652-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
653-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc
654-
```
655-
</details>
656-
657-
---
658-
659-
</details>
660-
661-
<details>
662-
<summary>Mozilla Firefox as your default browser</summary>
663-
664-
Run the command:
665-
666-
```bash
667-
ls /mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe
668-
```
669-
670-
Did you get an error like `ls: cannot access...`?
671-
672-
<details>
673-
<summary>Yes, I had an error</summary>
674-
675-
Run the following commands:
676-
677-
```bash
678-
echo "export BROWSER=\"/mnt/c/Program Files/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
679-
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
680-
```
681-
682-
</details>
683-
684-
<details>
685-
<summary>No, everything was fine</summary>
686-
687-
Run the following commands:
688-
689-
```bash
690-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe\"" >> ~/.zshrc
691-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Mozilla Firefox/firefox.exe'\"" >> ~/.zshrc
692-
```
693-
</details>
694-
695-
---
696-
697-
</details>
698-
699-
<details>
700-
<summary>Microsoft Edge as your default browser</summary>
701-
702-
Run the commands:
703-
704-
```bash
705-
echo "export BROWSER=\"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe\"" >> ~/.zshrc
706-
echo "export GH_BROWSER=\"'/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'\"" >> ~/.zshrc
707-
```
708-
709-
---
624+
```bash
625+
bash -c "$(curl -s https://raw.githubusercontent.com/julesvanrie/wslsetbrowser/refs/heads/main/wslsetbrowser.sh)"
626+
```
710627

711-
</details>
628+
Reset your terminal:
712629

713-
Restart your terminal.
630+
```bash
631+
exec zsh
632+
```
714633

715634
Then please make sure that the following command returns "Browser defined 👌":
716635

717636
```bash
718637
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
719638
```
720639

721-
If it does not,
722-
723-
:heavy_check_mark: If you got this message, you can continue :+1:
724-
725-
:x: If not, choose a browser in the list above and execute the corresponding command. Then don't forget to reset your terminal:
726-
727-
```bash
728-
exec zsh
729-
```
640+
If it does not, you can follow [these instructions](https://github.com/lewagon/setup/blob/master/_partials/windows_browser.md) to set your default browser manually.
730641

731642
Do not hesitate to **contact a teacher**.
732643

_partials/es/windows_browser.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Linking your default browser to Ubuntu
2+
3+
Para asegurarnos de que puedas interactuar desde la terminal de Ubuntu con el navegador que tienes instalado en Windows, debemos definirlo como tu navegador predeterminado aquí.
4+
5+
Ejecuta el siguiente comando y sigue las instrucciones. La herramienta te pedirá que elijas uno de los navegadores disponibles en tu sistema. Solo necesitas escribir el **número** que aparece delante del navegador.
6+
7+
```bash
8+
bash -c "$(curl -s https://raw.githubusercontent.com/julesvanrie/wslsetbrowser/refs/heads/main/wslsetbrowser.sh)"
9+
```
10+
11+
Reinicia tu terminal:
12+
13+
```bash
14+
exec zsh
15+
```
16+
17+
Luego asegúrate de que el siguiente comando devuelva "Browser defined 👌":
18+
19+
```bash
20+
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
21+
```
22+
23+
Si no es así, puedes seguir [estas instrucciones](https://github.com/lewagon/setup/blob/master/_partials/es/windows_browser.md) para configurar tu navegador predeterminado manualmente.
24+
25+
No dudes en **pedirle ayuda a tu profesor**.

_partials/windows_browser.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Linking your default browser to Ubuntu
2+
3+
To be sure that you can interact with your browser installed on Windows from your Ubuntu terminal, we need to set it as your default browser there.
4+
5+
Run the following command and follow the instructions. The tool will prompt you to choose one of the browsers that are available on your system. You just need to type in the **number** that is shown in front of the browser.
6+
7+
```bash
8+
bash -c "$(curl -s https://raw.githubusercontent.com/julesvanrie/wslsetbrowser/refs/heads/main/wslsetbrowser.sh)"
9+
```
10+
11+
Reset your terminal:
12+
13+
```bash
14+
exec zsh
15+
```
16+
17+
Then please make sure that the following command returns "Browser defined 👌":
18+
19+
```bash
20+
[ -z "$BROWSER" ] && echo "ERROR: please define a BROWSER environment variable ⚠️" || echo "Browser defined 👌"
21+
```
22+
23+
If it does not, you can follow [these instructions](https://github.com/lewagon/setup/blob/master/_partials/windows_browser.md) to set your default browser manually.
24+
25+
Do not hesitate to **contact a teacher**.

build.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
vscode_extensions
6565
setup/cli_tools
6666
setup/oh_my_zsh
67-
setup/windows_browser
67+
windows_browser
6868
direnv
6969
setup/gh_cli
7070
ubuntu_gcloud

0 commit comments

Comments
 (0)