Feat: Add tofi support (#7)

This commit is contained in:
Pablo Alessandro Santos Hugen 2024-03-21 16:15:38 -03:00 committed by GitHub
parent 7bf3afa284
commit e848c81297
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

5
README
View file

@ -6,7 +6,7 @@ demo: https://asciinema.org/a/525695
$ shmoji -h $ shmoji -h
usage: [download | bemenu | dmenu | rofi | wmenu | fzf] usage: [download | bemenu | dmenu | rofi | tofi | wmenu | fzf]
examples: examples:
# download emojis # download emojis
@ -27,6 +27,9 @@ examples:
# launch shmoji with wofi # launch shmoji with wofi
shmoji wofi shmoji wofi
# launch shmoji with tofi
shmoji tofi
# launch shmoji with fzf # launch shmoji with fzf
shmoji fzf shmoji fzf

11
shmoji
View file

@ -8,7 +8,8 @@
# - shmoji bemenu: bemenu & wtype # - shmoji bemenu: bemenu & wtype
# - shmoji dmenu: dmenu-wl # - shmoji dmenu: dmenu-wl
# - shmoji rofi: rofi & xdotool # - shmoji rofi: rofi & xdotool
# - shmoji rofi: wofi & wl-copy # - shmoji wofi: wofi & wl-copy
# - shmoji tofi: tofi & wl-copy
set -e set -e
@ -74,6 +75,12 @@ case "$cmd" in
emoji=$(cat "$emojifile" | wofi -dS dmenu | cut -d " " -f 1 | tr -d '\n') emoji=$(cat "$emojifile" | wofi -dS dmenu | cut -d " " -f 1 | tr -d '\n')
[ "$emoji" ] && wl-copy $emoji [ "$emoji" ] && wl-copy $emoji
;; ;;
tofi)
emojicheck
depends tofi wl-copy
emoji=$(cat "$emojifile" | tofi --prompt-text "Emoji: " | cut -d " " -f 1 | tr -d '\n')
[ "$emoji" ] && wl-copy $emoji
;;
fzf) fzf)
emojicheck emojicheck
depends fzf depends fzf
@ -81,7 +88,7 @@ case "$cmd" in
emojiprint "$emoji" emojiprint "$emoji"
;; ;;
*) *)
printf "%s\n" "usage: shmoji [download | bemenu | dmenu | rofi | wofi | fzf]" printf "%s\n" "usage: shmoji [download | bemenu | dmenu | rofi | wofi | tofi | fzf]"
;; ;;
esac esac