catppuccin / windows-files

🍪 Soothing pastel theme for Windows Files
MIT License
104 stars 4 forks source link

feat: use new JSON format, add install script #8

Closed nekowinston closed 6 months ago

nekowinston commented 6 months ago

docs need to be updated, script should work already

nekowinston commented 6 months ago

Closing all other issues since the complete theming mechanics have changed

yaira2 commented 6 months ago

@nekowinston thank you for updating this! If you're interested, feel free to open a PR on the Files website linking to this repo https://github.com/files-community/Website/.

sgoudham commented 6 months ago

Just leaving this here for the future, I wanted to try the following code to see if it would work on Powershell 5.1

https://stackoverflow.com/questions/75182380/how-to-convert-nested-json-into-hashtable-in-powershell

function Convert-PSCToHashTable
{
  param(
    $InputObject, 
    [int]$Depth = 5
  )

  if($Depth -gt 0){
    if($InputObject -is [System.Collections.IList]){
      return @($InputObject |ForEach-Object {Convert-PSCToHashTable $_ -Depth ($Depth - 1)})
    }

    if($InputObject.psobject.BaseObject -is [System.Management.Automation.PSCustomObject]){
      $ht = @{}
      foreach($prop in $InputObject.psobject.Properties){
        $ht[$prop.Name] = Convert-PSCToHashTable $prop.Value -Depth ($Depth - 1)
      }
      return $ht
    }
  }

  return $InputObject
}

$object = ConvertFrom-Json $json
$hashtable = Convert-PSCToHashTable $object

I'll probably try it out later when I'm on windows just out of curiosity