sway-tools
Version:
Some tools and a library for controlling sway
36 lines (35 loc) • 931 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hyprland = void 0;
const shelljs = require("shelljs");
class Hyprland {
getOutputs() {
const json = shelljs.exec('hyprctl monitors -j', {
async: false,
silent: true,
});
return JSON.parse(json);
}
getWorkspaces() {
const json = shelljs.exec('hyprctl workspaces -j', {
async: false,
silent: true,
});
return JSON.parse(json);
}
getActiveWorkspace() {
const json = shelljs.exec('hyprctl activeworkspace -j', {
async: false,
silent: true,
});
return JSON.parse(json);
}
getClients() {
const json = shelljs.exec('hyprctl clients -j', {
async: false,
silent: true,
});
return JSON.parse(json);
}
}
exports.Hyprland = Hyprland;