From bc9481f9d6609ef9fd1ce153b66f65bd9293443f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Z=C3=A1molyi?= <csaba.zamolyi@outlook.com> Date: Wed, 8 Feb 2023 07:12:27 +0100 Subject: [PATCH] Added example config file --- README.md | 39 +-------------------------------------- batteryd.conf.example | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 38 deletions(-) create mode 100644 batteryd.conf.example diff --git a/README.md b/README.md index d288bb7..19be8f9 100644 --- a/README.md +++ b/README.md @@ -25,45 +25,8 @@ Also, this is for learning in a fun, but somewhat productive way. ### Configuration `batteryd` can be configured with a `batteryd.conf` file located at `/etc/syscshee/batteryd.conf` -##### Example configuration -An example of a `batteryd.conf` file: +An example can be found in [batteryd.conf.example](batteryd.conf.example) -``` -# Example batteryd.conf file -# TODO: License -# -# There are three available battery levels: HALF, LOW, CRITICAL and their percentage value can be configured -# The actions can be as follows: -# - "notify": sends a notification to the user and informs them about the battery percentage via notify-send -# - "sleep": suspends system to RAM, waits for a configured amount of time. -# - "shutdown": gracefully shuts down the system, waits for a configured amount of time. -# You can assign more actions to a battery level, separated by commas (no trailing comma and whitespace after comma allowed) -# The daemon will execute the actions in the order they are specified so "shutdown,notify" will not make any sense -# if WAIT_TIME_SHUTDOWN is set to 0 - - -# HALF battery percentage treshold (usually 50%, but who knows!) -TRESHOLD_HALF=50 -# Action to do at HALF battery -ACTION_HALF="notify" - -# LOW battery percentage treshold (0-100) -TRESHOLD_LOW=30 -# Action to do at LOW battery -ACTION_LOW="notify" - -# CRITICAL battery percentage treshold (0-100) -TRESHOLD_CRITICAL=15 -ACTION_CRITICAL="notify,sleep" - -# Waiting times for actions (in seconds, maximum of 300) -# Waiting time for "sleep" action -WAIT_TIME_SLEEP=30 -# Waiting time for "shutdown" action -WAIT_TIME_SHUTDOWN=60 - -# TODO: more -``` ### License This project uses the [GNU General Public License v3.0](COPYING) diff --git a/batteryd.conf.example b/batteryd.conf.example new file mode 100644 index 0000000..98943cf --- /dev/null +++ b/batteryd.conf.example @@ -0,0 +1,36 @@ +# Example batteryd.conf file +# +# Copyright (c) 2023, Csaba Zámolyi +# LICENSE: GNU GPL v3.0 +# +# +# There are three available battery levels: HALF, LOW, CRITICAL and their percentage value can be configured +# The actions can be as follows: +# - "notify": sends a notification to the user and informs them about the battery percentage via notify-send +# - "sleep": suspends system to RAM, waits for a configured amount of time. +# - "shutdown": gracefully shuts down the system, waits for a configured amount of time. +# You can assign more actions to a battery level, separated by commas (no trailing comma and whitespace after comma allowed) +# The daemon will execute the actions in the order they are specified so "shutdown,notify" will not make any sense +# if WAIT_TIME_SHUTDOWN is set to 0 + + +# HALF battery percentage treshold (usually 50%, but who knows!) +TRESHOLD_HALF=50 +# Action to do at HALF battery +ACTION_HALF="notify" + +# LOW battery percentage treshold (0-100) +TRESHOLD_LOW=30 +# Action to do at LOW battery +ACTION_LOW="notify" + +# CRITICAL battery percentage treshold (0-100) +TRESHOLD_CRITICAL=15 +ACTION_CRITICAL="notify,sleep" + +# Waiting times for actions (in seconds, maximum of 300) +# Waiting time for "sleep" action +WAIT_TIME_SLEEP=30 +# Waiting time for "shutdown" action +WAIT_TIME_SHUTDOWN=60 + -- GitLab