modified emoji-picker script to use notify-send
This commit is contained in:
parent
7f93cea6e3
commit
26f0335da8
|
@ -11,15 +11,15 @@
|
||||||
|
|
||||||
# Check if emoji files are installed, if not pull from remote
|
# Check if emoji files are installed, if not pull from remote
|
||||||
if [ ! -f "$emoji_file" ] || [ ! -f "$nerdfont_file" ]; then
|
if [ ! -f "$emoji_file" ] || [ ! -f "$nerdfont_file" ]; then
|
||||||
echo "Symbol files not found. Fetching from: '$remote'..."
|
notify-send "Emoji Picker" "Symbol files not found. Fetching from: '$remote'..."
|
||||||
mkdir -p "$symbols_dir"
|
mkdir -p "$symbols_dir"
|
||||||
git clone "$remote" "$symbols_dir"
|
git clone "$remote" "$symbols_dir"
|
||||||
[ "$?" != 0 ] && echo "Error fetching from: $remote" && exit 1
|
[ "$?" != 0 ] && notify-send "Emoji Picker" "Error fetching from: $remote" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Concat all emoji files and pipe into dmenu. Remove empty rows with sed. Exit if invalid selection.
|
# Concat all emoji files and pipe into dmenu. Remove empty rows with sed. Exit if invalid selection.
|
||||||
emoji_row=$(cat "$recent" "$emoji_file" "$nerdfont_file" | sed '/^$/d' | dmenu -l 20)
|
emoji_row=$(cat "$recent" "$emoji_file" "$nerdfont_file" | sed '/^$/d' | dmenu -l 20)
|
||||||
[ "$emoji_row" == "**** Recent ****" ] || [ "$emoji_row" == "****************" ] && echo "Invalid selection." && exit 1
|
[ "$emoji_row" == "**** Recent ****" ] || [ "$emoji_row" == "****************" ] && notify-send "Emoji Picker" "Invalid selection." && exit 1
|
||||||
|
|
||||||
# Add selected emoji to recent.
|
# Add selected emoji to recent.
|
||||||
sed -i "/$emoji_row/d" "$recent" && sed -i "2s/^/$emoji_row\n/" "$recent"
|
sed -i "/$emoji_row/d" "$recent" && sed -i "2s/^/$emoji_row\n/" "$recent"
|
||||||
|
|
Loading…
Reference in New Issue