Save Battery Life (#32)

* Added parameters (also made the script more of a program).

* Add additional options for unplugged devices.

* Allow disabling of cron jobs and lowering of telegraf frequency through new config options.

* Fix cron package name.

* Fix ssh service name for Ubuntu.

* Add output to the options so user knows they were switched.

* Prevent some tasks when device is mobile.

* Enhance and add to comments.

* Add function to check flatpak app disk usage.

* Add repair into flatpak commands to help clean disk space of unused apps.

* Remove "Done!" output from flatpak-usage.

* Go ahead and add function for purging Flatpak apps.

* Few more comment changes.
This commit is contained in:
2022-12-03 15:28:29 -06:00
committed by GitHub
parent 3e05260423
commit e39aeb20e7
11 changed files with 162 additions and 48 deletions

View File

@ -61,11 +61,11 @@
when: branch == "dev"
ignore_errors: yes
- name: General | Software | Services | Install CROND (Looking at you, Fedora)
- name: General | Software | Services | Install CROND (Looking at you, Fedora+Mobian)
package:
name: cronie
name: "{{ cron }}"
state: present
when: ansible_pkg_mgr == "dnf"
when: ansible_pkg_mgr == "dnf" or ansible_distribution == "Mobian"
- name: General | Software | Services | Install killall (Looking at you, Debian)
package:
@ -77,7 +77,7 @@
package:
name:
- which
- cronie
- "{{ cron }}"
- vi
state: present
when: ansible_distribution == "Archlinux"

View File

@ -85,7 +85,7 @@
# user = "$USER"
[agent]
interval = "5s"
interval = "{{ '300s' if battery else '5s' }}"
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
@ -168,7 +168,7 @@
job: "{{ item.command }}"
special_time: "{{ item.freq }}"
state: present
disabled: no
disabled: "{{ 'yes' if no_telem else 'no' }}"
loop:
- { "name": "Telegraf Reboot Job" , "freq": "reboot", "command": "{{ telegraf_cmd }}"}
- { "name": "Telegraf Keep-Alive Job", "freq": "hourly", "command": "{{ telegraf_watcher }}"}