forked from GH-forks/shmoji
add fzf support, etc
This commit is contained in:
parent
0c67bb1637
commit
9376d8cdc3
2 changed files with 23 additions and 1 deletions
11
README
11
README
|
@ -10,3 +10,14 @@ examples:
|
|||
|
||||
# launch shmoji with bemenu
|
||||
shmoji bemenu
|
||||
|
||||
# launch shmoji with fzf
|
||||
shmoji fzf
|
||||
|
||||
|
||||
how do i use this in...
|
||||
sway/i3:
|
||||
bindsym $mod+Shift+o exec --no-startup-id shmoji bemenu
|
||||
|
||||
shell:
|
||||
shmoji fzf
|
||||
|
|
13
shmoji
13
shmoji
|
@ -9,7 +9,7 @@
|
|||
set -e
|
||||
|
||||
cmd="$1"
|
||||
emojidb="$HOME/.local/share/emoji-bemenu"
|
||||
emojidb="$HOME/.local/share/shmoji"
|
||||
emojifile="$emojidb/emojis.txt"
|
||||
|
||||
die() {
|
||||
|
@ -17,6 +17,10 @@ die() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
emojicheck() {
|
||||
[ -f "$emojifile" ] || die "emojis not found. try 'shmoji download'"
|
||||
}
|
||||
|
||||
case "$cmd" in
|
||||
download)
|
||||
command -v curl > /dev/null || die 'curl not found'
|
||||
|
@ -26,11 +30,18 @@ case "$cmd" in
|
|||
curl 'https://trash.j3s.sh/emojis.txt' >"$emojidb/emojis.txt"
|
||||
;;
|
||||
bemenu)
|
||||
emojicheck
|
||||
command -v bemenu > /dev/null || die 'bemenu not found'
|
||||
command -v wtype > /dev/null || die 'wtype not found'
|
||||
emoji=$(cat "$emojidb/emojis.txt" | bemenu -c -W 0.2 -l 20)
|
||||
printf "%s" "$emoji" | cut -d " " -f 1 | tr -d '\n' | wtype -
|
||||
;;
|
||||
fzf)
|
||||
emojicheck
|
||||
command -v fzf > /dev/null || die 'fzf not found'
|
||||
emoji=$(cat "$emojidb/emojis.txt" | fzf)
|
||||
printf "%s" "$emoji" | cut -d " " -f 1 | tr -d '\n'
|
||||
;;
|
||||
*)
|
||||
printf "%s\n" "usage: shmoji [bemenu | download]"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue