From 6d1873b6cda79f90d2a0a29bf62141b5e4adace4 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 30 Oct 2023 00:39:26 -0700 Subject: [PATCH] Make clip alias work on wayland --- init.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.zsh b/init.zsh index 0757de8..9959226 100644 --- a/init.zsh +++ b/init.zsh @@ -44,7 +44,13 @@ SAVEHIST=10000 # Tools for graphical sessions export BROWSER=mullvad-browser export READER=zathura -alias clip="xclip -selection clipboard" +if [[ -v WAYLAND_DISPLAY ]]; then + function clip { + (( ${#} >= 1 )) && (cat "${@}" | wl-copy) || wl-copy + } +else + alias clip="xclip -selection clipboard" +fi # I mess this up a lot alias cd..="cd .."