From 9d552966967177f7cc146121a207f21ef9c23a09 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 9 Nov 2026 19:52:48 +1100 Subject: [PATCH] fix(soe-gui): map Mac RDP PrtSc to the GNOME screenshot UI macOS has no PrtSc key code, so Thincast on a Mac sends F13 into the RDP session. GNOME reads F13 as XF86Tools, so PrtSc opens Settings instead of taking a screenshot. - soe-gui ships a system dconf default, 10-printscreen-rdp. It binds XF86Tools to the screenshot UI and drops it from the Settings shortcut. - The default applies on every Ubuntu and Fedora GNOME host through the soe-gui or printscreen tag. A user binding still wins. - The same two per-user keys made PrtSc in Thincast open the screenshot UI on dragonfly and desktop-derek. - run-tests.sh and hyperi-ci check --quick pass. The keyfile compiles with dconf compile. --- .../roles/soe-gui/files/dconf-printscreen-rdp | 9 +++++ ansible/roles/soe-gui/tasks/main.yml | 10 ++++++ ansible/roles/soe-gui/tasks/printscreen.yml | 35 +++++++++++++++++++ docs/install-matrix.md | 1 + 4 files changed, 55 insertions(+) create mode 100644 ansible/roles/soe-gui/files/dconf-printscreen-rdp create mode 100644 ansible/roles/soe-gui/tasks/printscreen.yml diff --git a/ansible/roles/soe-gui/files/dconf-printscreen-rdp b/ansible/roles/soe-gui/files/dconf-printscreen-rdp new file mode 100644 index 00000000..7eb42c65 --- /dev/null +++ b/ansible/roles/soe-gui/files/dconf-printscreen-rdp @@ -0,0 +1,9 @@ +# PrtSc on a Mac keyboard reaches an RDP session as F13, which GNOME reads as XF86Tools. +# Deployed to /etc/dconf/db/local.d/10-printscreen-rdp. Run 'dconf update' after changes. + +[org/gnome/shell/keybindings] +show-screenshot-ui=['Print', 'XF86Tools'] + +# XF86Tools opens Settings by default. Unbind it there so the screenshot binding gets the key. +[org/gnome/settings-daemon/plugins/media-keys] +control-center-static=@as [] diff --git a/ansible/roles/soe-gui/tasks/main.yml b/ansible/roles/soe-gui/tasks/main.yml index a3adcbc7..8484c082 100644 --- a/ansible/roles/soe-gui/tasks/main.yml +++ b/ansible/roles/soe-gui/tasks/main.yml @@ -23,6 +23,16 @@ - ansible_facts['distribution'] in ['Fedora', 'Ubuntu'] - has_gnome | default(false) +- name: Bind PrtSc from Mac RDP clients to the GNOME screenshot UI + ansible.builtin.include_tasks: + file: printscreen.yml + apply: + tags: ['soe-gui', 'printscreen'] + tags: ['soe-gui', 'printscreen'] + when: + - ansible_facts['distribution'] in ['Fedora', 'Ubuntu'] + - has_gnome | default(false) + # The GNOME desktop (extensions, dock, theming) is opt-in: it must only be # configured when winlike or maclike is EXPLICITLY requested. A `never` tag # alone cannot enforce that here, because the role-level tags are inherited by diff --git a/ansible/roles/soe-gui/tasks/printscreen.yml b/ansible/roles/soe-gui/tasks/printscreen.yml new file mode 100644 index 00000000..5d00d90a --- /dev/null +++ b/ansible/roles/soe-gui/tasks/printscreen.yml @@ -0,0 +1,35 @@ +--- +# PrtSc from a Mac RDP client (Thincast) arrives as F13, because macOS has no PrtSc key code. Bind its GNOME keysym, XF86Tools, to the screenshot UI. +# System-wide dconf default, so a user's own binding still wins. + +- name: Ensure system dconf keyfile directory exists + ansible.builtin.file: + path: /etc/dconf/db/local.d + state: directory + mode: '0755' + +- name: Ensure dconf user profile reads the local system-db + ansible.builtin.lineinfile: + path: /etc/dconf/profile/user + line: "{{ item }}" + create: true + mode: '0644' + loop: + - "user-db:user" + - "system-db:local" + register: printscreen_dconf_profile + +- name: Deploy PrtSc-over-RDP screenshot binding + ansible.builtin.copy: + src: dconf-printscreen-rdp + dest: /etc/dconf/db/local.d/10-printscreen-rdp + owner: root + group: root + mode: '0644' + register: printscreen_dconf_deployed + +- name: Update dconf database + ansible.builtin.command: + cmd: dconf update + changed_when: true + when: (printscreen_dconf_deployed.changed | default(false)) or (printscreen_dconf_profile.changed | default(false)) diff --git a/docs/install-matrix.md b/docs/install-matrix.md index 19fc69c3..05ab56b4 100644 --- a/docs/install-matrix.md +++ b/docs/install-matrix.md @@ -372,6 +372,7 @@ hyperi-ci. | Slack | all | vendor-repo / cask | | LibreOffice (org office suite) | Linux | distro repo | | Nemo, GNOME extensions (gext), fonts | Linux | distro / uv-tool / vendored | +| PrtSc from a Mac RDP client (arrives as F13) opens the GNOME screenshot UI (tag `printscreen`) | Linux GNOME | system dconf | | colima + Apple `container` (macOS only; `container` needs Apple silicon and macOS 26) | macOS | brew | | Local ClickHouse + Redpanda (opt-in `soe_local_services_enabled`) | all | container image | | removals / update_command / admin-scripts (opt-in `never`, on for soe) | Linux | tombstones + scripts |