Skip to content
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

playerctl cannot find player when using systemd service #4

Open
J4ckTh3R1pper opened this issue Feb 7, 2023 · 4 comments
Open

playerctl cannot find player when using systemd service #4

J4ckTh3R1pper opened this issue Feb 7, 2023 · 4 comments

Comments

@J4ckTh3R1pper
Copy link

This program performed flawlessly inside a terminal , however when using systemd service to run the program, playerctl can't find the mpd player, executing playerctl status only returns "No players found". I think it might be related to user bus, but I don't know how to solve it.
System is Arch Linux, 6.1.8-arch1-1

@J4ckTh3R1pper
Copy link
Author

The systemctl --status output seemed normal, except playerctl can't get any info about MPD

Service started.
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...
:mpd::client] Issuing command to MPD: playlistinfo
:mpd::client] Command playlistinfo returned
:plugins::mpris2::notifier] Waiting for MPD state change from org.mpris2.MediaPlayer2...

@szclsya
Copy link
Owner

szclsya commented Feb 7, 2023

Which DE/WM are you using? Also, are you running mpdris2-rs as root or as user service?

@J4ckTh3R1pper
Copy link
Author

Which DE/WM are you using? Also, are you running mpdris2-rs as root or as user service?

Hyprland WM, running as user service

@szclsya
Copy link
Owner

szclsya commented Feb 8, 2023

Then you might need to import some environment variables into systemd to make it work. On my sway setup I do this:

systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants