The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide Automatic Light & Dark Mode
#1
I like my moOde interface to follow my macOS system appearance settings (light mode during the day, dark mode in the evening). The default and Whiteshade themes fit that bill perfectly so here's a few commands to automatically switch between the two at given times of the day.

1. Setup
Code:
cd /home/pi
mkdir scripts
cd scripts

2. lightmode.sh
Code:
#!/bin/sh
sqlite3 /var/local/www/db/moode-sqlite3.db "UPDATE cfg_system SET value = 'Whiteshade' WHERE id = 88;"

3. darkmode.sh
Code:
#!/bin/sh
sqlite3 /var/local/www/db/moode-sqlite3.db "UPDATE cfg_system SET value = 'Default' WHERE id = 88;"

4. Make the scripts executable
Code:
chmod +x lightmode.sh
chmod +x darkmode.sh

5. Run the scripts at specific times (06:30 lightmode, 20:00 darkmode)
Code:
crontab -e

30 6 * * * /home/pi/scripts/lightmode.sh
0 20 * * * /home/pi/scripts/darkmode.sh

sudo service cron restart
Reply


Messages In This Thread
Automatic Light & Dark Mode - by Pieter - 08-14-2020, 09:52 AM
RE: Automatic Light & Dark Mode - by modeosonja - 08-21-2020, 01:22 PM
RE: Automatic Light & Dark Mode - by KmPan - 08-22-2020, 04:56 AM
RE: Automatic Light & Dark Mode - by KmPan - 08-26-2020, 04:22 PM
RE: Automatic Light & Dark Mode - by gregvds - 03-07-2021, 01:40 PM
RE: Automatic Light & Dark Mode - by Tim Curtis - 03-07-2021, 04:06 PM
RE: Automatic Light & Dark Mode - by gregvds - 03-08-2021, 06:43 AM
RE: Automatic Light & Dark Mode - by Tim Curtis - 03-08-2021, 02:23 PM

Forum Jump: