Skip to content

Instantly share code, notes, and snippets.

@detain
Created June 1, 2023 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save detain/9a5ab1d2c3d0408a6f7646ebcffe0530 to your computer and use it in GitHub Desktop.
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.
$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++."
#!/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