echo"Detected X11, but xsel or xclip are not installed."
fi
elif(( -n {WAYLAND_DISPLAY}));then
if(( $+commands[wl-copy]));then
command wl-copy $@
else
echo"Detected Wayland, but wl-copy is not installed."
fi
elif(( -n {SSH_CONNECTION}));then
if(( $+commands[lemonade]));then
command lemonade copy $@
else
echo"Detected an SSH connection, but lemonade is not installed."
fi
else
echo"Cannot determine desktop session type, are you running a display server that is not X11 or Wayland?"
fi
}
function zipline {
# see spectacle-screenshot for example usage
readonlyfile=${1:?Please provide the path to the file you want to upload.}
readonlyname=${2:?Please provide an application name to use in notify-send.}
readonlydesktopentry=${3:?Please provide a path to a desktop entry file.}
readonlytoken=${ZIPLINE_TOKEN:?Environment variable ZIPLINE_TOKEN is not set. Please set it to your Zipline API token. I recommend placing it in a file at ~/.config/environment.d/zipline.conf}
readonlyurl=${ZIPLINE_URL:?Environment variable ZIPLINE_URL is not set. Please set it to the URL of your Zipline instance. I recommend placing it in a file at ~/.config/environment.d/zipline.conf}
temp_file=$(mktemp)
trap'rm -f "$temp_file"' EXIT
if(( ! $+commands[jq]));then
echo"jq is not installed."
return1
fi
if(( ! $+commands[curl]));then
echo"curl is not installed."
return1
fi
if(( ! $+commands[notify-send]));then
echo"notify-send is not installed."
return1
fi
if[[ ! -f "${file}"]];then
echo"File does not exist."
return1
fi
if ! does-desktop-entry-exist "$desktopentry";then