1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_linux_desktop_setup.git synced 2024-09-14 19:54:51 +02:00

remove akku warning

This commit is contained in:
L3D 2019-04-07 18:53:06 +02:00
parent 4a269f02a4
commit a06fbe2bdb
4 changed files with 0 additions and 73 deletions

View file

@ -1,5 +0,0 @@
---
# should we install cronie?
install_and_enable_cronie: false

View file

@ -1,14 +0,0 @@
#!/bin/bash
power="$((`cat /sys/class/power_supply/BAT0/energy_now` * 100 / `cat /sys/class/power_supply/BAT0/energy_full_design`))"
if (( $power < 25 && $power > 15 )); then
zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0
elif (( $power < 15 && $power > 9 )); then
zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0
mpv /opt/low_battery.mkv -fs --volume 130 --start 00:00:18 --vo=tct
elif (( $power < 9 && $power > 5 )); then
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nPlease recharge NOW!" --display=:0.0
elif (( $power < 5 )); then
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nRECHARGE!\nNOW!" --display=:0.0
fi

View file

@ -1,54 +0,0 @@
---
- name: copy sound warning script
become: yes
copy:
src: 'files/akku.sh'
dest: '/opt/akku.sh'
owner: 'root'
group: 'root'
mode: '0755'
- name: copy sound warning video
become: yes
copy:
src: 'files/low_battery.mkv'
dest: '/opt/low_battery.mkv'
owner: 'root'
group: 'root'
mode: '0644'
- name: install zenity and mpv for notifications
become: yes
package:
name:
- zenity
- mpv
state: present
- name: Check akku every 2 minutes
become: yes
cron:
name: check if akku still okay
job: /opt/akku.sh
minute: '*/3'
user: '{{ user }}'
cron_file: /etc/crontab
- name: Make sure cron is installed
become: true
when: install_and_enable_cronie
package:
name:
- cronie
state: present
- name: Make sure cron is running
become: true
when: install_and_enable_cronie
systemd:
name: cronie.service
state: started
enabled: yes
daemon_reload: yes