Skip to content

About

Ready-made automations for pls: Mac settings, files, network, apps and developer chores, asked for in plain words.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pls automations

Everyday Mac automations for pls, ready to ask for in plain words. Mac settings, sound and music, the network, files and images, the clipboard, apps, Xcode and the simulator, Ghostty, developer chores and reminders.

pls "it's too bright"
pls "free up port 3000"
pls "keep my mac awake for 2 hours"
pls "what's taking up space?"
pls "remind me in 20 minutes to check the oven"
  • Read before you trust. Each one is a short shell script or AppleScript, and none runs until you've looked at it and turned it on.
  • Tested against the model. Each one's description, examples and params were checked against the on-device model pls uses, so plain requests find it and fill its values correctly.

Get started

Install the collection, turn one on and ask for it:

pls collection add alexmx/pls-automations   # everything starts off; answer n to review them later
pls collection enable my-ip                  # read one and turn it on
pls "what's my ip"

Then:

pls collection review                        # read what's off and turn on what you trust
pls collection update                        # get changes; what changed is off until you review it
pls collection disable focus                 # turn one off

An approval is for the files as you read them, so an update that changes one turns it off until you review it again. If you have an automation of your own with the same id, yours wins, and this one is still there as alexmx/pls-automations/<id>.

Requirements

  • macOS 26 and pls
  • A few need more, listed in the Notes column: Homebrew, Xcode, your password for sudo, or a permission macOS asks for the first time (Accessibility, Screen Recording, or "control this app" for the AppleScript ones)
  • focus and bluetooth need a Shortcut you build once; see below

Automations

System

Automation Ask What it does Notes
dark-mode “it's too bright” Switch the system appearance between dark and light
keep-awake “keep my mac awake for 2 hours” Keep the Mac and its display awake for a number of minutes, or let it sleep again runs in the background
sleep-display “turn off the screen” Turn the display off now, leaving everything running
lock-screen “lock my mac” Lock the Mac now, so it needs your password to get back in needs Accessibility permission
set-wallpaper “set my wallpaper to ~/Pictures/beach.jpg” Set the desktop picture to an image file
hidden-files “show hidden files” Show or hide hidden files (dotfiles) in Finder
dock-autohide “hide the dock” Turn Dock auto-hiding on or off
screenshot-folder “save screenshots to ~/Pictures/Screenshots” Change the folder new screenshots are saved in, or show where they go
screenshot-format “make screenshots jpg” Change the setting for which file format future screenshots are saved in (existing files stay as they are)
focus “do not disturb for an hour” Turn a macOS Focus mode on or off, optionally for a number of minutes needs the “Set Focus” Shortcut
bluetooth “turn off bluetooth” Turn Bluetooth on or off, or restart it needs the “Set Bluetooth” Shortcut
low-power-mode “turn on low power mode” Turn Low Power Mode on or off to save battery needs your password (sudo)

Sound and music

Automation Ask What it does Notes
set-volume “set the volume to 30” Set the sound output volume to a level from 0 to 100
mute “mute” Mute or unmute the sound, keeping the volume level
apple-music-control “pause the music” Play, pause, skip or go back a track in the Music app
apple-music-playlist “play my Chill playlist” Play a playlist from the Music app by name
apple-music-now-playing “what's playing?” Show what's playing in the Music app
say “say hello world” Speak or announce text out loud with the Mac's text-to-speech voice

Network

Automation Ask What it does Notes
wifi “turn off wifi” Turn Wi-Fi on or off, or restart it
flush-dns “flush dns” Clear the DNS cache, for when websites won't load or still point to their old address needs your password (sudo)
speed-test “how fast is my internet?” Measure the internet connection's download and upload speed
my-ip “what's my IP?” Show this Mac's IP address on the local network and on the internet
kill-port “free up port 3000” Kill whatever process is listening on a TCP port asks first; shows what it would do
ports-in-use “what's using port 5432?” List which apps are listening on which TCP ports, without stopping anything
ping-host “ping google.com” Check whether a host or website is reachable and how fast it answers

