Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| from AppKit import NSScreen, NSDeviceSize, NSDeviceResolution | |
| from Quartz import CGDisplayScreenSize | |
| for i, screen in enumerate(NSScreen.screens(), 1): | |
| description = screen.deviceDescription() | |
| pw, ph = description[NSDeviceSize].sizeValue() | |
| rx, ry = description[NSDeviceResolution].sizeValue() | |
| mmw, mmh = CGDisplayScreenSize(description["NSScreenNumber"]) | |
| scaleFactor = screen.backingScaleFactor() | |
| pw *= scaleFactor |
| #!/bin/bash | |
| trap "exit" INT TERM # Convert INT and TERM to EXIT | |
| trap "kill 0" EXIT # Kill all children if we receive EXIT | |
| # Run stuff in the background | |
| sleep 3 & | |
| sleep 4 & | |
| # Find child processes and wait for them to finish so this script doesn't |