I always wanted to cast android to my linux machine. It is especially useful in situations like watching the videos that is already on my phone in a bigger screen without really copying them over or syncing them using tools like syncthing. Oh too much to worry about. I wanted something simpler.

Here is a neat tool that lets you do that the same without hassle of connecting over the network (btw you can do that too). One of the most useful feature is that it supports audio routing also.

Install:
https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md

Before connecting phone, ensure USB debugging is turned on

Run:

scrcpy -S

To turn the phone’s screen off, pass the ‘-S’ flag

Extras:
https://gist.github.com/csarron/b3ab1fc6e5e9da622d675c59137ef2a8