Skip to content
Interstellar0verdrivePublic

About

macOS menu bar utility that gives long-running heavy jobs periodic rests. Watches HandBrake today, more apps to come.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

157 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Siesta

Siesta icon: a cat sleeping in front of the sun

Give your Mac a break. Siesta is a tiny macOS menu bar utility that gives demanding, long-running processes a rhythm of work and rest. Today it gives HandBrake periodic rests, so a laptop does not run flat out for hours on a long job or a queue of files.

Siesta counts the minutes the encoder has actually been working, then pauses it for a rest period and resumes it afterwards. The encoder simply continues from where it was: Siesta never restarts the job or touches the output file.

HandBrake is the first supported app. The code is structured so other encoders (Tdarr, Topaz Video AI, plain ffmpeg…) can be added as profiles.

Siesta in the macOS menu bar: HandBrake is working, with 12 minutes until the next pause, 18 of 30 work minutes elapsed, and recent CPU, GPU and temperature history

How it works

  • Every second Siesta looks at the processes that belong to HandBrake and adds up their CPU usage. HandBrake does the real encoding in a separate XPC worker: that is what Siesta pauses, so the HandBrake window stays responsive. If no worker can be identified, Siesta falls back to pausing the HandBrake processes it found.
  • Work minutes only advance while HandBrake is encoding (CPU above a threshold, 50 % by default). If the queue is finished or HandBrake is closed, Siesta waits and says so.
  • When the work minutes are up, the worker receives SIGSTOP for the configured rest minutes, then SIGCONT. CPU usage drops to zero during the rest.
  • If HandBrake stays idle for at least the rest duration, the work counter resets: it already had its rest.
  • Stopping or quitting Siesta always resumes a frozen worker first.

Four states. One familiar face.

The cat tells you what Siesta is doing, right from the menu bar.

It changes to show whether the cycle is stopped, HandBrake is encoding, taking a scheduled rest, or Siesta is waiting for work. During work and rest, the number beside it shows the minutes until the next change.

The four Siesta states: cycle stopped, working, resting, waiting

The panel

Everything Siesta knows, one click away.

Clicking the menu bar icon opens a popover with the current state and a countdown to the next change, a thin progress line for the running interval, the Work and Rest minutes, the Start/Stop cycle button, a collapsible activity log, a gear that opens the settings and a Quit button. "Next pause at" and "Resumes at" show exact times, because pauses start on a whole minute and rests last exactly the minutes you set.

You can change Work and Rest while the cycle runs: the new value applies as soon as you confirm it with Return, Tab or a click elsewhere, and the change appears in the activity log. In the two fields, the ↑ and ↓ keys step the value by one minute, by ten with Shift. Stop cycle stops Siesta's cycle, never the encoder.

Compact Siesta popover in light and dark mode, with the graph collapsed to live CPU, GPU and temperature readings

See the cycle unfold

Open the graph to follow CPU and GPU load, temperature and scheduled rests.

Expand CPU, GPU & temperature to see the recent history. The blue line is the encoder's CPU usage as a share of the whole Mac, from 0% to 100%; the green line is the GPU usage of the whole Mac, as the graphics driver reports it; the orange line is the hottest CPU core. The shaded bands mark scheduled rests: CPU usage falls while the worker is paused, and the temperature line shows how the Mac responds.

The GPU line covers every app, not just HandBrake, so it never drops to zero: the desktop alone keeps it around 10–15%. HandBrake's software encoders (x264, x265, SVT-AV1) run on the CPU and leave it there, and so do the VideoToolbox encoders, which use the Mac's dedicated media engine; macOS does not report that engine's load without administrator rights. The line climbs when HandBrake runs its filters on the GPU, as it does with a VideoToolbox encoder and hardware decoding: in my tests, scaling, deinterlacing and rotating a 1080p file kept the GPU near 80%.

The chart starts with a five-minute view, grows with the session, and then keeps a rolling six-hour history. Hovering over the plot shows the readings and the time of that moment; near the edge of a rest band the readout snaps to the moment the rest began or ended, and near the dotted lines of a cut (see below) to the moment work stopped or resumed. When there are more readings than pixels the lines are drawn as smooth curves, never across the start or end of a rest. Pinch on the trackpad or use the mouse wheel over the plot to zoom around the cursor, down to one minute and never beyond the recorded history. Scroll sideways with two fingers, or drag the plot, to move back and forth in time; a chevron at the right edge means newer data is waiting and clicking it jumps back to now, while the one at the left edge jumps to the start of the history, both keeping the current zoom. The legend at the top right always shows how much time the view spans; after zooming or moving, a small reload icon next to it, or a double-click on the plot, returns to the automatic view.

Siesta keeps recording while the cycle is stopped, so the chart also shows what HandBrake did before you pressed Start. With Hold the chart while idle turned on in the settings, the stretches in which HandBrake is not working are cut out instead: the chart stops scrolling, and when the work resumes two dotted lines with a narrow gap between them mark the cut. The time axis and the hover readout keep showing the real time on both sides.

Collapse the chart with the chevron next to its title and the current CPU, GPU and temperature readings take the place of the title, as in the compact view above. Siesta remembers whether you left the chart and the log open or closed.

Siesta popover in light and dark mode, with a 30-minute work interval, 12 minutes until the next rest, and the graph expanded to show CPU, GPU, temperature and shaded rest periods

A window when you need one

Detach the panel and open the activity log.

Drag the popover by its header, or by any empty spot between its blocks, and it lifts off the menu bar: it widens as it follows the pointer and, where you let go, becomes a regular window that floats above your other apps, handy when you want to keep an eye on a long queue without reopening the popover. It holds exactly the same panel, with a little more room for the activity log, and it reopens where you left it. Here the chart is collapsed and Activity log is expanded, showing recent pauses and resumes. The button at the right of the title bar takes the panel back to the menu bar, and Open the panel as in the settings chooses which of the two the cat opens.

