Elektrine lite

← Feed

@AstroLightz@lemmy.world

Post #558319

2026-03-06 19:04 UTC

Thank you so much! One more thing: would there be a way to check if the user has playerctl installed on their system? Or is there a Python package like it?

Replies (4)

  • @felsiq@piefed.zip 2026-03-07 02:27

    If you don’t want a playerctl dependency you can use a dbus library to check for mpris players manually, though it’s a little less readable

    Open ##563903

  • @Maxy@lemmy.blahaj.zone 2026-03-07 06:58

    That depends on your distro. On Debian/ubuntu(-based) distro’s, you can try apt list --installed playerctl, which will output nothing if the package isn’t yet installed, or the package name with version info if it is installed. To install it, run sudo apt install playerctl On arch(-based) distro’s, you can try pacman -Qi playerctl, which should return an error if there is no such package installed, or several lines of info if it is installed. To install it, run sudo pacman -S playerctl, ideally after running a full system upgrade with sudo pacman -Syu

    Open ##566365

  • You could always run whereis playerctl and parse the output with awk or sed

    Open ##567485

  • @floquant@lemmy.dbzer0.com 2026-03-07 11:27

    You can test if a command exists in several ways, but the most portable one should be using command -v which is POSIX. if command -v playerctl &> /dev/null # do things else # warn and exit end

    Open ##569410