Skip to content

Commit

Permalink
- Prepared configs for packaging
Browse files Browse the repository at this point in the history
- Updated README
- Minor fixes for packaging
  • Loading branch information
OzymandiasTheGreat committed Feb 15, 2020
1 parent 225d15d commit c8da929
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 90 deletions.
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
# Emoji keyboard

Virtual keyboard-like emoji picker for Linux.
Virtual keyboard-like emoji palette for Linux.

Emoji artwork and metadata provided by [Emoji Two](https://emojitwo.github.io/)
by [Ranks.com](http://www.ranks.com/) and is licensed under
[CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode).
Emoji support on Linux is shaky at best. Modern distributions finally support
displaying color emoji, but using emoji is inconsistent and inconvenient.

Additional artwork provided by
[Twitter Emoji](https://github.com/twitter/twemoji)
([CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode)) and
[Noto Emoji](https://github.com/googlei18n/noto-emoji)
([Apache 2.0](https://github.com/googlei18n/noto-emoji/blob/master/LICENSE)).
Enter `emoji-keyboard`! Press a hotkey (default `Ctrl+Super+Space`) or choose `Palette`
from app indicator and an emoji palette opens. Then just click on emoji you want to use
and watch them appear in the active application!

## Installation
> **Tip:** hold shift when using the terminal and you can type emoji into the terminal
> **Tip:** you can choose to copy emoji into the clipboard instead in the `Preferences`
Easy.

You can install emoji keyboard from [pypi](https://pypi.org/project/emoji-keyboard).
Not sure which emoji to use? Press `Ctrl+Super+F` or choose `Search` from app indicator
and you can search emoji by name, short code or emoticon.

First you need pip and pygobject bindings, on Debian based distros you can get them with:
> **Tip:** don't want to use mouse after searching? Press up/down arrows and `Enter` to type
```sudo apt install python3-pip python3-gi gir1.2-gtk-3.0 gir1.2-glib-2.0```
Got emoji you use frequently? Memorize short code (you can see it when hovering emoji
in the palette) and then just type it and watch it be replaced by the emoji.

Next run this command (on other distros it may just be `pip` depending on how you installed pip):
> **Tip:** you can disable this feature in `Preferences`. It doesn't play well with Firefox
```pip3 install --user https://github.com/OzymandiasTheGreat/emoji-keyboard/archive/master.zip```
And of course there's eye-candy. Choose emoji set you prefer or app and panel themes to match your system.

Now start the indicator by running `emoji-keyboard` and start typing those emoji!
## Credits and License

## Usage
`emoji-keyboard` is release under GPLv3 or later license.

### Keyboard
© 2020 [Ozymandias (Tomas Ravinskas)](mailto:[email protected])

Selecting `Show Keyboard` from the app indicator menu or, if your desktop
environment supports it, middle-clicking app indicator will toggle the visibility
of the keyboard. When the picker is visible simply clicking on emoji will type it
into focused application.
Emoji artwork and metadata provided by:

### Search
[Blobmoji](https://github.com/c1710/blobmoji) by Google Inc. and is licensed under [Apache-2.0](https://github.com/C1710/blobmoji/blob/master/LICENSE)

You can search by official unicode name or by :shortname:.
Pressing `enter` will select and type the first result.
[Emoji Two](https://emojitwo.github.io/) by [Ranks.com](http://www.ranks.com/) and is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode).

### Hotkeys
[Noto emoji](https://github.com/googlefonts/noto-emoji) by Google Inc. and is licensed under [Apache-2.0](https://github.com/googlefonts/noto-emoji/blob/master/LICENSE)

`emoji-keyboard` can be controlled from the command line. Use your desktop's
native hotkey utility to assign hotkeys to
[Twemoji](https://github.com/twitter/twemoji) by [Twitter](https://twemoji.twitter.com/) and is licensed under [CC-BY-4.0](https://github.com/twitter/twemoji/blob/master/LICENSE-GRAPHICS)

`emoji-keyboard -k` to toggle visibility of the keyboard,
[Openmoji](https://github.com/hfg-gmuend/openmoji) by [openmoji.org](https://openmoji.org/about/#team) and is licensed under [CC-BY-SA-4.0](https://creativecommons.org/licenses/by-sa/4.0/)

## Installation

`emoji-keyboard -s` to toggle visibility of the search window.
Grab AppImage from [releases page](https://github.com/OzymandiasTheGreat/emoji-keyboard/releases) and just run it!

Run `emoji-keyboard -h` in the terminal to get full list of commands.
## Feedback is always WELCOME
9 changes: 2 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"options": {
"outputPath": "dist",
"outputPath": "dist/angular/",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
"src/favicon.png",
"src/favicon.icns",
"src/favicon.256x256.png",
"src/favicon.512x512.png"
{ "glob": "**/*", "input": "src/assets/", "output": "/assets/" }
],
"styles": [
"node_modules/spinkit/spinkit.min.css",
Expand Down
68 changes: 48 additions & 20 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
{
"productName": "angular-electron",
"appId": "tk.ozymandias.emoji-keyboard",
"productName": "emoji-keyboard",
"copyright": "© 2020 ${author}",
"directories": {
"output": "release/"
"buildResources": "dist/resources",
"output": "dist/release/"
},
"files": [
"**/*",
"!**/*.ts",
"!*.code-workspace",
"!LICENSE.md",
"!package.json",
"!package-lock.json",
"!src/",
"!e2e/",
"!hooks/",
"!angular.json",
"!_config.yml",
"!karma.conf.js",
"!tsconfig.json",
"!tslint.json"
],
"electronDownload": {
"version": "8.0.1"
},
"nodeVersion": "${current}",
"files": [
"**/*",
"!**/*.ts",
"!**/*.py",
"!.*",
"!*.json",
"!*.md",
"!*.code-workspace",
"!*.webpack.*",
"!LICENSE",
"!package.json",
"!package-lock.json",
"!pyproject.toml",
"!poetry.lock",
"!src",
"!src_py",
"!.venv",
"!scripts",
"!sources",
"!karma.conf.js",
"!.vscode"
],
"win": {
"icon": "dist",
"target": [
Expand All @@ -32,9 +45,24 @@
]
},
"linux": {
"icon": "dist",
"icon": "dist/resources/icon",
"category": "Utility",
"target": [
"AppImage"
]
}
},
"appImage": {
"license": "LICENSE"
},
"extraResources": [
{
"from": "dist/resources/main.pyz",
"to": "main.pyz"
}
],
"asar": true,
"asarUnpack": [
"dist/angular/assets/data/emoji.json",
"dist/angular/assets/data/default.ini"
]
}
25 changes: 14 additions & 11 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as PKG from "./package.json";

const DEV = process.argv.includes("--dev");
const SHELL = new PythonShell(
DEV ? "./main.py" : "emoji_keyboard.pyz",
app.isPackaged ? path.resolve(process.resourcesPath, "main.pyz") : "main.py",
{
mode: "json",
pythonOptions: [ "-u" ],
Expand All @@ -20,6 +20,11 @@ let MAIN_WINDOW: BrowserWindow = null;
let PANEL_THEME = "dark";


function getAsset(assetPath: string): string {
return path.resolve(app.getAppPath(), app.isPackaged ? "dist/angular/assets" : "src/assets", assetPath);
}


function createIndicator(): Tray {
const menu = Menu.buildFromTemplate([
{ id: "palette", label: "Palette", click() {
Expand Down Expand Up @@ -64,16 +69,14 @@ function createIndicator(): Tray {
{ id: "about", label: "About", click() { app.showAboutPanel(); } },
{ id: "quit", label: "Quit", role: "quit" },
]);
INDICATOR = new Tray(`./src/assets/icons/icon-${PANEL_THEME}-48.png`) // TODO
INDICATOR = new Tray(getAsset(`icons/icon-${PANEL_THEME}-16.png`));
INDICATOR.setContextMenu(menu);
return INDICATOR;
}


function createWindow(): BrowserWindow {

let res: Promise<void>;
// Create the browser MAIN_WINDOWdow.
MAIN_WINDOW = new BrowserWindow({
width: 490,
height: 330,
Expand All @@ -84,25 +87,25 @@ function createWindow(): BrowserWindow {
// alwaysOnTop: true, // ALSO NOT IMPLEMENTED ON LINUX
fullscreenable: false,
title: PKG.name.split("-").map((w) => w.slice(0, 1).toUpperCase() + w.slice(1)).join(" "),
icon: "./src/assets/icons/icon-48.png", // TODO
icon: getAsset("icons/icon-48.png"),
show: false,
frame: false,
// backgroundColor: "", // TODO Theming
webPreferences: {
nodeIntegration: true,
preload: path.resolve(__dirname, "preload.js"),
preload: path.resolve(app.getAppPath(), "preload.js"),
allowRunningInsecureContent: (DEV) ? true : false,
},
});

if (DEV) {
require('electron-reload')(__dirname, {
electron: require(`${__dirname}/node_modules/electron`)
require('electron-reload')(app.getAppPath(), {
electron: require(`${app.getAppPath()}/node_modules/electron`)
});
MAIN_WINDOW.loadURL('http://localhost:4200');
} else {
MAIN_WINDOW.loadURL(url.format({
pathname: path.join(__dirname, "dist/index.html"),
pathname: getAsset("../index.html"),
protocol: 'file:',
slashes: true,
}));
Expand Down Expand Up @@ -130,7 +133,7 @@ app.setAboutPanelOptions({
credits: `${PKG.author.name} <${PKG.author.email}>`,
authors: [`${PKG.author.name} <${PKG.author.email}>`],
website: PKG.homepage,
iconPath: "./src/assets/icons/icon.svg",
iconPath: getAsset("icons/icon.svg"),
});
app.on("ready", () => {
createIndicator();
Expand All @@ -150,7 +153,7 @@ ipcMain.on("python", (event, msg) => {
SHELL.send(msg);
});
ipcMain.on("indicator", (event, theme) => {
INDICATOR.setImage(`./src/assets/icons/icon-${theme}-48.png`);
INDICATOR.setImage(`src/assets/icons/icon-${theme}-48.png`);
});
SHELL.on("message", (msg) => {
if (MAIN_WINDOW) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "emoji-keyboard",
"version": "3.0.0",
"description": "Virtual keyboard-like emoji palette",
"version": "3.0.0rc0",
"description": "Type emoji easily! Virtual keyboard-like emoji palette for Linux with lots of features.",
"homepage": "https://github.com/OzymandiasTheGreat/emoji-keyboard",
"repository": "https://github.com/OzymandiasTheGreat/emoji-keyboard",
"author": {
"name": "Ozymandias (Tomas Ravinskas)",
"email": "[email protected]"
Expand Down Expand Up @@ -90,7 +91,6 @@
"@mdi/font": "4.9.95",
"custom-electron-titlebar": "3.2.2-hotfix62",
"ini": "1.3.5",
"interactjs": "1.8.4",
"object-observer": "2.5.2",
"python-shell": "1.0.8",
"spinkit": "2.0.1",
Expand Down
Loading

0 comments on commit c8da929

Please sign in to comment.