Tuning the electrical and optical properties of dinuclear ruthenium complexes for near infrared optical sensing.