From 349e29d1bc7133973b682f0ac77388508ae34740 Mon Sep 17 00:00:00 2001 From: 4nkitd <4nkitd@gmail.com> Date: Sun, 12 Nov 2023 22:43:21 +0530 Subject: [PATCH 1/3] add windows install script --- README.md | 5 +++++ util/install_windows.cmd | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 util/install_windows.cmd diff --git a/README.md b/README.md index c5dbf11..ba44a3c 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,11 @@ brew install font-monaspace ### Windows You can manually drag the fonts from the `fonts/otf` or `fonts/variable` directory into `C:\Windows\Fonts`. Alternatively, right-click the fonts you want and click Install. +```powershell +$ cd util +$ ./install_windows.sh +``` + ### Linux You can manually drag the fonts from the `fonts/otf` and `fonts/variable` directory into `~/.local/share/fonts`. diff --git a/util/install_windows.cmd b/util/install_windows.cmd new file mode 100644 index 0000000..071e092 --- /dev/null +++ b/util/install_windows.cmd @@ -0,0 +1,19 @@ +@echo off + +echo Installing fonts... + +set mainFontFolder="./../fonts/otf" + +for /r "%mainFontFolder%" %%f in (*.ttf, *.otf, *.woff, *.woff2) do ( + copy "%%f" "%WINDIR%\Fonts" + reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%%~nxf (TrueType)" /t REG_SZ /d %%~nxf /f +) + +set mainFontFolder="./../fonts/varible" + +for /r "%mainFontFolder%" %%f in (*.ttf, *.otf, *.woff, *.woff2) do ( + copy "%%f" "%WINDIR%\Fonts" + reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "%%~nxf (TrueType)" /t REG_SZ /d %%~nxf /f +) + +echo All fonts installed successfully. \ No newline at end of file From 9b48d48c1deeaf584b119a6a3b159a732b8f280d Mon Sep 17 00:00:00 2001 From: 4nkitd <4nkitd@gmail.com> Date: Sun, 12 Nov 2023 22:51:25 +0530 Subject: [PATCH 2/3] check for admin rights --- util/install_windows.cmd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/util/install_windows.cmd b/util/install_windows.cmd index 071e092..793b5f1 100644 --- a/util/install_windows.cmd +++ b/util/install_windows.cmd @@ -1,5 +1,14 @@ @echo off +echo Checking for admin rights... +net session >nul 2>&1 +if %errorLevel% == 0 ( + echo Admin rights granted. +) else ( + echo Admin rights required. Please run this script as an administrator. + exit /b 1 +) + echo Installing fonts... set mainFontFolder="./../fonts/otf" From ef6bc1b8fea2efd3c0ad699a31faef4b0e50a85d Mon Sep 17 00:00:00 2001 From: 4nkitd <4nkitd@gmail.com> Date: Wed, 15 Nov 2023 18:13:38 +0530 Subject: [PATCH 3/3] powershell script extension correction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba44a3c..8d5815b 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ You can manually drag the fonts from the `fonts/otf` or `fonts/variable` directo ```powershell $ cd util -$ ./install_windows.sh +$ ./install_windows.cmd ``` ### Linux