diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..aad7b51 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# rofi-emoji + +depends on: + +* xdotool +* rofi + +offers you a list of all the emoji and then when you +pick one it types it into the focused input 4 u + +bind it to a key like + +```ini +[keybindings] +M-S-e = xdotool type $(node path/to/rofi-emoji $(node path/to/rofi-emoji | rofi -dmenu)) +``` diff --git a/index.js b/index.js new file mode 100644 index 0000000..15ab29d --- /dev/null +++ b/index.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node +const list = require('emoji.json/emoji-compact.json') +const exec = require('child_process').exec + +console.log( + process.argv[2] + ? process.argv[2].split(' ')[0] + : list.data.map(item => `${item[1]} ${item[2].toLowerCase()} (${item[3].replace(/\| /g, '')})`).join('\n') +) diff --git a/package.json b/package.json new file mode 100644 index 0000000..1a37590 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "rofi-emoji", + "version": "1.0.0", + "main": "index.js", + "author": "chee ", + "license": "MIT", + "dependencies": { + "emoji.json": "^1.2.0" + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..99b1f29 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,6 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 +emoji.json: + version "1.2.0" + resolved "https://registry.yarnpkg.com/emoji.json/-/emoji.json-1.2.0.tgz#18bed59f324818907aedc94c440595638f7f25c1" +