-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (24 loc) · 718 Bytes
/
index.js
File metadata and controls
32 lines (24 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { app, BrowserWindow } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 320,
minWidth: 340,
height: 44,
minHeight: 44,
maxHeight: 44,
frame: false,
})
win.webContents.on('select-bluetooth-device', (e, devices, cb) => {
e.preventDefault()
devices?.length && cb(devices[0].deviceId)
})
win.loadFile('src/index.html')
// win.webContents.openDevTools({ mode: 'detach' })
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => app.quit())