diff --git a/localhost.yml b/localhost.yml index dd1c73c..c79a3ae 100644 --- a/localhost.yml +++ b/localhost.yml @@ -1,19 +1,19 @@ --- - hosts: localhost roles: - - dwm - - ubuntu - - firefox - - docker - - dotfiles - - java - - jetbrains - - signal - - virtual - - lutris - - ego - - laptop - - prusa-slicer - - intellij +# - dwm +# - ubuntu +# - firefox +# - docker +# - dotfiles +# - java +# - jetbrains +# - signal +# - virtual +# - lutris +# - ego +# - laptop +# - prusa-slicer +# - intellij - chromium - terraform diff --git a/roles/dwm/files/usr/local/bin/launch-polybar b/roles/dwm/files/usr/local/bin/launch-polybar new file mode 100644 index 0000000..bdd748a --- /dev/null +++ b/roles/dwm/files/usr/local/bin/launch-polybar @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -x + +if type "xrandr"; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload dwm & + done +else + polybar --reload dwm & +fi diff --git a/roles/dwm/tasks/dwm.yml b/roles/dwm/tasks/dwm.yml index 83155fc..886a823 100644 --- a/roles/dwm/tasks/dwm.yml +++ b/roles/dwm/tasks/dwm.yml @@ -13,6 +13,7 @@ - libxinerama-dev - libxcb-res0-dev - libx11-xcb-dev + - libyajl-dev - name: create src dir file: diff --git a/roles/dwm/tasks/main.yml b/roles/dwm/tasks/main.yml index 57f378d..9d48b26 100644 --- a/roles/dwm/tasks/main.yml +++ b/roles/dwm/tasks/main.yml @@ -5,4 +5,4 @@ - import_tasks: st-term.yml -- import_tasks: dwmstatus.yml +- import_tasks: polybar.yml diff --git a/roles/dwm/tasks/polybar.yml b/roles/dwm/tasks/polybar.yml new file mode 100644 index 0000000..9c0c8bf --- /dev/null +++ b/roles/dwm/tasks/polybar.yml @@ -0,0 +1,61 @@ +--- +- name: install required packages for polybar + become: yes + apt: + update_cache: yes + pkg: + - git + - make + - cmake + - libcairo2-dev + - libcurl4-openssl-dev + - libmpdclient-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 + - libjsoncpp-dev + +- name: create src dir + file: + path: "{{ ansible_user_dir }}/src" + +- name: checkout polybar + git: + repo: "{{ polybar.repo }}" + dest: "{{ ansible_user_dir }}/src/polybar" + version: "{{ looking_glass.branch }}" + clone: yes + update: yes + +- name: create directory for build + file: + state: directory + path: "{{ ansible_user_dir }}/src/polybar/build" + +- name: run cmake + shell: + cmd: "cmake ../" + chdir: "{{ ansible_user_dir }}/src/polybar/build" + +- name: build + make: + chdir: "{{ ansible_user_dir }}/src/polybar/build" + +- name: install + become: yes + make: + chdir: "{{ ansible_user_dir }}/src/polybar/build" + target: install + +- name: copy run script + become: yes + copy: + src: usr/local/bin/launch-polybar + dest: /usr/local/bin/launch-polybar + mode: '0755' diff --git a/roles/dwm/vars/main.yml b/roles/dwm/vars/main.yml index 81f0e74..0b290c7 100644 --- a/roles/dwm/vars/main.yml +++ b/roles/dwm/vars/main.yml @@ -5,3 +5,5 @@ st: repo: https://github.com/pgrondek/stterm.git dwmstatus: repo: https://git.grondek.pl/pgrondek/dwmstatus.git +polybar: + repo: https://github.com/mihirlad55/polybar-dwm-module.git \ No newline at end of file