Scan themes/ for themes
This commit is contained in:
parent
192fbcc687
commit
36818f6bdc
2 changed files with 11 additions and 11 deletions
16
clock.py
16
clock.py
|
@ -5,15 +5,14 @@ import math
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import copy
|
import copy
|
||||||
import os
|
from os import uname, walk
|
||||||
from kivy.config import Config
|
from kivy.config import Config
|
||||||
from kivy.properties import ObjectProperty
|
from kivy.properties import ObjectProperty
|
||||||
import time
|
import time
|
||||||
from sounds import WakeUpSounds
|
from sounds import WakeUpSounds
|
||||||
from themes import Themes
|
|
||||||
|
|
||||||
def is_arm():
|
def is_arm():
|
||||||
if (os.uname()[4][:3] == 'arm') or (os.uname()[4][:7] == 'aarch64'):
|
if (uname()[4][:3] == 'arm') or (uname()[4][:7] == 'aarch64'):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -256,14 +255,21 @@ class MyClockWidget(FloatLayout):
|
||||||
self.ids["settings_menu_theme_label_top"].color = self.theme.color_font
|
self.ids["settings_menu_theme_label_top"].color = self.theme.color_font
|
||||||
self.settings_menu_theme_Ok_button.color = self.theme.color_font
|
self.settings_menu_theme_Ok_button.color = self.theme.color_font
|
||||||
|
|
||||||
|
def find_themes(self):
|
||||||
|
themes = next(walk('themes/'))[1]
|
||||||
|
if ('Dark' in themes) and ('Light' in themes):
|
||||||
|
themes.append('Automatic')
|
||||||
|
print('Found the following themes: ' + str(themes))
|
||||||
|
return themes
|
||||||
|
|
||||||
def add_themes(self):
|
def add_themes(self):
|
||||||
|
self.themes = self.find_themes()
|
||||||
|
|
||||||
x = self.ids["settings_menu_theme_boxlayout"]
|
x = self.ids["settings_menu_theme_boxlayout"]
|
||||||
gl = GridLayout(
|
gl = GridLayout(
|
||||||
cols=2,
|
cols=2,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.themes = Themes
|
|
||||||
|
|
||||||
self.theme_selected = next(iter(self.themes))
|
self.theme_selected = next(iter(self.themes))
|
||||||
self.ids["settings_menu_theme_select_button"].text = self.theme_selected
|
self.ids["settings_menu_theme_select_button"].text = self.theme_selected
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
Themes = {
|
|
||||||
"Light": "Woodpecker Chirps - QuickSounds.com.mp3",
|
|
||||||
"Dark": "https://icecast.omroep.nl/radio1-bb-mp3",
|
|
||||||
"Automatic": "https://icecast-qmusicnl-cdp.triple-it.nl/Qmusic_nl_nonstop_high.aac?aw_0_1st.playerId=redirect",
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue