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:
parent
b3dc0c1254
commit
e89a93db81
4 changed files with 10 additions and 6 deletions
|
@ -2,6 +2,10 @@
|
||||||
# which user are we currently using?
|
# which user are we currently using?
|
||||||
akku_user: "{{ ansible_user_id }}"
|
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?
|
# should we install cronie?
|
||||||
install_and_enable_cronie: false
|
install_and_enable_cronie: false
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
- name: copy sound warning script
|
- name: copy sound warning script
|
||||||
become: yes
|
become: yes
|
||||||
copy:
|
templates:
|
||||||
src: 'files/akku.sh'
|
src: 'templates/akku.sh'
|
||||||
dest: '/opt/akku.sh'
|
dest: '/opt/akku.sh'
|
||||||
owner: 'root'
|
owner: 'root'
|
||||||
group: 'root'
|
group: 'root'
|
||||||
|
@ -14,8 +14,8 @@
|
||||||
- name: copy sound warning video
|
- name: copy sound warning video
|
||||||
become: yes
|
become: yes
|
||||||
copy:
|
copy:
|
||||||
src: 'files/low_battery.m4a'
|
src: "{{ akku_sound_src }}"
|
||||||
dest: '/opt/low_battery.m4a'
|
dest: "{{ akku_sound_dest }}"
|
||||||
owner: 'root'
|
owner: 'root'
|
||||||
group: 'root'
|
group: 'root'
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
|
@ -5,7 +5,7 @@ power="$((`cat /sys/class/power_supply/BAT0/energy_now` * 100 / `cat /sys/class/
|
||||||
if (( $power < 25 && $power > 15 )); then
|
if (( $power < 25 && $power > 15 )); then
|
||||||
zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0
|
zenity --warning --title="Low Power" --text="$power percent remaining.\n\nPlease recharge soon!" --display=:0.0
|
||||||
elif (( $power < 15 && $power > 9 )); then
|
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
|
elif (( $power < 9 && $power > 5 )); then
|
||||||
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nPlease recharge NOW!" --display=:0.0
|
zenity --warning --title="Critical Power" --text="$power percent remaining.\n\nPlease recharge NOW!" --display=:0.0
|
||||||
elif (( $power < 5 )); then
|
elif (( $power < 5 )); then
|
|
@ -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'
|
playbook_version_path: '/etc/ansible-version/role-akku-warning_chaos-bodensee_github.com.version'
|
||||||
|
|
Loading…
Reference in a new issue