diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-11-20 23:59:38 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-11-20 23:59:38 +0100 |
commit | b363c0acab4a268c01f941fa954d0b7b5049842a (patch) | |
tree | b348aab317341cac948d6b0c14c241176bbe16e7 /.local | |
parent | dd96f6351926d767ec06ca2d3ad73d6297150a30 (diff) |
uni: Type rune when used in GUI
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/uni | 9 |
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 |