From 11aef457cbe233fc0fd87e411415b3fb8fb8a900 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 23 Dec 2023 11:15:09 -0500 Subject: Add support for wayland and wl-copy --- dpw | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dpw b/dpw index d21f8f5..67ee242 100755 --- a/dpw +++ b/dpw @@ -25,7 +25,12 @@ Darwin) pbcopy ;; *) - xclip -selection "$PASSWORD_STORE_X_SELECTION" + case $XDG_SESSION_TYPE in + wayland) + wl-copy ;; + *) + xclip -selection "$PASSWORD_STORE_X_SELECTION" ;; + esac :; esac } @@ -37,8 +42,14 @@ Darwin) printf '' | pbcopy" & ;; *) - sh -c "sleep ${PASSWORD_STORE_CLIP_TIME}; + case $XDG_SESSION_TYPE in + wayland) + sh -c "sleep ${PASSWORD_STORE_CLIP_TIME}; wl-copy -c " & ;; + *) + sh -c "sleep ${PASSWORD_STORE_CLIP_TIME}; printf '' | xclip -selection '$PASSWORD_STORE_X_SELECTION'" & + ;; + esac :; esac } -- cgit v1.2.3