From defe8c6b2de029aa0320be5faeefe8a58254a246 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Thu, 30 Jun 2022 20:39:39 +0200 Subject: [PATCH] Make super+shift+w bind to firefox if librewolf isn't installed --- roles/i3/tasks/main.yml | 4 ++++ roles/i3/templates/i3config.j2 | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/i3/tasks/main.yml b/roles/i3/tasks/main.yml index 5978c2a..e7b01ff 100644 --- a/roles/i3/tasks/main.yml +++ b/roles/i3/tasks/main.yml @@ -48,6 +48,10 @@ - {repo: 'https://github.com/addy-dclxvi/i3-starterpack.git', dest: '~/.git_clones/i3-starterpack'} - {repo: 'https://github.com/vivien/i3blocks-contrib.git', dest: '~/.git_clones/i3blocks-contrib'} +- name: Gather installed packages # used for i3 config template + package_facts: + manager: auto + - name: Copy i3 config template: src: i3config.j2 diff --git a/roles/i3/templates/i3config.j2 b/roles/i3/templates/i3config.j2 index 7ba5d01..d63a6de 100644 --- a/roles/i3/templates/i3config.j2 +++ b/roles/i3/templates/i3config.j2 @@ -29,8 +29,11 @@ bindsym $super+BackSpace scratchpad show bindsym $super+Return exec i3-sensible-terminal bindsym Print exec scrot 'Cheese_%Y%m%d_%H:%M.png' -e 'viewnior ~/$f' bindsym $alt+l exec i3lock -i ~/.lock -bindsym $super+Shift+f exec firefox +{% if 'librewolf' in ansible_facts.packages or 'librewolf-bin' in ansible_facts.packages %} bindsym $super+Shift+w exec librewolf +{% else %} +bindsym $super+Shift+w exec firefox +{% endif %} bindsym $super+Shift+p exec passmenu bindsym $super+Shift+u exec passmenu-user bindsym $super+Shift+y exec passmenu-url