aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2023-12-23 11:15:09 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2023-12-23 11:15:09 -0500
commit11aef457cbe233fc0fd87e411415b3fb8fb8a900 (patch)
treef2718522cfc058f62e6dc5e0d645b94fc5f55e18
parente2083fe8d58f73a03f072eeeb6cf7f267c10735c (diff)
downloaddpw-11aef457cbe233fc0fd87e411415b3fb8fb8a900.tar.gz
dpw-11aef457cbe233fc0fd87e411415b3fb8fb8a900.tar.xz
Add support for wayland and wl-copy
-rwxr-xr-xdpw15
1 files 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
}