Files
env-ansible/tasks/workstation/linux/software/i3.yml
T
2026-07-16 19:18:53 -07:00

70 lines
2.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
# 20260716 - Hyperling
# Add the setup for a simple i3 configuration. It´s pretty easy to use and
# functions super well. Very easy to get going and does not need a whole lot of
# work to change things around. Good alternative to DWM and so lightweight that
# it doesn´t even matter if both are installed!!
- name: Workstation | Linux | Software | i3 | Facts | General [1/2]
set_fact:
i3_package: i3
i3_light: light
i3_config: "settings/i3.config"
i3_config_dir: "{{ user_user.home }}/.config/i3"
- name: Workstation | Linux | Software | i3 | Facts | General [1/2]
set_fact:
i3_config_file: "{{ i3_config_dir }}/config"
#- name: Workstation | Linux | Software | i3 | Facts | TBD
# set_fact:
# i3_package: i3-wm
# when: ansible_distribution in ("TBD")
- name: Workstation | Linux | Software | i3 | Install
package:
name:
- "{{ i3_package }}"
- "{{ lightdm }}"
- "{{ i3_light }}"
state: present
update_cache: yes
- name: Workstation | Linux | Software | i3 | Config | Create Dir
ansible.builtin.file:
path: "{{ i3_config_dir }}"
state: directory
mode: '0755'
owner: "{{ user }}"
group: "{{ user }}"
- name: Workstation | Linux | Software | i3 | Config | Copy File
copy:
src: "{{ i3_config }}"
dest: "{{ i3_config_file }}"
owner: "{{ user }}"
group: "{{ user }}"
mode: '0664'
# TBD: Automate getting the brightness keys to work.
#
# User is already part of the video group. Just need to configure udev rules.
#
# Get the folder name from here: `ls /sys/class/backlight/`
#
# That is your <DEVICE> for the following lines, which go here: /etc/udev/rules.d/backlight.rules
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<DEVICE>", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="<DEVICE>", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
#
# So, for example:
# [18:12:20 root@device ~]# cat /etc/udev/rules.d/backlight.rules
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness"
# ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness"
# [18:12:21 root@device ~]#
#
# It then required a reboot. Doing the commands below was not enough.
#
# # sudo udevadm control --reload-rules ^C
# # sudo udevadm trigger
#