Skip to content

Commit 7cc047b

Browse files
illyberbadfox
andauthored
🐛 Fix: unable to use clip in wayland
Co-authored-by: badfox <himesaber@qq.com>
1 parent 60b4c63 commit 7cc047b

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/utils/clipboard/linux.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,8 @@ wayland)
1111
echo >&2 "no wl-clipboard"
1212
exit 1
1313
}
14-
filePath=$(wl-copy -o 2>/dev/null | grep ^file:// | cut -c8-)
15-
if [ -z "$filePath" ]; then
16-
if
17-
wl-copy -t image/png image/png -o >"$1" 2>/dev/null
18-
then
19-
echo "$1"
20-
else
21-
rm -f "$1"
22-
echo "no image"
23-
fi
24-
else
25-
echo "$filePath"
26-
fi
14+
wl-paste > "$1" 2>/dev/null
15+
echo "$1"
2716
;;
2817
x11 | tty)
2918
# require xclip(see http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script/677212#677212)

0 commit comments

Comments
 (0)