keeweb/app/scripts/auto-type/helper/auto-type-helper-linux.js

24 lines
617 B
JavaScript
Raw Normal View History

2019-09-15 14:16:32 +02:00
import { Launcher } from 'comp/launcher';
2016-04-19 20:48:49 +02:00
2020-06-01 16:53:51 +02:00
const AutoTypeHelper = function () {};
2016-04-19 20:48:49 +02:00
2020-06-01 16:53:51 +02:00
AutoTypeHelper.prototype.getActiveWindowInfo = function (callback) {
2016-04-24 22:29:28 +02:00
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);
2016-04-24 22:29:28 +02:00
}
});
2016-04-19 20:48:49 +02:00
};
2019-09-15 14:16:32 +02:00
export { AutoTypeHelper };