Preface:
I was looking for a project like macast for quite some time, my priorities were not having to run a window manager on my headless living room server and being able to remotely cast video files on my TV.
My setup is a arch-linux server with a TV via HDMI and 5.1 analog sound system via pulseaudio, I use Jellyfin to cast my videos.
Prerequisites:
- A user called 'macast', which will be used to run Macast
- A Xserver (I use xorg-server and xorg-apps packages)
- Systemd
Configuration:
We will need to create and edit a few files by hand(I might create a AUR repository later):
/etc/systemd/system/macast.service
[Unit]
Description=Macast-gui (X11)
After=remote-fs.target systemd-user-sessions.service network-online.target nss-lookup.target sound.target bluetooth.target polkit.service upower.service mysqld.service lircd.service
Wants=network-online.target polkit.service upower.service
[email protected]
[Service]
User=macast
Group=macast
PAMName=login
TTYPath=/dev/tty1
ExecStart=/usr/bin/xinit /usr/bin/macast-gui
ExecStop=/usr/bin/killall --user macast --exact --wait macast-gui.bin
Restart=on-abort
StandardInput=tty
StandardOutput=journal
[Install]
Alias=display-manager.service
Note the User=macast and Group=macast as well as the ExecStop --user macast switch, if you want to use a different user, make your changes here
run
systemctl daemon-reload && systemctl start macast && systemctl stop macast
This will create the macast_setting.json in /home/macast/.config/Macast/
Next edit that file and make sure the following settings are set as follows:
/home/macast/.config/Macast/macast_setting.json
"PlayerPosition": 4,
"PlayerSize":4,
This will run mpv/macast in the center as fullscreen, you can find compatible settings here: https://github.com/xfangfang/Macast/blob/937891b99f25f12ed788c98f988b1ce530c77e4e/macast_renderer/mpv.py#L482-L506
Usage:
Now run macast:
systemctl start macast
and optionally run macast on boot:
systemctl enable macast