betterdisplaycli 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "betterdisplaycli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "TypeScript bindings for `betterdisplaycli`.",
5
5
  "author": "Lucas Garron <code@garron.net>",
6
6
  "license": "MIT",
package/src/Device.ts CHANGED
@@ -104,6 +104,7 @@ class SingleDisplay extends Device {
104
104
  ).shellOut({ print: false });
105
105
  },
106
106
  };
107
+
107
108
  string = {
108
109
  get: async (
109
110
  settingName: STRING_SETTING,
@@ -149,9 +150,10 @@ class SingleDisplay extends Device {
149
150
  const currentResolution = await this.resolution.get();
150
151
 
151
152
  const args: string[] = [];
153
+ // TODO: implement batch changes.
152
154
  if (
153
155
  resolutionInfo.width !== currentResolution.width ||
154
- resolutionInfo.width !== currentResolution.height
156
+ resolutionInfo.height !== currentResolution.height
155
157
  ) {
156
158
  args.push(`--resolution=${resolutionInfo.logicalResolutionString()}`);
157
159
  }
@@ -159,7 +161,7 @@ class SingleDisplay extends Device {
159
161
  isNotUndefined(resolutionInfo.hiDPI) &&
160
162
  resolutionInfo.hiDPI !== currentResolution.hiDPI
161
163
  ) {
162
- args.push(`--hiDPI=${resolutionInfo.hiDPI}`);
164
+ args.push(`--hiDPI=${resolutionInfo.hiDPI ? "on" : "off"}`);
163
165
  }
164
166
  if (
165
167
  isNotUndefined(resolutionInfo.notch) &&
@@ -65,7 +65,6 @@ export class ResolutionInfo {
65
65
  const match = s.match(
66
66
  /^([1-9][0-9]*)[x×]([1-9][0-9]*)+(@([1-9][0-9]*)x)?([+-]notch)?$/,
67
67
  );
68
- console.log({ s, match });
69
68
  if (!match) {
70
69
  throw new Error("Invalid resolution info.");
71
70
  }