Skip to content
Snippets Groups Projects
Verified Commit 803e2f5d authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Add readme and fullscreen option

parent 0efa7cf7
Branches
No related tags found
No related merge requests found
# cs-fancy-clock
A simple clock that displays the current time in a fancy way.
## Installation (on Pi Zero W)
Use Wayland for the display server, especially if you're using an SPI display. X11 may also be too slow.
```bash
cd ~
git clone https://git.rb9.xyz/TheJoeCoder/cs-fancy-clock
cd cs-fancy-clock
sudo apt-get install python3 python3-dev python3-pip python3-pygame
python3 -m venv .venv
# Install the requirements
# Omit the -r requirements.neopixel.txt if you don't have a neopixel strip
./.venv/bin/pip install -r requirements.txt -r requirements.neopixel.txt
# Change access permissions for Wayland (insecure but necessary)
xhost +SI:localuser:root
# Run the clock
sudo ./.venv/bin/python3 main.py
```
\ No newline at end of file
PROP_SCREEN_WIDTH = 240 PROP_SCREEN_WIDTH = 240
PROP_SCREEN_HEIGHT = 280 PROP_SCREEN_HEIGHT = 280
PROP_WINDOW_FULLSCREEN = False
# Make the window scale larger for development # Make the window scale larger for development
PROP_WINDOW_SCALE = 3 PROP_WINDOW_SCALE = 3
......
...@@ -82,7 +82,13 @@ def load_pattern(pattern_name: str, leds: ILedString): ...@@ -82,7 +82,13 @@ def load_pattern(pattern_name: str, leds: ILedString):
def run_screen(): def run_screen():
# Initialise Pygame and create a window # Initialise Pygame and create a window
pygame.init() pygame.init()
screen = pygame.display.set_mode((PROP_SCREEN_WIDTH * PROP_WINDOW_SCALE, PROP_SCREEN_HEIGHT * PROP_WINDOW_SCALE)) pg_options = 0x0
if PROP_WINDOW_FULLSCREEN:
pg_options |= pygame.FULLSCREEN
screen = pygame.display.set_mode(
(PROP_SCREEN_WIDTH * PROP_WINDOW_SCALE, PROP_SCREEN_HEIGHT * PROP_WINDOW_SCALE),
pg_options
)
pygame.display.set_caption("Clock") pygame.display.set_caption("Clock")
# Init widgets # Init widgets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment