import * as shelljs from 'shelljs';

export class Hyprland {
  public getOutputs() {
    const json = shelljs.exec('hyprctl monitors -j', {
      async: false,
      silent: true,
    });

    return JSON.parse(json);
  }

  public getWorkspaces() {
    const json = shelljs.exec('hyprctl workspaces -j', {
      async: false,
      silent: true,
    });

    return JSON.parse(json);
  }

  public getActiveWorkspace() {
    const json = shelljs.exec('hyprctl activeworkspace -j', {
      async: false,
      silent: true,
    });

    return JSON.parse(json);
  }

  public getClients() {
    const json = shelljs.exec('hyprctl clients -j', {
      async: false,
      silent: true,
    });

    return JSON.parse(json);
  }
}
