Stop Sleep / Screen Dim Mac

I found this post from 2013, updated in 2019, which offers a solution but it seems that the function declarations have changed again since then…