kspi / dmenu-frecency

A dmenu-based desktop application launcher
MIT License
33 stars 8 forks source link

dmenu-frecency is unable to parse dmenu arguments. #3

Closed xfractured closed 10 years ago

xfractured commented 10 years ago

dmenu-frecency seems to have an issue with parsing dmenu arguments. If you try to add any additional arguments along side the default (-i) within the config file it errors out.

Example 1:

"dmenu-args": [
    "-i -b"
 ],

Example 2:

"dmenu-args": [
    "-i -nb \"#285577\" -p \">:\""
],

Generated Error:

./dmenu-frecency usage: dmenu [-b] [-f] [-i] [-l lines] [-p prompt] [-fn font] [-m monitor] [-nb color] [-nf color] [-sb color] [-sf color] [-v] Traceback (most recent call last): File "./dmenu-frecency", line 278, in DmenuFrecency(arguments).main() File "./dmenu-frecency", line 248, in main stdout, stderr = dmenu.communicate() File "/usr/lib/python3.4/subprocess.py", line 959, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/usr/lib/python3.4/subprocess.py", line 1578, in _communicate self.stdin.flush() BrokenPipeError: [Errno 32] Broken pipe

kspi commented 10 years ago

The arguments should be specified as a JSON array, for example

"dmenu-args": ["-i", "-b"],

and

"dmenu-args": ["-i", "-nb", "#285577", "-p", ">:"],

They aren't passed through a shell, so no additional quoting for colors is required. I'll add a note about this to the README.