diff --git a/roles/laptop/files/chargecontrol.service b/roles/laptop/files/chargecontrol.service new file mode 100644 index 0000000..28ef755 --- /dev/null +++ b/roles/laptop/files/chargecontrol.service @@ -0,0 +1,5 @@ +[Service] +ExecStart=ectool chargecontrol normal 87 87 + +[Install] +WantedBy=default.target diff --git a/roles/laptop/handlers/main.yml b/roles/laptop/handlers/main.yml index 18d48bd..f7f8ba6 100644 --- a/roles/laptop/handlers/main.yml +++ b/roles/laptop/handlers/main.yml @@ -6,3 +6,8 @@ service: name: power_monitor.service state: restarted + +- name: restart charge control + service: + name: chargecontrol.service + state: restarted diff --git a/roles/laptop/tasks/framework.yml b/roles/laptop/tasks/framework.yml new file mode 100644 index 0000000..002745c --- /dev/null +++ b/roles/laptop/tasks/framework.yml @@ -0,0 +1,27 @@ +--- +- name: Install fw-ectool-git + kewlfft.aur.aur: + name: fw-ectool-git + become: yes + become_user: "{{ aur.user }}" + tags: + - aur + - framework + +- name: Copy charge control service + copy: + src: chargecontrol.service + dest: /etc/systemd/system/ + notify: + - reload systemd config + - restart charge control + tags: + - framework + +- name: Enable and start charge control service + service: + name: chargecontrol.service + enabled: yes + state: started + tags: + - framework diff --git a/roles/laptop/tasks/main.yml b/roles/laptop/tasks/main.yml index e12382f..2f4483c 100644 --- a/roles/laptop/tasks/main.yml +++ b/roles/laptop/tasks/main.yml @@ -5,6 +5,9 @@ - include_tasks: tuned.yml when: power_management is defined and power_management == "tuned" +- include_tasks: framework.yml + when: power_management is defined and power_management == "tuned" and ansible_system_vendor == "Framework" + - name: Install x86_energy_perf_policy pacman: name: x86_energy_perf_policy