diff --git a/roles/xmonad/files/recompile_xmonad.hook b/roles/xmonad/files/recompile_xmonad.hook new file mode 100644 index 0000000..9bc68b1 --- /dev/null +++ b/roles/xmonad/files/recompile_xmonad.hook @@ -0,0 +1,9 @@ +[Trigger] +Operation = Upgrade +Type = Package +Target = xmonad + +[Action] +Description = Recompiling xmonad... +When = PostTransaction +Exec = /usr/bin/sudo -u max /usr/bin/xmonad --recompile diff --git a/roles/xmonad/tasks/main.yml b/roles/xmonad/tasks/main.yml index 8a00c0f..7cc7aa3 100644 --- a/roles/xmonad/tasks/main.yml +++ b/roles/xmonad/tasks/main.yml @@ -38,7 +38,7 @@ become: true ansible.builtin.lineinfile: path: /etc/sudo.conf - line: 'max ALL=(ALL) NOPASSWD: /usr/bin/pacman' + line: 'max ALL=(ALL) NOPASSWD: /usr/bin/pacman, /usr/bin/mkdir, /usr/bin/cp' state: present validate: 'visudo -cf %s' @@ -48,7 +48,22 @@ state: present name: - pmount - - advmvcp + - advcpmv + + - name: Create pacman hook directory + become: true + ansible.builtin.file: + path: /etc/pacman.d/hooks + state: directory + mode: '0755' + + - name: Copy over xmonad pacman hook + become: true + ansible.builtin.copy: + src: recompile_xmonad.hook + dest: /etc/pacman.d/recompile_xmonad.hook + mode: '0644' + always: - name: Disable user to use sudo pacman without password become: true