Automatically accept Portal dialogs for Input Capture and Remote Control/Desktop.
Important
🎉 For Deskflow, this tool is now redundant for Remote Desktop/Control portal permission! See: deskflow/deskflow#8865
We're still waiting for Input Capture token support: flatpak/xdg-desktop-portal#1768
Once that's done, we can archive this project.
$ accept-portal-dialog
[2025-08-09 00:29:02] Checking for yDoTool daemon...
[2025-08-09 00:29:02] Found yDoTool daemon, socket: /run/user/1000/.ydotool_socket
[2025-08-09 00:29:02] Watching for Portal permission dialogs... Press Ctrl+C to stop.
[2025-08-09 00:29:06] Found GNOME dialog: Remote Desktop (ID: 2176466517, Focus: yes)
[2025-08-09 00:29:06] Accepting GNOME Portal permission dialog
[2025-08-09 00:29:06] Pressing down keys: ['28:1'], up keys: ['28:0']
[2025-08-09 00:29:06] Pressing down keys: ['56:1', '31:1'], up keys: ['31:0', '56:0']
This tool was born out of frustration with the Portal permission dialogs:

Users and developers of applications like Deskflow, Synergy, and LAN Mouse find Portal permission dialogs frustrating. For users, they must be present at the remote computer to accept the dialog.
For a Deskflow/Synergy developer, or any remote access tool developer, these dialogs are a nightmare during development as you will likely see them hundreds of times a day.
This tool is for people who find these dialogs annoying, and want them to be automatically accepted.
Warning
This tool will decrease the security of your computer, so please use it only if you know what you're doing.
This tool is a workaround, not a long-term fix.
The Portal project is working on fixing this UX problem, but it will take time to become generally available.
Once the fix is complete in Portal and it becomes ubiquitous, this project will become obsolete and can be archived.
The Linux community is divided on this tool, and opinions about it are mixed.
One Reddit user says:
Security implications aside, this is a bad idea in itself.
But, on the other hand:
I believe this program wouldn't exist if the actual end-user implementations were well done enough. -- Reddit user
On both GNOME and KDE, you'll need to install: ydotool
GNOME requires you to enable unsafe mode:
- Press Alt+F2
- Enter:
lg
- Run:
global.context.unsafe_mode = true
You can also create an extension (see below) to do this automatically.
On KDE, you'll also need to install: kdotool
To start monitoring for Portal permission dialogs and automatically accepting them, run the Python script from a Terminal:
./accept-portal-dialog.py
A config file is generated by default at ~/.config/accept-portal-dialog/config.ini
:
The values can be changed, and will be used when the tool is restarted. You should already be familiar with editing .ini files before attempting this.
Warning
The minimum sleep/delay values 0.5; any lower and the GUI doesn't have time to do it's fancy animations. This is especially noticeable on GNOME.
Numbers in the sequence are ydotool
compatible key codes:
Key | Code |
---|---|
Alt | 56 |
S | 31 |
Enter | 28 |
Tab | 15 |
Example for Chinese users who want to accept the 'Input capture' dialog on KDE:
[kde]
dialog_titles = 請求遠端控制權限
Example to change the accept key sequence to Alt+S on KDE:
[kde]
accept_sequence_0 = 56,31
Default for accept_sequence_0
on KDE is Enter
. This is OK on KDE as the dialog is a bit
more consistently designed. The GNOME dialogs may have varying tab orders, so Alt+S tends to
work better in that case which is why it's the default. However, Alt+S is not great for i18n
so you may want to use a series of Tap presses and the Enter key.
[gnome]
accept_sequence_0 = 28
accept_sequence_1 = <sleep>
accept_sequence_3 = 15
accept_sequence_4 = 15
accept_sequence_5 = 28
You may need to remove a tab depending on the dialog title (e.g. remote desktop or input capture).
The <sleep>
is necessary on GNOME, as it takes a moment for the GUI to do some fancy animation
after toggling the switch to enabled.
Warning
Do not do this unless you really know what you're doing; it's very unsafe and should only be done by experts.
Doing 'Alt+F2 → lg → global.context.unsafe_mode = true' every time you login is a pain.
To avoid having to do this, create an extension.
mkdir -p ~/.local/share/gnome-shell/extensions/unsafe-mode@local
metadata.json
{
"uuid": "unsafe-mode@local",
"name": "Unsafe Mode Enabler",
"description": "Sets global.context.unsafe_mode to true at session start.",
"version": 1,
"shell-version": ["47"]
}
extension.js
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
export default class UnsafeModeExtension extends Extension {
enable() {
try {
if (global && global.context && 'unsafe_mode' in global.context) {
global.context.unsafe_mode = true;
console.log('[unsafe-mode] unsafe_mode set to true');
} else {
console.error('[unsafe-mode] global.context.unsafe_mode not found');
}
} catch (e) {
console.error('[unsafe-mode] failed to set unsafe_mode:', e);
}
}
disable() {
// Optional: flip it back
// if (global && global.context && 'unsafe_mode' in global.context)
// global.context.unsafe_mode = false;
}
}
Important: On Wayland, you'll need to log out and log back in to load the extension.
These dialogs are supported by default.



