Separate global and OS-specific config

This commit is contained in:
Manuel Thalmann 2024-09-22 17:50:05 +02:00
parent 4fe88bba12
commit d0b055140e
15 changed files with 101 additions and 61 deletions
scripts/Windows/Software

View file

@ -44,19 +44,11 @@ param(
$dir = New-TemporaryDirectory;
Push-Location $dir;
function Get-WinConfig {
param(
[string] $Name
)
Get-Config "valhalla.windows.$Name";
}
# Copy keyboard layout
# ToDo: Why not NewUser? Investiagte!
Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $False;
if (Get-WinConfig "legacyIconSpacing") {
if (Get-OSConfig "legacyIconSpacing") {
Write-Host "Setting up old-school Desktop Icon spacing";
Edit-DefaultUserKey {
@ -73,7 +65,7 @@ param(
};
}
if (-not (Get-WinConfig "dynamicLighting")) {
if (-not (Get-OSConfig "dynamicLighting")) {
Write-Host "Disabling Dynamic Lighting";
Edit-DefaultUserKey {
@ -87,7 +79,7 @@ param(
};
}
if (-not (Get-WinConfig "adware")) {
if (-not (Get-OSConfig "adware")) {
$startLayoutFile = "start.json";
Write-Host "Removing adware";
@ -151,7 +143,7 @@ param(
$startLayout | ConvertTo-Json -Compress | Set-Content "$env:SystemDrive\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.json";
}
if (Get-WinConfig "showFileExt") {
if (Get-OSConfig "showFileExt") {
Edit-DefaultUserKey {
param (
[RegistryKey] $Key

View file

@ -18,7 +18,7 @@ param (
Start-SoftwareInstaller @Parameters `
-Installer {
$params = "/WindowsTerminalProfile";
$defaultBranch = Get-Config "valhalla.git.defaultBranch";
$defaultBranch = Get-OSConfig "git.defaultBranch";
if ($defaultBranch) {
$params += " /DefaultBranchName:`"$defaultBranch`"";