When you Suspend and Resume Ubuntu 20.04, if it Resumes with a black background or black tiles around open apps, try this:
Tap twice on the key that will open and close your Brisk Menu. (for details, see My simple fix below)
After several months working on various problems, I have Ubuntu Mate 20.04 running very smoothly on two lovely old MacBooks (13" Mid-2010 A1342-7,1). They had grown progressively slower and more annoying with each new MacOS, then this year they lost Apple support and thus became vulnerable to hackers. Now running Mate they're happily secure, sleek and fast again. One last minor nuisance remains, so I'm going to try a simple idea to fix it.
With the laptop open, I can do a Suspend with the Logout button in the Panel and then Wake (Resume) with a tap on the Shift key and it works fine. BUT my more common way to Suspend is simply closing the lid. When I do that and then open the lid to Wake, the background image is gone, leaving solid black other than the bottom Panel that I've set to not autohide. Any windows I've left open when closing the lid also show up fine, but may have a few scattered small tiles of the Background image around their margins. There's also at least several pure black areas of the screen, and they remain black until something is placed over them. That can be a window I drag around over the black areas, or new windows that open in those areas. So clearly this is not a serious problem, but it is annoying.
My simple fix:
I have the Brisk Menu Launcher (version 0.6.0) in the Panel, and when used via the Mac "Command" key (Alt on my PC) it instantly opens full screen. Tap that key again and it instantly disappears. So to fix the funky Background image when I open the lid to Wake from Suspend, for the past month or so I just tap that key twice and carry on.
Now I'd like to have the computer do the open/close of that or some other full-screen app at every Wake event. Since the double keytap method works reliably, rather than find the cause I hope to find and share here a simple solution. Since anyone using this popular Mac model (and probably many other makes and models) will encounter this problem, I'm thinking a functioning script would be useful.
For everyone wondering if I've seen all the prior posts about funky background Wake issue: yes, I've searched exhaustively and as posted by many other moaning newbies nothing works for me. So today I decided to try a simple script to instantly open & close a full-screen app called in pm-utils as described in this post?
First I tried Close Lid (Suspend)->Lid Open->this Terminal command:
which works perfectly, and seems to happen so fast (also closing the Terminal window) I don't see the Brisk menu at all. Then I put that in a draft script with this name:
and with these Permissions:
-rwxr-xr-x 1 root root 101
but it doesn't work. There's a new brief pause during wake, but the black areas remain. So maybe the way it works via Terminal differs from what it does when run with exec from the script?
After reading this man page I tried renaming the script to
in case the execution order was problematic. Still no luck.
What I Seek:
Help with writing the script. Clearly there's plenty of info out there on how to write scripts, but most of it's irrelevant to this effort and quickly forgotten my someone simply using the computer for non-technical daily tasks (me). Is there a kindly soul reading this willing to whip up a sample script and post it here?
case "$1" in