|
@ -1,11 +1,14 @@ |
|
|
const { exec } = require('child_process') |
|
|
const { exec } = require('child_process') |
|
|
|
|
|
|
|
|
|
|
|
const dmenuPath = process.env.DMENU_PATH || 'dmenu' |
|
|
|
|
|
|
|
|
module.exports = (...args) => choices => |
|
|
module.exports = (...args) => choices => |
|
|
new Promise((resolve, reject) => { |
|
|
new Promise((resolve, reject) => { |
|
|
let choice = '' |
|
|
let choice = '' |
|
|
const error = [] |
|
|
const error = [] |
|
|
|
|
|
|
|
|
const execCommand = `dmenu ${args}` |
|
|
|
|
|
|
|
|
// Use a default of 'dmenu' if not specified in process.env
|
|
|
|
|
|
const execCommand = `${dmenuPath} ${args}` |
|
|
console.debug('$', execCommand) |
|
|
console.debug('$', execCommand) |
|
|
const dmenu = exec(execCommand) |
|
|
const dmenu = exec(execCommand) |
|
|
dmenu.stdin.write(choices) |
|
|
dmenu.stdin.write(choices) |
|
|