@apognu told me in mp that the approach used was perhaps too complex for nwg-drawer's needs and advised me to use the env command.
According to him, nwg-drawer should never try to parse a command line to separate the envvars, from the command, from the arguments, it's actually super complicated (yes indeed :smile:). env is on all UNIX, this command allows you to launch a command with an environment and arguments, and it takes care of the parsing as it should.
So in the case of nwg-drawer, instead of doing your own parsing, you could simply run :
["env", "-S", ]
["swaymsg", "exec", "env", "-S", ]
["hyprctl", "dispatch", "exec", "env", "-S", ]
So I've simplified everything, taking his advice into account, and my tests are correct.
Description
@apognu told me in mp that the approach used was perhaps too complex for nwg-drawer's needs and advised me to use the
env
command.According to him, nwg-drawer should never try to parse a command line to separate the envvars, from the command, from the arguments, it's actually super complicated (yes indeed :smile:).
env
is on all UNIX, this command allows you to launch a command with an environment and arguments, and it takes care of the parsing as it should.So in the case of nwg-drawer, instead of doing your own parsing, you could simply run :
So I've simplified everything, taking his advice into account, and my tests are correct.