-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphical session clipboard support #27
Labels
Projects
Comments
Workaround:
#!/bin/bash
DOWNLOADS=~/Downloads/
XCLIPBOARD=~/Xclipboard
mkdir -p "$DOWNLOADS"
msg_err() {
echo -en '\e[1;37;41m\e[2K\n\e[2K'
echo " [ $1 ]"
echo -en '\e[2K\n\e[0m\e[2K'
}
msg_ok() {
echo -en '\e[1;37;40m\e[2K\n\e[2K [ \e[32m'
echo -n "$1"
echo -en '\e[37m ]\n\e[2K\n\e[0m\e[2K'
}
msg_wait() {
echo -en '\e[?1004h'
read -n 1 -rs -p ' *** Press any key ***'
echo -en '\e[?1004l'
}
save_uri() {
URI="$1"
if R="$(termsh copy -fu "$URI" -tp "$DOWNLOADS" 2>&1)"
then
msg_ok "[$URI] saved to [$DOWNLOADS]"
else
msg_err "Failed to save [$URI] to [$DOWNLOADS]: $R"
fi
}
send_as_text() {
URI="$1"
if R="$(termsh cat "$URI" | termsh send --text-stdin 2>&1)"
then
msg_ok "Sending [$URI]..."
else
msg_err "Failed to send [$URI]: $R"
fi
}
convert_by() {
CMD=($1)
URI="$2"
EXT="$3"
TYPE="$4"
FN="$(termsh name "$URI")"
if R="$(termsh cat "$URI" | "${CMD[@]}" | termsh send -n "${FN%.*}.$EXT" -m "$TYPE" 2>&1)"
then
msg_ok "Sending [$URI]..."
else
msg_err "Failed to convert or send [$URI]: $R"
fi
}
convert_file_by() {
CMD=($1)
CMD=("${CMD[0]}" "${CMD[@]}")
URI="$2"
EXT="$3"
TYPE="$4"
FN="$(termsh name "$URI")"
if R="$(termsh with-uris "${CMD[@]}" "$URI" | termsh send -n "${FN%.*}.$EXT" -m "$TYPE" 2>&1)"
then
msg_ok "Sending [$URI]..."
else
msg_err "Failed to convert or send [$URI]: $R"
fi
}
save_uri_to_xclipboard() {
URI="$1"
if R="$(termsh copy -fu "$URI" -tp "$XCLIPBOARD" 2>&1)"
then
msg_ok "[$URI] saved to X clipboard"
else
msg_err "Failed to save [$URI] to X clipboard: $R"
fi
}
save_text_to_xclipboard() {
TEXT="$1"
if R="$(echo -n "$TEXT" 2>&1 1>"$XCLIPBOARD")"
then
msg_ok "'$TEXT' saved to X clipboard"
else
msg_err "Failed to save '$TEXT' to X clipboard: $R"
fi
}
#!/bin/bash
. ./content-base.sh
TEXT="$INPUT_TEXT"
TEXT="${TEXT:-$INPUT_SPANNED}"
TEXT="${TEXT:=$INPUT_HTML}"
if [[ -n $TEXT ]]
then
save_text_to_xclipboard "$TEXT"
DONE=1
elif [[ -n $INPUT_URI ]]
then
save_uri_to_xclipboard "$INPUT_URI"
DONE=1
elif [[ -n $INPUT_URIS ]]
then
for URI in $INPUT_URIS
do
save_uri_to_xclipboard "$URI"
DONE=1
break
done
fi
[[ -z $DONE ]] && msg_err 'Nothing to save'
msg_wait Profile settings: "$DATA_DIR/proots/linuxcontainers-debian-buster/run" '' '~/content-to-X-clipboard.sh' Another Term settings quick link:
|
Implemented: 9178d9f |
green-green-avk
added a commit
to green-green-avk/AnotherTerm-scripts
that referenced
this issue
Feb 1, 2022
green-green-avk
added a commit
to green-green-avk/AnotherTerm-docs
that referenced
this issue
Feb 1, 2022
Done. Usage of Android international keyboard input and clipboard integration: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is it.
The text was updated successfully, but these errors were encountered: