A complete implementation of the org.freedesktop.impl.portal.RemoteDesktop portal for Hyprland, providing remote desktop capabilities using libei and Wayland virtual input protocols.
# Install portal system-wide
sudo make install
# Copy portal configuration
sudo cp data/hyprland.portal /usr/share/xdg-desktop-portal/portals/
# Restart portal services
systemctl --user restart xdg-desktop-portalInstall dependencies:
- cmake, pkg-config, gcc
- wayland-client, wayland-protocols, wayland-scanner
- libei-1.0, sdbus-c++, systemd
Then:
./build.sh- Fixed: Now uses session bus instead of system bus
- Fixed: Correct method signatures prevent registration errors
- Normal: Occurs when another portal uses the same service name
- Solution: Use development mode (automatic in
test_portal.sh)
Check if the portal is discoverable:
# List all portal services
busctl --user list | grep portal
# Monitor D-Bus calls to your portal
busctl --user monitor org.freedesktop.impl.portal.desktop.hyprland.dev
# Test method calls
busctl --user call org.freedesktop.impl.portal.desktop.hyprland.dev \
/org/freedesktop/portal/desktop \
org.freedesktop.impl.portal.RemoteDesktop \
CreateSession 'a{sv}' 0hyprland-remote-desktop/
├── src/
│ ├── main.cpp # Main application entry point
│ ├── portal.cpp/.h # D-Bus portal implementation
│ ├── wayland_virtual_keyboard.cpp/.h # Virtual keyboard protocol
│ ├── wayland_virtual_pointer.cpp/.h # Virtual pointer protocol
│ └── libei_handler.cpp/.h # LibEI event processing
├── protocols/
│ ├── virtual-keyboard-unstable-v1.xml # Wayland keyboard protocol
│ └── wlr-virtual-pointer-unstable-v1.xml # wlroots pointer protocol
├── data/
│ ├── hyprland.portal # Portal configuration
│ └── org.freedesktop.impl.portal.desktop.hyprland.service.in
├── shell.nix # NixOS development environment
├── CMakeLists.txt # Build configuration
├── build.sh # Build script
├── test_portal.sh # Development testing script
└── README.md # This file
# Build and test
./test_portal.sh
# Manual testing
nix-shell
./build.sh
./build/hyprland-remote-desktop
# D-Bus testing
busctl --user introspect org.freedesktop.impl.portal.desktop.hyprland.dev /org/freedesktop/portal/desktop
busctl --user call org.freedesktop.impl.portal.desktop.hyprland.dev /org/freedesktop/portal/desktop org.freedesktop.impl.portal.RemoteDesktop CreateSession 'a{sv}' 0- Use the provided
shell.nixfor development - Follow the existing code structure
- Test with
./test_portal.sh - Ensure both keyboard and pointer protocols work
- Verify D-Bus method signatures match the portal specification
MIT License - see LICENSE file for details.