@ -1,46 +1,16 @@
[](https://galaxy.ansible.com/do1jlr/akku_warning)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+Lint+check%22)
[](https://travis-ci.org/chaos-bodensee/role_akku_warning)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Ajessie%22)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22)
[](https://github.com/chaos-bodensee/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Alatest%22)
[](https://github.com/chaos-bodensee/role_akku_warning/blob/master/LICENSE)
ansible role: akku warning
==========================
This ansible warning will install an bash Script, that will be executet every 3 minutes.
If your batterie is under 25 percent, it will start warning you.
This role is tested with the [i3 - improved tiling wm ](https://i3wm.org/ ), but probably will work on all window magers!
Variables:
-----------
```yaml
# Your username you mostly use on your device
akku_user: "{{ ansible_user_id }}"
[](https://galaxy.ansible.com/do1jlr/akku_warning) [](https://travis-ci.org/roles-ansible/role_akku_warning) [](https://github.com/roles-ansible/role_akku_warning/blob/master/LICENSE)
# should we install and enable cronie?
install_and_enable_cronie: true
# play a sound at critical battery level
multimedia_akku_warning: true
# set this to false to disable package installation?
manage_packages_akku_warning: true
ansible role: akku warning
==========================
# version check for this playbook
submodules_versioncheck: true
This ansible role installs a bash script (per cronjob) which is executed every 3 minutes. This bash script checks if the battery level is below 25 percent and is currently not charging. If this is the case, the program [zenity ](https://de.wikipedia.org/wiki/Zenity ) installed by this role will generate a popup message stating that the battery is low.
While the battery level is between 15 and 10 percent, it will also attempt to play a sound. But this does not (yet) work reliably.
```
*For a complete view of all variables pleas have a look into the default folder.*
This role is tested with the [i3 - improved tiling wm ](https://i3wm.org/ ), installed by [this role ](https://github.com/chaos-bodensee/role-i3wm.git ) at Archlinux, but probably will work on all window magers and the most operating systems!
Installation and Usage
------------
------------------------
### install with galaxy:
```bash
ansible-galaxy install do1jlr.akku_warning
@ -57,7 +27,7 @@ ansible-galaxy install do1jlr.akku_warning
### installation via git
```bash
# download this role into your roles directory
git clone https://github.com/chaos-bodense e/role_akku_warning.git
git clone https://github.com/roles-ansibl e/role_akku_warning.git
```
### example playbook
@ -71,10 +41,61 @@ git clone https://github.com/chaos-bodensee/role_akku_warning.git
- role_akku_warning
```
Variables:
-----------
```yaml
---
# simple version check for this playbook
# true is highly recomended
submodules_versioncheck: false
# which user are we currently using?
akku_user: "{{ ansible_user_id }}"
# which sound should we play?
akku_sound_src: 'files/low_battery.m4a'
akku_sound_dest: '/opt/low_battery.m4a'
# should we install cronie?
install_and_enable_cronie: true
# play a video in the background with sound
multimedia_akku_warning: true
# you want to install missing packages?
manage_packages_akku_warning: true
```
Missing something?
----------------
Please feel free to open a [github ](https://github.com/chaos-bodensee/role_akku_warning.git ) Issue or Pull-Request. Thanks < 3
Please feel free to open a [github ](https://github.com/ roles-ansibl e/role_akku_warning.git) Issue or Pull-Request. Thanks < 3
Testing
---------
This role is tested via github [actions ](https://github.com/chaos-bodensee/role_akku_warning/actions ).
----------
This role is tested with [these github-action ](https://github.com/search?q=topic%3Acheck-ansible+topic%3Agithub-actions+org%3Aroles-ansible&type=Repositories ) tests for different versions of differen linux systems. Linting is tested via travis-ci and the [ansible-lint action ](https://github.com/marketplace/actions/ansible-lint ).
If you want to find out more about our tests, please have a look at the github marketplace.
| test status | Github Marketplace |
| :--------- | :---------------- |
| [](https://travis-ci.org/roles-ansible/role_akku_warning) | [.travis.yml ](https://github.com/roles-ansible/role_akku_warning/blob/master/.travis.yml ) |
|||
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible-lint action ](https://github.com/marketplace/actions/ansible-lint )
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Astable%22) | [ansible test with debian stable ](https://github.com/marketplace/actions/check-ansible-debian-stable ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Alatest%22) | [ansible test with debian latest ](https://github.com/marketplace/actions/check-ansible-debian-latest ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Asid%22) | [ansible test with debian sid ](https://github.com/marketplace/actions/check-ansible-debian-sid ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Abuster%22) | [ansible test with debian buster ](https://github.com/marketplace/actions/check-ansible-debian-buster ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Ajessie%22) | [ansible test with debian jessie ](https://github.com/marketplace/actions/check-ansible-debian-jessie ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+debian%3Astretch%22) | [ansible test with debian stretch ](https://github.com/marketplace/actions/check-ansible-debian-stretch ) |
| | |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+archlinux%3Alatest%22) | [ansible test with archlinux latest ](https://github.com/marketplace/actions/check-ansible-archlinux-latest ) |
| | |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Alatest%22) | [ansible test with ubuntu latest ](https://github.com/marketplace/actions/check-ansible-ubuntu-latest ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Abionic%22) | [ansible test with ubuntu bionic ](https://github.com/marketplace/actions/check-ansible-ubuntu-bionic ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Aeoan%22) | [ansible test with ubuntu eoan ](https://github.com/marketplace/actions/check-ansible-ubuntu-eoan ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Atrusty%22) | [ansible test with ubuntu trusty ](https://github.com/marketplace/actions/check-ansible-ubuntu-trusty ) |
| [](https://github.com/roles-ansible/role_akku_warning/actions?query=workflow%3A%22Ansible+check+ubuntu%3Axenial%22) | [ansible test with ubuntu xenial ](https://github.com/marketplace/actions/check-ansible-ubuntu-xenial ) |
Contribution
------------
If you are missing some features or have an idea for improving this role, please feel free to open an issue - or even better - create a pull request.