SwiftBar plugin to display Awair air quality data in your macOS menu bar with COโ alerts.
๐ก Why this exists: High COโ levels significantly impair cognitive function.
- ๐๐๐ฎโ๐จ๐ช๐จ Evidence-based thresholds (colorblind-friendly icons)
- โฌ๏ธ
โ๏ธ โก๏ธโ๏ธ โฌ๏ธ Live COโ trend tracking with 5 levels (1m/2m/5m deltas) - macOS notifications when crossing thresholds
- Dropdown with full metrics (temp, humidity, VOC, PM2.5, trends)
- Hides automatically when not on home network
- Updates every 10 seconds for near real-time monitoring
brew install swiftbar jq
mkdir -p ~/.config/swiftbar
ln -s /Users/lc140159/.scripts/awair/awair.10s.sh ~/.config/swiftbar/awair.10s.sh-
Configure SwiftBar:
- Open SwiftBar app (from Applications)
- Click the SwiftBar menu bar icon โ Preferences
- Set plugin folder to:
~/.config/swiftbar/ - Click Refresh All
-
Enable Awair Local API:
- Open Awair Home app
- Go to: Device Settings โ Developer Option โ Enable Local Sensors
-
Configure IP (if needed):
- Find your Awair's IP address in your router's admin interface (e.g., Linksys app, or web admin at 192.168.1.1)
- Edit
AWAIR_IPinawair.10s.shif your device has a different IP than 192.168.1.74 - Reserve/bind the IP to the Awair's MAC address in your router's DHCP settings so it doesn't change
- Note: Router configuration varies by manufacturer and ISP provider
Polling Interval: The .10s. in the filename tells SwiftBar to run the script every 10 seconds. You can change this by renaming the file:
.10s.sh= every 10 seconds (current).30s.sh= every 30 seconds.1m.sh= every 1 minute.5m.sh= every 5 minutes
Permissions: The symlink preserves executable permissions from the source file, so no chmod needed after setup.
The menu bar arrow is based on the 1-minute trend:
- โฌ๏ธ Very fast rise: >+50 ppm
โ๏ธ Rising: +25 to +50 ppm- โก๏ธ Stable: -25 to +25 ppm
โ๏ธ Falling: -50 to -25 ppm- โฌ๏ธ Very fast fall: <-50 ppm
The dropdown shows three trend windows:
- Trend (1m): Immediate feedback (did opening the window help?)
- Trend (2m): Short-term pattern
- Trend (5m): Longer pattern (is ventilation consistently improving things?)
History is stored in /tmp/awair_co2_history (last 5 minutes, auto-cleaned).
Based on Allen et al. 2016 (Harvard) and Satish et al. 2012 (Berkeley).
| Icon | COโ | Cognitive Impact |
|---|---|---|
| ๐ | < 800 ppm | Minimal |
| ๐ | 800+ ppm | Subtle effects possible |
| ๐ฎโ๐จ | 1000+ ppm | Affects complex thinking |
| ๐ช | 1200+ ppm | Significant impact |
| ๐จ | 1500+ ppm | Headaches, fatigue |