1
0
Fork 0
mirror of https://github.com/roles-ansible/role_akku_warning.git synced 2024-08-16 10:09:50 +02:00
ansible role to install a warning if your akku is low
Find a file
2020-05-16 21:10:33 +02:00
.github No support for fedora because mpv is not available by default 2020-05-16 19:18:05 +02:00
defaults Update README description and testing 2020-05-16 20:39:04 +02:00
files Use new sound 2019-08-31 15:05:07 +02:00
meta update metadata 2020-05-16 20:40:50 +02:00
tasks rename akku.sh to akku.sh.j2 and fix description 2020-05-16 19:36:07 +02:00
templates rename akku.sh to akku.sh.j2 and fix description 2020-05-16 19:36:07 +02:00
vars update version string 2020-02-20 22:57:09 +01:00
.travis.yml add travis check 2020-02-20 22:57:21 +01:00
LICENSE Update LICENCE Information 2019-06-07 11:37:31 +02:00
README.md Add ad-hoc command 2020-05-16 21:10:33 +02:00

Ansible Galaxy Build Status MIT License

ansible role: akku warning

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 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.

This role is tested with the i3 - improved tiling wm, installed by this role at Archlinux, but probably will work on all window magers and the most operating systems!

Installation and Usage

install with galaxy:

ansible-galaxy install do1jlr.akku_warning

You can execute the role directly via ansible ad-hoc commands, but it is highly recomended to create a ansible playbook

# example ad-hoc command
ansible -m include_role -a "name=do1jlr.akku_warning" localhost

example playbook with galaxy

---
- hosts:
  roles:
    - do1jlr.akku_warning

installation via git

# download this role into your roles directory
git clone https://github.com/roles-ansible/role_akku_warning.git

example playbook

---
- name: install akku_warning
  hosts: localhost
  tags:
   - akku_warning
  roles:
    - role_akku_warning

Variables:

---
# 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 Issue or Pull-Request. Thanks <3

Testing

This role is tested with these github-action tests for different versions of differen linux systems. Linting is tested via travis-ci and the ansible-lint action. If you want to find out more about our tests, please have a look at the github marketplace.

test status Github Marketplace
Travis Build Status .travis.yml
Ansible Lint check ansible-lint action
Ansible check debian:stable ansible test with debian stable
Ansible check debian:latest ansible test with debian latest
Ansible check debian:sid ansible test with debian sid
Ansible check debian:buster ansible test with debian buster
Ansible check debian:jessie ansible test with debian jessie
Ansible check debian:stretch ansible test with debian stretch
Ansible check archlinux:latest ansible test with archlinux latest
Ansible check ubuntu:latest ansible test with ubuntu latest
Ansible check ubuntu:bionic ansible test with ubuntu bionic
Ansible check ubuntu:eoan ansible test with ubuntu eoan
Ansible check ubuntu:trusty ansible test with ubuntu trusty
Ansible check ubuntu:xenial ansible test with 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.