Thanks ronniew, thanks for making this script, it works great on my ArchLinux LXDE. However, I noticed a problem, which you may consider adding to the OP.

Sometimes the script starts too soon,...