Skip to content

Commit

Permalink
In hindsight, keep OSX locking available
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinista committed Feb 2, 2021
1 parent c014ce8 commit 3f7485d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "git://github.com/muffinista/before-dawn.git"
},
"dependencies": {
"@muffinista/goto-sleep": "^0.0.2",
"@muffinista/goto-sleep": "^0.0.3",
"@sentry/electron": "^2.0.0",
"async-mutex": "^0.2.2",
"auto-launch": "^5.0.5",
Expand Down
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ var runScreenSaver = function() {
var shouldLockScreen = function() {
// we can't lock the screen on OSX because it would involve using
// private APIs and is a super pain in the butt
return ( process.platform !== "darwin" && prefs.lock === true );
return ( prefs.lock === true );
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/screen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";

const gotoSleep = require("@muffinista/goto-sleep");
exports.doLockScreen = gotoSleep.lockSystem;
exports.doLockScreen = gotoSleep.lockScreen;
exports.doSleep = gotoSleep.gotoSleep;
37 changes: 29 additions & 8 deletions src/renderer/components/PrefsForm.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<template>
<div id="prefs-form">
<h1>Settings</h1>
<form v-on="$listeners" class="grid">
<form
class="grid"
v-on="$listeners"
>
<div class="options">
<div class="form-check hide-on-darwin">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" id="lock" class="form-check-input" v-model="prefs.lock" />
<input
id="lock"
v-model="prefs.lock"
type="checkbox"
class="form-check-input"
>
Lock screen after running?
</label>
<small class="form-text text-muted">
Expand All @@ -15,7 +23,12 @@

<div class="form-check">
<label class="form-check-label">
<input type="checkbox" id="disableOnBattery" class="form-check-input" v-model="prefs.disableOnBattery" />
<input
id="disableOnBattery"
v-model="prefs.disableOnBattery"
type="checkbox"
class="form-check-input"
>
Disable when on battery?
</label>
<small class="form-text text-muted">
Expand All @@ -28,7 +41,11 @@
<!-- ' -->
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" v-model="prefs.auto_start" />
<input
v-model="prefs.auto_start"
type="checkbox"
class="form-check-input"
>
Auto start on login?
</label>
<small class="form-text text-muted">
Expand All @@ -38,8 +55,12 @@

<div class="form-check">
<label class="form-check-label">
<input type="checkbox" id="primary-display" class="form-check-input"
v-model="prefs.runOnSingleDisplay" />
<input
id="primary-display"
v-model="prefs.runOnSingleDisplay"
type="checkbox"
class="form-check-input"
>
Only run on the primary display?
</label>
<small class="form-text text-muted">
Expand All @@ -53,7 +74,7 @@

<script>
export default {
name: "prefs-form",
name: "PrefsForm",
components: {},
props: ["prefs"],
methods: {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -904,10 +904,10 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==

"@muffinista/goto-sleep@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@muffinista/goto-sleep/-/goto-sleep-0.0.2.tgz#e3e0933b8915604c096e966c6e8f5941534ecf18"
integrity sha512-46CfSDPaD8wO/gMsZEKkT1iTD4U+wZXPe8dEVyT5Ms0H6DZMgHbjIf3TMhsl5GHI10C3UuqVTSGWZFIHQ9KDkQ==
"@muffinista/goto-sleep@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@muffinista/goto-sleep/-/goto-sleep-0.0.3.tgz#d1c31937cccb64500b9f41928507bdaf97614ac9"
integrity sha512-ZL1FTIrzCSZoV73Q/AlSstZzWOb3IhL5o6J4kx0ErbszbQCOrpZ9phv+cfBcrblVaorotMwjg5yofKCqO0SuQQ==
dependencies:
bindings "^1.5.0"
nan "^2.14.0"
Expand Down

0 comments on commit 3f7485d

Please sign in to comment.