Detached Siesta window in light and dark mode during a five-minute rest, with current CPU, GPU and temperature readings and the expanded activity log

Settings

A few choices, one click from the panel.

The gear next to the version number slides the panel over to the settings page; the back chevron or Esc slides it back. Every change applies at once.

  • General. Open Siesta at login, follow the system appearance or force light or dark, open the panel as a popover or as a window, and choose what the menu bar shows next to the cat: the countdown, the encoder's CPU usage, the GPU usage and the hottest core's temperature, in any combination.
  • Cycle. Start automatically starts the cycle as soon as HandBrake starts working, so a queue launched in a hurry still gets its rests. Save the activity log to a file keeps a copy of every log line in ~/Library/Logs/Siesta/Siesta.log, with a link that shows it in the Finder.
  • Chart. Smooth curves, magnetic edges (rest bands and the dotted lines of a cut pull the hover readout), and Hold the chart while idle, described above.
  • Updates. Check for new releases automatically, install them automatically, or check now.
The Siesta settings page in light and dark mode, with the General, Cycle, Chart and Updates groups

A little about the name

Siesta takes its name from the afternoon nap. The cat curled up beneath a warm sun reflects the same idea: even a Mac running a long encode deserves a little rest along the way.

The Siesta icon in its light and dark variants: a cat asleep in front of the sun


Download

Grab Siesta-<version>.zip from the Releases page, unzip it and move Siesta.app to your Applications folder. The app is universal (Apple Silicon and Intel) and needs macOS 13 or later.

Siesta is signed ad hoc and is not notarized, so macOS blocks the first launch with a "Siesta was not opened" dialog. Click Done, then go to System Settings → Privacy & Security, find the message about Siesta and click Open Anyway. This is only needed once. If you prefer the Terminal, removing the quarantine flag has the same effect:

xattr -d com.apple.quarantine /Applications/Siesta.app

Updates

The current version is shown in small print next to the Quit button, and again in the settings, where a link at the bottom opens this page. While Siesta is running it asks GitHub for the latest release at launch and then every six hours; nothing runs while the app is closed. Check now in the settings asks at once, and turning off Check for updates automatically stops the checks at launch and every six hours.

When a newer release exists a yellow Update to x.y.z chip appears at the top of the panel, and only then. Clicking it downloads the release archive, verifies its SHA-256 checksum against the one published with the release, replaces the app in place (the old copy goes to the Trash) and relaunches. Because the new bundle is written by Siesta itself it carries no quarantine flag, so macOS does not ask for approval again: only the very first installation needs it. If the app lives in a folder Siesta cannot write to, or anything goes wrong, the chip simply opens the release page instead.

With Install updates automatically turned on, Siesta does all of this by itself as soon as it finds a new release. It never interrupts a running cycle: if one is running, the update waits until you stop it.


Building

Only the Xcode Command Line Tools are needed:

./build.sh

The app is produced at build/Siesta.app as a universal binary; ./build.sh --zip also packages it for a release.

Launching the binary with --start starts the cycle immediately with the last saved values.


Preferences

Stored in the io.github.interstellar0verdrive.siesta defaults domain: work, rest (minutes), window (detached window), appearance (system, light or dark), menuBarItems (any of time, cpu, gpu, temp), autoStart, logFile, smoothCurves, magneticBands, holdChart, checkUpdates, autoInstall (all on or off, as in the settings page), and threshold (CPU percentage considered "encoding", default 50, not exposed in the UI). Open at login is kept by macOS, in System Settings → General → Login Items.


Is pausing safe for the files?

A pause is SIGSTOP, which only suspends scheduling of the worker; SIGCONT lets it continue exactly where it was, and pending disk writes complete on resume. Siesta never reads, deletes or rewrites the output file. It cannot protect against unrelated failures such as a crash, a power loss or HandBrake being force-quit during an encode, exactly as without Siesta.

Siesta resumes a frozen worker when you stop the cycle, quit, or when it receives a termination signal (kill, logout). A kill -9 cannot be intercepted and may leave the worker frozen; the file is still fine, and the next launch of Siesta detects and resumes it. You can also resume HandBrake's worker by hand:

kill -CONT $(pgrep -x HandBrakeXPCService)

What's next

A few things I would like Siesta to do, in no particular order and with no dates attached:

  • More apps. Profiles for other long-running jobs, such as Tdarr or Topaz Video AI, chosen from a list of running programs.
  • A thermal mode. Rest when the chip has been above a chosen temperature for a while, instead of after a fixed number of minutes.

Smaller refinements will arrive along the way.


A note from the author

Siesta started as a tool I built for myself, and it still is one. I am sharing it in case it is useful to someone else, with a few honest caveats:

  • No warranty. Siesta pauses and resumes other programs and keeps your Mac running long jobs. I have taken care to make that safe, but you use it at your own risk: I cannot take responsibility for lost encodes, overheated hardware or anything else that may go wrong.
  • No promise of maintenance. This is a hobby project, not a commercial product. I will keep improving it as long as I use it, but there is no schedule and no guarantee of support. Suggestions, bug reports and code contributions are very welcome, with the same spirit in mind.
  • How it was made. Part of the code was written with the help of AI tools. The design, the decisions, the review and the testing on several Macs are mine.
  • macOS only. Siesta relies on macOS features and there are no plans for a Windows or Linux version.

Thank you for trying it. I hope it gives your Mac, and you, a well-deserved rest.


License

MIT, see LICENSE.


Enjoying this project? Support independent development on Ko-fi

About

macOS menu bar utility that gives long-running heavy jobs periodic rests. Watches HandBrake today, more apps to come.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages