dotfiles

My dotfiles: zsh, lf, sxiv, i3, ranger, mpd and more
Log | Files | Refs | Submodules | README | LICENSE

dmenuunicode (554B)


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