1
0
Fork 0
mirror of https://github.com/roles-ansible/role_akku_warning.git synced 2024-08-16 10:09:50 +02:00

Use new sound

This commit is contained in:
L3D 2019-08-31 15:05:07 +02:00
parent b3dc0c1254
commit e89a93db81
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 10 additions and 6 deletions

View file

@ -2,6 +2,10 @@
# 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_src: '/opt/low_battery.m4a'
# should we install cronie?
install_and_enable_cronie: false

View file

@ -4,8 +4,8 @@
- name: copy sound warning script
become: yes
copy:
src: 'files/akku.sh'
templates:
src: 'templates/akku.sh'
dest: '/opt/akku.sh'
owner: 'root'
group: 'root'
@ -14,8 +14,8 @@
- name: copy sound warning video
become: yes
copy:
src: 'files/low_battery.m4a'
dest: '/opt/low_battery.m4a'
src: "{{ akku_sound_src }}"
dest: "{{ akku_sound_dest }}"
owner: 'root'
group: 'root'
mode: '0644'

View file

@ -5,7 +5,7 @@ power="$((`cat /sys/class/power_supply/BAT0/energy_now` * 100 / `cat /sys/class/
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
if (( RANDOM % 2 )); then zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0; else mpv /opt/low_battery.mkv -fs --volume 130 --start 00:00:18 --vo=tct > /dev/null ; fi
if (( RANDOM % 2 )); then zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0; else pulsemixer --set-volume 95; mpv {{ akku_sound_dest }} -fs --volume 130 --start 00:00:18 --vo=tct > /dev/null ; fi
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

View file

@ -1,3 +1,3 @@
---
playbook_version_number: 104
playbook_version_number: 1024 #should be over ninethousand
playbook_version_path: '/etc/ansible-version/role-akku-warning_chaos-bodensee_github.com.version'