]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/wsl_install.sh
[Keymap] Add missing tap dance action and fix RGB hues in personal keymaps (#6312)
[qmk_firmware.git] / util / wsl_install.sh
1 #!/bin/bash
2
3 dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4 pushd "$dir";
5
6 if [[ $dir != /mnt/* ]];
7 then
8     echo
9     echo "You need to clone the qmk_firmware repository outside the linux filesystem."
10     echo "Otherwise the windows executables can't be run."
11     exit 1
12 fi
13
14
15 while true; do
16     echo
17     echo "Do you want to install all toolchain dependencies needed for compiling QMK?"
18     echo "If you don't want that, you can install the dependencies manually."
19     read -p "(Y/N) " res
20     case $res in
21         [Yy]* ) ./linux_install.sh; break;;
22         [Nn]* ) break;;
23         * ) echo "Invalid answer";;
24     esac
25 done
26
27 download_dir=wsl_downloaded
28
29 source "$dir/win_shared_install.sh"
30
31 pushd "$download_dir"
32 while true; do
33     echo
34     echo "Flip need to be installed if you want to use that for programming."
35     echo "Please install it to the default location!"
36     read -p "Do you want to install it now? (Y/N) " res
37     case $res in
38         [Yy]* ) cmd.exe /c FlipInstaller.exe; break;;
39         [Nn]* ) break;;
40         * ) echo "Invalid answer";;
41     esac
42 done
43 popd
44
45
46 echo 
47 echo "Creating a softlink to the utils directory as ~/qmk_utils."
48 echo "This is needed so that the the make system can find all utils it need."
49 read -p "Press enter to continue (ctrl-c to abort)"
50 ln -sfn "$dir" ~/qmk_utils
51
52 if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc
53 then
54     echo
55     echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc"
56     echo "Not adding it twice"
57 else
58     while true; do
59         echo
60         echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your"
61         echo ".bashrc file? Without this make won't find the needed utils, so if you don't"
62         echo "want to do it automatically, then you have to do it manually later."
63         read -p "(Y/N)? " res
64         case $res in
65             [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;;
66             [Nn]* ) break;;
67             * ) echo "Invalid answer";;
68         esac
69     done
70 fi
71
72 while true; do
73     echo
74     echo "Do you want to add a symlink to the QMK repository in your home directory for"
75     echo "convenience? This will create a folder 'qmk_firmware' in your home directory."
76     echo "In the future you can use this folder instead of the full path on your Windows"
77     echo "file system."
78     read -p "(Y/N)? " res
79     case $res in
80         [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;;
81         [Nn]* ) break;;
82         * ) echo "Invalid answer";;
83     esac
84 done
85
86 echo
87 echo "******************************************************************************"
88 echo "Installation completed!"
89 echo "You need to open a new bash command prompt for all the utils to work properly"
90 echo "******************************************************************************"
91
92 popd > /dev/null