testsAndMisc/scripts/digital_wellbeing/systemd/music-parallelism.service
Krzysztof kuhy Rudnicki 774c28b7a7 Add music parallelism prevention script
Prevents multitasking between focus work and music streaming.
When focus apps (VS Code, Steam, Godot, etc.) are detected running
alongside music services (YouTube Music, Spotify, etc.), the music
is automatically stopped.

Features:
- Monitors for focus applications (IDEs, games, creative software)
- Detects music streaming via browser tabs and native apps
- Closes music windows/processes when conflict detected
- Desktop notifications when music is stopped
- Status command to check current state
- Systemd service for background monitoring
2025-12-07 14:27:19 +01:00

26 lines
574 B
Desktop File

[Unit]
Description=Music Parallelism Prevention - Stops music when focus apps are running
After=graphical-session.target
Wants=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/local/bin/music-parallelism.sh monitor
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
# Run as user (needs access to X11/Wayland for window detection)
# This will be set during installation based on the actual user
# Environment for X11/Wayland access
Environment=DISPLAY=:0
# Resource limits
MemoryMax=50M
CPUQuota=5%
[Install]
WantedBy=default.target