Open mmonaco opened 4 years ago
I don't see a good way of doing this.
TL;DR;? It must already be possible to parse a command line, honoring whitespace, no? A la exec
?
We pass sway{bar,bg}_command
to exec(3)
, which doesn't accept arguments, just a filename. I'm not willing to re-implement word splitting.
On mobile now, but isn't it execve
or similar? We pass the bar id to bars for example. Can you please be clear if you don't like the idea at all or patches welcome?
Ah, I was thinking you'd want to support swaybar_command "cmd arg1 arg2 arg3"
, not swaybar_command cmd arg1 arg2 arg3
. Now assuming you were planning to do the latter.
I'm still on the fence because this allows to easily break CLI args (by specifying flags Sway already specifies). Also, I don't want complexity to be added to the spawning code just because of this new feature.
A possible workaround is to write a script which passes whatever arguments you want to your swaybar
along with the ones passed by sway
($@
) and then set this as your swaybar_command
.
As of now (HEAD)
swaybar_command
andswaybg_command
take everything as the executable, spaces and all, regardless of quotes. It would be useful to be able to pass a richer command line (as we can forexec
), without wrapper scripts. Some bars take e.g., flags to control logging levels. My case is probably a bit over the top but I like for the command to besystemd-cat -t swaybg /usr/bin/swaybg
to help me debug / learn.Apologies if this is WAI