Moode Forum
[How to do instruction] Automatic Light & Dark Mode - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9)
+--- Thread: [How to do instruction] Automatic Light & Dark Mode (/showthread.php?tid=2892)



Automatic Light & Dark Mode - Pieter - 08-14-2020

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



RE: Automatic Light & Dark Mode - TheOldPresbyope - 08-14-2020

Nice!


RE: Automatic Light & Dark Mode - modeosonja - 08-21-2020

Good one.. looks amazing!


RE: Automatic Light & Dark Mode - KmPan - 08-22-2020

Good one,


RE: Automatic Light & Dark Mode - KmPan - 08-26-2020

(08-22-2020, 04:56 AM)KmPan Wrote: Good one,

Thanks for the hint,  Smile Smile.


RE: Automatic Light & Dark Mode - gregvds - 03-07-2021

Great idea! Thanks,

Done it, with some personal themes I added like this:

Code:
sudo sqlite3 /var/local/www/db/moode-sqlite3.db       -> Connect to DB

.schema cfg_theme                                     -> give table structure (just for education)
select * from cfg_theme;                              -> show content of table (to be sure new ids will not conflict)
insert into cfg_theme (id,theme_name,tx_color,bg_color,mbg_color) values(16, 'Steppe', 'ddd', '162,146,146', '64,58,58,0.75');
insert into cfg_theme (id,theme_name,tx_color,bg_color,mbg_color) values(17, 'Dark Clay', 'ddd', '116,111,111', '69,66,66,0.75');
                                                     -> insert new themes
.exit

Greg


RE: Automatic Light & Dark Mode - Tim Curtis - 03-07-2021

When u get the chance post some screenies of the Themes.


RE: Automatic Light & Dark Mode - gregvds - 03-08-2021

Damn, the copy-paste images are not working.

I don't have an online account to stock images..

Sorry about that,

Greg


RE: Automatic Light & Dark Mode - Tim Curtis - 03-08-2021

Hi,

The images don't appear fo me, can you have a look?