record-desktop
Version:
Record gifs and take screenshots on linux, built with electron.
17 lines (14 loc) • 360 B
JavaScript
import { exec } from '../utils';
export default function xwininfo() {
return exec(`xwininfo -id $(xdotool getactivewindow)`)
.then(res => {
const lines = res.split('\n');
const fn = ind => +(lines[ind].split(':')[1].trim());
return {
x: fn(2),
y: fn(3),
width: fn(6),
height: fn(7)
};
});
};