Commit 88293518 authored by santiago duque's avatar santiago duque

files for desktop and autostart, updated main to see if gets better

parent 8140a414
[Desktop Entry]
Type=Application
Name=Start AudioplayerWatchdog
Exec=sh -c "sudo /bin/systemctl start audioplayer-watchdog.service"
Icon=system-run
Terminal=true
StartupNotify=false
\ No newline at end of file
[Desktop Entry]
Type=Application
Name=Stop AudioplayerWatchdog
Exec=sh -c "sudo /bin/systemctl stop audioplayer-watchdog.service"
Icon=media-playback-stop
Terminal=true
StartupNotify=false
\ No newline at end of file
[Unit]
Description=Audio Python Script
After=default.target
Wants=default.target
[Service]
Type=simple
User=squareclouds
Environment=DISPLAY=:0
Environment=HOME=/home/squareclouds
Environment=XDG_RUNTIME_DIR=/run/user/1000
Environment=PYTHONUNBUFFERED=1
Environment=SDL_AUDIODRIVER=alsa
Nice=-5
LimitRTPRIO=99
ExecStartPre=/home/squareclouds/wait-for-x.sh
ExecStart=/usr/bin/chrt -r 20 /usr/bin/python3 /home/squareclouds/audioplayer/main.py
WorkingDirectory=/home/squareclouds/audioplayer
Restart=always
RestartSec=15
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=default.target
#!/bin/bash
# wait-for-x.sh
# home/squareclouds
until [ -S /tmp/.X11-unix/X0 ]; do
sleep 1
done
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys import sys
import os import os
from os.path import isfile, join os.environ['SDL_AUDIODRIVER'] = 'alsa'
import pygame import pygame
pygame.mixer.pre_init(frequency=44100, size=-16, channels=2, buffer=2048)
from os.path import isfile, join
from gpiozero import Button from gpiozero import Button
from storage_media import USBDeviceHandler from storage_media import USBDeviceHandler
pygame.init() pygame.init()
winW = pygame.display.Info().current_w * 0.2 winW = pygame.display.Info().current_w * 0.2
winH = pygame.display.Info().current_h * 0.2 winH = pygame.display.Info().current_h * 0.2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment