mirror of https://github.com/keeweb/keeweb.git
24 lines
617 B
JavaScript
24 lines
617 B
JavaScript
import { Launcher } from 'comp/launcher';
|
|
|
|
const AutoTypeHelper = function () {};
|
|
|
|
AutoTypeHelper.prototype.getActiveWindowInfo = function (callback) {
|
|
Launcher.spawn({
|
|
cmd: 'xdotool',
|
|
args: ['getactivewindow', 'getwindowname', 'getactivewindow'],
|
|
complete(err, out) {
|
|
let windowInfo;
|
|
if (out) {
|
|
const [title, id] = out.trim().split('\n');
|
|
windowInfo = {
|
|
id,
|
|
title
|
|
};
|
|
}
|
|
return callback(err, windowInfo);
|
|
}
|
|
});
|
|
};
|
|
|
|
export { AutoTypeHelper };
|