clip-moji: add script

This commit is contained in:
Guilherme Rugai Freire 2021-08-14 12:08:50 -03:00
parent 9ce73b0201
commit 693905cb08
No known key found for this signature in database
GPG Key ID: 0F9FE41723A8A297
4 changed files with 1629 additions and 0 deletions

1
bin/clip-moji Symbolic link
View File

@ -0,0 +1 @@
../clip-moji/clip-moji.sh

8
clip-moji/README.md Normal file
View File

@ -0,0 +1,8 @@
# clip-moji
## About
a launcher to select a emoji and copy to the clipboard
## Requirements
- [rofi](https://github.com/davatorium/rofi) or [dmenu](https://tools.suckless.org/dmenu/)
- [xclip](https://github.com/astrand/xclip) or [wl-clipboard](https://github.com/bugaevc/wl-clipboard)

27
clip-moji/clip-moji.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
EMOJI_LIST="$HOME/.scripts/clip-moji/emoji-list"
if [ "$(command -v rofi)" ]; then
LAUNCHER_CMD='rofi -dmenu';
elif [ "$(command -v dmenu)" ]; then
LAUNCHER_CMD='dmenu';
else
echo 'Could not find either dmenu or rofi, exiting'
exit 1;
fi
if [ "$(command -v xclip)" ]; then
CLIPBOARD_CMD='xclip -selection clipboard';
elif [ "$(command -v wl-copy)" ]; then
CLIPBOARD_CMD='wl-copy';
else
echo 'Could not find either xclip or wl-copy, exiting'
exit 1;
fi
EMOJI=$(cut -d';' -f1 "$EMOJI_LIST" | $LAUNCHER_CMD -i | cut -d' ' -f1)
[ -z "$EMOJI" ] && exit
printf "%s" "$EMOJI" | $CLIPBOARD_CMD

1593
clip-moji/emoji-list Normal file

File diff suppressed because it is too large Load Diff