Home IOS Development Controlling Display screen Sharing from the command line — Erica Sadun

Controlling Display screen Sharing from the command line — Erica Sadun

0
Controlling Display screen Sharing from the command line — Erica Sadun

[ad_1]

My world usually narrows to Xcode and Terminal. There are occasions I simply wish to test in on one other pc shortly and I don’t need the trouble of making a brand new Finder window, going to the community, ready for the objects to load, and clicking Display screen Sharing.

Let me share a fast osascript answer I exploit as a substitute (and there’s an excellent higher answer for launching simply utilizing open, thanks Chris). This instance connects to Esopus Spitzenburg, my Mojave pc (aka the one that also runs every thing together with Photoshop and Microsoft Workplace).

#! /bin/sh

/usr/bin/osascript -e 'inform software "Display screen Sharing" to GetURL "vnc://Esopus-Spitzenburg.native"'

If closed, the Display screen Sharing software launches within the foreground. If already working, it stays at its relative hierarchy. You’ll be able to add a command to activate to convey it to the entrance on every invocation, even when the connection is already energetic.

For those who’d wish to let the utility toggle visibility on name as a substitute, add a request to Finder and append it to the script:

/usr/bin/osascript -e 'inform software "Finder" to set seen of course of "Display screen Sharing" to not seen of course of "Display screen Sharing"'

I’ve written related utilities to open Broxwood Foxwhelp and Glockenapfel, relying on the pc I’m utilizing. As a lot as I’ve supposed to jot down a single utility as a substitute of two or three devoted scripts, I’ve can’t persuade myself it’s well worth the effort.

(Bonus factors: Why are my computer systems named this fashion?)



[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here