From 9ac25a152da20e2b96de7537b0c398b725713c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Wed, 27 Jan 2021 15:51:37 +0100 Subject: [PATCH] i3: Add shortcuts for screenconfigs --- _machines/ares.yml | 2 ++ _machines/tb-hak.yml | 4 ++++ i3/config.j2 | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/_machines/ares.yml b/_machines/ares.yml index 5afd4e4..8529c85 100644 --- a/_machines/ares.yml +++ b/_machines/ares.yml @@ -30,6 +30,8 @@ screen: 9: DisplayPort-0 0: DisplayPort-0 +screencfgs: [] + workspace: environment: diff --git a/_machines/tb-hak.yml b/_machines/tb-hak.yml index bd37138..b045d42 100644 --- a/_machines/tb-hak.yml +++ b/_machines/tb-hak.yml @@ -47,6 +47,10 @@ workspace: 9: music 10: pim +screencfgs: + - name: three-screens + key: F3 + environment: MACHINE_TYPE: "laptop" MACHINE_HAS_KEEPASSX: "true" diff --git a/i3/config.j2 b/i3/config.j2 index 695cbab..efa593c 100644 --- a/i3/config.j2 +++ b/i3/config.j2 @@ -212,8 +212,10 @@ assign [class="^Wine$"] $workspace10 bindsym F2 exec --no-startup-id ~/.i3/scripts/screenmenu bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock - bindsym $mod+F2 exec --no-startup-id screencfg ~/.screencfg/all.yml ; exec systemctl --user restart keyboard.service - bindsym $mod+F3 exec --no-startup-id screencfg ~/.screencfg/laptop.yml ; exec systemctl --user restart keyboard.service + bindsym $mod+F2 exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/default.yml ; exec systemctl --user restart keyboard.service + {% for screencfg in machine.screencfgs -%} + bindsym $mod+{{ screencfg.key }} exec --no-startup-id screencfg ~/.screencfg/{{ ansible_hostname }}/{{ screencfg.name }}.yml ; exec systemctl --user restart keyboard.service + {% endfor -%} bindsym $mod+F4 exec --no-startup-id ~/.i3/scripts/i3exit suspend bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu