ansible-desktop/roles/dwm/tasks/polybar.yml

87 lines
1.8 KiB
YAML

---
- name: "polybar: install required packages"
become: yes
apt:
update_cache: yes
pkg:
- cmake
- libcairo2-dev
- libcurl4-openssl-dev
- libiw-dev
- libxcb-composite0-dev
- libxcb-randr0-dev
- xcb-proto
- libxcb-icccm4-dev
- libxcb-ewmh-dev
- libxcb-util-dev
- libxcb-image0-dev
- python3-xcbgen
- python3-sphinx
- libjsoncpp-dev
- libuv1-dev
when: ansible_distribution == "Ubuntu"
- name: "polybar: install required packages"
become: yes
community.general.pacman:
name:
- cmake
- cairo
- dbus-python
- libcurl-compat
- libxcb
- xcb-proto
- xcb-util-cursor
- xcb-util-image
- xcb-util-wm
- python-sphinx
- jsoncpp
- libuv
- alsa-lib
when: ansible_distribution == "Archlinux"
- name: "polybar: create src dir"
file:
path: "{{ desktop_src_dir }}"
- name: "polybar: checkout"
git:
repo: "{{ polybar.repo }}"
dest: "{{ desktop_src_dir }}/polybar"
clone: yes
update: yes
- name: Clean build directory
file:
path: "{{ desktop_src_dir }}/polybar/build"
state: absent
- name: "polybar: create directory for build"
file:
state: directory
path: "{{ desktop_src_dir }}/polybar/build"
- name: "polybar: run cmake"
shell:
cmd: "cmake ../"
chdir: "{{ desktop_src_dir }}/polybar/build"
- name: "polybar: build"
make:
chdir: "{{ desktop_src_dir }}/polybar/build"
params:
NUM_THREADS: "{{ ansible_processor_vcpus }}"
- name: "polybar: install"
become: yes
make:
chdir: "{{ desktop_src_dir }}/polybar/build"
target: install
- name: "polybar: copy run script"
become: yes
copy:
src: usr/local/bin/launch-polybar
dest: /usr/local/bin/launch-polybar
mode: '0755'