10.1 C
Canberra
Friday, September 20, 2024

Controlling Display Sharing from the command line — Erica Sadun


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

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

#! /bin/sh

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

If closed, the Display Sharing utility launches within the foreground. If already working, it stays at its relative hierarchy. You possibly can add a command to activate to deliver it to the entrance on every invocation, even when the connection is already energetic.

For those who’d prefer 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 utility "Finder" to set seen of course of "Display Sharing" to not seen of course of "Display Sharing"'

I’ve written comparable utilities to open Broxwood Foxwhelp and Glockenapfel, relying on the pc I’m utilizing. As a lot as I’ve supposed to put in writing a single utility as a substitute 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 fashion?)



Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles