Add kanshi for both FreeBSD and Linux.

pixelbook
Tom Alexander 1 year ago
parent 7c6c81711b
commit a702833aa4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -0,0 +1 @@
install_graphics: false

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -9,7 +9,7 @@
state: present
- name: Install packages
when: install_graphics is defined and install_graphics
when: install_graphics
package:
name:
- pinentry-qt5

@ -4,8 +4,8 @@ use-standard-socket
default-cache-ttl 600
max-cache-ttl 7200
display :0
{% if install_graphics is defined and install_graphics and os_flavor == "linux" %}
{% if install_graphics and os_flavor == "linux" %}
pinentry-program /usr/bin/pinentry-qt
{% elif install_graphics is defined and install_graphics and os_flavor == "freebsd" %}
{% elif install_graphics and os_flavor == "freebsd" %}
pinentry-program /usr/local/bin/pinentry-qt5
{% endif %}

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -0,0 +1,7 @@
profile docked {
output eDP-1 disable
output "Dell Inc. DELL U3014 P1V6N35M329L" enable
}
profile laptop {
output eDP-1 enable
}

@ -0,0 +1,11 @@
[Unit]
Description=Dynamic output configuration for Wayland compositors
Documentation=https://github.com/emersion/kanshi
BindsTo=graphical.target
[Service]
Type=simple
ExecStart=/usr/bin/kanshi
[Install]
WantedBy=graphical.target

@ -0,0 +1,3 @@
dependencies:
- users

@ -0,0 +1,20 @@
- name: Install packages
package:
name:
- kanshi
state: present
- 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

@ -0,0 +1,5 @@
# - name: Install packages
# package:
# name:
# - foo
# state: present

@ -0,0 +1,6 @@
# - name: Install packages
# pacman:
# name:
# - foo
# state: present
# update_cache: true

@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics

@ -0,0 +1,29 @@
- 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/kanshi"
- 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: config_kanshi
dest: .config/kanshi/config
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'
- import_tasks: tasks/peruser_linux.yaml
when: 'os_flavor == "linux"'

@ -0,0 +1,9 @@
- name: Configure dotfiles (conf directory)
copy:
src: "files/sway_config_files/{{ item }}.conf"
dest: "{{ account_homedir.stdout }}/.config/sway/config.d/{{ item }}.conf"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- exec_kanshi

@ -0,0 +1,17 @@
- 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: kanshi.service
dest: .config/systemd/user/kanshi.service
- name: Enable services
systemd:
name: kanshi.service
daemon_reload: yes
enabled: true
scope: user

@ -8,4 +8,3 @@ default_sway_conf_files:
- screenshots
- notifications
- disable_focus_follows_mouse
- waybar

@ -2,3 +2,4 @@ dependencies:
- users
- build # for aurutils on linux
- waybar
- kanshi

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -11,7 +11,6 @@
loop:
- ".config/sway"
- ".config/sway/config.d"
- ".config/waybar"
- ".config/xdg-desktop-portal-wlr"
- ".config/mako"
@ -29,10 +28,6 @@
dest: .config/sway/bliss.jpg
- src: spaceglenda300.jpg
dest: .config/sway/spaceglenda300.jpg
- src: waybar_config.json
dest: .config/waybar/config
- src: style.css
dest: .config/waybar/style.css
- src: xdg-desktop-portal-wlr-config
dest: .config/xdg-desktop-portal-wlr/config
- src: electron-flags.conf

@ -1,2 +1,2 @@
- import_tasks: tasks/common.yaml
when: install_graphics is defined and install_graphics
when: install_graphics

@ -24,6 +24,16 @@
- src: style.css
dest: .config/waybar/style.css
- name: Configure dotfiles (conf directory)
copy:
src: "files/sway_config_files/{{ item }}.conf"
dest: "{{ account_homedir.stdout }}/.config/sway/config.d/{{ item }}.conf"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- waybar
- import_tasks: tasks/peruser_freebsd.yaml
when: 'os_flavor == "freebsd"'

Loading…
Cancel
Save