How to have a straight line uv
I'm not sure you can have a straight line with the current topology, what you could do in the UV Editor is rip the 2 horizontal rows, rotate them 90° and stick them to the vertical.
Or you can change your topology, going from that:

to that:

then select all, select an active face, press U &gt; Reset, then U again and &gt; Follow Active Quads, and it will give a straight line.