dotfiles/.config/niri/emoji-picker.fish

17 lines
484 B
Fish
Executable file

#!/usr/bin/env fish
set -l data_path ~/.config/niri/emoji-data.txt
# read emoji data
set -l data (cat $data_path | string collect -N | string trim --right | string collect -N)
# user selects line with fuzzel
set -l line (printf "%s" $data | fuzzel --prompt=">> " --dmenu)
# get the first space-separated token
set -l emoji (string split -f1 ' ' $line)
sleep 0.15
if test -n "$emoji"
wtype "$emoji"
else
return 1
end
# wtype "gaming jacket"
# nohup wtype $emoji &>/dev/null &