From 7364d5aa1bb119dee7d167b7a51923dd5d207a23 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 25 Aug 2026 17:31:03 +0800 Subject: [PATCH] feat(home): add pyclipsync clipboard sync service for niri xwayland-satellite has no compositor-level clipboard bridging, so X11 clients (WeChat/QQ) and Wayland clients cannot see each other's clipboard. Add the pyclipsync flake input and enable its home-manager module, which installs the daemon as a systemd user service bound to the graphical session. --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 6 ++++++ home/linux/gui/niri/default.nix | 13 +++++++++++++ 3 files changed, 40 insertions(+) diff --git a/flake.lock b/flake.lock index de5e4cfb..0d750b85 100644 --- a/flake.lock +++ b/flake.lock @@ -842,6 +842,26 @@ "type": "github" } }, + "pyclipsync": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1787650021, + "narHash": "sha256-rUcNR2oIAVCQA4TJR1jU38cHnd0j9njNZLOj8n2oeHk=", + "owner": "ryan4yin", + "repo": "pyclipsync", + "rev": "2a427d11e8e2195703a8f84a734cad4c68d5875c", + "type": "github" + }, + "original": { + "owner": "ryan4yin", + "repo": "pyclipsync", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -869,6 +889,7 @@ "nur-ryan4yin": "nur-ryan4yin", "pre-commit-hooks": "pre-commit-hooks", "preservation": "preservation", + "pyclipsync": "pyclipsync", "wallpapers": "wallpapers" } }, diff --git a/flake.nix b/flake.nix index 3c2de9e9..a29e81d0 100644 --- a/flake.nix +++ b/flake.nix @@ -168,5 +168,11 @@ url = "github:ryan4yin/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # Wayland <-> X11 clipboard sync daemon for xwayland-satellite (niri) + pyclipsync = { + url = "github:ryan4yin/pyclipsync"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/home/linux/gui/niri/default.nix b/home/linux/gui/niri/default.nix index 86c1a982..e112eab2 100644 --- a/home/linux/gui/niri/default.nix +++ b/home/linux/gui/niri/default.nix @@ -2,12 +2,18 @@ pkgs, config, lib, + pyclipsync, ... }@args: let cfg = config.modules.desktop.niri; in { + imports = [ + # provides `services.pyclipsync.enable` + pyclipsync.homeModules.default + ]; + options.modules.desktop.niri = { enable = lib.mkEnableOption "niri compositor"; }; @@ -56,6 +62,13 @@ in }; }; + # xwayland-satellite has no compositor-level clipboard bridging, so X11 + # clients (WeChat/QQ, run via xwayland-satellite) and Wayland clients + # cannot see each other's clipboard. This daemon mirrors the X11 + # CLIPBOARD and the Wayland data device both directions (see the + # pyclipsync repo for details). + services.pyclipsync.enable = true; + # NOTE: this executable is used by greetd to start a wayland session when system boot up # with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config in NixOS module home.file.".wayland-session" = {