Skip to content

Commit 553cdfc

Browse files
author
hamizmz
committed
Initial Fork 🍔
1 parent f5834ee commit 553cdfc

File tree

5 files changed

+64
-166
lines changed

5 files changed

+64
-166
lines changed

index.js

Lines changed: 31 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,31 @@
1-
var menubar = require('menubar')
2-
var ipc = require('electron').ipcMain
3-
var globalShortcut = require('electron').globalShortcut
4-
var mb = menubar({ dir: __dirname + '/app', width: 440, height: 230, icon: __dirname + '/app/Icon-Template.png', preloadWindow: true, windowPosition: 'topRight' })
5-
var Menu = require('electron').Menu
6-
7-
mb.on('show', function () {
8-
mb.window.webContents.send('show')
9-
})
10-
11-
mb.app.on('will-quit', function () {
12-
globalShortcut.unregisterAll()
13-
})
14-
15-
mb.app.on('activate', function () {
16-
mb.showWindow()
17-
})
18-
19-
// when receive the abort message, close the app
20-
ipc.on('abort', function () {
21-
mb.hideWindow()
22-
})
23-
24-
// when receive the abort message, close the app
25-
ipc.on('update-preference', function (evt, pref, initialization) {
26-
registerShortcut(pref['open-window-shortcut'], initialization)
27-
})
28-
29-
var template = [
30-
{
31-
label: 'Mojibar',
32-
submenu: [
33-
{
34-
label: 'Undo',
35-
accelerator: 'Command+Z',
36-
selector: 'undo:'
37-
},
38-
{
39-
label: 'Redo',
40-
accelerator: 'Shift+Command+Z',
41-
selector: 'redo:'
42-
},
43-
{
44-
label: 'Cut',
45-
accelerator: 'Command+X',
46-
selector: 'cut:'
47-
},
48-
{
49-
label: 'Copy',
50-
accelerator: 'Command+C',
51-
selector: 'copy:'
52-
},
53-
{
54-
label: 'Paste',
55-
accelerator: 'Command+V',
56-
selector: 'paste:'
57-
},
58-
{
59-
label: 'Select All',
60-
accelerator: 'Command+A',
61-
selector: 'selectAll:'
62-
},
63-
{
64-
label: 'Reload',
65-
accelerator: 'CmdOrCtrl+R',
66-
click: function (item, focusedWindow) { if (focusedWindow) focusedWindow.reload() }
67-
},
68-
{
69-
label: 'Preference',
70-
accelerator: 'Command+,',
71-
click: function () { mb.window.webContents.send('open-preference') }
72-
},
73-
{
74-
label: 'Quit App',
75-
accelerator: 'Command+Q',
76-
selector: 'terminate:'
77-
},
78-
{
79-
label: 'Toggle DevTools',
80-
accelerator: 'Alt+Command+I',
81-
click: function () { mb.window.toggleDevTools() }
82-
}
83-
]
84-
}
85-
]
86-
87-
mb.on('ready', function ready () {
88-
// Build default menu for text editing and devtools. (gone since electron 0.25.2)
89-
var menu = Menu.buildFromTemplate(template)
90-
Menu.setApplicationMenu(menu)
91-
})
92-
93-
// Register a shortcut listener.
94-
var registerShortcut = function (keybinding, initialization) {
95-
globalShortcut.unregisterAll()
96-
97-
try {
98-
var ret = globalShortcut.register(keybinding, function () {
99-
mb.window.isVisible() ? mb.hideWindow() : mb.showWindow()
100-
})
101-
} catch (err) {
102-
mb.window.webContents.send('preference-updated', false, initialization)
103-
}
104-
105-
if (ret) {
106-
mb.window.webContents.send('preference-updated', true, initialization)
107-
}
108-
}
1+
'use strict';
2+
3+
const electron = require('electron');
4+
const app = electron.app;
5+
const WIDTH = 460;
6+
const HEIGHT = 540;
7+
8+
var _window = null;
9+
10+
/*
11+
WINDOW JUNK
12+
*/
13+
app.on('window-all-closed', function() {
14+
// On OS X, we don't quit the program when all windows are closed (usually)
15+
if (process.platform != 'darwin')
16+
app.quit();
17+
});
18+
19+
app.on('ready', function() {
20+
_window = new electron.BrowserWindow({
21+
"width": WIDTH,
22+
"height": HEIGHT
23+
});
24+
_window.setMenuBarVisibility(false);
25+
_window.loadURL('file://' + __dirname + '/app/index.html');
26+
27+
// CLEAN-UP Window
28+
_window.on('closed', function() {
29+
_window = null;
30+
});
31+
});

