-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 65d086c
Showing
12 changed files
with
2,520 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,6 @@ | ||
{ | ||
"rules": { | ||
"semi": "error", | ||
"quotes": "error" | ||
} | ||
} |
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,28 @@ | ||
name: Build / Release | ||
|
||
on: push | ||
|
||
jobs: | ||
release: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
cache: 'npm' | ||
- run: npm install | ||
- name: Build/release Electron app | ||
uses: samuelmeuli/action-electron-builder@v1 | ||
with: | ||
# GitHub token, automatically provided to the action | ||
# (No need to define this secret in the repo settings) | ||
github_token: ${{ secrets.github_token }} | ||
|
||
# If the commit is tagged with a version (e.g. "v1.0.0"), | ||
# release the app after building | ||
release: ${{ startsWith(github.ref, 'refs/tags/v') }} |
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,5 @@ | ||
{ | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
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,20 @@ | ||
Copyright (c) Zak Barbuto | ||
|
||
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,31 @@ | ||
<center> | ||
|
||
# TREMOR | ||
|
||
<img src="icon/icon.png" width="150"> | ||
|
||
### A quake-style drop-down browser you can open from anywhere | ||
|
||
## FAQ | ||
|
||
### Why? | ||
|
||
Because I wanted one and couldn't find one | ||
|
||
### How? | ||
|
||
Launch the app ``then CTRL+ALT+` `` to summon browser. Note, it opens on the monitor your cursor is on. | ||
|
||
### Can it use my normal chrome profile? | ||
|
||
Probably but I don't know how yet | ||
|
||
### Can it open an address bar instead of google search by default? | ||
|
||
Yes, I'll do it later. I made this in 30 minutes so didn't really put much thought into features. | ||
|
||
### "Tremor"? | ||
|
||
Quake -> Earthquake -> Tremors.... I dunno, you name it! | ||
|
||
</center> |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,92 @@ | ||
const { | ||
app, | ||
BrowserWindow, | ||
Tray, | ||
globalShortcut, | ||
screen, | ||
Menu, | ||
nativeImage, | ||
} = require('electron'); | ||
const { join } = require('path'); | ||
|
||
let hasWin = false; | ||
|
||
function createWindow() { | ||
const electronScreen = screen; | ||
const { x, y } = screen.getCursorScreenPoint(); | ||
// Find the display where the mouse cursor will be | ||
// const currentDisplay = screen.getDisplayNearestPoint({ x, y }); | ||
|
||
const displays = electronScreen.getAllDisplays(); | ||
const currentDisplay = screen.getDisplayNearestPoint({ x, y }); | ||
const size = currentDisplay.workAreaSize; | ||
|
||
let win = new BrowserWindow({ | ||
x: currentDisplay.bounds.x, | ||
y: 0, | ||
frame: false, | ||
width: size.width, | ||
height: size.height / 3, | ||
}); | ||
|
||
win.loadURL('https://www.google.com'); | ||
|
||
// Emitted when the window is closed. | ||
win.on('closed', (e) => { | ||
// Dereference the window object, usually you would store window | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
// win = null; | ||
hasWin = false; | ||
win = null; | ||
|
||
// Don't exit electron | ||
e.preventDefault(); | ||
}); | ||
|
||
return win; | ||
} | ||
|
||
app.whenReady().then(() => { | ||
let win; | ||
const ret = globalShortcut.register('Alt+Ctrl+`', () => { | ||
if (!hasWin) { | ||
win = createWindow(); | ||
hasWin = true; | ||
} else { | ||
win.close(); | ||
} | ||
}); | ||
|
||
const contextMenu = Menu.buildFromTemplate([ | ||
{ | ||
label: 'Exit', | ||
enabled: true, | ||
click: () => { | ||
app.quit(); | ||
}, | ||
}, | ||
]); | ||
|
||
tray = new Tray( | ||
nativeImage | ||
.createFromPath( | ||
join( | ||
__dirname, | ||
'icon', | ||
process.platform === 'win32' ? 'icon.ico' : 'icon.png' | ||
) | ||
) | ||
.resize( | ||
process.platform === 'darwin' | ||
? { width: 16, height: 16 } | ||
: { width: 128, height: 128 } | ||
) | ||
); | ||
tray.setToolTip('Tremor'); | ||
tray.setContextMenu(contextMenu); | ||
}); | ||
|
||
app.on('window-all-closed', () => { | ||
// do nothing - otherwise electron exits | ||
}); |
Oops, something went wrong.