Skip to content

Commit

Permalink
Merge pull request #54 from jcalado/master
Browse files Browse the repository at this point in the history
x and y arguments for positioning
  • Loading branch information
steveseguin authored Apr 30, 2021
2 parents 6af036b + bdc424f commit dd83b62
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,17 @@ var argv = require('yargs')
type: "boolean",
default: true
})
.option("x", {
describe: "Window X position",
type: "number",
})
.option("y", {
describe: "Window Y position",
type: "number",
})
.describe("help", "Show help.") // Override --help usage message.

var { width, height, url, title, pin, hwa } = argv.argv;
var { width, height, url, title, pin, hwa, x, y } = argv.argv;

if (!(url.startsWith("http"))){
url = "https://"+url.toString();
Expand Down Expand Up @@ -156,6 +164,10 @@ function createWindow (URL=url) {
},
title: currentTitle
});

if (x && y) {
mainWindow.setPosition(Math.floor(x/factor), Math.floor(y/factor))
}

mainWindow.on('close', function(e) {
e.preventDefault();
Expand Down

0 comments on commit dd83b62

Please sign in to comment.