Small modifications in 'fawesome' and 'unicode' scripts

This commit is contained in:
samedamci 2020-05-11 15:24:21 +02:00
parent a87dab433c
commit 8aeb485b85
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894
2 changed files with 12 additions and 10 deletions

View File

@ -2,13 +2,14 @@
xclip -h 2>/dev/null || exit xclip -h 2>/dev/null || exit
CHOSEN=$(sed '0,/^__DATA__$/d' "$0" | rofi -dmenu -i -l 20 -p 'Font Awesome') emoji=$(sed '0,/^__DATA__$/d' "$0" | rofi -dmenu -i -l 20 -p 'Font Awesome')
[ ! "$emoji" ] && exit
[ "$CHOSEN" != "" ] || exit emoji=$(printf "%s$emoji" | sed "s/ .*//")
CHOSEN=$(printf "%s$CHOSEN" | sed "s/ .*//") echo "$emoji" | tr -d '\n' | xclip -selection clipboard
echo "$CHOSEN" | tr -d '\n' | xclip -selection clipboard
notify-send "'$CHOSEN' copied to clipboard." notify-send "'$emoji' copied to clipboard."
exit exit

View File

@ -1,16 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Give dmenu list of all unicode characters to copy. # Give dmenu list of all unicode characters to copy.
# Shows the selected character in dunst if running. # Shows the selected character in dunst if running.
xclip -h 2>/dev/null || exit xclip -h 2>/dev/null || exit
CHOSEN=$(sed '0,/^__DATA__$/d' "$0" | rofi -dmenu -i -l 20 -p 'Unicode') emoji=$(sed '0,/^__DATA__$/d' "$0" | rofi -dmenu -i -l 20 -p 'Unicode')
[ "$CHOSEN" != "" ] || exit [ ! "$emoji" ] && exit
CHOSEN=$(printf "%s$CHOSEN" | sed "s/ .*//") emoji=$(printf "%s$emoji" | sed "s/ .*//")
echo "$CHOSEN" | tr -d '\n' | xclip -selection clipboard echo "$emoji" | tr -d '\n' | xclip -selection clipboard
notify-send "'$CHOSEN' copied to clipboard." notify-send "'$emoji' copied to clipboard."
exit exit