-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit with generator-electron
- Loading branch information
Lucas Bento
committed
Oct 24, 2017
0 parents
commit 552c77f
Showing
10 changed files
with
2,759 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{package.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) Lucas Bento <lucas.bsilva@outlook.com> (https://github.com/lucasbento) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# menubar-brightness | ||
|
||
> My wicked app | ||
|
||
## References | ||
|
||
- https://github.com/kevva/brightness | ||
- Hide dock icon as default (https://github.com/electron/electron/issues/422#issuecomment-293518966) | ||
|
||
## Dev | ||
|
||
``` | ||
$ npm install | ||
``` | ||
|
||
### Run | ||
|
||
``` | ||
$ npm start | ||
``` | ||
|
||
### Build | ||
|
||
``` | ||
$ npm run build | ||
``` | ||
|
||
Builds the app for macOS, Linux, and Windows, using [electron-packager](https://github.com/electron-userland/electron-packager). | ||
|
||
|
||
## License | ||
|
||
MIT © [Lucas Bento](https://github.com/lucasbento) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
font-family: -apple-system, 'Helvetica Neue', Helvetica, sans-serif; | ||
} | ||
|
||
header { | ||
position: absolute; | ||
width: 500px; | ||
height: 250px; | ||
top: 50%; | ||
left: 50%; | ||
margin-top: -125px; | ||
margin-left: -250px; | ||
text-align: center; | ||
} | ||
|
||
header h1 { | ||
font-size: 60px; | ||
font-weight: 100; | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Electron boilerplate</title> | ||
<link rel="stylesheet" href="index.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<header> | ||
<h1>Electron boilerplate</h1> | ||
</header> | ||
<section class="main"></section> | ||
<footer></footer> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
const electron = require('electron'); | ||
const menubar = require('menubar'); | ||
|
||
const app = electron.app; | ||
const menu = menubar(); | ||
|
||
// adds debug features like hotkeys for triggering dev tools and reload | ||
require('electron-debug')(); | ||
|
||
// prevent window being garbage collected | ||
let mainWindow; | ||
|
||
function onClosed() { | ||
// dereference the window | ||
// for multiple windows store them in an array | ||
mainWindow = null; | ||
} | ||
|
||
function createMainWindow() { | ||
menu.app.on('closed', onClosed); | ||
|
||
return menu.app; | ||
} | ||
|
||
menu.app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
menu.app.on('activate', () => { | ||
if (!mainWindow) { | ||
mainWindow = createMainWindow(); | ||
} | ||
}); | ||
|
||
menu.app.on('ready', () => { | ||
mainWindow = createMainWindow(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "menubar-brightness", | ||
"productName": "MenubarBrightness", | ||
"version": "0.0.0", | ||
"description": "My wicked app", | ||
"license": "MIT", | ||
"repository": "lucasbento/menubar-brightness", | ||
"author": { | ||
"name": "Lucas Bento", | ||
"email": "lucas.bsilva@outlook.com", | ||
"url": "github.com/lucasbento" | ||
}, | ||
"scripts": { | ||
"test": "xo", | ||
"start": "electron .", | ||
"build": "electron-packager . --out=dist --asar --overwrite --all" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.html", | ||
"index.css" | ||
], | ||
"keywords": [ | ||
"electron-app", | ||
"electron" | ||
], | ||
"dependencies": { | ||
"electron-debug": "^1.0.0", | ||
"menubar": "^5.2.3" | ||
}, | ||
"devDependencies": { | ||
"devtron": "^1.1.0", | ||
"electron": "^1.3.3", | ||
"electron-packager": "^8.0.0", | ||
"xo": "^0.16.0" | ||
}, | ||
"xo": { | ||
"esnext": true, | ||
"envs": [ | ||
"node", | ||
"browser" | ||
] | ||
} | ||
} |
Oops, something went wrong.