Comments (5)
Workaround:
~/content-base.sh
:
#!/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
}
~/content-to-X-clipboard.sh
:
#!/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:
Share in "share with" / "open in" dialog: ☑
Execute:
"$DATA_DIR/proots/linuxcontainers-debian-buster/run" '' '~/content-to-X-clipboard.sh'
Another Term settings quick link:
local-terminal:/opts?perm_favmgmt=false&shareable=true&charset=UTF-8&screen_cols=0&screen_rows=0&keymap=&wakelock.acquire_on_connect=true&terminal_string=xterm&perm_pluginexec=true&font_size_auto=false&wakelock.release_on_disconnect=true&execute=%22%24DATA_DIR%2Fproots%2Flinuxcontainers-debian-buster%2Frun%22%20''%20'~%2Fcontent-to-X-clipboard.sh'&name=Copy%20to%20X%20clipboard&term_compliance=ansi&terminate.on_disconnect=true
from anotherterm.
from anotherterm.
Implemented: 9178d9f
from anotherterm.
from anotherterm.
Done.
Usage of Android international keyboard input and clipboard integration:
https://github.com/green-green-avk/AnotherTerm-scripts/tree/master/Xwayland
from anotherterm.
Related Issues (20)
- MANAGE_EXTERNAL_STORAGE
- Support styled and colored underlines HOT 3
- Terminal color is too dark to see HOT 8
- Built-in command to operate android clipboard HOT 3
- With Font iconsolata not display completely HOT 3
- A mask is displayed when Returning back to terminal HOT 3
- Charset list is not displayed correctly in terminal HOT 6
- termsh cannot send cleartext http request on android 13 HOT 2
- Wayland support: missing XDG-WM-Base protocol HOT 4
- armeabi-v7a re-support HOT 8
- Weird error when trying to execute sh ./repo-linuxcontainers.sh HOT 4
- lsusb after libusb setup crashes debian bookworm root session HOT 8
- Unable to access CTAP2 device to backup in Debian PRoot HOT 6
- Text direction HOT 6
- proot ubuntu/debian unable to ssh HOT 1
- Suggestion: the selection pop-up menu in the terminal
- Non-monospace characters rendering HOT 2
- [FR] Add ability to have hook script when toggling android on screen keyboard HOT 3
- Audio Support HOT 2
- Shared Memory Error: Can't run Firefox & Falkon HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anotherterm.