Run a command with i3-nagbar , that has apostrophes in it..
If I were to run a command with i3-nagbar, that contains apostrophes itself, how would I validate those apostrophes?
e.g. i3-nagbar -t warning -m 'Selection or active window (4 sec. delay)' -b 'selection' 's crot -s \'/home/user/Pictures/screenshots/%H%M_%d%m%Y_$wx$h.png\'' -b 'active window' 'scrot -u -d 4 \'/home/user/Pictures/screenshots/%H%M_%d%m%Y_$wx$h.png\''
edit: For instance I were to use bindsym to run i3-nagbar, which will then run a command that requires quoting again (example below). Can I validate the apostrophes with a backslash?
bindsym Shift+Print exec "i3-nagbar -t warning -m 'Selection or active window (4 sec. delay)' -b 'selection' 'scrot -s \'/home/user/Pictures/screenshots/%s_%H%M_%d%m%Y_$wx$h.png\'' -b 'active window' 'scrot -u -d 4 \'/home/user/Pictures/screenshots/%H%M_%d%m%Y_$wx$h.png\''"
edit 2:
I've tried to use "
for the directory used for scrot and \'
both doesn't seem to work for me.
Why not just use double quotes to quote the command and single quotes to quote the command inside?
Also, feel free to use i3-nagbar for this, but using a binding mode might be a bit more "friendly".
I am planning to bind Shift + Printscreen for this.. I'll try to use the double quotes, thank you!
I meant use a binding mode (not a binding) to choose whether the active window or selection should be used. Then it would integrate into i3bar and not launch i3-nagbar, which is a fairly ugly tool we only use for errors.
How could I use i3bar in this case?