From b363c0acab4a268c01f941fa954d0b7b5049842a Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 20 Nov 2023 23:59:38 +0100 Subject: uni: Type rune when used in GUI --- .local/bin/uni | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to '.local/bin') diff --git a/.local/bin/uni b/.local/bin/uni index 9a8d636..d0dbc36 100755 --- a/.local/bin/uni +++ b/.local/bin/uni @@ -24,5 +24,10 @@ readonly DATA="${XDG_DATA_HOME:-$HOME/.local/share}/unicode-data" opt="$(cut -d';' -f2 "$DATA" | osel)" rune="$(awk -vopt="$opt" -F';' '$2 == opt { print $1 }' "$DATA" | xargs printf)" -wl-copy -n "$rune" \ -&& notify 'Rune Copied' "The rune ‘$rune’ was copied to the clipboard" +if [ -t 2 ] +then + wl-copy -n "$rune" \ + && notify 'Rune Copied' "The rune ‘$rune’ was copied to the clipboard" +else + wtype -- "$rune" +fi -- cgit v1.2.3