Skip to content

Instantly share code, notes, and snippets.

@dmbfm
Last active April 22, 2021 17:10
Show Gist options
  • Save dmbfm/63b5f0c01f9e5a708f3629fecc718d37 to your computer and use it in GitHub Desktop.
Save dmbfm/63b5f0c01f9e5a708f3629fecc718d37 to your computer and use it in GitHub Desktop.
Fanzy-zones configurator
#!/usr/bin/env node
const fs = require('fs');
const path = `${process.env.LocalAppData}\\Microsoft\\PowerToys\\FancyZones\\zones-settings.json`;
fs.copyFileSync(path, path + `.bk-${Date.now()}`);
let settings = require(path);
let customZoneSets = [
{
"uuid": "{73B592A4-41D0-42C6-9FB0-03E2674A2C99}",
"name": "Custom Layout 4",
"type": "canvas",
"info": {
"ref-width": 1920,
"ref-height": 1080,
"zones": [
{
"X": 36,
"Y": 16,
"width": 1842,
"height": 1014
},
{
"X": 194,
"Y": 76,
"width": 1539,
"height": 928
},
{
"X": 376,
"Y": 143,
"width": 1176,
"height": 796
}
],
"sensitivity-radius": 20
}
},
{
"uuid": "{57B5342D-095F-4E54-8B72-4B4789F952A3}",
"name": "Custom Layout 5",
"type": "canvas",
"info": {
"ref-width": 1920,
"ref-height": 1080,
"zones": [
{
"X": 75,
"Y": 41,
"width": 1149,
"height": 974
},
{
"X": 1288,
"Y": 41,
"width": 567,
"height": 606
},
{
"X": 1288,
"Y": 668,
"width": 567,
"height": 347
}
],
"sensitivity-radius": 20
}
}
];
settings['custom-zone-sets'] = customZoneSets;
fs.writeFileSync(path, JSON.stringify(settings, null, 2));
console.log(settings);
{
"name": "fancy-zones-configurator",
"version": "1.0.0",
"bin": "./index.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment