From 91bea2fd831d684470cc3c0a01ee8db3d98bfd1c Mon Sep 17 00:00:00 2001 From: Kos-M <46938390+Kos-M@users.noreply.github.com> Date: Sun, 7 Feb 2021 20:39:39 +0200 Subject: [PATCH] Bonus - Cron Auto Switch Theme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 3a4e523..3b95e5d 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,18 @@ Creating new theme: - update README.md with activate instructions and screenshots for new theme. - commit & push to your fork - create a pull request. + +## Bonus - Cron Auto Switch Theme (Example) + - Requires GogsThemes installed ( see above , steps ) + - Create tmpl file called `night.tmpl` in our GOGS_ROOT/custom/templates/inject/night.tmpl + - add for example dark theme + ```css + + ``` + - > crontab -e + - Enter bellow code: +```cron +30 17 * * * sudo cat /home/git/gogs/custom/templates/inject/night.tmpl > /home/git/gogs/custom/templates/inject/head.tmpl ; sudo service gogs restart +0 7 * * * cd /home/git/gogs/custom/templates/inject/; sudo echo "" > head.tmpl ; sudo service gogs restart +``` +*in above example GOGS_ROOT is `/home/git/gogs/`