Updated external-selection-menu
This commit is contained in:
parent
4df066122d
commit
a28f151098
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"manifestVersion": "0.1.0",
|
||||
"name": "external-selection-menu",
|
||||
"description": "Use an external menu such as dmenu when prompted to select an entry for auto-type",
|
||||
|
@ -9,10 +9,10 @@
|
|||
"url": "https://github.com/b3nj5m1n"
|
||||
},
|
||||
"resources": {
|
||||
"js": "RvSZ2bbByyAOv5JPT13iq99mki0c7eYxDYzjlB0ZGREZiRVs/keybiVDjhqipxkn0mamzYjXCgZMAnXm0j7Vc6+9StQ37/3ImsdKIwsOmOepdVjuf7GhvEYeIKfLwNlG4D7b1mtn9QqnKyjE4gVhc/hm42xrmCgUQKySGfkqk5RWlcxSeG7DZJhgH7Rcs89d3WPWlPT9/JSosoBLl1NoXyuKKXT0lwMkUbQv6PIDheLB3rGb9AdcGS9pKi6AulimP4ApvpJuGcPcalrbgaWZ7n+VUdzI7xNp9JIziLS2BGhQCMKS16VkLCEXM4kRtGovIziaygm5KjiBbtnFtVVXYg=="
|
||||
"js": "ZYKeaD1NlG5UJt0TOqdy6SIxOwFWRSwG4MXPHzNHuZy7f4jVo8AEjOINFa33o7dXYWWAqYmJVuhwfiXZgqn5EvL7i+QyICw9+2QxKfk8NH3BuymlgbNQUeCY0ck1fPetYPtMeBumvRCSsuufbw2HZXH44umXa4LXRmaU70VFwd8T/NUZAQLxJV9m8UbJVBOu6vzMJ2VV5Sq989PevTXHtjtBpHcQ/FUzB/fR0COvgRUim3mYYHj01SXxxDaS5zE+RLngg1bSnTpjywHlQR48bCQY0rYJciL3AMZims5WAWax0iybmoYgFBMO5ZMbOEK/EzkUWYK4wWgCUKxR6ydKWw=="
|
||||
},
|
||||
"license": "MIT",
|
||||
"url": "https://plugins.keeweb.info/plugins/external-selection-menu",
|
||||
"publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnRq2k3TTx0ewTe6wDr6QVeB5diwiIWzsJD+ApfZu1KNPedcAgslAfjpNsYF1if6cYsPMJH70xJ2np6RQBl1VPdwShOuxkD7m0BD5Hw/Aar8Hdp5cvAdOOMdBO+0DbGeUMy+z66s+oUCJmqVp19T6PkkxbhN08rgtT7v+aFvrbqbO/vlsskbJpH2K2io+e1XmRGPnSr9q4KSqfGbTfe5gLwDIOFd66Z4mb5Utb5wWpsy6Gjh06Yf257AccGD3A1bkTNOyeeX0tqciYBePWMk0icP/aZ6hnErfhnUKf3tOgPLppSHiGcaSKekhChZ2xLUs3U64JwrXSmwHj+TzdO3S0QIDAQAB",
|
||||
"url": "https://github.com/b3nj5m1n/keeweb-external-selection-menu",
|
||||
"publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6ibQ/D4FoT4AK0wQPalHvTLWKUMMa5oRL8jQi4fzRgCam/PhA/gzaaPZ/ttC/sjEBPOxhaQ4A76jWnMJ7E/f1zfHbPvpB+tvDGDKNHpjrldTOQIYcz4uU+y+qsFWSv0bJjDORxHbfQT3xXJ09wT7vjSXyD7ERuUIvm6jr+L5v168EZ8iscPnM3pUKp2wYJDR4AGWJ+WD7IHzDZZ8cUvMSsP7IPvVhSfHZZpkfakswgQ1kNWRNcFtmlxcR62xOiLIeJiAix1LXkkDJCT2MjH2XgCG3PNDSChPKr6rui90Wa5O5iGqn0bx6KAyxuP7/adM8ZzAW0HvDPGIV1RfevNpuQIDAQAB",
|
||||
"desktop": true
|
||||
}
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
* @license MIT
|
||||
*/
|
||||
|
||||
const Logger = require('util/logger');
|
||||
const logger = new Logger.Logger('external-selection-menu');
|
||||
// const Logger = require('util/logger');
|
||||
// const logger = new Logger.Logger('external-selection-menu');
|
||||
|
||||
const launcher = require('comp/launcher');
|
||||
const Launcher = launcher.Launcher;
|
||||
|
@ -29,14 +29,12 @@ let args = ['-c'];
|
|||
|
||||
// Overwrite processEventWithFilter function
|
||||
autoType.AutoType.processEventWithFilter = function (evt) {
|
||||
// Default code for when a matching entry can be found without having to select one; disabled for now
|
||||
// Default code for when a matching entry can be found without having to select one
|
||||
//
|
||||
// const initEntries = evt.filter.getEntries(); if (initEntries.length === 1 && AppSettingsModel.directAutotype) {
|
||||
// this.hideWindow(() => {
|
||||
// autoType.AutoType.runAndHandleResult({ entry: initEntries[0] }, evt.windowInfo.id);
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
const initEntries = evt.filter.getEntries(); if (initEntries.length === 1) {
|
||||
autoType.AutoType.runAndHandleResult({entry: initEntries[0]}, evt.windowInfo.id);
|
||||
return;
|
||||
}
|
||||
// Custom code replacing the selection menu
|
||||
//
|
||||
evt.filter.ignoreWindowInfo = true; /* Set filter to ignore windowInfo */
|
||||
|
@ -77,7 +75,7 @@ module.exports.getSettings = function() {
|
|||
type: 'text',
|
||||
maxlength: 50,
|
||||
placeholder: '',
|
||||
value: 'dmenu'
|
||||
value: 'rofi'
|
||||
},
|
||||
{
|
||||
name: 'External menu command arguments',
|
||||
|
@ -85,19 +83,31 @@ module.exports.getSettings = function() {
|
|||
type: 'text',
|
||||
maxlength: 50,
|
||||
placeholder: '',
|
||||
value: '-c'
|
||||
value: '--dmenu,-p,"> "'
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
module.exports.setSettings = function(changes) {
|
||||
if (changes['External menu command']) {
|
||||
cmd = changes['External menu command'];
|
||||
cmd = changes['External menu command'] + '';
|
||||
}
|
||||
if (changes['External menu command arguments']) {
|
||||
args = changes['External menu command arguments'].split(' ');
|
||||
args = changes['External menu command arguments'];
|
||||
// Make sure there is actually 1+ arguments, otherwise set args to null
|
||||
if (args === '' || args === ' ' || args === '-') {
|
||||
args = null;
|
||||
}
|
||||
// If there are args, split them into an array (Using , as the delimiter) and remove any quotes around the input
|
||||
if (args !== null) {
|
||||
args = args.split(',');
|
||||
for (let i = 0, len = args.length; i < len; i++) {
|
||||
if (args[i][0] === '"' && args[i][args[i].length - 1] === '"') {
|
||||
args[i] = args[i].replace(/"([^"]+(?="))"/g, '$1');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info('Menu command changed to: ' + cmd + ' ' + args);
|
||||
};
|
||||
|
||||
module.exports.uninstall = function() {
|
||||
|
|
Loading…
Reference in New Issue