Handling of variables in the i3 config is very minimal, they are just set verbatim to whatever is written after the variable name. This includes quotation marks. That means, when you do
set $TERMINAL 'LD_PRELOAD=/net/erard/usr/lib/stderred/build/libstderred.so /usr/bin/konsole'
the single quotes are still contained in $TERMINAL
. When you try to start the terminal, exec
or rather the shell called by exec
tries to start a binary named LD_PRELOAD=/net/erard/usr/lib/stderred/build/libstderred.so /usr/bin/konsole
To get the intended results, just define $TERMINAL
like you would write it in the shell, that is, without surrounding quotes:
set $TERMINAL LD_PRELOAD="/net/erard/usr/lib/stderred/build/libstderred.so" /usr/bin/konsole
You could also create a script like this:
#!/bin/sh
export LD_PRELOAD="/net/erard/usr/lib/stderred/build/libstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
/usr/bin/konsole
Make it executable and then change the configuration accordingly
set `$TERMINAL` /path/to/script
Also going by the instructions on (stderred github page)[https://github.com/sickill/stderred] it is sufficient to put
export LD_PRELOAD="/absolute/path/to/stderred/buildlibstderred.so${LD_PRELOAD:+:$LD_PRELOAD}"
into your shell configuration (~/.bashrc
, ~/.zshrc
, etc.). That is because stderred changes the behaviour of the commands you are calling in the shell and not the the behaviour of the terminal or shell. Therefore it doesn't have to be already set when opening the terminal.
Im leaving the first answer, because, although it is not really necessary in the case of stderred, it may be of help in other cases where $LD_PRELOAD
(or any other environment variable) has to be set for the program called.