From 501c8aaa3b00157f12383023e4751cb65b1cd988 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Fri, 27 Sep 2024 11:45:51 +0300 Subject: [PATCH] feat: Copy images from XWayland --- .../users/sweetbread/modules/wms/hyprland.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home-manager/users/sweetbread/modules/wms/hyprland.nix b/home-manager/users/sweetbread/modules/wms/hyprland.nix index 005e703..c20b00e 100644 --- a/home-manager/users/sweetbread/modules/wms/hyprland.nix +++ b/home-manager/users/sweetbread/modules/wms/hyprland.nix @@ -7,6 +7,8 @@ wofi clipse grimblast + xclip + clipnotify ]; wayland.windowManager.hyprland = @@ -58,6 +60,15 @@ finally: system(f"swww img {folder}/{filename} --transition-type center") ''; + + clipsync = pkgs.writers.writeBash "clipsync" '' + while clipnotify; do + xclip -q -sel clip -t image/png -o > /dev/null && \ + xclip -sel clip -t image/png -o | wl-copy + xclip -q -sel clip -o > /dev/null && \ + xclip -sel clip -o | wl-copy + done + ''; in { enable = true; xwayland.enable = true; @@ -194,6 +205,7 @@ "swww init" "python3 ${lib.getExe wallpaper_changer}" "waybar" + "${clipsync}" "clipse -listen" ];