Skip to content

Commit

Permalink
Merge pull request #339 from mathoudebine/feature/add-theme-author
Browse files Browse the repository at this point in the history
  • Loading branch information
mathoudebine authored Sep 26, 2023
2 parents d78af54 + 9611886 commit 97ff030
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 0 deletions.
14 changes: 14 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import os
import subprocess
import sys
import webbrowser

MIN_PYTHON = (3, 8)
if sys.version_info < MIN_PYTHON:
Expand Down Expand Up @@ -155,6 +156,8 @@ def __init__(self):
self.theme_preview = ttk.Label(self.window)
self.theme_preview.place(x=10, y=10)

self.theme_author = ttk.Label(self.window)

sysmon_label = ttk.Label(self.window, text='Display configuration', font='bold')
sysmon_label.place(x=320, y=0)

Expand Down Expand Up @@ -252,6 +255,17 @@ def load_theme_preview(self):
self.theme_preview_img = ImageTk.PhotoImage(theme_preview)
self.theme_preview.config(image=self.theme_preview_img)

theme_data = get_theme_data(self.theme_cb.get())
author_name = theme_data.get('author', 'unknown')
self.theme_author.config(text="Author: " + author_name)
if author_name.startswith("@"):
self.theme_author.config(foreground="#a3a3ff", cursor="hand2")
self.theme_author.bind("<Button-1>", lambda e: webbrowser.open_new_tab("https://github.com/" + author_name[1:]))
else:
self.theme_author.config(foreground="#a3a3a3", cursor="")
self.theme_author.unbind("<Button-1>")
self.theme_author.place(x=10, y=self.theme_preview_img.height() + 15)

def load_config_values(self):
with open("config.yaml", "rt", encoding='utf8') as stream:
self.config, ind, bsi = ruamel.yaml.util.load_yaml_guess_indent(stream)
Expand Down
2 changes: 2 additions & 0 deletions res/themes/3.5inchTheme2/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 0, 0, 255
Expand Down
2 changes: 2 additions & 0 deletions res/themes/5inchTheme2/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@alexwbaule"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: portrait
Expand Down
2 changes: 2 additions & 0 deletions res/themes/5inchTheme2Radial/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@arthurferrai"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: portrait
Expand Down
2 changes: 2 additions & 0 deletions res/themes/BigClock/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@RussNelson"

display:
DISPLAY_ORIENTATION: landscape
DISPLAY_RGB_LED: 255, 0, 0
Expand Down
5 changes: 5 additions & 0 deletions res/themes/CyanTheme/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 0, 0, 255

static_text:
GPU_MODEL:
TEXT: RTX3080TI
Expand All @@ -28,13 +31,15 @@ static_text:
FONT_SIZE: 25
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png

static_images:
BACKGROUND:
PATH: background.png
X: 0
Y: 0
WIDTH: 480
HEIGHT: 800

STATS:
CPU:
PERCENTAGE:
Expand Down
3 changes: 3 additions & 0 deletions res/themes/Cyberpunk-net/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@amiltonjr"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 255, 255, 0
Expand Down Expand Up @@ -59,6 +61,7 @@ static_text:
FONT_SIZE: 15
FONT_COLOR: 255, 239, 8
BACKGROUND_IMAGE: background.png

STATS:
CPU:
PERCENTAGE:
Expand Down
2 changes: 2 additions & 0 deletions res/themes/Cyberpunk/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 255, 255, 0
Expand Down
2 changes: 2 additions & 0 deletions res/themes/DragonBall5inch/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/Landscape15Grid/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/Landscape6Grid/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_ORIENTATION: landscape
DISPLAY_RGB_LED: 0, 0, 255
Expand Down
2 changes: 2 additions & 0 deletions res/themes/LandscapeEarth/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_ORIENTATION: landscape
DISPLAY_RGB_LED: 66, 207, 239
Expand Down
2 changes: 2 additions & 0 deletions res/themes/LandscapeMagicBlue/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_ORIENTATION: landscape
DISPLAY_RGB_LED: 16, 223, 239
Expand Down
2 changes: 2 additions & 0 deletions res/themes/NZXT_B/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/NZXT_BLUR/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/NZXT_C/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/NZXT_color/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/NZXT_dynamic/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/PurpleTheme/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 5"
DISPLAY_ORIENTATION: landscape
Expand Down
2 changes: 2 additions & 0 deletions res/themes/Terminal/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@Ebag333"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 255, 0, 0
Expand Down
2 changes: 2 additions & 0 deletions res/themes/bash-dark-green-gpu/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@Rollbacke"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 30, 255, 50
Expand Down
2 changes: 2 additions & 0 deletions res/themes/bash-dark-green/theme.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
author: "@Rollbacke"

display:
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 30, 255, 50
Expand Down
5 changes: 5 additions & 0 deletions res/themes/theme_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

# NOTE: Every HW sensor is hidden in this example, to show a sensor change 'SHOW: False' to 'SHOW: True'
---
# If you indicate @ with your GitHub username, there will be a hyperlink to your GitHub profile in the Config. Wizard
# Otherwise, you can just indicate any text e.g. author: "Your Name"
# You can also remove the line if you don't want to be credited
author: "@your_GitHub_username"

display:
# Specify the display size in inch for this theme: 3.5" (default) or 5"
DISPLAY_SIZE: 3.5"
Expand Down

0 comments on commit 97ff030

Please sign in to comment.