ShareShortcuts

Sidecar Headless Mode

wjames1
Dupliquer « Sidecar Headless Mode »

Tu as créé quelque chose de nouveau à partir de ce raccourci ? Partage-le comme version dérivée : il devient un raccourci à toi, que tu gères, et les deux pages renvoient l’une vers l’autre pour que wjames1 soit crédité.

  1. 1Obtenez le raccourci et modifiez-le dans l’app Raccourcis. Donnez-lui un nom bien à lui.
  2. 2Partage-le depuis l’app Raccourcis et copie le lien iCloud.
  3. 3Reviens ici, colle le lien et décris ce qui change, par exemple : « Ajout d’une étape qui utilise Apple Intelligence pour personnaliser le texte. »
Créer mon fork
Téléchargements
60K
Enregistré
0
Actions
9
Catégorie
API
Version
1.0
Langue
EN

Run Sidecar from iPad even while Mac is sleeping/locked or closed, affectively allowing Sidecar to be used In headless mode.

Instructions:

  • Please make sure to enable remote login under sharing in system preferences.
  • If you will be running this shortcut while computer is locked or closed, Make sure power nap is enabled under power save settings and plugged in.
  • To access your Mac's IP address click on sharing again in system preferences. At the top it should say your Mac is accessible at name-MacBook-Pro.local or something similar. Copy paste this into the shortcut Mac IP import question.

Please note this shortcut can take up to 6 seconds to complete be patient before running again. If Shortcut is run while Mac is already connected, Mac will be disconnected and sent to sleep mode.

Nouveautés

Version 1.0

First release

Historique des versions
1.0 2 mai 2020

First release

Ce qu’il fait

9 actions
  1. Text
  2. If
  3. Set Variable
    Password
  4. If
  5. Ask for Input
    MacOS Password?
  6. Set Variable
    Password
  7. Get Device Details
  8. Nothing
  9. Run Script Over SSH

Afficher en tant que code
Bêta

Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.

#include 'actions/network'
#include 'actions/device'
#define color blue
#define glyph circledPower

const Text = "nil"

if Text {
	@Password = Text
} else {
	prompt("MacOS Password?")
	@Password
}
getDeviceDetail("")
nothing()
runSSHScript("caffeinate -u -t 4\nosascript -e 'tell application \"System Events\" to key code 123'\nosascript -e 'tell application \"System Events\" to keystroke \"{@Password}\"'\nosascript -e 'tell application \"System Events\" to keystroke return'\n\nsleep 4\n\n\nosascript <<EOD\ntell application \"System Events\"\n  tell process \"SystemUIServer\"\n    click (menu bar item 1 of menu bar 1 whose description contains \"Displays\")\n    if menu item \"Stop Airplay\" of menu 1 of result exists then\n      click menu item \"Stop Airplay\" of menu 1 of result\n      tell application \"Finder\" to sleep\n    else\n      click menu item \"{}\" of menu 1 of result\n    end if\n  end tell\nend tell\nEOD\n", nil, "foos-MacBook-Pro.local", "", "foo bar", "", @Password)
Ouvrir dans Cherri Playground Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.

Notes et avis

Écrire un avis
–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aucun avis pour le moment. Sois le premier à partager ton avis !

Publicité

Ça pourrait aussi te plaire

Tout afficher
Publicité