### Install Autosuspend on Gentoo Source: https://github.com/languitar/autosuspend/blob/main/doc/source/installation.rst Installs Autosuspend on Gentoo by enabling a repository, syncing it, and then emerging the package. ```bash eselect repository enable pholthaus-overlay emaint sync -r pholthaus-overlay emerge sys-apps/autosuspend ``` -------------------------------- ### Manual Installation from Source Source: https://github.com/languitar/autosuspend/blob/main/doc/source/installation.rst Installs Autosuspend from source using a virtual environment and pip. Replace with the desired Git tag or branch. ```bash python3 -m venv /opt/autosuspend /opt/autosuspend/bin/pip install git+https://github.com/languitar/autosuspend.git@#egg=autosuspend[all] ``` -------------------------------- ### Install Autosuspend on Debian Source: https://github.com/languitar/autosuspend/blob/main/doc/source/installation.rst Installs Autosuspend from official package sources using apt-get. ```bash apt-get install autosuspend ``` -------------------------------- ### Start AutosuSpenD Service with systemctl Source: https://github.com/languitar/autosuspend/blob/main/doc/source/systemd_integration.rst Starts the AutosuSpenD service immediately. This command is used to manually initiate the daemon's operation after it has been enabled or if it is not currently running. ```bash systemctl start autosuspend.service ``` -------------------------------- ### Install Autosuspend on Archlinux (AUR) Source: https://github.com/languitar/autosuspend/blob/main/doc/source/installation.rst Installs Autosuspend from the AUR using an AUR helper like paru. ```bash paru -S autosuspend ``` -------------------------------- ### iCalendar File Example Source: https://github.com/languitar/autosuspend/blob/main/doc/source/faq.rst This is an example of an iCalendar file (.ics) used to define events for system wake-up and activity periods. It specifies daily events from 7 a.m. to 8 p.m. to keep the system active. ```icalendar BEGIN:VCALENDAR PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN VERSION:2.0 BEGIN:VEVENT CREATED:20180602T151701Z LAST-MODIFIED:20180602T152732Z DTSTAMP:20180602T152732Z UID:0ef23894-702e-40ac-ab09-94fa8c9c51fd SUMMARY:keep active RRULE:FREQ=DAILY DTSTART:20180612T070000 DTEND:20180612T200000 TRANSP:OPAQUE SEQUENCE:3 END:VEVENT END:VCALENDAR ``` -------------------------------- ### Enable AutosuSpenD Service with systemctl Source: https://github.com/languitar/autosuspend/blob/main/doc/source/systemd_integration.rst Enables the AutosuSpenD service to start automatically at system boot. This command ensures the service is configured to be managed by systemd. ```bash systemctl enable autosuspend.service ``` -------------------------------- ### Query pyLoad for active downloads Source: https://github.com/languitar/autosuspend/blob/main/doc/source/external_command_activity_scripts.rst This script queries pyLoad for active downloads. It requires two separate requests due to pyLoad's login theme. Ensure jq is installed for JSON parsing. ```bash #!/bin/bash SessionID=$(curl -s "http://127.0.0.1:8000/api/login" -g -H "Host: 127.0.0.1:8000" -H "Content-Type: application/x-www-form-urlencoded" --data "username=user&password=password" | jq -r) SessionStatus=$(curl -s "http://127.0.0.1:8000/api/statusServer" -g -H "Host: 127.0.0.1:8000" -H "Content-Type: application/x-www-form-urlencoded" --data "session=$SessionID" | jq -r '.active') if [ $SessionStatus -eq 1 ] then exit 0 else exit 1 fi ``` -------------------------------- ### Autosuspend Configuration for Calendar Checks Source: https://github.com/languitar/autosuspend/blob/main/doc/source/faq.rst This configuration sets up autosuspend to use calendar events for managing system activity. It defines the general suspend/wakeup commands and enables both the ActiveCalendarEvent check and the Calendar wakeup check, pointing to the same iCalendar file. ```ini [general] interval = 30 suspend_cmd = /usr/bin/systemctl suspend wakeup_cmd = echo {timestamp:.0f} > /sys/class/rtc/rtc0/wakealarm [check.ActiveCalendarEvent] enabled = true url = file:///path/to/your.ics [wakeup.Calendar] enabled = true url = file:///path/to/your.ics ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.