180 lines
5.1 KiB
YAML
180 lines
5.1 KiB
YAML
---
|
|
- name: Install packages (Archlinux)
|
|
become: true
|
|
community.general.pacman:
|
|
name:
|
|
- dmenu
|
|
- dunst
|
|
- hsetroot
|
|
- i3-gaps
|
|
- i3blocks
|
|
- i3lock
|
|
- libnotify
|
|
- lxappearance
|
|
- pandoc # for clitip
|
|
- picom
|
|
- python-feedparser
|
|
- python-matplotlib
|
|
- numlockx # activate numlock (set in .xinitrc)
|
|
- scrot
|
|
- sysstat
|
|
- lm_sensors
|
|
- udiskie # automount external drives (set in .xinitrc)
|
|
- upower
|
|
- viewnior
|
|
- xdg-user-dirs
|
|
- xmlstarlet # for clitip
|
|
- xorg
|
|
- xorg-xinit # enable xinit to avoid having to type 'startx'
|
|
- xsettingsd
|
|
when: ansible_facts['distribution'] == 'Archlinux'
|
|
|
|
- name: Install packages (Debian)
|
|
become: true
|
|
ansible.builtin.apt:
|
|
name:
|
|
- aptitude
|
|
- autoconf
|
|
- dunst
|
|
- hsetroot
|
|
- i3-wm
|
|
- i3lock
|
|
- libnotify-bin
|
|
- libstartup-notification0-dev # build dependency
|
|
- lxappearance
|
|
- numlockx # activate numlock (set in .xinitrc)
|
|
- pandoc # for clitip
|
|
- picom
|
|
- scrot
|
|
- python3-matplotlib
|
|
- suckless-tools
|
|
- sysstat
|
|
- lm-sensors
|
|
- upower
|
|
- udiskie # automount external drives (set in .xinitrc)
|
|
- viewnior
|
|
- xdg-user-dirs
|
|
- xinit # enable xinit to avoid having to type 'startx'
|
|
- xmlstarlet # for clitip
|
|
- xorg
|
|
- xsettingsd
|
|
when: ansible_facts['distribution'] == 'Debian'
|
|
|
|
- name: Clone i3blocks-contrib
|
|
ansible.builtin.git:
|
|
repo: https://github.com/vivien/i3blocks-contrib.git
|
|
dest: ~/.git_clones/i3blocks-contrib
|
|
clone: true
|
|
update: false
|
|
version: master
|
|
|
|
- name: Gather installed packages # used for i3 config template
|
|
ansible.builtin.package_facts:
|
|
manager: auto
|
|
|
|
- name: Create needed directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
mode: 0755
|
|
with_items:
|
|
- ~/.config/i3
|
|
- ~/.config/i3blocks
|
|
- ~/.config/i3blocks/scripts
|
|
- ~/.local
|
|
- ~/.local/bin
|
|
|
|
- name: Copy i3 config
|
|
ansible.builtin.template:
|
|
src: i3/config.j2
|
|
dest: ~/.config/i3/config
|
|
mode: 0644
|
|
|
|
- name: Copy files
|
|
ansible.builtin.copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
mode: 0644
|
|
with_items:
|
|
- {src: 'i3blocks/config', dest: '~/.config/i3blocks/config'}
|
|
- {src: 'xinitrc', dest: '~/.xinitrc'}
|
|
- {src: 'xserverrc', dest: '~/.xserverrc'}
|
|
- {src: 'Xmodmap', dest: '~/.Xmodmap'}
|
|
- {src: 'Xresources', dest: '~/.Xresources'}
|
|
- {src: 'xsettingsd', dest: '~/.xsettingsd'}
|
|
- {src: 'picom.conf', dest: '~/.config/picom.conf'}
|
|
|
|
- name: Symlink files (All)
|
|
ansible.builtin.file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: link
|
|
with_items:
|
|
- {src: '~/.config/picom.conf', path: '~/.config/compton.conf'}
|
|
- {src: '~/.git_clones/i3blocks-contrib/temperature/temperature', path: '~/.config/i3blocks/scripts/temperature'}
|
|
- {src: '~/.git_clones/i3blocks-contrib/calendar/calendar', path: '~/.config/i3blocks/scripts/calendar'}
|
|
- {src: '~/.git_clones/i3blocks-contrib/cpu_usage/cpu_usage', path: '~/.config/i3blocks/scripts/cpu_usage'}
|
|
|
|
- name: Symlink files (Archlinux)
|
|
ansible.builtin.file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: link
|
|
with_items:
|
|
- {src: '~/.git_clones/i3blocks-contrib/arch-update/arch-update', path: '~/.config/i3blocks/scripts/arch-update'}
|
|
when: ansible_facts['distribution'] == 'Archlinux'
|
|
|
|
- name: Symlink files (Debian)
|
|
ansible.builtin.file:
|
|
src: "{{ item.src }}"
|
|
path: "{{ item.path }}"
|
|
state: link
|
|
with_items:
|
|
- {src: '~/.git_clones/i3blocks-contrib/apt-upgrades/apt-upgrades', path: '~/.config/i3blocks/scripts/apt-upgrades'}
|
|
when: ansible_facts['distribution'] == 'Debian'
|
|
|
|
- name: Copy wallpaper scripts
|
|
ansible.builtin.copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
mode: 0755
|
|
with_items:
|
|
- {src: 'clitip_wallpaper.sh', dest: '~/.local/bin/clitip_wallpaper.sh'}
|
|
- {src: 'xkcd_wallpaper.sh', dest: '~/.local/bin/xkcd_wallpaper.sh'}
|
|
|
|
- name: Copy scripts (All)
|
|
ansible.builtin.copy:
|
|
src: "{{ item }}"
|
|
dest: ~/.config/i3blocks/scripts/
|
|
mode: 0755
|
|
with_fileglob:
|
|
- i3blocks/scripts/*
|
|
|
|
- name: Copy newmail_maildirs file
|
|
ansible.builtin.copy:
|
|
content: "{{ lookup('file', 'i3blocks/newmail_maildirs') | replace('~', ansible_facts.user_dir) | replace('\n', '\0') }}"
|
|
dest: ~/.config/i3blocks/newmail_maildirs
|
|
mode: 0644
|
|
|
|
- name: Update user dirs
|
|
ansible.builtin.command: xdg-user-dirs-update
|
|
|
|
- name: Build i3blocks for Debian
|
|
when: ansible_facts['distribution'] == 'Debian'
|
|
block:
|
|
- name: Clone i3blocks for Debian
|
|
ansible.builtin.git:
|
|
repo: https://github.com/vivien/i3blocks.git
|
|
dest: ~/.git_clones/i3blocks
|
|
clone: true
|
|
update: false
|
|
version: master
|
|
- name: Build i3blocks for Debian
|
|
ansible.builtin.shell:
|
|
cmd: ./autogen.sh && ./configure && make
|
|
chdir: ~/.git_clones/i3blocks
|
|
- name: Install i3blocks for Debian
|
|
become: true
|
|
ansible.builtin.command:
|
|
cmd: make install
|
|
chdir: "{{ ansible_facts.user_dir }}/.git_clones/i3blocks"
|