Package: chromecast-mpris
📺 Control Chromecasts from Linuxchromecast_mprisisa daemonutility that allows you to control media playback on casting devices from the Linux desktop.While this service runs, it gathers and  publishes data about the media and apps playing on your casting devices.Note: This package is now called Cast Control, and isavailable on PyPI ascast_control.Please upgrade tocast_controlfor new features and bug fixes.Integrationschromecast_mpriscontrols Chromecasts and casting devices via D-Bus andMPRIS media player controls.MPRIS is the standard media player interface on Linux desktops.MPRIS integration isenabled by defaultin Plasma Desktop, and, along with GNOME's volume control widget,there are widgets for GNOME, too.playerctlprovides a CLIfor controlling media players through MPRIS.Check out▶️mpris_serverif you want to integrate MPRIS support into your media player.ScreenshotsControlling a Chromecast via Plasma Desktop's Media Player widget:FeaturesControl music and video playbackControl app playbackView playback information in real-timeDisplay thumbnail and titleDisplay playback position and media lengthSeek forward and backwardPlay, pause, and stop playbackVolume up and downPlay next and previousQuit casted appOpen media from D-BusPlay YouTube videosPlaylist integrationInstallationRequirementsLinux / *BSD /macOSD-BusPython >= 3.6PyGObjectrequirements.txtInstalling PyGObjectOn Debian-derived distributions like Ubuntu, installpython3-giwithapt.On Arch, you'll want to installpython-gobject, or installchromecast_mprisdirectly from the AUR.On macOS, installpygobject3viabrew.Usepipto installPyGObject>=3.34.0if there are no installation candidates available in your vendor's package repositories.PyPI$python3-mpipinstallchromecast_mprisYou'll get achromecast_mprisexecutable added to your$PATH.GitHubCheck outthe releases page on GitHubfor stable releases.If you'd like to use the development branch, clone the repository.Once you have a source copy, runpython3 -m pip install -r requirements.txt, followed bypython3 setup.py install.You'll get achromecast_mprisexecutable added to your$PATH.AURIf you're on Arch, you can installchromecast_mprisdirectly from the AUR.$yay-Schromecast_mprisUpgradesStable releases are uploaded to PyPI. You can upgrade yourchromecast_mprisinstallation like so:$python3-mpip--upgradechromecast_mprisSee thereleases pageon GitHub.UsageYou'll need to make sure that your computer can make network connections with your casting devices. It also helps to know the names of the devices in advance.LaunchInstalling the package via PyPI, GitHub or the AUR will addchromecast_mpristo yourpipexecutables path:$whichchromecast_mpris~/.local/bin/chromecast_mprisIf you have yourpipexecutables path added to your shell's$PATH, you can launchchromecast_mprislike so:$chromecast_mprisYou can also launchchromecast_mprisvia its Python module. This can be useful if your$PATHdoesn't point to yourpipexecutables.$python3-mchromecast_mprisHelpShell completionTo enable Bash completion forchromecast_mpris, add the following to your~/.bashrc:eval"$(_CHROMECAST_MPRIS_COMPLETE=bash_sourcechromecast_mpris)"For thezshandfishshells, check outthe documentation here.Help command$chromecast_mpris--help
Usage:chromecast_mpris[OPTIONS]ControlcastingdevicesviaLinuxmediacontrolsanddesktops.ThisdaemonconnectsyourcastingdevicedirectlytotheD-Busmediaplayerinterface.

Options:-n,--nameTEXTConnecttoadeviceviaitsname,otherwisecontrolthefirstdevicefound.-h,--hostTEXTConnecttoadeviceviaitshostnameorIPaddress,otherwisecontrolthefirstdevicefound.-u,--uuidTEXTConnecttoadeviceviaitsUUID,otherwisecontrolthefirstdevicefound-w,--waitFLOATSecondstowaitbetweentryingtomakeinitialsuccessfulconnectionstoadevice.-r,--retry-waitFLOATSecondstowaitbetweenreconnectionattemptsifasuccessfulconnectionisinterrupted.[default:5.0]-i,--iconUsealightericoninsteadofthedarkicon.Thelightericongoeswellwithdarkthemes.[default:False]-l,--log-levelTEXTSetthedebuggingloglevel.[default:WARN]--helpShowthismessageandexit.Connect to a deviceConnect to a device named "My Device" and runchromecast_mprisin the background.$chromecast_mpris--name"My Device"&[1]1234After launchingchromecast_mpris, you can use any MPRIS client to interact with it. MPRIS support is built in directly to Plasma Desktop and GNOME 3, and you can useplayerctlon the command-line.Retry until a Chromecast is foundYou can use the-w/--waitflag to specify a waiting period in seconds beforechromecast_mpriswill try to find a casting device again if one is not found initially.For example, if you want to wait 60 seconds between scans for devices, you can run the following:$exportSECONDS=60$chromecast_mpris--wait$SECONDSThis is useful if you'd like to startchromecast_mprisat login, and there is a chance that your device isn't on, or you're on a different network.Open a URI on a ChromecastGet the D-Bus name for your device usingplayerctl.$playerctl--list-all
My_DeviceUse the D-Bus name to issue commands to it.$exportURL="http://ccmixter.org/content/gmz/gmz_-_Parametaphoriquement.mp3"$playerctl--playerMy_Deviceopen"$URL"This will play a song on your device.Open a YouTube videoYou can cast YouTube videos the same way you can cast a generic URI.$exportVIDEO="https://www.youtube.com/watch?v=I4nkgJdVZFA"$playerctl--playerMy_Deviceopen"$VIDEO"SupportWant to support this project andother open-source projectslike it?LicenseSeeLICENSE. Message me if you'd like to use this project with a different license.