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

24 lines
628 B
JavaScript
Raw Normal View History

2017-01-31 07:50:28 +01:00
const Launcher = require('../../comp/launcher');
2016-04-19 20:48:49 +02:00
2019-08-16 23:05:39 +02:00
const AutoTypeHelper = function() {};
2016-04-19 20:48:49 +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 [id, title] = 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
};
module.exports = AutoTypeHelper;