From e98a9d154879c792c2c53c64ea2d1f4806f66798 Mon Sep 17 00:00:00 2001 From: eoli3n Date: Fri, 7 Jul 2023 19:43:14 +0200 Subject: [PATCH] fix .gitignore --- hosts | 4 ++ roles/sway/templates/hosts/sway/osz/config.j2 | 52 +++++++++++++++++++ .../sway/templates/hosts/sway/work/config.j2 | 28 ++++++++++ 3 files changed, 84 insertions(+) create mode 100644 hosts create mode 100644 roles/sway/templates/hosts/sway/osz/config.j2 create mode 100644 roles/sway/templates/hosts/sway/work/config.j2 diff --git a/hosts b/hosts new file mode 100644 index 0000000..797f3ca --- /dev/null +++ b/hosts @@ -0,0 +1,4 @@ +[cli] +[desktop] +osz ansible_connection=local + diff --git a/roles/sway/templates/hosts/sway/osz/config.j2 b/roles/sway/templates/hosts/sway/osz/config.j2 new file mode 100644 index 0000000..2f1546f --- /dev/null +++ b/roles/sway/templates/hosts/sway/osz/config.j2 @@ -0,0 +1,52 @@ +#INCLUDE#################################################### +# output configuration +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 }}" + +# toggle proj +bindsym --no-repeat $mod+p output $screen2 toggle +bindsym --no-repeat $mod+Shift+p output $screen2 toggle; output $laptop toggle + +# start kanshi +exec_always "pkill kanshi; kanshi" + +# dpms +output * dpms on + +# turn of screen when laptop closed +bindswitch --reload lid:on output $laptop disable +bindswitch --reload lid:off output $laptop enable + +# assign workspace to screens +workspace $tag1 output $screen1 +workspace $tag2 output $screen1 +workspace $tag3 output $screen1 +workspace $tag4 output $laptop +workspace $tag5 output $screen1 +workspace $tag6 output $laptop +workspace $tag7 output $laptop +workspace $tag8 output $laptop +workspace $tag9 output $laptop +workspace $tag10 output $laptop + +# laptop bindsyms +bindsym XF86AudioRaiseVolume exec pamixer -ui 5 && \ + pamixer --get-volume > $SWAYSOCK.wob +bindsym XF86AudioLowerVolume exec pamixer -ud 5 && \ + pamixer --get-volume > $SWAYSOCK.wob +bindsym XF86AudioMute exec pamixer --toggle-mute && \ + ( pamixer --get-mute && echo 0 > $SWAYSOCK.wob ) || \ + pamixer --get-volume > $SWAYSOCK.wob +bindsym XF86AudioMicMute exec amixer set Capture toggle +bindsym XF86MonBrightnessUp exec brightnessctl set +10% && \ + brightnessctl -m | cut -d',' -f4 | tr -d '%' > $SWAYSOCK.wob +bindsym XF86MonBrightnessDown exec brightnessctl set 10%- && \ + brightnessctl -m | cut -d',' -f4 | tr -d '%' > $SWAYSOCK.wob + +# autostart per host +# syncthing +exec_always bash -c "pgrep -x syncthing || syncthing" +# pipewire +exec_always bash -c "pgrep -x pipewire || pipewire" +#INCLUDE#################################################### diff --git a/roles/sway/templates/hosts/sway/work/config.j2 b/roles/sway/templates/hosts/sway/work/config.j2 new file mode 100644 index 0000000..047e189 --- /dev/null +++ b/roles/sway/templates/hosts/sway/work/config.j2 @@ -0,0 +1,28 @@ +#INCLUDE#################################################### +# output configuration +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 }}" + +# dpms +output * dpms on + +# turn of screen when laptop closed +bindswitch --reload lid:on output $laptop disable +bindswitch --reload lid:off output $laptop enable + +# assign workspace to screens +workspace $tag1 output $screen1 +workspace $tag2 output $screen1 +workspace $tag3 output $screen2 +workspace $tag4 output $laptop +workspace $tag5 output $screen2 +workspace $tag6 output $screen2 +workspace $tag7 output $screen1 +workspace $tag8 output $screen1 +workspace $tag9 output $laptop +workspace $tag10 output $laptop + +# syncthing +exec_always bash -c "pgrep -x syncthing || syncthing" +#INCLUDE####################################################