Thursday, December 5, 2024
HomeiOS DevelopmentControlling Display Sharing from the command line — Erica Sadun

Controlling Display Sharing from the command line — Erica Sadun

[ad_1]

My world typically narrows to Xcode and Terminal. There are occasions I simply need to test in on one other laptop 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 Sharing.

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

#! /bin/sh

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

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

Should you’d prefer to let the utility toggle visibility on name as an alternative, 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 Sharing" to not seen of course of "Display 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 meant to put in writing a single utility as an alternative of two or three devoted scripts, I’ve can’t persuade myself it’s definitely worth the effort.

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



[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments