Add polybar to dwm role

This commit is contained in:
Przemek Grondek 2023-08-05 00:49:37 +02:00
parent 0f8e61efa4
commit af6beb0559
6 changed files with 90 additions and 15 deletions

View file

@ -1,19 +1,19 @@
--- ---
- hosts: localhost - hosts: localhost
roles: roles:
- dwm # - dwm
- ubuntu # - ubuntu
- firefox # - firefox
- docker # - docker
- dotfiles # - dotfiles
- java # - java
- jetbrains # - jetbrains
- signal # - signal
- virtual # - virtual
- lutris # - lutris
- ego # - ego
- laptop # - laptop
- prusa-slicer # - prusa-slicer
- intellij # - intellij
- chromium - chromium
- terraform - terraform

View file

@ -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

View file

@ -13,6 +13,7 @@
- libxinerama-dev - libxinerama-dev
- libxcb-res0-dev - libxcb-res0-dev
- libx11-xcb-dev - libx11-xcb-dev
- libyajl-dev
- name: create src dir - name: create src dir
file: file:

View file

@ -5,4 +5,4 @@
- import_tasks: st-term.yml - import_tasks: st-term.yml
- import_tasks: dwmstatus.yml - import_tasks: polybar.yml

View file

@ -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'

View file

@ -5,3 +5,5 @@ st:
repo: https://github.com/pgrondek/stterm.git repo: https://github.com/pgrondek/stterm.git
dwmstatus: dwmstatus:
repo: https://git.grondek.pl/pgrondek/dwmstatus.git repo: https://git.grondek.pl/pgrondek/dwmstatus.git
polybar:
repo: https://github.com/mihirlad55/polybar-dwm-module.git