dmenuunicode.sh 540 B

12345678910111213141516171819
  1. #!/bin/sh
  2. # The famous "get a menu of emojis to copy" script.
  3. # Get user selection via dmenu from emoji file.
  4. chosen=$(cut -d ';' -f1 ~/.emoji.txt | dmenu -i -l 30 | sed "s/ .*//")
  5. # Exit if none chosen.
  6. [ -z "$chosen" ] && exit
  7. # If you run this command with an argument, it will automatically insert the
  8. # character. Otherwise, show a message that the emoji has been copied.
  9. if [ -n "$1" ]; then
  10. xdotool type "$chosen"
  11. else
  12. echo "$chosen" | tr -d '\n' | xclip -selection clipboard
  13. notify-send "'$chosen' copied to clipboard." &
  14. fi