I'm trying to set environment variables for non-interactive non-login shell. I know bash reads the contents of ~/.bashrc before execute the command. In the beginning of the script there's a part:
*# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac*
So I think if I add something above it, it will take effect no matter if the shell is interactive or not:
export VAR=something
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
However it doesn't work :(. I want to avoid using $BASH_ENV because it messes up my xkb settings. I remapped some keys in /usr/share/X11/xkb/symbols/pc. And if I set $BASH_ENV, it will just loads the default keymap.