Hey newbie scripter here. We have a lot of teachers come in and ask our tech team how to mirror the display . So I wrote a small script that will mirror the display for you through Self Service. This will only work if there is an external display connected. It downloads a command line tool created by Fabian Canas and runs it.
( I was trying really hard to make a script myself to mirror the display but finding this command line tool made things way easier.)
#!/bin/bash
## Checking if file exists
if [ -e /Library/Application Support/JAMF/tmp/mirror ]
then
## running the executable
/Library/Application Support/JAMF/tmp/mirror
else
## if file doesn't exist
cd /Library/Application Support/JAMF/tmp/
## it will go ahead and download the file to the tmp directory
curl -L "https://github.com/fcanas/mirror-displays/releases/download/1.0/MirrorTool.zip" > MirrorTool.zip
sleep 2
unzip MirrorTool.zip
sleep 0.5
## it will then run the downloaded executable
/Library/Application Support/JAMF/tmp/mirror
fi
exit 0
Definitely looking for any suggestions on how to change this up.
We wanted to store the file under the tmp folder, that can be changed to your taste.
Credit goes to Fabian Canas for making the Mirror Display Application and Command line Tool:
[http://fabiancanas.com/open-source/mirror-displays](link URL)