Skip to content

Commit

Permalink
also copy it into the clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Dec 10, 2016
1 parent 1271d06 commit a0f9537
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -4,10 +4,14 @@ depends on:

* xdotool
* rofi
* xsel

offers you a list of all the emoji and then when you
pick one it types it into the focused input 4 u

it also now copies it to the clipboard because xdotool
doesn't support printing emoji into some windows

install it by

```sh
Expand Down
9 changes: 6 additions & 3 deletions index.js
Expand Up @@ -4,7 +4,10 @@ const exec = require('child_process').exec

exec(
`echo '${list.data.map(item => `${item[1]} ${item[2].toLowerCase()} (${item[3].replace(/\| /g, '')})`).join('\n')}' | rofi -dmenu`,
(error, choice) => error
? console.error(error)
: exec(`xdotool type ' ${choice.split(' ')[0]}'`)
(error, choice) => {
if (error) throw error
const emoji = choice.split(' ')[0]
exec(`xdotool type ' ${emoji}'`)
exec(`echo -n ${emoji} | xsel -b`)
}
)

0 comments on commit a0f9537

Please sign in to comment.