diff --git a/roles/hotkeys/meta/main.yml b/roles/hotkeys/meta/main.yml new file mode 100644 index 0000000..caeaee7 --- /dev/null +++ b/roles/hotkeys/meta/main.yml @@ -0,0 +1,6 @@ +--- +galaxy_info: + author: cjr + description: Deploy script desktop files and configure Plasma global hotkeys + license: BSD-3-Clause + min_ansible_version: "2.1" diff --git a/roles/hotkeys/tasks/main.yml b/roles/hotkeys/tasks/main.yml new file mode 100644 index 0000000..e43adea --- /dev/null +++ b/roles/hotkeys/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- name: Copy cheat sheet desktop file + ansible.builtin.template: + src: cheat-sheet.desktop.j2 + dest: "{{ ansible_user_home }}/.local/share/applications/net.local.cheat-sheet.sh.desktop" + mode: "0644" + +- name: Copy password script + ansible.builtin.template: + src: pass-menu.desktop.j2 + dest: "{{ ansible_user_home }}/.local/share/applications/net.local.pass-menu.sh.desktop" + mode: "0644" + +- name: Set cheat-sheet hotkey + community.general.ini_file: + path: "{{ ansible_user_home }}/.config/kglobalshortcutsrc" + section: "services][net.local.cheat-sheet.sh.desktop" + option: _launch + value: Alt+C + mode: "0644" + +- name: Set pass-menu hotkey + community.general.ini_file: + path: "{{ ansible_user_home }}/.config/kglobalshortcutsrc" + section: "services][net.local.pass-menu.sh.desktop" + option: _launch + value: Alt+P + mode: "0644" diff --git a/roles/hotkeys/templates/cheat-sheet.desktop.j2 b/roles/hotkeys/templates/cheat-sheet.desktop.j2 new file mode 100644 index 0000000..b231597 --- /dev/null +++ b/roles/hotkeys/templates/cheat-sheet.desktop.j2 @@ -0,0 +1,7 @@ +[Desktop Entry] +Exec={{ ansible_user_home }}/scripts/cheat-sheet.sh +Name=cheat-sheet +NoDisplay=true +StartupNotify=false +Type=Application +X-KDE-GlobalAccel-CommandShortcut=true diff --git a/roles/hotkeys/templates/pass-menu.desktop.j2 b/roles/hotkeys/templates/pass-menu.desktop.j2 new file mode 100644 index 0000000..a50d102 --- /dev/null +++ b/roles/hotkeys/templates/pass-menu.desktop.j2 @@ -0,0 +1,7 @@ +[Desktop Entry] +Exec={{ ansible_user_home }}/scripts/pass-menu.sh +Name=pass-menu +NoDisplay=true +StartupNotify=false +Type=Application +X-KDE-GlobalAccel-CommandShortcut=true diff --git a/roles/scripts/meta/main.yml b/roles/scripts/meta/main.yml new file mode 100644 index 0000000..4f4ff4d --- /dev/null +++ b/roles/scripts/meta/main.yml @@ -0,0 +1,6 @@ +--- +galaxy_info: + author: cjr + description: Clone scripts repo and add to PATH + license: BSD-3-Clause + min_ansible_version: "2.1" diff --git a/roles/scripts/tasks/main.yml b/roles/scripts/tasks/main.yml new file mode 100644 index 0000000..a6e7f96 --- /dev/null +++ b/roles/scripts/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- name: Clone the scripts repo + ansible.builtin.git: + repo: https://gitea.learningunix.net/cjr/scripts + dest: "{{ ansible_user_home }}/scripts" + update: true + version: main + +- name: Ensure that scripts is in the user's path + ansible.builtin.lineinfile: + path: "{{ ansible_user_home }}/dotfiles/zsh/.zshrc" + line: 'export PATH="$HOME/scripts:$PATH"' + state: present diff --git a/site.yml b/site.yml index 1e2c949..0bd7e70 100644 --- a/site.yml +++ b/site.yml @@ -17,3 +17,9 @@ tags: web - role: flatpak tags: flatpak + - role: dotfiles + tags: dotfiles + - role: scripts + tags: scripts + - role: hotkeys + tags: hotkeys