{"id":16216853,"url":"https://github.com/mrmekon/circadian","last_synced_at":"2025-04-13T00:47:46.158Z","repository":{"id":26831645,"uuid":"110593919","full_name":"mrmekon/circadian","owner":"mrmekon","description":"Suspend-On-Idle Daemon for GNU/Linux Power Management","archived":false,"fork":false,"pushed_at":"2024-08-15T02:05:46.000Z","size":85,"stargazers_count":257,"open_issues_count":6,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-13T00:47:40.733Z","etag":null,"topics":["hibernate","linux","power-management","suspend","systemd"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrmekon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-13T19:46:10.000Z","updated_at":"2025-03-04T22:13:42.000Z","dependencies_parsed_at":"2024-08-15T03:20:51.116Z","dependency_job_id":"3bce8e86-e45d-4967-b792-30222af34c4e","html_url":"https://github.com/mrmekon/circadian","commit_stats":{"total_commits":70,"total_committers":9,"mean_commits":7.777777777777778,"dds":"0.37142857142857144","last_synced_commit":"02fbb007a88a453163346cfd8a75b3d386ecc288"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmekon%2Fcircadian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmekon%2Fcircadian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmekon%2Fcircadian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmekon%2Fcircadian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrmekon","download_url":"https://codeload.github.com/mrmekon/circadian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650435,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hibernate","linux","power-management","suspend","systemd"],"created_at":"2024-10-10T11:22:56.525Z","updated_at":"2025-04-13T00:47:46.138Z","avatar_url":"https://github.com/mrmekon.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Circadian\n\n##\n### Suspend-On-Idle Daemon for GNU/Linux Power Management\n##\n\nCircadian is a background daemon/service for triggering suspend/sleep/hibernate automatically when a computer is idle.\n\nIt is primarily for stationary devices with permanent power (i.e. desktops, servers, media centers).\n\nCircadian uses a suite of 'idle heuristics' to determine when a system is idle.  These include:\n * User activity in X11 (keyboard, mouse, full-screen playback)\n * User activity in terminals (typing in PTY/SSH session)\n * Open SSH connections\n * Open SMB/Samba connections\n * Open NFS connections\n * Active audio playback\n * CPU usage below specified threshold\n * Blacklisted processes\n\nWhen all of its heuristics determine that your system has been idle for long enough, Circadian will execute a command.  This is typically a simple power suspend, but it can be configured to any desired action.\n\nCircadian can also schedule an automatic daily wakeup.  Simply set a wake time in its configuration file and it will wake up once every day at that time (if not already awake).  This allows an easy way to keep a machine updated and backed up, even if it is seldom used.\n\nIt can also execute a command when it detects that the system has woken up from sleep, regardless of why it woke up.\n\nCircadian exists because modern Linux distros already support suspend-on-idle, but it is apparently a very buggy and unreliable domain.  After you've followed your distro's advice of poking a handful of conf files, tweaking a few XML hierarchies, writing a few scripts, wafting the smoke of burning sage across your keyboard, suspending gem stones from your machine, and whatever else may be recommended... perhaps try Circadian.\n\n## Example use cases\n\n* Gaming rig with noisy fans?  Auto-sleep when idle!\n* Storage/backup machine?  Auto-wake, backup, and auto-sleep!\n* Seldom used server, but needs to be available?  Wake-on-LAN, and auto-sleep when no SSH connections!\n* Wake up to your local music library?  Auto-wake, play music, and auto-sleep!\n* Media center that you only use in evenings? Sleep all day, auto-wake when you get home!\n\n## Status\n\n\"Works for me\".  You try.  You give feedback on GitHub, or to \u003ctrevor@trevorbentley.com\u003e.\n\n## Installing\n\n### Debian x86-64\n\n* Download the latest [Circadian release](https://github.com/mrmekon/circadian/releases/)\n\n```\n$ sudo dpkg -i circadian_0.6.0-1_amd64.deb\n```\n\nIf desired, install tooling to detect network (`netstat`), X11 (`xssstate` and`xprintidle`), audio activity (`pactl`):\n\n```\n$ sudo apt-get install suckless-tools xprintidle net-tools pulseaudio-utils\n```\n\nEdit `/etc/circadian.conf` to configure.  The default is to suspend with systemd after 2 hours of idle.\n\nWhen you are happy with the config, continue:\n\n```\n$ sudo systemctl enable --now circadian\n```\n\n### Arch Linux\n\n* Use your favorite AUR package manager\n\n```\nyay -S circadian\n```\n\nConsider installing the optional packages of `xprintidle` and `xssstate` for X11 based idle detection and `net-tools` for SSH detection. Both of this options are enabled by default.\n\n\n### Any other system with systemd\n\nInstall manually.  It's easy.\n\n```\n$ git clone https://github.com/mrmekon/circadian.git\n$ cd circadian\n$ cargo build --release\n$ sudo cp target/release/circadian /usr/local/bin/\n$ sudo cp resources/circadian.conf.in /etc/circadian.conf\n$ sudo cp resources/circadian.service /etc/systemd/system/\n$ sudo systemctl enable circadian\n$ sudo systemctl start circadian\n```\n\n### Non-systemd systems\n\nFollow systemd instructions, and port circadian.service to whatever format you want.\n\n## Dependencies\n\n* Might need to install\n    * xssstate\n    * xprintidle\n    * netstat\n    * pactl\n    * rustc + cargo (if building locally)\n* Should already have\n    * grep\n    * awk\n    * w\n    * id\n    * uptime\n    * pgrep\n    * cat\n    * sh\n\nAuto-wake requires kernel support for the real-time clock (RTC).  You can check for the file `/sys/class/rtc/rtc0/wakealarm`.  You probably have it.\n\n## Usage\n\n* Should run as root, ideally from systemd.\n* Config is in: /etc/circadian.conf (it is documented)\n* `pkill -SIGUSR1 circadian` will dump info to syslog.  Use that to see if it's working, or find out why it isn't sleeping.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmekon%2Fcircadian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrmekon%2Fcircadian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmekon%2Fcircadian/lists"}