alkaa/roles/xmonad/tasks/main.yml
2024-03-16 21:00:52 +01:00

176 lines
4.1 KiB
YAML

---
- name: Install general packages
ansible.builtin.package:
name:
- xmonad
- xmonad-contrib
- xmobar
- alacritty
- dunst
- redshift
- cmus
- lightdm
- lightdm-gtk-greeter
- nnn
- trash-cli
- tar
- zip
- unzip
- unrar
- feh
- mpv
- nsxiv
- zathura
- ttc-iosevka
state: present
become: true
tags: [pc, setup]
- name: Install laptop specific packages
ansible.builtin.package:
name:
- pavucontrol
- pamixer
- brightnessctl
state: present
tags: [t460p, x220, setup]
- name: Build and install dmenu
community.general.make:
chdir: "{{ role_path }}/files/dmenu"
target: install
become: true
tags: [pc, setup]
- name: Cleanup built dmenu artifacts
community.general.make:
chdir: "{{ role_path }}/files/dmenu"
target: clean
become: true
tags: [pc, setup]
- name: Build and install slock
community.general.make:
chdir: "{{ role_path }}/files/slock"
target: install
become: true
tags: [pc, setup]
- name: Cleanup built slock artifacts
community.general.make:
chdir: "{{ role_path }}/files/slock"
target: clean
become: true
tags: [pc, setup]
- name: Create config directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- ~/.config/xmonad
- ~/.config/xmobar
- ~/.config/dunst
- ~/.config/cmus
- ~/.config/redshift
- ~/.config/nsxiv
- ~/.config/nsxiv/exec
- ~/.config/zathura
tags: [pc, setup]
- name: Copy over cmus config
ansible.builtin.copy:
src: "{{ item }}"
dest: "~/.config/cmus/"
mode: '0644'
with_fileglob: "cmus/*"
tags: pc
- name: Create nnn config directory
ansible.builtin.file:
path: "~/.config/nnn"
state: directory
mode: '0755'
tags: [pc, setup]
- name: Clone nnn repository into temp
ansible.builtin.git:
repo: https://github.com/jarun/nnn.git
force: true
dest: /tmp/nnn
tags: [pc, setup]
- name: Move nnn plugins into right place
ansible.builtin.copy:
remote_src: true
src: /tmp/nnn/plugins/
dest: ~/.config/nnn/plugins/
mode: '0755'
tags: [pc, setup]
- name: Copy over common config files
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "~/.config/{{ item.dest }}"
mode: '0644'
tags: pc
loop:
- { src: alacritty.toml, dest: alacritty.toml }
- { src: dunstrc, dest: dunst/dunstrc }
- { src: dircolours, dest: dircolours }
- { src: redshiftrc, dest: redshift/redshiftrc }
- { src: zathurarc, dest: zathura/zathurarc }
- name: Copy over nsixv key handler script
ansible.builtin.copy:
src: nsxiv_key_handler
dest: ~/.config/nsxiv/exec/key-handler
mode: '0755'
tags: pc
- name: Copy over T460p config files
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: '0644'
with_items:
- { src: xmonad_t460p.hs, dest: ~/.config/xmonad/xmonad.hs }
- { src: xmobarrc_t460p, dest: ~/.config/xmobar/xmobarrc }
- { src: bashrc_t460p, dest: ~/.bashrc }
- { src: profile_t460p, dest: ~/.profile }
tags: t460p
- name: Copy over qwerty config files
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: '0644'
with_items:
- { src: xmonad_qwerty.hs, dest: ~/.config/xmonad/xmonad.hs }
- { src: xmobarrc_qwerty, dest: ~/.config/xmobar/xmobarrc }
- { src: bashrc_qwerty, dest: ~/.bashrc }
- { src: profile_qwerty, dest: ~/.profile }
- { src: mimeapps_qwerty.list, dest: ~/.config/mimeapps.list }
tags: qwerty
- name: Copy over x220 config files
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: '0644'
with_items:
- { src: xmonad_x220.hs, dest: ~/.config/xmonad/xmonad.hs }
- { src: xmobarrc_x220, dest: ~/.config/xmobar/xmobarrc }
- { src: bashrc_x220, dest: ~/.bashrc }
- { src: profile_x220, dest: ~/.profile }
- { src: mimeapps_x220.list, dest: ~/.config/mimeapps.list }
tags: x220
- name: Enable Lightdm
ansible.builtin.service:
name: lightdm
state: started
enabled: true
tags: [pc, setup]