1

I want to create shortcut to make screenshots in DWM with maim.

Command works for bash but for C there are spaces and symbols so DWM can't execute this command correctly.

static const char *maim[]  = {"maim ~/Screenshots/$(date +%F-%H_%M_%S).png", NULL };
Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
YukaMax
  • 31
  • 3

1 Answers1

0

Commands with substitutions should be executed in shell, so the right syntax is:

static const char *maim[] = { "/bin/sh", "-c", "maim ~/Screenshots/$(date +%F-%H_%M_%S).png", NULL };
skink
  • 5,133
  • 6
  • 37
  • 58