mirror of
https://github.com/roles-ansible/ansible_role_i3wm.git
synced 2024-08-16 10:09:53 +02:00
Merge pull request #3 from roles-ansible/i3blocks
I3blocks config updated
This commit is contained in:
commit
aaa162276d
10 changed files with 77 additions and 70 deletions
|
@ -5,7 +5,6 @@ Install and deploy a basic configuration of [I3 Window Manager](https://i3wm.org
|
|||
Optionally configure your resolution, which applications will be bound to which screen and what will be included in the autostart.<br/>
|
||||
If you want to use wayland instead of xorg, think about using [sway](https://swaywm.org/) as window manager. The corresponding ansible is located on [github.com/roles-ansible/role-sway](https://github.com/roles-ansible/role-sway.git).
|
||||
|
||||
[![Build Status](https://travis-ci.org/chaos-bodensee/role-i3wm.svg?branch=master)](https://travis-ci.org/chaos-bodensee/role-i3wm)
|
||||
[![MIT License](https://raw.githubusercontent.com/chaos-bodensee/role-i3wm/master/.github/license.svg?sanitize=true)](https://github.com/chaos-bodensee/role-i3wm/blob/master/LICENSE)
|
||||
[![MIT License](https://raw.githubusercontent.com/chaos-bodensee/role-i3wm/master/.github/galaxy.svg?sanitize=true)](https://galaxy.ansible.com/do1jlr/i3wm)
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ separator_block_width=15
|
|||
markup=pango
|
||||
|
||||
[weather]
|
||||
command=curl -Ss 'https://wttr.in?0&T' | cut -c 16- | head -4 | tail -2 | xargs echo
|
||||
interval=1800
|
||||
command=curl -Ss 'wttr.in?format="%l:+%c%t+%w\n"' | xargs echo
|
||||
interval=600
|
||||
color=#A4C2F4
|
||||
|
||||
[volume]
|
||||
|
|
|
@ -10,7 +10,8 @@ if [[ -z "$IFACE" ]] ; then
|
|||
elif ( ip a s dev wlan0 ) > /dev/null 2>& 1 ; then
|
||||
IFACE="wlan0"
|
||||
else
|
||||
exit 1
|
||||
# No wlan interface found
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
50
tasks/config.yml
Normal file
50
tasks/config.yml
Normal file
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
- name: Creates directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '/home/{{ i3wm_user }}/.config'
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ i3wm_user }}"
|
||||
group: "{{ i3wm_user }}"
|
||||
|
||||
- name: create i3 config folder
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: '/home/{{ i3wm_user }}/.config/i3/'
|
||||
state: directory
|
||||
mode: 0755
|
||||
owner: "{{ i3wm_user }}"
|
||||
group: "{{ i3wm_user }}"
|
||||
|
||||
- name: copy multiple images
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: 0644
|
||||
owner: "{{ i3wm_user }}"
|
||||
group: "{{ i3wm_user }}"
|
||||
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
|
||||
ansible.builtin.template:
|
||||
src: templates/config.j2
|
||||
dest: "/home/{{ i3wm_user }}/.config/i3/config"
|
||||
mode: 0600
|
||||
backup: true
|
||||
validate: i3 -C -c %s
|
||||
owner: "{{ i3wm_user }}"
|
||||
group: "{{ i3wm_user }}"
|
||||
|
||||
- name: copy bin src folder
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: "{{ role_path }}/files/i3blocks/"
|
||||
dest: "~/.config/i3blocks"
|
||||
mode: 0755
|
||||
owner: "{{ i3wm_user }}"
|
||||
group: "{{ i3wm_user }}"
|
|
@ -1,65 +1,22 @@
|
|||
---
|
||||
- include_tasks: versioncheck.yml
|
||||
- name: run optional versionscheck
|
||||
ansible.builtin.include_tasks: versioncheck.yml
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: register variables
|
||||
import_tasks: variables.yml
|
||||
ansible.builtin.import_tasks: variables.yml
|
||||
|
||||
# ensure i3 packages are installed [Debian].
|
||||
- include_tasks: setup-Debian.yml
|
||||
- name: ensure i3 packages are installed [Debian]
|
||||
ansible.builtin.include_tasks: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
# ensure i3 packages are installed [Archlinux}
|
||||
- include_tasks: setup-Archlinux.yml
|
||||
- name: ensure i3 packages are installed [Archlinux}
|
||||
ansible.builtin.include_tasks: setup-Archlinux.yml
|
||||
when: ansible_os_family == 'Archlinux'
|
||||
|
||||
# ensure i3 packages are installed [RHEL].
|
||||
- include_tasks: setup-RedHat.yml
|
||||
- name: ensure i3 packages are installed [RHEL].
|
||||
ansible.builtin.include_tasks: setup-RedHat.yml
|
||||
when: ansible_os_family == 'Fedora' or ansible_os_family == 'RedHat'
|
||||
|
||||
# create i3 config file
|
||||
- name: Creates directory
|
||||
become: true
|
||||
become_user: "{{ i3wm_user }}"
|
||||
file:
|
||||
path: '/home/{{ i3wm_user }}/.config'
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ i3wm_user }}"
|
||||
|
||||
- name: create i3 config folder
|
||||
become: true
|
||||
become_user: "{{ i3wm_user }}"
|
||||
file:
|
||||
path: '/home/{{ i3wm_user }}/.config/i3/'
|
||||
state: directory
|
||||
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 }}"
|
||||
template:
|
||||
src: templates/config.j2
|
||||
dest: "/home/{{ i3wm_user }}/.config/i3/config"
|
||||
mode: 0600
|
||||
backup: true
|
||||
validate: i3 -C -c %s
|
||||
|
||||
- name: vim - copy bin src folder
|
||||
become: true
|
||||
become_user: "{{ i3wm_user }}"
|
||||
copy:
|
||||
src: "{{ role_path }}/files/i3blocks/"
|
||||
dest: "~/.config/i3blocks"
|
||||
mode: 0755
|
||||
- name: create i3 config file
|
||||
ansible.builtin.include_tasks: config.yml
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: ensure i3 packages are installed.
|
||||
pacman:
|
||||
ansible.builtin.pacman:
|
||||
name: "{{ i3_packages }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: ensure i3 packages are installed.
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
name: "{{ i3_packages }}"
|
||||
state: "present"
|
||||
become: true
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: ensure i3 packages are installed.
|
||||
dnf:
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ i3_packages }}"
|
||||
state: present
|
||||
become: true
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
---
|
||||
- name: register os-specific variables
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
||||
when: ansible_distribution != "Fedora"
|
||||
|
||||
- name: register Fedora variables
|
||||
include_vars: "{{ ansible_distribution }}.yml"
|
||||
ansible.builtin.include_vars: "{{ ansible_distribution }}.yml"
|
||||
when: ansible_distribution == "Fedora"
|
||||
|
||||
# i3 packages
|
||||
- name: define i3_packages
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_packages: "{{ __i3_packages | list }}"
|
||||
when: i3_packages is not defined
|
||||
|
||||
- name: define i3_packages_extra
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_packages: "{{ i3_packages | list + i3_packages_extra | list }}"
|
||||
when: i3_packages_extra is defined
|
||||
|
||||
# i3 workspaces
|
||||
- name: define i3_packages
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_workspaces: "{{ __i3_workspaces | list }}"
|
||||
when: i3_workspaces is not defined
|
||||
|
||||
# i3 keybindings
|
||||
- name: define i3_packages
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_keybindings: "{{ __i3_keybindings | list }}"
|
||||
when:
|
||||
- i3_keybindings is not defined
|
||||
- __i3_keybindings is defined
|
||||
|
||||
- name: define extra i3 keybindings
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_keybindings: "{{ i3_keybindings_extra | list + i3_keybindings | list }}"
|
||||
when:
|
||||
- i3_keybindings_extra is defined
|
||||
- i3_keybindings is defined
|
||||
|
||||
- name: define extra i3 keybindings
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
i3_keybindings: "{{ i3_keybindings_extra | list }}"
|
||||
when:
|
||||
- i3_keybindings_extra is defined
|
||||
|
|
|
@ -33,5 +33,5 @@ __i3_workspaces:
|
|||
|
||||
user: "{{ i3wm_user }}"
|
||||
|
||||
playbook_version_number: 9020 # should be int
|
||||
playbook_version_number: 9021 # should be int
|
||||
playbook_version_path: 'role-i3wm_chaos-bodensee_github.com.version'
|
||||
|
|
Loading…
Reference in a new issue