Add kanshi for both FreeBSD and Linux.
This commit is contained in:
parent
7c6c81711b
commit
a702833aa4
1
ansible/group_vars/all
Normal file
1
ansible/group_vars/all
Normal file
@ -0,0 +1 @@
|
|||||||
|
install_graphics: false
|
@ -1,2 +1,2 @@
|
|||||||
- import_tasks: tasks/common.yaml
|
- 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
|
- 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
|
- import_tasks: tasks/common.yaml
|
||||||
when: install_graphics is defined and install_graphics
|
when: install_graphics
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
when: install_graphics is defined and install_graphics
|
when: install_graphics
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- pinentry-qt5
|
- pinentry-qt5
|
||||||
|
@ -4,8 +4,8 @@ use-standard-socket
|
|||||||
default-cache-ttl 600
|
default-cache-ttl 600
|
||||||
max-cache-ttl 7200
|
max-cache-ttl 7200
|
||||||
display :0
|
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
|
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
|
pinentry-program /usr/local/bin/pinentry-qt5
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
- import_tasks: tasks/common.yaml
|
- import_tasks: tasks/common.yaml
|
||||||
when: install_graphics is defined and install_graphics
|
when: install_graphics
|
||||||
|
7
ansible/roles/kanshi/files/config_kanshi
Normal file
7
ansible/roles/kanshi/files/config_kanshi
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
profile docked {
|
||||||
|
output eDP-1 disable
|
||||||
|
output "Dell Inc. DELL U3014 P1V6N35M329L" enable
|
||||||
|
}
|
||||||
|
profile laptop {
|
||||||
|
output eDP-1 enable
|
||||||
|
}
|
11
ansible/roles/kanshi/files/kanshi.service
Normal file
11
ansible/roles/kanshi/files/kanshi.service
Normal file
@ -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 @@
|
|||||||
|
exec kanshi
|
3
ansible/roles/kanshi/meta/main.yaml
Normal file
3
ansible/roles/kanshi/meta/main.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- users
|
||||||
|
|
20
ansible/roles/kanshi/tasks/common.yaml
Normal file
20
ansible/roles/kanshi/tasks/common.yaml
Normal file
@ -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
|
5
ansible/roles/kanshi/tasks/freebsd.yaml
Normal file
5
ansible/roles/kanshi/tasks/freebsd.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# - name: Install packages
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
6
ansible/roles/kanshi/tasks/linux.yaml
Normal file
6
ansible/roles/kanshi/tasks/linux.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# - name: Install packages
|
||||||
|
# pacman:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
||||||
|
# update_cache: true
|
2
ansible/roles/kanshi/tasks/main.yaml
Normal file
2
ansible/roles/kanshi/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: install_graphics
|
29
ansible/roles/kanshi/tasks/peruser.yaml
Normal file
29
ansible/roles/kanshi/tasks/peruser.yaml
Normal file
@ -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"'
|
9
ansible/roles/kanshi/tasks/peruser_freebsd.yaml
Normal file
9
ansible/roles/kanshi/tasks/peruser_freebsd.yaml
Normal file
@ -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
|
17
ansible/roles/kanshi/tasks/peruser_linux.yaml
Normal file
17
ansible/roles/kanshi/tasks/peruser_linux.yaml
Normal file
@ -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
|
- screenshots
|
||||||
- notifications
|
- notifications
|
||||||
- disable_focus_follows_mouse
|
- disable_focus_follows_mouse
|
||||||
- waybar
|
|
||||||
|
@ -2,3 +2,4 @@ dependencies:
|
|||||||
- users
|
- users
|
||||||
- build # for aurutils on linux
|
- build # for aurutils on linux
|
||||||
- waybar
|
- waybar
|
||||||
|
- kanshi
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
- import_tasks: tasks/common.yaml
|
- import_tasks: tasks/common.yaml
|
||||||
when: install_graphics is defined and install_graphics
|
when: install_graphics
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
loop:
|
loop:
|
||||||
- ".config/sway"
|
- ".config/sway"
|
||||||
- ".config/sway/config.d"
|
- ".config/sway/config.d"
|
||||||
- ".config/waybar"
|
|
||||||
- ".config/xdg-desktop-portal-wlr"
|
- ".config/xdg-desktop-portal-wlr"
|
||||||
- ".config/mako"
|
- ".config/mako"
|
||||||
|
|
||||||
@ -29,10 +28,6 @@
|
|||||||
dest: .config/sway/bliss.jpg
|
dest: .config/sway/bliss.jpg
|
||||||
- src: spaceglenda300.jpg
|
- src: spaceglenda300.jpg
|
||||||
dest: .config/sway/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
|
- src: xdg-desktop-portal-wlr-config
|
||||||
dest: .config/xdg-desktop-portal-wlr/config
|
dest: .config/xdg-desktop-portal-wlr/config
|
||||||
- src: electron-flags.conf
|
- src: electron-flags.conf
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
- import_tasks: tasks/common.yaml
|
- import_tasks: tasks/common.yaml
|
||||||
when: install_graphics is defined and install_graphics
|
when: install_graphics
|
||||||
|
@ -24,6 +24,16 @@
|
|||||||
- src: style.css
|
- src: style.css
|
||||||
dest: .config/waybar/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
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user