dm-unicode-icons.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. # The famous "get a menu of emojis to copy" script.
  3. # Colors:
  4. # Materia Manjaro
  5. nf='#09dbc9'
  6. nb='#222b2e'
  7. sf='#dbdcd5'
  8. sb='#009185'
  9. fn='Iosevka-16:normal'
  10. # fn='Ubuntu-16:normal'
  11. # Gruvbox
  12. # nf='#fea63c'
  13. # nb='#282828'
  14. # # sf='#dbdcd5'
  15. # sb='#d79921'
  16. # fn='Sarasa Mono SC Nerd-17:normal'
  17. DMENU="dmenu -i -l 10 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p"
  18. # Get user selection via dmenu from emoji file.
  19. chosen=$(cut -d ';' -f1 ~/.myScripts/dmscripts/emoji | ${DMENU} 'Choose an icon:' | awk '{print $1}')
  20. # chosen=$(cut -d ';' -f1 ~/.myScripts/dmscripts/emoji | dmenu -l 20 -nf ${nf} -nb ${nb} -sf ${sf} -sb ${sb} -fn ${fn} -p 'Choose an icon:' | awk '{print $1}')
  21. # Exit if none chosen.
  22. [ -z "$chosen" ] && exit
  23. # If you run this command with an argument, it will automatically insert the
  24. # character. Otherwise, show a message that the emoji has been copied.
  25. if [ -n "$1" ]; then
  26. xdotool type "$chosen"
  27. else
  28. printf "$chosen" | xclip -selection clipboard
  29. notify-send "'$chosen' copied to clipboard." &
  30. fi