|
@ -3,9 +3,12 @@ const { exec } = require('child_process') |
|
|
module.exports = (...args) => choices => |
|
|
module.exports = (...args) => choices => |
|
|
new Promise((resolve, reject) => { |
|
|
new Promise((resolve, reject) => { |
|
|
let choice = '' |
|
|
let choice = '' |
|
|
|
|
|
let dmenu_path = process.env.DMENU_PATH |
|
|
const error = [] |
|
|
const error = [] |
|
|
|
|
|
|
|
|
const execCommand = `dmenu ${args}` |
|
|
|
|
|
|
|
|
// Use a default of 'dmenu' if not specified in process.env
|
|
|
|
|
|
const dmenu_binary = (typeof dmenu_path === 'undefined') ? 'dmenu' : dmenu_path; |
|
|
|
|
|
const execCommand = `${dmenu_binary} ${args}` |
|
|
console.debug('$', execCommand) |
|
|
console.debug('$', execCommand) |
|
|
const dmenu = exec(execCommand) |
|
|
const dmenu = exec(execCommand) |
|
|
dmenu.stdin.write(choices) |
|
|
dmenu.stdin.write(choices) |
|
|