install-desktop-linux

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
npm install
4+
dir=$(pwd)
5+
file=/usr/share/applications/mojibar.desktop
6+
7+
touch $file
8+
cat <<EOM >> $file
9+
[Desktop Entry]
10+
Version=1.0
11+
Name=mojibar
12+
Comment=A thing to do stuff
13+
Exec=$dir/run
14+
Path=$dir
15+
Icon=$dir/mojibar.png
16+
Terminal=false
17+
Type=Application
18+
Categories=Utility;Application;Internet;
19+
EOM

readme.md

Lines changed: 11 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,24 @@
11
# Mojibar [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
22

3-
A menubar app adaptation of [Emoji searcher](http://emoji.muan.co).
3+
A linux desktop app adapation of [a menubar app](https://github.com/muan/mojibar)
4+
which is an adaptation of [Emoji searcher](http://emoji.muan.co).
45

5-
![screenshot](https://cloud.githubusercontent.com/assets/1153134/12583324/7756a38a-c485-11e5-9388-3b5c61743905.gif)
6+
![screenshot](./screenshot.png)
67

7-
## Install
8+
## INSTALL
89

9-
#### :triangular_flag_on_post: Download and drag
10-
11-
[Download the latest version for Mac on the releases page](https://github.com/muan/mojibar/releases) (and drag into your apps folder.)
12-
13-
#### :triangular_flag_on_post: Install using [Homebrew Cask](http://caskroom.io/)
10+
NOTE: Requires electron in order to run:
1411

1512
```
16-
$ brew cask install mojibar
13+
$ npm install -g electron # That should do the trick!
1714
```
1815

19-
#### :triangular_flag_on_post: Launch Mojibar
20-
21-
Go into your apps folder and select Mojibar (Mac shortcut: use command-space bar, then type Mojibar in the spotlight search field). Mojibar will display in the menubar at the top right corner of your screen.
22-
23-
## Usage
24-
25-
<kbd>control + shift + space</kbd><br>
26-
Open app.
27-
28-
<kbd>command + ,</kbd><br>
29-
Open preference (while window is open).
30-
31-
<kbd>👆/👇/👈/👉</kbd><br>
32-
Navigate between emojis.
33-
34-
<kbd>enter</kbd><br>
35-
Copy emoji unicode char and exit. For example: `💩`.
36-
37-
<kbd>shift + enter</kbd><br>
38-
Copy emoji code and exit. For example: `:poop:`.
39-
40-
<kbd>space</kbd><br>
41-
Next page.
42-
43-
<kbd>shift + space</kbd><br>
44-
Previous page.
45-
46-
<kbd>/</kbd><br>
47-
Jump to the search field.
48-
49-
<kbd>esc</kbd><br>
50-
Exit.
51-
52-
<kbd>command + q</kbd><br>
53-
Quit Mojibar (while window is open).
54-
55-
## Build
56-
57-
:construction:
58-
5916
```
60-
$ git clone https://github.com/muan/mojibar.git
61-
$ cd mojibar
62-
$ npm install
63-
$ npm start
17+
$ git clone https://github.com/coffee-n-code/mojibar.git && cd mojibar
6418
```
6519

66-
## Built with
67-
68-
- [maxogden/menubar](https://github.com/maxogden/menubar)
69-
- [muan/emojilib](https://github.com/muan/emojilib)
20+
```
21+
$ sudo ./install-desktop-linux
22+
```
7023

71-
## :heart:
24+
## :heart:

run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
electron .

screenshot.png

201 KB
Loading

0 commit comments

Comments
 (0)