That shouldn't be so difficult to understand. It may be exactly the configuration a user wants. My Acer even offers this as default: The desktop comes up on the internal display with the JWM tray at the bottom, the desktop fits the screen resolution, so perfect for the internal monitor. The external monitor shows the pinboard background but otherwise is empty. It serves as a big extended screen. When I shift windows to the right side they will reappear on the left side of the external monitor. I could open a fullscreen window on the big monitor while working on other stuff on the internal monitor. The laptop monitor is used as the main monitor, the external monitor is just a nice extra space. So far understandable? Now the user takes a break and closes the lid. What should he expect? Chances are that he wants to continue with the same configuration when he opens the lid again. Instead your fix shifts the tray and icons to the external monitor and from now on he is forced to use the external monitor as his main monitor. The xrandr command has destroyed his configuration and there is no easy way back.
Obviously you want to use the external monitor as main and are quite happy that your fix moves the tray to the bigger monitor. I can fully understand that. But this doesn't mean that a lid event should be in charge of messing around with the configuration. There are other and better solutions possible.
I've tested your suspend.sh again (pure curiosity, zero need for acpi) , this time with BW64 on Acer Aspire One:
External monitor attached. Closing lid triggers suspend. It shouldn't! Your changes fail because of line
Code: Select all
case "$(awk '{print $2}' /proc/acpi/button/lid/LID0/state)" in
In BW64 it's LID , not LID0.
And another bad news. I already mentioned
Code: Select all
xrandr --output eDP-1 --off || xrandr --output eDP1 --off || xrandr --output LVDS-1 --off || xrandr --output LVDS1 --off
This code works only for monitors named eDP-1 because xrandr always returns true, even if the name is wrong. Therefore better stop guessing and retrieve the exact name. You can get it from xrandr.