summaryrefslogtreecommitdiffstats
path: root/roles/gpu-switch/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/gpu-switch/tasks/main.yml')
-rw-r--r--roles/gpu-switch/tasks/main.yml22
1 files changed, 22 insertions, 0 deletions
diff --git a/roles/gpu-switch/tasks/main.yml b/roles/gpu-switch/tasks/main.yml
new file mode 100644
index 00000000..14cc3be2
--- /dev/null
+++ b/roles/gpu-switch/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+- name: "Ensure gpu-switch is installed"
+ become: true
+ become_user: "aur_builder"
+ kewlfft.aur.aur:
+ name: "gpu-switch"
+ state: "present"
+ use: "yay"
+
+- name: "Configure gpu-switch to use dedicated GPU"
+ become: true
+ ansible.builtin.command:
+ cmd: "gpu-switch -d"
+ changed_when: false
+ when: gpu_switch_dedicated
+
+- name: "Configure gpu-switch to use integrated GPU"
+ become: true
+ ansible.builtin.command:
+ cmd: "gpu-switch -i"
+ changed_when: false
+ when: not gpu_switch_dedicated