Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packaging/macos/screenshot.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Generated by ship; edit internal/generate/templates and run ship sync.
# Generated by ship (58f1ad43); edit internal/generate/templates and run ship sync.
# Photograph the application's own window at a size App Store Connect accepts.
#
# The counterpart of `packaging/windows/screenshot.ps1`, and written for the
Expand Down
52 changes: 51 additions & 1 deletion packaging/macos/take-shots.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Generated by ship; edit internal/generate/templates and run ship sync
# Generated by ship (e7bbcdc2); edit internal/generate/templates and run ship sync
#
# The half of a macOS screenshot set that is the same in every repository.
#
Expand Down Expand Up @@ -29,6 +29,21 @@
# EVERY_SHOT actions run before every shutter, the reference frame
# included, for state every coordinate is measured against
#
# WHAT THIS PROVIDES BACK
#
# shot one frame: a name, then the actions
# stage the copy a frame opens, in a folder that reads like a
# person's machine
# appearance `appearance light` or `appearance dark`, set on the
# desktop and read back
#
# LIGHT LEADS
#
# A listing's first picture is the one the product page shows largest, an
# application that follows the system appearance is light on a fresh macOS
# installation, and that is what most people see. So a set opens light, and
# dark is worth a frame rather than half the set.
#
# and then, at the end:
#
# . "$(dirname -- "$0")/take-shots.sh"
Expand Down Expand Up @@ -111,6 +126,41 @@ take_shots() {
echo "shots.sh: ${taken} shot(s) in ${OUTDIR}"
}

# appearance sets the desktop's appearance and reads it back.
#
# Here rather than in each repository's recipe, where it was written once and
# would have been written five more times. No control in a window changes it,
# so it is set before a launch; the driver stops whatever is running and
# launches again for every frame, so a value set here is read at the start it
# belongs to.
#
# **Asked of System Events, and not written with `defaults`.** `defaults write
# -g AppleInterfaceStyle Dark` writes the value and `defaults read` returns it,
# because both go through the same preferences cache - and the window server is
# never told, so an application launched afterwards still draws light. Measured
# on 2026-09-17: the dark frame came back a pixel-for-pixel duplicate of its
# light pair. System Events sets it the way the Settings pane does, and it is
# already trusted for Accessibility on a runner, which the driver needs anyway.
#
# Read back for the same reason: a frame taken after an appearance that did not
# take is a duplicate of its pair, and a duplicate is the sort of thing that
# reaches a listing.
appearance() {
case "$1" in
light) want=false ;;
dark) want=true ;;
*) echo "shots.sh: appearance is light or dark, not $1" >&2; exit 2 ;;
esac
osascript -e "tell application \"System Events\" to tell appearance preferences to set dark mode to ${want}" >/dev/null
sleep 1
got=$(osascript -e 'tell application "System Events" to tell appearance preferences to get dark mode')
[ "$got" = "$want" ] || {
echo "shots.sh: asked for $1 and the desktop reads dark mode ${got}" >&2
exit 1
}
echo "shots.sh: desktop set to $1"
}

# stage copies what the shot opens somewhere that reads like a person's machine
# rather than like a build: the path is in the frame, and photographing the
# checkout put a /private/tmp workspace in the picture.
Expand Down
2 changes: 1 addition & 1 deletion packaging/windows/screenshot.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Photograph an application's own window at a size the Microsoft Store accepts.
# Generated by ship; edit internal/generate/templates and run ship sync.
# Generated by ship (8001e560); edit internal/generate/templates and run ship sync.
#
# Screenshots were once listed as something no script could do, and that was an
# assumption rather than a measurement. What a script cannot do is decide which
Expand Down
2 changes: 1 addition & 1 deletion packaging/windows/take-shots.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Take a set of store screenshots, given the recipes for them.
# Generated by ship; edit internal/generate/templates and run ship sync.
# Generated by ship (e5b476af); edit internal/generate/templates and run ship sync.
#
# `shots.ps1` beside this is the half that is a product's - which document,
# which frames, and what has to happen in the window before each shutter. It
Expand Down
Loading