Created
June 1, 2023 01:36
-
-
Save detain/9a5ab1d2c3d0408a6f7646ebcffe0530 to your computer and use it in GitHub Desktop.
Downlaods and installs a bunch of additional nice themes for Notepad++ installer in powershell and bash flavors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$programFilesThemesDir = "$env:PROGRAMFILES\Notepad++\themes\" | |
$appDataThemesDir = "$env:APPDATA\Notepad++\themes\" | |
# Check if both directories exist | |
$programFilesThemesExist = Test-Path -Path $programFilesThemesDir | |
$appDataThemesExist = Test-Path -Path $appDataThemesDir | |
# Prompt the user to select the installation directory | |
if ($programFilesThemesExist -and $appDataThemesExist) { | |
$installToProgramFiles = Read-Host "Both 'Program Files' and 'AppData' themes directories exist. Where do you want to install the themes? Enter 'P' for Program Files or 'A' for AppData." | |
$installToProgramFiles = $installToProgramFiles.ToUpper() | |
} elseif ($programFilesThemesExist) { | |
$installToProgramFiles = "P" | |
} elseif ($appDataThemesExist) { | |
$installToProgramFiles = "A" | |
} | |
# Set the installation directory based on user selection or availability | |
if ($installToProgramFiles -eq "P") { | |
$themeDir = $programFilesThemesDir | |
} elseif ($installToProgramFiles -eq "A") { | |
$themeDir = $appDataThemesDir | |
} else { | |
Write-Output "No suitable themes directory found. Exiting script." | |
exit | |
} | |
$repos = @( | |
"60ss/Npp-1-Dark", | |
"Codextor/npp-mariana-theme", | |
"Codextor/npp-material-theme", | |
"chriskempson/tomorrow-theme", | |
"dracula/dracula-theme", | |
"jkesanen/notepadplusplus-zenburn", | |
"kurtmkurtm/HyperTheme-NotepadPlusPlus", | |
"mnmlize/npp-one-monokai-theme", | |
"nordtheme/notepadplusplus", | |
"walesmd/notepad-plus-plus-solarized", | |
"wburton95/Notepadpp-Gruvbox-Port" | |
) | |
foreach ($repo in $repos) { | |
$d = $repo -replace "/", "-" | |
git clone "https://github.com/$repo" $d | |
Copy-Item -Path (Get-ChildItem -Path $d -Filter "*.xml" -File -Recurse).FullName -Destination $themeDir -Verbose | |
Remove-Item -Path $d -Recurse -Force | |
} | |
Write-Output "Themes are installed. Restart Notepad++." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#themeDir="/mnt/c/Program Files/Notepad++/themes/" | |
themeDir="/mnt/c/Users/joehu/AppData/Roaming/Notepad++/themes/" | |
IFS=" | |
"; repos="60ss/Npp-1-Dark | |
Codextor/npp-mariana-theme | |
Codextor/npp-material-theme | |
chriskempson/tomorrow-theme | |
dracula/dracula-theme | |
jkesanen/notepadplusplus-zenburn | |
kurtmkurtm/HyperTheme-NotepadPlusPlus | |
mnmlize/npp-one-monokai-theme | |
nordtheme/notepadplusplus | |
walesmd/notepad-plus-plus-solarized | |
wburton95/Notepadpp-Gruvbox-Port" | |
for r in $repos; do | |
d=$(echo $r|tr / -); | |
git clone https://github.com/$r $d; | |
cp -v $(find $d -name "*xml" -type f) $themeDir | |
rm -rf $d | |
done | |
echo "Themes are installed, restart notepad++" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment