dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

dmenuunicode (564B)


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