Move waybar into its own role that sway depends on.
This commit is contained in:
parent
2222c9d033
commit
7c6c81711b
@ -1,3 +1,4 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- users
|
- users
|
||||||
- build # for aurutils on linux
|
- build # for aurutils on linux
|
||||||
|
- waybar
|
||||||
|
@ -1,14 +1,3 @@
|
|||||||
- name: Install scripts
|
|
||||||
copy:
|
|
||||||
src: "files/waybar_scripts/{{ item.src }}"
|
|
||||||
dest: "{{ item.dest }}"
|
|
||||||
mode: 0755
|
|
||||||
owner: root
|
|
||||||
group: wheel
|
|
||||||
loop:
|
|
||||||
- src: waybar_custom_clock.py
|
|
||||||
dest: /usr/local/bin/waybar_custom_clock
|
|
||||||
|
|
||||||
- import_tasks: tasks/freebsd.yaml
|
- import_tasks: tasks/freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
- libnotify # mako doesn't seem to work without it
|
- libnotify # mako doesn't seem to work without it
|
||||||
- pcmanfm # For mounting drives
|
- pcmanfm # For mounting drives
|
||||||
- wf-recorder # screen recording
|
- wf-recorder # screen recording
|
||||||
- waybar
|
|
||||||
- xdg-desktop-portal
|
- xdg-desktop-portal
|
||||||
- xdg-desktop-portal-wlr # screen sharing
|
- xdg-desktop-portal-wlr # screen sharing
|
||||||
# - rofimoji
|
# - rofimoji
|
||||||
@ -49,19 +48,3 @@
|
|||||||
- src: launch_sway_freebsd.bash
|
- src: launch_sway_freebsd.bash
|
||||||
dest: /usr/local/bin/launch_sway
|
dest: /usr/local/bin/launch_sway
|
||||||
|
|
||||||
- name: Install scripts
|
|
||||||
copy:
|
|
||||||
src: "files/waybar_scripts/{{ item.src }}"
|
|
||||||
dest: "{{ item.dest }}"
|
|
||||||
mode: 0755
|
|
||||||
owner: root
|
|
||||||
group: wheel
|
|
||||||
loop:
|
|
||||||
- src: waybar_battery_freebsd.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_battery
|
|
||||||
- src: waybar_available_memory_freebsd.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_available_memory
|
|
||||||
- src: waybar_sound_freebsd.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_sound
|
|
||||||
- src: waybar_temperature_freebsd.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_temperature
|
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
- name: Install packages
|
|
||||||
package:
|
|
||||||
name:
|
|
||||||
- bc # For waybar sound script
|
|
||||||
- upower # Needed for waybar battery script
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Install scripts
|
- name: Install scripts
|
||||||
copy:
|
copy:
|
||||||
src: "files/{{ item.src }}"
|
src: "files/{{ item.src }}"
|
||||||
@ -16,17 +9,3 @@
|
|||||||
- src: launch_sway_linux.bash
|
- src: launch_sway_linux.bash
|
||||||
dest: /usr/local/bin/launch_sway
|
dest: /usr/local/bin/launch_sway
|
||||||
|
|
||||||
- name: Install scripts
|
|
||||||
copy:
|
|
||||||
src: "files/waybar_scripts/{{ item.src }}"
|
|
||||||
dest: "{{ item.dest }}"
|
|
||||||
mode: 0755
|
|
||||||
owner: root
|
|
||||||
group: wheel
|
|
||||||
loop:
|
|
||||||
- src: waybar_battery_linux.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_battery
|
|
||||||
- src: waybar_available_memory_linux.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_available_memory
|
|
||||||
- src: waybar_sound_linux.bash
|
|
||||||
dest: /usr/local/bin/waybar_custom_sound
|
|
||||||
|
2
ansible/roles/waybar/meta/main.yaml
Normal file
2
ansible/roles/waybar/meta/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- users
|
25
ansible/roles/waybar/tasks/common.yaml
Normal file
25
ansible/roles/waybar/tasks/common.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
- name: Install scripts
|
||||||
|
copy:
|
||||||
|
src: "files/waybar_scripts/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: waybar_custom_clock.py
|
||||||
|
dest: /usr/local/bin/waybar_custom_clock
|
||||||
|
|
||||||
|
- import_tasks: tasks/freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
|
|
||||||
|
- include_tasks:
|
||||||
|
file: tasks/peruser.yaml
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ initialize_user }}"
|
||||||
|
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: initialize_user
|
22
ansible/roles/waybar/tasks/freebsd.yaml
Normal file
22
ansible/roles/waybar/tasks/freebsd.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- waybar
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install scripts
|
||||||
|
copy:
|
||||||
|
src: "files/waybar_scripts/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: waybar_battery_freebsd.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_battery
|
||||||
|
- src: waybar_available_memory_freebsd.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_available_memory
|
||||||
|
- src: waybar_sound_freebsd.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_sound
|
||||||
|
- src: waybar_temperature_freebsd.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_temperature
|
21
ansible/roles/waybar/tasks/linux.yaml
Normal file
21
ansible/roles/waybar/tasks/linux.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- bc # For waybar sound script
|
||||||
|
- upower # Needed for waybar battery script
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install scripts
|
||||||
|
copy:
|
||||||
|
src: "files/waybar_scripts/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: waybar_battery_linux.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_battery
|
||||||
|
- src: waybar_available_memory_linux.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_available_memory
|
||||||
|
- src: waybar_sound_linux.bash
|
||||||
|
dest: /usr/local/bin/waybar_custom_sound
|
2
ansible/roles/waybar/tasks/main.yaml
Normal file
2
ansible/roles/waybar/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: install_graphics is defined and install_graphics
|
31
ansible/roles/waybar/tasks/peruser.yaml
Normal file
31
ansible/roles/waybar/tasks/peruser.yaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
- include_role:
|
||||||
|
name: per_user
|
||||||
|
|
||||||
|
- name: Create directories
|
||||||
|
file:
|
||||||
|
name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0700
|
||||||
|
owner: "{{ account_name.stdout }}"
|
||||||
|
group: "{{ group_name.stdout }}"
|
||||||
|
loop:
|
||||||
|
- ".config/waybar"
|
||||||
|
|
||||||
|
- name: Copy files
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||||
|
mode: 0600
|
||||||
|
owner: "{{ account_name.stdout }}"
|
||||||
|
group: "{{ group_name.stdout }}"
|
||||||
|
loop:
|
||||||
|
- src: waybar_config.json
|
||||||
|
dest: .config/waybar/config
|
||||||
|
- src: style.css
|
||||||
|
dest: .config/waybar/style.css
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
0
ansible/roles/waybar/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/waybar/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/waybar/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/waybar/tasks/peruser_linux.yaml
Normal file
Loading…
x
Reference in New Issue
Block a user