This works for a Mac or for any other laptop that has magnets in the lid so it can tell when it's closed. We will be making a sunshade that clings to them via the power of magnetism.
Go to the art store, get some black illustration board (I like cold press) and some black masking tape. Also get some small magnets, you can probably find them there too.
Also you will need a straightedge at least as long as the longest dimension of your laptop, an x-acto knife (you could probably make do with a box cutter in a pinch), and a pencil. Maybe a t-square or a triangle, too. And something to cut all that board on top of so you don't make a mess of the table or floor or whatevs, I have a drafting table with a self-healing cutting mat because I am an artist-type person, you could probably just use a kitchen cutting board if that's what's handy.
You will need to cut four pieces out of your board.
Piece 1 is a big rectangle about the size of the laptop - mine's about as wide and a little shorter.
Piece 2 is a rectangle about as high as the bezel on your screen and as wide as the big rectangle.
Pieces 3 and 4 are are irregular quadrilaterals. They can start as rectangles half as wide as piece 1 and a little taller than piece 1 and 2 put together; then you want to cut a shallow triangle off the top so that one side is as tall as piece 1.
And now the magic part. Center piece 2 on the top of your laptop's bezel. Get out those little magnets, and feel around for where the magnets are in the bezel. Let them snap down onto piece 2. Draw around the magnets with a pencil, then take them off and use your x-acto to cut out little holes just big enough to put the magnets into. Cover one side with tape, put piece 1 back on the bezel, and put the magnets back in again. Then tape them over on the back side, add a layer or two more on both sides while you're at it.
Finally you get to tape it all together, kinda like this shitty ASCII diagram:
|\ _______________ /|
| \[______2________]/ |
| | | |
| | | |
| | | |
|3 | 1 |4 |
| | | |
| | | |
|__|_______________|__|
(3 and 4 are actually a little less than half as wide as 1, and the slope on their top is a lot shallower.)
Make hinges with the masking tape, there are some subtleties about creating small spaces in the hinges to make sure that 1 is going to be sitting on top of the thickness of the edges of 2, 3, and 4 when it's all folded up on top of the computer.
Ideally when you fold 3 and 4 over 1/2, the whole thing should be about the same footprint as your computer. If your bag's pocket is properly sized for your laptop then it should fit in there really nicely along with the lappy and not get messed up.
If you get a new laptop of the same size you may have to take out the magnets and re-orient them, the magnets in the bezel are not guaranteed to be any particular orientation.
Probably costs like ten bucks, plus whatever an hour or two of your time is worth. Cheap and easy to replace if something happens to it, weighs next to nothing. I keep on promising to make one of these for my boyfriend so he can join me in slouching around under a tree and getting work done...