41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
|
|
# Screen Control Script (Kivy)
|
|
#
|
|
# This script displays a simple "Bonjour" message on the HDMI screen using Kivy.
|
|
# It is designed to be run on a device without a desktop environment (headless/framebuffer).
|
|
#
|
|
# HOW TO RUN (CLI):
|
|
# -----------------
|
|
# 1. Ensure Kivy is installed (python3-kivy).
|
|
# 2. You may need to set the DISPLAY environment variable if running from SSH or outside a graphical session:
|
|
# export DISPLAY=:0
|
|
# 3. Run the script:
|
|
# python3 /home/aircarto/nebuleair_pro_4g/screen_control/screen.py
|
|
#
|
|
# HOW TO RUN (BACKGROUND):
|
|
# ------------------------
|
|
# nohup python3 /home/aircarto/nebuleair_pro_4g/screen_control/screen.py > /dev/null 2>&1 &
|
|
#
|
|
# HOW TO STOP:
|
|
# ------------
|
|
# pkill -f "screen_control/screen.py"
|
|
#
|
|
|
|
import os
|
|
os.environ['KIVY_GL_BACKEND'] = 'gl'
|
|
from kivy.app import App
|
|
from kivy.uix.label import Label
|
|
from kivy.core.window import Window
|
|
|
|
# Set background color to black (optional, but good for screens)
|
|
Window.clearcolor = (0, 0, 0, 1)
|
|
|
|
class ScreenApp(App):
|
|
def build(self):
|
|
# Create a label with large text "Bonjour" centered on the screen
|
|
label = Label(text='Bonjour', font_size='150sp', color=(1, 1, 1, 1))
|
|
return label
|
|
|
|
if __name__ == '__main__':
|
|
ScreenApp().run()
|