Package: cast-control
📺 Control Chromecasts from Linuxcast_controlisa daemonutility that allows you to control media playback on casting devices from the Linux desktop.While this service runs, it collects data about the media and apps playing on your casting devices and displays it on your computer.Integrationscast_controlcontrols 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.7PyGObjectrequirements.txtInstalling PyGObjectOn Debian-derived distributions like Ubuntu, installpython3-giwithapt.On Arch, you'll want to installpython-gobjectandgobject-introspection, or installcast_controldirectly 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-mpipinstallcast_controlYou'll get acast_controlexecutable 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 acast_controlexecutable added to your$PATH.AURIf you're on Arch, you can installcast_controldirectly from the AUR. Thanks,@yochananmarqos!$yay-Scast_controlUpgradesStable releases are uploaded to PyPI. You can upgrade yourcast_controlinstallation like so:$python3-mpip--upgradecast_controlSee 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 addcast_controlto yourpipexecutables path:$whichcast_control~/.local/bin/cast_controlIf you have yourpipexecutables path added to your shell's$PATH, you can launchcast_controllike so:$cast_control--helpOr, using the short name launchercastctl:$castctl--helpYou can also launchcast_controlvia its Python module. This can be useful if your$PATHdoesn't point to yourpipexecutables.$python3-mcast_control--helpHelpShell completionTo enable Bash completion forcast_control, add the following to your~/.bashrc:eval"$(_CAST_CONTROL_COMPLETE=bash_sourcecast_control)"For thezshandfishshells, check outthe documentation here.Help text$cast_control--help
Usage:cast_control[OPTIONS]COMMAND[ARGS]...ControlcastingdevicesviaLinuxmediacontrolsanddesktops.ThisdaemonconnectsyourcastingdevicedirectlytotheD-Busmediaplayerinterface.Seehttps://github.com/alexdelorenzo/cast_controlformoreinformation.

Options:-L,--licenseShowlicenseandcopyrightinformation.-V,--versionShowversioninformation.--helpShowthismessageandexit.

Commands:connectConnecttothedeviceandruntheserviceintheforeground.serviceConnect,disconnectorreconnectthebackgroundservicetoor...connectcommand$cast_controlconnect--help
Usage:cast_controlconnect[OPTIONS]Connecttothedeviceandruntheserviceintheforeground.

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.servicecommand$cast_controlservice--help
Usage:cast_controlservice[OPTIONS]COMMAND[ARGS]...Connect,disconnectorreconnectthebackgroundservicetoorfromyourdevice.

Options:--helpShowthismessageandexit.

Commands:connectConnectthebackgroundservicetothedevice.disconnectDisconnectthebackgroundservicefromthedevice.reconnectReconnectthebackgroundservicetothedevice.logShowtheservicelog.service connectcommand$cast_controlserviceconnect--help
Usage:cast_controlserviceconnect[OPTIONS]Connectthebackgroundservicetothedevice.

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":$cast_controlconnect--name"My Device"Connect to a device named "My Device" and runcast_controlin the background:$cast_controlserviceconnect--name"My Device"After launchingcast_control, 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 beforecast_controlwill 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$cast_controlconnect--wait$SECONDS# or$cast_controlserviceconnect--wait$SECONDSThis is useful if you'd like to startcast_controlat login, and there is a chance that your device isn't on, or you're on a different network.Reconnect or disconnect the background serviceIf the background service is running, you can force it to reconnect and restart, or disconnect it entirely.$cast_controlservicereconnect# or$cast_controlservicedisconnectOpen 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"LogsYou can set the log level using the-l/--log-levelflag with theconnectorservice connectcommands:$cast_controlconnect--log-leveldebugHere's alist of log levels supported bycast_control.You can view the background service's log file with theservice logcommand:$cast_controlservicelogSupportWant to support this project andother open-source projectslike it?LicenseSeeLICENSE. If you'd like to use this project with a different license, please get in touch.