From 4ab2c0fb8d2179423fe4acde1709e4d06bff7c53 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 14 Oct 2020 13:18:44 +0200 Subject: [PATCH] Expand i3blocks --- defaults/main.yml | 19 +++++++++++++++---- tasks/main.yml | 24 ++++++++++++++++-------- templates/config.j2 | 15 ++++++++++++--- vars/main.yml | 2 +- 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index dec98b7..038ce64 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,6 +6,7 @@ i3_keybindings_extra: [] # name: example # key: $mod+Shift+F10 # exec: --no-startup-id touch /tmp/example.txt + i3_monitors: [] # see: xrandr # - monitor: # id: 1 @@ -14,32 +15,42 @@ i3_monitors: [] # see: xrandr # pos: "0x0" # rotate: "normal" # workspaces: [1,2,3,4,5,6,7,8,9,0] # bind workspace to a specific monitor + i3_applications: [] # - application: # class: "Firefox" # name: "firefox" # workspace: 1 # bind application to a specific workspace # on_startup: false + i3_run_on_startup: [] # - foo # - bar + +# which user are we? +i3wm_user: "{{ ansible_user_id }}" + ## set default font size i3_font_size: 9 i3_focus_follows_mouse: true + # set i3lock options i3lock_options: "i3lock --image=/home/{{ i3wm_user }}/.config/lockscreen.png --color 000000" + # use fancy background i3_desktop_background: "/home/{{ i3wm_user }}/.config/background.png" + +i3_terminal: "terminator" + # install additional packages i3_packages_extra: - ranger -# which user are we? -i3wm_user: "{{ ansible_user_id }}" -# version check for this role? -submodules_versioncheck: true i3wm_copy_wallpapers: true disable_screensaver: true enable_lock_after_time: false lock_after_time: '200' # minutes to wait until your screen is locked + +# version check for this role? +submodules_versioncheck: true diff --git a/tasks/main.yml b/tasks/main.yml index a4bed5b..62c907f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -36,6 +36,16 @@ mode: 0755 owner: "{{ i3wm_user }}" +- name: copy multiple images + copy: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: 0644 + with_items: + - { src: 'files/background.png', dest: "/home/{{ i3wm_user }}/.config/background.png" } + - { src: 'files/lockscreen.png', dest: '/home/{{ i3wm_user }}/.config/lockscreen.png' } + when: i3wm_copy_wallpapers | bool + - name: copy and validate i3wm config file become: true become_user: "{{ i3wm_user }}" @@ -46,12 +56,10 @@ backup: true validate: i3 -C -c %s -- name: copy files +- name: vim - copy bin src folder + become: true + become_user: "{{ i3wm_user }}" copy: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - mode: 0644 - with_items: - - { src: 'files/background.png', dest: "/home/{{ i3wm_user }}/.config/background.png" } - - { src: 'files/lockscreen.png', dest: '/home/{{ i3wm_user }}/.config/lockscreen.png' } - when: i3wm_copy_wallpapers | bool + src: "{{ role_path }}/files/i3blocks/" + dest: "~/.config/i3blocks" + mode: 0755 diff --git a/templates/config.j2 b/templates/config.j2 index 2b10001..c591761 100644 --- a/templates/config.j2 +++ b/templates/config.j2 @@ -1,6 +1,6 @@ set $mod Mod4 -set $term terminator +set $term {{ i3_terminal }} # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. @@ -23,7 +23,8 @@ bindsym $mod+d exec dmenu_run {%- else -%} bindsym $mod+d exec rofi -show run # bindsym $mod+d exec rofi (a program launcher) -bindsym $mod+Shift+d exec rofi -show window +bindsym $mod+Shift+d exec rofi -show drun +bindsym $mod+Shift+y exec rofi -show window bindsym $mod+Shift+s exec rofi -show ssh {% endif %} @@ -96,6 +97,10 @@ set $workspace{{ workspace.id }} "{{ workspace.name }}" bindsym $mod+{{ workspace.id }} workspace $workspace{{ workspace.id }} {% endfor %} +# toggle workspace +bindsym $mod+Tab workspace next_on_output +bindsym $mod+Shift+Tab workspace prev_on_output + # move focused container to workspace {% for workspace in i3_workspaces %} bindsym $mod+Shift+{{ workspace.id }} move container to workspace $workspace{{ workspace.id }} @@ -150,7 +155,11 @@ bindsym $mod+r mode "resize" # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { - status_command i3status + font pango:mono {{ i3_font_size }} + status_command i3blocks + position top + mode dock + modifier None } # Setup Monitors diff --git a/vars/main.yml b/vars/main.yml index 2bb2882..8974f3e 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,5 +33,5 @@ __i3_workspaces: user: "{{ i3wm_user }}" -playbook_version_number: 9014 # should be over ninethousand +playbook_version_number: 9015 # should be over ninethousand playbook_version_path: 'role-i3wm_chaos-bodensee_github.com.version'