Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal of features such as Net classes, Date and a new theme. #72

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ config:
# THEME: Cyberpunk
THEME: 3.5inchTheme2

# Network metrics
# Put the interface name or let it blank if the card does not exist
# ETH: ""
ETH: "eth0" # Ethernet Card
WLO: "wlo1" # Wi-Fi Card

display:
# Display resolution in portrait orientation
# Do not use this setting to rotate display! Display orientation is managed by themes
Expand Down
1 change: 1 addition & 0 deletions library/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from library.log import logger

PNIC_BEFORE = ""

def load_yaml(configfile):
with open(configfile, "r") as stream:
Expand Down
14 changes: 14 additions & 0 deletions library/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ def DiskStats():
stats.Disk.stats()


@async_job("Net_Stats")
@schedule(timedelta(seconds=THEME_DATA['STATS']['NET'].get("INTERVAL", None)).total_seconds())
def NetStats():
# logger.debug("Refresh net stats")
stats.Net.stats()


@async_job("Date_Stats")
@schedule(timedelta(seconds=THEME_DATA['STATS']['DATE'].get("INTERVAL", None)).total_seconds())
def DateStats():
# logger.debug("Refresh date stats")
stats.Date.stats()


@async_job("Queue_Handler")
@schedule(timedelta(milliseconds=1).total_seconds())
def QueueHandler():
Expand Down
243 changes: 234 additions & 9 deletions library/stats.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ def sighandler(signum, frame):
logger.warning("Your GPU is not supported yet")
scheduler.MemoryStats()
scheduler.DiskStats()
scheduler.NetStats()
scheduler.DateStats()
scheduler.QueueHandler()
137 changes: 132 additions & 5 deletions res/themes/3.5inchTheme2/theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ STATS:
TEXT:
SHOW: True
X: 250
Y: 13
Y: 18
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
Expand All @@ -81,7 +81,7 @@ STATS:
GRAPH:
SHOW: True
X: 155
Y: 50
Y: 55
WIDTH: 150
HEIGHT: 15
MIN_VALUE: 0
Expand All @@ -98,7 +98,7 @@ STATS:
TEXT:
SHOW: True
X: 154
Y: 70
Y: 74
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 30
FONT_COLOR: 255, 255, 255
Expand Down Expand Up @@ -141,7 +141,7 @@ STATS:
TEXT:
SHOW: True
X: 154
Y: 13
Y: 18
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
Expand Down Expand Up @@ -237,7 +237,7 @@ STATS:
BAR_OUTLINE: False
BACKGROUND_COLOR: 0, 0, 0
# BACKGROUND_IMAGE: background.png
VALUE_TEXT:
USED:
SHOW: TRUE
X: 204
Y: 290
Expand All @@ -246,6 +246,15 @@ STATS:
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
FREE:
SHOW: FALSE
X: 182
Y: 129
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
PERCENT_TEXT:
SHOW: TRUE
X: 250
Expand Down Expand Up @@ -279,6 +288,15 @@ STATS:
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
PERCENT_TEXT:
SHOW: False
X: 46
Y: 402
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
TOTAL:
TEXT:
SHOW: TRUE
Expand All @@ -299,3 +317,112 @@ STATS:
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
NET:
INTERVAL: 1
WLO:
UPLOAD:
TEXT:
SHOW: FALSE
X: 4
Y: 311
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
UPLOADED:
TEXT:
SHOW: FALSE
X: 90
Y: 311
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
DOWNLOAD:
TEXT:
SHOW: FALSE
X: 4
Y: 261
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
DOWNLOADED:
TEXT:
SHOW: FALSE
X: 90
Y: 261
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
ETH:
UPLOAD:
TEXT:
SHOW: FALSE
X: 254
Y: 311
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
UPLOADED:
TEXT:
SHOW: FALSE
X: 192
Y: 311
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
DOWNLOAD:
TEXT:
SHOW: FALSE
X: 254
Y: 261
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
DOWNLOADED:
TEXT:
SHOW: FALSE
X: 192
Y: 261
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 23
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
DATE:
# In seconds. Longer intervals cause this to refresh more slowly.
# Setting to lower values will display near real time data,
# but may cause significant CPU usage or the display not to update properly
INTERVAL: 1
DAY:
TEXT:
SHOW: True
X: 155
Y: 4
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 10
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
HOUR:
TEXT:
SHOW: True
X: 250
Y: 4
FONT: jetbrains-mono/JetBrainsMono-Bold.ttf
FONT_SIZE: 10
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 132, 154, 165
# BACKGROUND_IMAGE: background.png
131 changes: 129 additions & 2 deletions res/themes/Cyberpunk/theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,18 @@ STATS:
BAR_OUTLINE: True
# BACKGROUND_COLOR: 0, 255, 0
BACKGROUND_IMAGE: background.png
VALUE_TEXT:
USED:
SHOW: True
X: 80
X: 28
Y: 256
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 16
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
FREE:
SHOW: True
X: 110
Y: 256
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 16
Expand Down Expand Up @@ -297,6 +306,15 @@ STATS:
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
PERCENT_TEXT:
SHOW: True
X: 170
Y: 430
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 30
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
TOTAL:
TEXT:
SHOW: False
Expand All @@ -317,3 +335,112 @@ STATS:
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
NET:
INTERVAL: 1
WLO:
UPLOAD:
TEXT:
SHOW: FALSE
X: 4
Y: 311
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
UPLOADED:
TEXT:
SHOW: FALSE
X: 90
Y: 311
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
DOWNLOAD:
TEXT:
SHOW: FALSE
X: 4
Y: 261
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
DOWNLOADED:
TEXT:
SHOW: FALSE
X: 90
Y: 261
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
ETH:
UPLOAD:
TEXT:
SHOW: FALSE
X: 254
Y: 311
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
UPLOADED:
TEXT:
SHOW: FALSE
X: 192
Y: 311
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
DOWNLOAD:
TEXT:
SHOW: FALSE
X: 254
Y: 261
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
DOWNLOADED:
TEXT:
SHOW: FALSE
X: 192
Y: 261
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 26
FONT_COLOR: 2, 216, 243
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
DATE:
# In seconds. Longer intervals cause this to refresh more slowly.
# Setting to lower values will display near real time data,
# but may cause significant CPU usage or the display not to update properly
INTERVAL: 1
DAY:
TEXT:
SHOW: True
X: 10
Y: 455
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 18
FONT_COLOR: 255, 239, 8
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
HOUR:
TEXT:
SHOW: True
X: 195
Y: 32
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 18
FONT_COLOR: 255, 239, 8
# BACKGROUND_COLOR: 0, 0, 0
BACKGROUND_IMAGE: background.png
Loading