This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # | |
| # toggle-sleep.sh – Disable system sleep when on AC power; re-enable on battery. | |
| # | |
| # Requires: sudo privileges for `pmset`. Run `sudo visudo` and add a NOPASSWD | |
| # rule if you want it to run unattended: | |
| # youruser ALL=(ALL) NOPASSWD: /usr/bin/pmset | |
| # | |
| # Install with: | |
| # */1 * * * * /opt/homebrew/bin/zsh -i -c '/Users/thomas/.local/bin/toggle-sleep > /Users/thomas/.local/log/toggle-sleep.log' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ### defaults ############################################################### | |
| VOICE="alloy" # any voice listed in the docs, e.g. 'alloy' 'nova' … | |
| SPEED=1.0 # 0.25 – 4.0 (1.0 = normal) | |
| FORMAT="mp3" # mp3 | wav | flac … | |
| VERBOSE=0 | |
| CACHE_DIR="${XDG_CACHE_HOME:-$HOME/Library/Caches}/openai-say" |
OlderNewer