summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-20 23:59:38 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-20 23:59:38 +0100
commitb363c0acab4a268c01f941fa954d0b7b5049842a (patch)
treeb348aab317341cac948d6b0c14c241176bbe16e7 /.local
parentdd96f6351926d767ec06ca2d3ad73d6297150a30 (diff)
uni: Type rune when used in GUI
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/uni9
1 files changed, 7 insertions, 2 deletions
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