johnpapa / vscode-peacock

Subtly change the color of your Visual Studio Code workspace. Ideal when you have multiple VS Code instances, use VS Live Share, or use VS Code's Remote features, and you want to quickly identify your editor.
MIT License
1.04k stars 117 forks source link

surpriseMeOnStartup - Not on first window (unless hardcoded peacock.Color) #399

Open iyerusad opened 4 years ago

iyerusad commented 4 years ago

Is your feature request related to a problem? Please describe.

Only Peacock colorize windows when A. Hardcoded color values present in workspace (e.g. peacock.Color/workbench.colorCustomizations) B. Additional new windows opened (first window remains as is)

Feature: surpriseMeOnStartup

Describe the solution you'd like

Pseudo code (would skip first instance for surpriseMe, would use peacock color if hard coded, otherwise would no run peacock tweaks on the first window):

if (vscode.instances.length > 1 && !peacock.Color) {
  run peacock surpriseMe // Writes peacock.AutoSelectedColor
} else if (peacock.Color) { //Workspace has a **user set** window coloration, NOT peacock.AutoSelectedColor
  use peacock.Color settings
}
else {
 //otherwise do nothing, which should mean using existing theme's window coloring
}

Describe alternatives you've considered

Additional context https://github.com/johnpapa/vscode-peacock/issues/33#issuecomment-467944074

I'm not sure if you're able to detect if there's more than one instance open or not though, especially since VS Code is cross platform. It wouldn't be the worst thing in the world if it always applied a color scheme, but 80% of the time I'm only working in a single instance and wouldn't need the different color scheme (and I like my default theme colors, so it would be nice if they weren't overridden).

johnpapa commented 4 years ago

Thank you @iyerusad for creating this issue!