https://github.com/ynodd/screen-blanking-app-for-kivy-apps-on-raspbery-pi
Screen blanking app for kivy apps on Raspbery Pi
https://github.com/ynodd/screen-blanking-app-for-kivy-apps-on-raspbery-pi
kivy raspberry-pi raspi screen-blanking screensaver
Last synced: 28 days ago
JSON representation
Screen blanking app for kivy apps on Raspbery Pi
- Host: GitHub
- URL: https://github.com/ynodd/screen-blanking-app-for-kivy-apps-on-raspbery-pi
- Owner: YNodd
- License: mit
- Created: 2025-01-20T11:10:15.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-21T11:02:26.000Z (3 months ago)
- Last Synced: 2025-02-05T00:39:54.377Z (3 months ago)
- Topics: kivy, raspberry-pi, raspi, screen-blanking, screensaver
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# screen blanking app for kivy apps on Raspberry Pi
Quick and dirty screensaver solution to force the screen on the Raspberry Pi to blanking mode (because – at least in my case – the kivy app suppresses the normal functioning of the Raspi's screensaver).
As I didn't manage to get working the genuine screensaver, I wrote this small kivy app as a quick workaround. It opens a window on which screen motions (mouse or touch) are detected and which forces the screen to blank mode after a certain time of inactivity.
## downsides:
It's only a workaround – a simple kivy window/app that sets the timer to zero every time it registers a motion on this window. That means, the timer continues if this window is covered by another app (or minimized) and blanks the screen even when you're working on it. It's no problem to reactivate the screen, as a simple touch is enough to switch it on again. But later, before you leave the screen, this app has to be in front and reset by a touch, otherwise the timer continues above the threshold (e.g. 356/20) and doesn't reach it again (and therefore doesn't blank the screen).## used hardware and software:
Python version 3.11
Kivy version 2.2.1
Raspberry Pi 4 with Debian GNU/Linux 11 (bullseye)
4.3" touchscreen (DSI)## what worked for me:
To make an executable app from the code that can be easily started by simply clicking on it, I packaged the code with pyinstaller this way:
- open the terminal in the folder where the code is saved (or open the terminal anywhere and go there with the cd keyword)
- type in the terminal:
pyinstaller my_code_to_package.py
- This creates some new files and folders in the folder where the original code is. The executable is found in a subfolder of "dist".