diff --git a/config/ansible/tasks/workstations/cliphist.yml b/config/ansible/tasks/workstations/cliphist.yml new file mode 100644 index 0000000..637cb5f --- /dev/null +++ b/config/ansible/tasks/workstations/cliphist.yml @@ -0,0 +1,41 @@ +--- +- name: Ensure wl-clipboard and cliphist are installed + become: true + package: + name: + - wl-clipboard + - cliphist + - wofi + state: present + +- name: Create systemd user service for cliphist + become: false + copy: + dest: "{{ ansible_env.HOME }}/.config/systemd/user/cliphist-store.service" + mode: "0644" + content: | + [Unit] + Description=Store clipboard history with cliphist + + [Service] + ExecStart=/usr/bin/sh -c 'wl-paste --watch cliphist store' + Restart=on-failure + + [Install] + WantedBy=default.target + +- name: Reload systemd user daemon + become: false + systemd: + daemon_reload: yes + scope: user + +# TO ENABLE READING, ADD A KEYBOARD SHORTCUT SOMEWHERE IN YOUR WM CONFIGURATION +# cliphist list | wofi -S dmenu | cliphist decode | wl-copy +- name: Enable and start cliphist-store service + become: false + systemd: + name: cliphist-store.service + enabled: yes + state: started + scope: user diff --git a/config/ansible/tasks/workstations/workstation.yml b/config/ansible/tasks/workstations/workstation.yml index f1373f4..a089255 100644 --- a/config/ansible/tasks/workstations/workstation.yml +++ b/config/ansible/tasks/workstations/workstation.yml @@ -4,6 +4,9 @@ - name: Include workstation symlinks tasks ansible.builtin.import_tasks: tasks/workstations/symlinks.yml + - name: Include workstation cliphist tasks + ansible.builtin.import_tasks: tasks/workstations/cliphist.yml + - name: Include GNOME Extensions tasks ansible.builtin.import_tasks: tasks/workstations/gnome-extensions.yml when: ansible_facts.env.XDG_CURRENT_DESKTOP is defined and 'GNOME' in ansible_facts.env.XDG_CURRENT_DESKTOP