Files

Automation Ask What it does Notes
clean-downloads “clean up my downloads” Trash old files in Downloads that haven't changed for a number of days, to free up space asks first; shows what it would do
image-compress “shrink my screenshots” Compress images in a folder to a lower quality, reducing file size but keeping their dimensions
image-resize “resize the photos in ~/Pictures/trip to 1200 pixels” Resize images in a folder to smaller pixel dimensions (width and height)
image-convert “convert my iPhone photos to jpg” Convert images in a folder to another file format
video-convert “make this video smaller: ~/Movies/demo.mov” Shrink or convert a video file (.mov, .mp4) to a smaller size or another format, keeping the original
zip “zip ~/Projects/site” Zip a file or folder into a .zip archive next to it
unzip “unzip ~/Downloads/fonts.zip” Extract a .zip archive next to it
large-files “what's taking up space?” List the biggest files in a folder and its subfolders, to see what's taking up space
organize-folder “organize my downloads” Sort the files in a folder into subfolders by type: Images, Documents, Videos, Audio, Archives, Installers, Other asks first; shows what it would do
empty-trash “empty the trash” Empty the Trash, permanently deleting what's in it asks first; shows what it would do
eject-disks “eject all disks” Safely eject all external drives and disk images

Clipboard and text

Automation Ask What it does Notes
plain-clipboard “make the clipboard plain text” Remove formatting from the copied text, so it pastes as plain text
clipboard-to-file “save the clipboard to a file” Save the copied text to a file
new-uuid “new uuid” Generate a new UUID and copy it to the clipboard
pretty-json “pretty print the json I copied” Format the JSON on the clipboard with indentation, or say why it isn't valid JSON
count-words “how many words did I copy?” Count the words, characters and lines in the copied text

Apps

Automation Ask What it does Notes
quit-apps “quit everything” Quit all open apps except the ones the request names asks first; shows what it would do
force-quit “force quit Xcode” Force-quit one app that's frozen or not responding, losing its unsaved work asks first; shows what it would do
hide-apps “hide everything else” Hide every app except the one in front, to clear the screen

Developer

Automation Ask What it does Notes
brew-upgrade “update brew” Update Homebrew, upgrade all installed packages, and clean up old versions and unused dependencies needs Homebrew
serve-folder “serve this folder” Serve a folder over HTTP on a local port, to preview a website or share files, until Ctrl-C
open-repo-page “open this repo on github” Open the current git repository's page on GitHub or GitLab in the browser
git-prune-branches “clean up merged branches” Delete the local git branches of a repo that are merged into its default branch, or whose remote branch is gone after a merge asks first; shows what it would do
git-worktree “new worktree for fix-login” Start work on a git branch in its own worktree, a folder next to the repo, and open it in a new Ghostty tab; a new branch starts from the default branch needs Ghostty 1.3+ for the tab
git-worktree-clean “clean up my worktrees” Remove a repo's extra git worktrees whose branch is merged into the default branch, or whose remote branch is gone after a merge, and delete those branches; worktrees with changes are kept asks first; shows what it would do

Apple development

Automation Ask What it does Notes
simulators “boot the iPhone 17 simulator” List, boot, shut down or erase iOS simulators asks first for erase; needs Xcode
sim-open-url “open myapp://settings in the simulator” Open a link or deep link (a custom URL scheme) in the running iOS simulator, to test how an app handles it needs Xcode
sim-push “send a test push to com.me.app saying Hello” Send a test push notification to an app in the running iOS simulator, by its bundle id needs Xcode
sim-appearance “simulator dark mode” Switch the running iOS simulators to dark or light mode, or change their text size (Dynamic Type), to check how an app's UI holds up; or show the current settings needs Xcode
profile-info “what's in this provisioning profile ~/Downloads/App.mobileprovision” Show what's in an iOS or macOS provisioning profile (app id, team, type, expiry, devices, entitlements), or list the installed profiles and which have expired
app-signature “show the entitlements of ~/Desktop/MyApp.app” Show how an app is code signed: who signed it, what kind of signature, whether it's valid and notarized, and its entitlements
xcode-switch “switch to Xcode beta” Switch the active Xcode (xcode-select) between the installed versions, or list them and show which one is in use asks first for switch; needs your password (sudo) to switch
xcode-cleanup “Xcode is hogging space, clean it up” Free the disk space Xcode piles up: DerivedData (also fixes stale builds), device support files, old simulators whose iOS version is no longer installed and simulator caches, and Swift package caches; archives are kept asks first; shows what it would do

