diff --git a/lib/gui/app/app.js b/lib/gui/app/app.js index 235e7d9c..fb449e4c 100644 --- a/lib/gui/app/app.js +++ b/lib/gui/app/app.js @@ -456,6 +456,32 @@ app.controller('HeaderController', function (OSOpenExternalService) { this.shouldShowHelp = () => { return !settings.get('disableExternalLinks') } + + /** + * @summary Whether to show the sleep button + * @function + * @public + * + * @returns {Boolean} + * + * @example + * HeaderController.shouldShowSleep() + */ + this.shouldShowSleep = () => { + return settings.get('showScreensaverDelay') + } + + /** + * @summary Enables the screensaver + * @function + * @public + * + * @example + * HeaderController.sleep() + */ + this.sleep = () => { + screensaver.off() + } }) app.controller('StateController', function ($rootScope, $scope) { diff --git a/lib/gui/app/index.html b/lib/gui/app/index.html index 89ab9b73..d28d6aae 100644 --- a/lib/gui/app/index.html +++ b/lib/gui/app/index.html @@ -11,22 +11,36 @@