1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-22 10:01:27 +03:00

Add wayland support to stealth-mode

This commit is contained in:
Scott Little 2021-04-23 14:10:48 -05:00
parent b071e17ecc
commit 064eacf513

View File

@ -686,7 +686,11 @@ cmd_stealth() {
if [ "$is_macos" = yes ]; then
past=$(pbpaste)
else
past=$(xsel -o)
if [ "$XDG_SESSION_TYPE" = wayland ]; then
past=$(xl-paste -p)
else
past=$(xsel -o)
fi
fi
printf "\033[0;31mstealth:\033[0m you are in the stealth mode; select any text in any window for a query\n"
printf "\033[0;31mstealth:\033[0m selections longer than $STEALTH_MAX_SELECTION_LENGTH words are ignored\n"
@ -698,7 +702,11 @@ cmd_stealth() {
if [ "$is_macos" = yes ]; then
current=$(pbpaste)
else
current=$(xsel -o)
if [ "$XDG_SESSION_TYPE" = wayland ]; then
current=$(wl-paste -p)
else
current=$(xsel -o)
fi
fi
if [ "$past" != "$current" ]; then
past=$current