Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
app-pyaudioplayer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
santiago duque
app-pyaudioplayer
Commits
88293518
Commit
88293518
authored
Jul 23, 2025
by
santiago duque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files for desktop and autostart, updated main to see if gets better
parent
8140a414
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
2 deletions
+54
-2
Start AudioplayerWatchdog.desktop
PI_SCRIPTS/Start AudioplayerWatchdog.desktop
+7
-0
Stop AudioplayerWatchdog.desktop
PI_SCRIPTS/Stop AudioplayerWatchdog.desktop
+7
-0
audioplayer-watchdog.service
PI_SCRIPTS/audioplayer-watchdog.service
+29
-0
wait-for-x.sh
PI_SCRIPTS/wait-for-x.sh
+6
-0
main.py
main.py
+5
-2
No files found.
PI_SCRIPTS/Start AudioplayerWatchdog.desktop
0 → 100644
View file @
88293518
[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
PI_SCRIPTS/Stop AudioplayerWatchdog.desktop
0 → 100644
View file @
88293518
[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
PI_SCRIPTS/audioplayer-watchdog.service
0 → 100644
View file @
88293518
[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
PI_SCRIPTS/wait-for-x.sh
0 → 100644
View file @
88293518
#!/bin/bash
# wait-for-x.sh
# home/squareclouds
until
[
-S
/tmp/.X11-unix/X0
]
;
do
sleep
1
done
main.py
View file @
88293518
#!/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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment