From 280bce9025b1bf3e7c6f3badc769aee3e937e537 Mon Sep 17 00:00:00 2001 From: eoli3n Date: Tue, 14 Nov 2023 14:21:41 +0100 Subject: [PATCH] updated sway and kanshi display config at work --- .gitignore | 2 +- host_vars/work.yml | 8 ++++---- hosts | 3 +-- roles/sway/templates/hosts/sway/work/config.j2 | 1 + roles/sway/templates/kanshi.config.j2 | 7 +++++++ 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index fe53d90..c09404f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .vagrant *.swp -./hosts +hosts diff --git a/host_vars/work.yml b/host_vars/work.yml index db628b4..0bf82ea 100644 --- a/host_vars/work.yml +++ b/host_vars/work.yml @@ -7,19 +7,19 @@ displays: mode: 1920x1080 scale: 1.6 - name: screen1 - id: DP-7 + id: DP-8 x: 0 y: 0 mode: 1920x1080 scale: 1 - name: screen2 - id: DP-5 + id: DP-6 mode: 1920x1080 x: 1920 y: 0 scale: 1 - - name: screen2 - id: DP-6 + - name: screen3 + id: DP-7 mode: 1920x1080 x: 3840 y: 0 diff --git a/hosts b/hosts index 797f3ca..123bceb 100644 --- a/hosts +++ b/hosts @@ -1,4 +1,3 @@ [cli] [desktop] -osz ansible_connection=local - +work ansible_connection=local diff --git a/roles/sway/templates/hosts/sway/work/config.j2 b/roles/sway/templates/hosts/sway/work/config.j2 index b084070..40f565f 100644 --- a/roles/sway/templates/hosts/sway/work/config.j2 +++ b/roles/sway/templates/hosts/sway/work/config.j2 @@ -3,6 +3,7 @@ set $laptop "{{ (displays | selectattr('name', 'eq', 'laptop')).0.id }}" set $screen1 "{{ (displays | selectattr('name', 'eq', 'screen1')).0.id }}" set $screen2 "{{ (displays | selectattr('name', 'eq', 'screen2')).0.id }}" +set $screen3 "{{ (displays | selectattr('name', 'eq', 'screen3')).0.id }}" # dpms output * dpms on diff --git a/roles/sway/templates/kanshi.config.j2 b/roles/sway/templates/kanshi.config.j2 index 604c65d..9a65a70 100644 --- a/roles/sway/templates/kanshi.config.j2 +++ b/roles/sway/templates/kanshi.config.j2 @@ -1,3 +1,10 @@ +profile { + output "{{ (displays | selectattr('name', 'eq', 'screen3')).0.id }}" position {{ (displays | selectattr('name', 'eq', 'screen3')).0.x }},{{ (displays | selectattr('name', 'eq', 'screen3')).0.y }} mode {{ (displays | selectattr('name', 'eq', 'screen3')).0.mode }} scale {{ (displays | selectattr('name', 'eq', 'screen3')).0.scale }} + output "{{ (displays | selectattr('name', 'eq', 'screen2')).0.id }}" position {{ (displays | selectattr('name', 'eq', 'screen2')).0.x }},{{ (displays | selectattr('name', 'eq', 'screen2')).0.y }} mode {{ (displays | selectattr('name', 'eq', 'screen2')).0.mode }} scale {{ (displays | selectattr('name', 'eq', 'screen2')).0.scale }} + output "{{ (displays | selectattr('name', 'eq', 'screen1')).0.id }}" position {{ (displays | selectattr('name', 'eq', 'screen1')).0.x }},{{ (displays | selectattr('name', 'eq', 'screen1')).0.y }} mode {{ (displays | selectattr('name', 'eq', 'screen1')).0.mode }} scale {{ (displays | selectattr('name', 'eq', 'screen1')).0.scale }} + output "{{ (displays | selectattr('name', 'eq', 'laptop')).0.id }}" position {{ (displays | selectattr('name', 'eq', 'laptop')).0.x }},{{ (displays | selectattr('name', 'eq', 'laptop')).0.y }} mode {{ (displays | selectattr('name', 'eq', 'laptop')).0.mode }} scale {{ (displays | selectattr('name', 'eq', 'laptop')).0.scale }} +} + profile { output "{{ (displays | selectattr('name', 'eq', 'screen2')).0.id }}" disable output "{{ (displays | selectattr('name', 'eq', 'screen1')).0.id }}" position {{ (displays | selectattr('name', 'eq', 'screen1')).0.x }},{{ (displays | selectattr('name', 'eq', 'screen1')).0.y }} mode {{ (displays | selectattr('name', 'eq', 'screen1')).0.mode }} scale {{ (displays | selectattr('name', 'eq', 'screen1')).0.scale }}