From 2a9b241bda5a7e451b01b4fadcdd7a03ba46373d Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sat, 2 Mar 2019 16:47:59 +0000 Subject: [PATCH] Add Linux configuration for global keybindings --- .../roles/linux_desktop/tasks/config.yaml | 26 +++++++++++++++++++ .ansible/roles/linux_desktop/vars/main.yaml | 11 ++++++++ 2 files changed, 37 insertions(+) diff --git a/.ansible/roles/linux_desktop/tasks/config.yaml b/.ansible/roles/linux_desktop/tasks/config.yaml index 197f530..f3e9c65 100644 --- a/.ansible/roles/linux_desktop/tasks/config.yaml +++ b/.ansible/roles/linux_desktop/tasks/config.yaml @@ -59,3 +59,29 @@ copy: dest: '~/.config' src: files/albert + +- name: 'Gnome: Custom key bindings: Add' + tags: + - config + - keybindings + block: + - name: 'Gnome: Custom key bindings: Set facts' + set_fact: + customkbpath: '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings' + kblist: [] + + - name: 'Gnome: Custom key bindings: Build list' + set_fact: + kblist: "{{ kblist + [ ( customkbpath + '/custom' + index | string + '/' ) | to_json ] }}" + loop: "{{ gnome_custom_keybindings }}" + loop_control: + index_var: index + label: "{{ item.name }}" + + - name: 'Gnome: Custom key bindings: Configure list' + command: "dconf write {{ customkbpath }} [{{ kblist | join(',') | quote }}]" + + - include: includes/keybindings.yaml + loop: "{{ gnome_custom_keybindings }}" + loop_control: + index_var: index diff --git a/.ansible/roles/linux_desktop/vars/main.yaml b/.ansible/roles/linux_desktop/vars/main.yaml index b41095e..dc00477 100644 --- a/.ansible/roles/linux_desktop/vars/main.yaml +++ b/.ansible/roles/linux_desktop/vars/main.yaml @@ -63,3 +63,14 @@ gnome_extension_ids: - 28 # gtile - 1386 # notification counter - 19 # user themes + +gnome_custom_keybindings: + - name: 'Show clipboards in Albert' + binding: 'c' + command: > + 'albert show \'pb \'' + + - name: 'Show CopyQ clipboards' + binding: 'x' + command: > + 'copyq show'