-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd service #84
Comments
This is going to be a bit difficult because a media player exposes the interface on the session bus and there can be zero or many session buses running on your system. The library will read |
@acrisci Thank you. I was already researching in this direction and it seems that I have a working setup… or at least a partially working solution. I guess there might be more people who might be interested in this solution, so I try to be as explicit as possible. I created a dbus service # /usr/share/dbus-1/services/org.mpris.MediaPlayer2.vlc.service
[D-BUS Service]
Name=org.mpris.MediaPlayer2.vlc
Exec=/bin/false
SystemdService=vlc.service with a corresponding systemd service # /etc/systemd/user/vlc.service
Description=VLC media player
[Service]
Type=dbus
BusName=org.mpris.MediaPlayer2.vlc
Environment="DISPLAY=:0"
ExecStart=/usr/bin/vlc --video-on-top --fullscreen --no-video-title-show --no-osd --no-spu --start-paused When I send a dbus message from command line it all works as expected and vlc is launched. [Unit]
Description=Demo MediaPlayer
After=dbus.service
[Service]
ExecStart=/usr/bin/node demo.mjs
WorkingDirectory=/home/pi/demo-media-player
StandardOutput=inherit
StandardError=inherit
Restart=always
Environment="DISPLAY=:0"
[Install]
WantedBy=default.target I made sure that user services get loaded during boot via let dbus = await bus.getProxyObject(
"org.mpris.MediaPlayer2.vlc",
"/org/mpris/MediaPlayer2"
); When I restart the service via Any idea what might cause it? |
I know that this is probably not the right place to ask, but I just created a small app which is checking a MediaPlayer for its status. The service is running great when manually started from the command line. But fails miserably when I try to create a systemd service to automatically start it when the system restarts.
Has anyone an idea how to tackle that issue?
The text was updated successfully, but these errors were encountered: