unicode.sh 549 B

123456789101112131415161718
  1. #!/bin/sh
  2. # Give dmenu list of all unicode characters to copy.
  3. # Shows the selected character in dunst if running.
  4. # Must have xclip installed to even show menu.
  5. xclip -h >/dev/null || exit
  6. chosen=$(grep -v "#" $HOME/.scripts/i3/emojis.txt | dmenu -i -l 20 )
  7. [ "$chosen" != "" ] || exit
  8. c=$(echo "$chosen" | sed "s/ .*//")
  9. echo "$c" | tr -d '\n' | xclip -selection clipboard
  10. notify-send "'$c' copied to clipboard." &
  11. s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}')
  12. echo "$s" | tr -d '\n' | xclip
  13. notify-send "'$s' copied to primary." &