Ghostty

Automation Ask What it does Notes
ghostty-workspace “new dev workspace” Split the current Ghostty pane into a dev workspace: this shell on the left, lazygit top right and a smaller shell bottom right needs Ghostty 1.3+; lazygit, if you want it in a repo
ghostty-split “split right” Split the current Ghostty pane, opening the new pane in the current folder, and run a command in it if one is given needs Ghostty 1.3+
ghostty-jump “go to the terminal in ark” Go to the open Ghostty terminal in a folder, or with a title, by bringing it to the front needs Ghostty 1.3+
ghostty-ssh “ssh to build-mac” Open a new Ghostty tab connected over SSH to a host needs Ghostty 1.3+
ghostty-present “big terminal for a demo” Open a new Ghostty window with a big font, for a demo or screen sharing; other windows keep theirs needs Ghostty 1.3+

Productivity

Automation Ask What it does Notes
new-note “new note called groceries” Create a note in Apple Notes and open it
remind-me “remind me to call mom” Add a reminder to the Reminders app, optionally due in a number of minutes
timer “set a timer for 10 minutes” Set a quick timer that notifies you with a sound after a number of minutes
pomodoro “start a pomodoro” Run Pomodoro focus sessions, work and break rounds with a notification at each switch, or stop them runs in the background
screen-recording “record my screen for a minute” Record the screen to a video file for a number of seconds, without sound needs Screen Recording permission

Maintenance

Automation Ask What it does Notes
disk-space “how much disk space is free?” Show how much free disk space is left on each drive
battery “how much battery do I have?” Show the battery level, whether it's charging, how long is left, and the battery's health
time-machine-backup-now “back up my mac now” Start a Time Machine backup now, or show when the last one finished
check-updates “are there any macOS updates?” Check for macOS and Apple software updates, without installing anything
shutdown-later “shut down in an hour” Shut down or restart the Mac now or after some minutes, or cancel a pending one asks first for shutdown or restart; runs in the background

Setting up focus and bluetooth

macOS has no command for Focus modes or Bluetooth, so these two run a Shortcut you build once in the Shortcuts app. Until you do, they say so and stop.

  • Set Bluetooth: an If on Shortcut Input is on with Set Bluetooth: On, and Otherwise Set Bluetooth: Off. (bluetooth reads the current state itself, so the Shortcut only ever gets on or off.)
  • Set Focus: Get Dictionary from Input, then Get Dictionary Value for mode and for minutes. For each Focus you use, an If on mode (e.g. is work) with Set Focus: Work, On — until Adjust Date (Current Date + minutes minutes) if you want the time limit. For off, Set Focus actions that turn your Focus modes off. The choices are do-not-disturb, work, personal, sleep, morning and reduce-interruptions; trim the @pls.param mode line in automations/focus.sh to the ones you have.

Make one yours

Copy it into ~/.config/pls/automations and change it there: your copy wins, and updates leave it alone.

Contributing

Keep each automation self-contained (no paths into anyone's home, no files outside its own folder) and check it before opening a pull request:

PLS_HOME=. pls doctor                         # no problems
PLS_HOME=. pls doctor --examples <id>         # every example picks it
python3 scripts/update-readme.py              # refresh the table

The formats, and how to write descriptions the model routes well, are in the use-pls skill.

License

MIT

About

Ready-made automations for pls: Mac settings, files, network, apps and developer chores, asked for in plain words.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages