cswimr/home
Archived
Template
1
0
Fork 0

added some echo statements in clip function

This commit is contained in:
Seaswimmer 2024-10-16 14:30:01 -04:00
parent 5f9d13f2bf
commit f22da62b82
Signed by: cswimr
GPG key ID: A9C162E867C851FA

View file

@ -1,32 +1,37 @@
function clip {
echo "clip: info: checking for clipboard manager"
if [[ $(uname) == "Darwin" ]];then
echo "Detected macOS"
command pbcopy $@
elif [[ "${XDG_SESSION_TYPE}" == "x11" ]]; then
echo "clip: info: Detected X11"
if (( $+commands[xsel] )); then
command xsel -ib $@
elif (( $+commands[xclip] )); then
command xclip $@
else
echo "Detected X11, but xsel or xclip are not installed."
echo "clip: fatal: xsel or xclip are not installed."
fi
elif [[ -n "${WAYLAND_DISPLAY}" ]]; then
echo "clip: info: Detected Wayland"
if (( $+commands[wl-copy] )); then
command wl-copy $@
else
echo "Detected Wayland, but wl-copy is not installed."
echo "clip: fatal: wl-copy is not installed."
fi
elif [[ -n "${SSH_CONNECTION}" ]]; then
echo "clip: info: Detected an SSH connection"
if (( $+commands[lemonade] )); then
command lemonade copy $@
else
echo "Detected an SSH connection, but lemonade is not installed."
echo "clip: fatal: lemonade is not installed."
fi
else
echo "Cannot determine desktop session type, are you running a display server that is not X11 or Wayland?"
echo "clip: fatal: Cannot determine desktop session type, are you running a display server that is not X11 or Wayland?"
fi
}