mirror of
https://github.com/GRFreire/scripts.git
synced 2026-01-09 20:59:37 +00:00
clip-moji: add script
This commit is contained in:
parent
9ce73b0201
commit
693905cb08
1
bin/clip-moji
Symbolic link
1
bin/clip-moji
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../clip-moji/clip-moji.sh
|
||||||
8
clip-moji/README.md
Normal file
8
clip-moji/README.md
Normal 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
27
clip-moji/clip-moji.sh
Executable 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
1593
clip-moji/emoji-list
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user