UseI use spaceline.
Basically it's built on top of
powerlineand let you build your mode-line by adding several segments one after the other (in both left and right sections).For instance, the following segment:
(major-mode :face highlight-face)will insert the current major mode and apply a special face to it. This facehighlight-facechanges following several criterias. You can customizespaceline-modified,spaceline-read-onlyandspaceline-unmodifiedfaces to fix your issue.If you still want to use
powerline, you need to do whatspacelinealready does. That is to check for buffer status and apply the face you want. Seebuffer-read-onlyandbuffer-modified-p.
Here is how my mode-line looks like:



