This is quick tutorial shows you how to prevent Ubuntu desktop from being automatic turned off (or locked up) while you’re watching videos.
Although the “System Settings” utility offers “Power” page to change screen dimming, blank screen inactive time, etc, it will be convenient to have a panel indicator applet to toggle the settings.
And Caffeine shows an applet in system tray area allows to temporarily prevent the activation of both the screensaver and the “sleep” powersaving mode.
To install Caffeine in Unity or Other Desktops:
For non-Gnome users in Ubuntu 16.04, Ubuntu 17.10, and higher, just search for and install “caffeine” in Ubuntu Software:
Once installed, you can launch it from app launcher or let it launch automatically in next login.
To install Caffeine extension in Gnome Shell:
For Gnome Desktop, there’s an Caffeine extension available for install.
You can follow this tutorial to install the extension. Since Ubuntu 17.10 artful you can search for and install the extension via Ubuntu Software:
skip caffeine for xscreensaver which it not updated for a lone time.
Once installed, you should see the applet in system tray. And you can manage gnome extensions via “Gnome Tweaks” utility (Install it via Ubuntu Software if you don’t have it).