UNPKG

sway-tools

Version:

Some tools and a library for controlling sway

40 lines (31 loc) 729 B
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); } }