Add fullscreen_message skill
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# fullscreen_message Skill
|
||||
|
||||
This skill lets you display a fullscreen message popup on the local machine, triggered from the command line (or by other agents/automations). Great for visual notifications, alerts, or simple messages—works outside of chat.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
python3 fullscreen_message_skill.py --message "Your custom message!" --timeout 5
|
||||
```
|
||||
- `--message` (optional): The text to display (default: "Hello, Adolfo!")
|
||||
- `--timeout` (optional): Auto-dismiss after N seconds (default: wait for key or click)
|
||||
|
||||
You can connect this to a heartbeat or automation to make sure you never miss an alert!
|
||||
|
||||
---
|
||||
|
||||
### To Expand
|
||||
- Color, font size, dynamic sizing
|
||||
- Interactive elements (buttons, input)
|
||||
- Multi-message queue
|
||||
- Two-way local interaction
|
||||
@@ -0,0 +1,37 @@
|
||||
import argparse
|
||||
import pygame
|
||||
import sys
|
||||
import time
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Display a fullscreen message.")
|
||||
parser.add_argument('--message', type=str, default="Hello, Adolfo!", help='Message to display')
|
||||
parser.add_argument('--timeout', type=int, default=0, help='Seconds before auto-dismiss (0 = wait for key)')
|
||||
args = parser.parse_args()
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
|
||||
pygame.display.set_caption("Fullscreen Message")
|
||||
font = pygame.font.Font(None, 100)
|
||||
text = font.render(args.message, True, (255, 255, 255))
|
||||
text_rect = text.get_rect(center=(screen.get_width() // 2, screen.get_height() // 2))
|
||||
clock = pygame.time.Clock()
|
||||
start_time = time.time()
|
||||
running = True
|
||||
|
||||
while running:
|
||||
for event in pygame.event.get():
|
||||
if event.type in (pygame.QUIT, pygame.KEYDOWN, pygame.MOUSEBUTTONDOWN):
|
||||
running = False
|
||||
if args.timeout and (time.time() - start_time) > args.timeout:
|
||||
running = False
|
||||
|
||||
screen.fill((0, 0, 0))
|
||||
screen.blit(text, text_rect)
|
||||
pygame.display.flip()
|
||||
clock.tick(30)
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user