Raycast Script to Prevent macOS Sleep 0 ▲ Yash Garg 213 days ago · Tech · hide · Fediverse post I'm tired of running the CLI command.I got fed up with using Amphetamine to keep my display awake, it had some really annoying bugs. Sometimes the display wouldn’t sleep even after disabling it, and other times it wouldn’t wake up properly after opening the lid. macOS by default ships with a utility called caffeinate which does the exact same thing. So, I wrote a small script for Raycast so that I don’t have to go around manually run the command in terminal and keep it minimized all the time. #!/bin/bash # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Keep Awake # @raycast.mode silent # Optional parameters: # @raycast.icon ☀️ if pgrep -f "caffeinate -d" > /dev/null; then # It's running, so turn it off pkill -f "caffeinate -d" echo "Keep Awake: OFF" else # It's not running, so turn it on in the background caffeinate -d &>/dev/null & echo "Keep Awake: ON" fi Why not just set the display to never sleep? Because most companies and their IT departments will block you… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town