my_konfig

This commit is contained in:
2025-12-17 18:10:08 +01:00
parent ed4ae93364
commit 773955ef02
42 changed files with 1313 additions and 158 deletions

View File

@@ -1,7 +1,7 @@
- name: Deploy Sway Configuration
hosts: localhost
connection: local
become: true # Run the entire playbook with elevated privileges
become: true
vars:
target_user: jonnybravo
@@ -26,53 +26,127 @@
- playerctl
- qalculate-gtk
- tmux
- rclone
- pacman-contrib
- udisks2
- udiskie
- mpd
- ncmpcpp
- ttf-dejavu
- otf-font-awesome
- papirus-icon-theme
- nwg-look
state: present
- name: Ensure .config directory exists for target user
ansible.builtin.file:
path: "/home/{{ target_user }}/.config"
state: directory
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0755'
- name: Check if yay is installed
ansible.builtin.command: "which yay"
register: yay_check
changed_when: false
ignore_errors: true
- name: Ensure .config subdirectories exist
- name: Install AUR packages with yay
ansible.builtin.command: "yay -S --noconfirm tty-clock catppuccin-gtk-theme-mocha"
when: yay_check.rc == 0
become: true
become_user: "{{ target_user }}"
- name: Add user to storage group
ansible.builtin.user:
name: "{{ target_user }}"
groups: storage
append: true
notify:
- Reboot required for group changes
- name: Create required directories
ansible.builtin.file:
path: "/home/{{ target_user }}/.config/{{ item }}"
path: "{{ item }}"
state: directory
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0755'
loop:
- sway
- waybar
- mako
- wofi
- alacritty
- kanshi
- "/home/{{ target_user }}/.config/sway"
- "/home/{{ target_user }}/.config/sway/scripts"
- "/home/{{ target_user }}/.config/waybar"
- "/home/{{ target_user }}/.config/mako"
- "/home/{{ target_user }}/.config/wofi"
- "/home/{{ target_user }}/.config/alacritty"
- "/home/{{ target_user }}/.config/kanshi"
- "/home/{{ target_user }}/.config/rclone"
- "/home/{{ target_user }}/.config/systemd/user"
- "/home/{{ target_user }}/.config/mpd"
- "/home/{{ target_user }}/.config/ncmpcpp"
- name: Copy all config files
- name: Copy configuration files
ansible.builtin.copy:
src: "{{ playbook_dir }}/config/{{ item.path }}"
dest: "/home/{{ target_user }}/.config/{{ item.path }}"
src: "{{ playbook_dir }}/{{ item.src }}"
dest: "/home/{{ target_user }}/{{ item.dest }}"
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0644'
loop:
- { path: 'sway/config' }
- { path: 'waybar/config' }
- { path: 'waybar/style.css' }
- { path: 'mako/config' }
- { path: 'wofi/config' }
- { path: 'alacritty/alacritty.toml' }
- { path: 'alacritty/alacritty.yml' }
- { path: 'alacritty/catppuccin-mocha.toml' }
- { path: 'kanshi/config' }
- { src: 'config/sway/config', dest: '.config/sway/config' }
- { src: 'config/waybar/config', dest: '.config/waybar/config' }
- { src: 'config/waybar/style.css', dest: '.config/waybar/style.css' }
- { src: 'config/mako/config', dest: '.config/mako/config' }
- { src: 'config/wofi/config', dest: '.config/wofi/config' }
- { src: 'config/alacritty/alacritty.toml', dest: '.config/alacritty/alacritty.toml' }
- { src: 'config/alacritty/alacritty.yml', dest: '.config/alacritty/alacritty.yml' }
- { src: 'config/alacritty/catppuccin-mocha.toml', dest: '.config/alacritty/catppuccin-mocha.toml' }
- { src: 'config/kanshi/config', dest: '.config/kanshi/config' }
- { src: 'config/rclone/rclone.conf', dest: '.config/rclone/rclone.conf' }
- { src: '.tmux.conf', dest: '.tmux.conf' }
- { src: 'config/systemd/user/rclone-sync.service', dest: '.config/systemd/user/rclone-sync.service' }
- { src: 'config/systemd/user/rclone-sync.timer', dest: '.config/systemd/user/rclone-sync.timer' }
- { src: 'config/mpd/mpd.conf', dest: '.config/mpd/mpd.conf' }
- { src: 'config/ncmpcpp', dest: '.config/ncmpcpp' }
- { src: 'config/systemd/user/mpd.service', dest: '.config/systemd/user/mpd.service' }
- name: Copy Tmux config to home directory
- name: Copy background image
ansible.builtin.copy:
src: "{{ playbook_dir }}/.tmux.conf"
dest: "/home/{{ target_user }}/.tmux.conf"
src: "{{ playbook_dir }}/media/wallpapersden.com_astronaut-with-jellyfish_2560x1440.jpg"
dest: "/home/{{ target_user }}/Bilder/wallpapersden.com_astronaut-with-jellyfish_2560x1440.jpg"
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0644'
- name: Copy and make waybar scripts executable
ansible.builtin.copy:
src: "{{ playbook_dir }}/config/waybar/{{ item }}"
dest: "/home/{{ target_user }}/.config/waybar/{{ item }}"
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0755'
loop:
- "updates.sh"
- "vpn-status.sh"
- "rclone-status.sh"
- name: Copy and make sway scripts executable
ansible.builtin.copy:
src: "{{ playbook_dir }}/config/sway/scripts/auto-bluetooth.sh"
dest: "/home/{{ target_user }}/.config/sway/scripts/auto-bluetooth.sh"
owner: "{{ target_user }}"
group: "{{ target_user }}"
mode: '0755'
- name: Reload systemd daemon for the target user
ansible.builtin.command: "systemctl --user daemon-reload"
become: true
become_user: "{{ target_user }}"
- name: Enable and start the rclone timer for the target user
ansible.builtin.command: "systemctl --user enable --now rclone-sync.timer"
become: true
become_user: "{{ target_user }}"
- name: Enable and start mpd service for the target user
ansible.builtin.command: "systemctl --user enable --now mpd.service"
become: true
become_user: "{{ target_user }}"
handlers:
- name: Reboot required for group changes
ansible.builtin.debug:
msg: "User '{{ target_user }}' was added to the 'storage' group. A reboot or re-login is required for changes to take effect."