Skip to content

Commit

Permalink
v2.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
sidneys committed Mar 7, 2017
1 parent cdabdf6 commit cbac1b8
Show file tree
Hide file tree
Showing 24 changed files with 1,094 additions and 187 deletions.
8 changes: 7 additions & 1 deletion .editorconfig
Expand Up @@ -4,10 +4,16 @@ root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[package.json]
indent_size = 2
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,37 @@
<!--- ⬆️ Add your issue title in the "Title" field above ⬆️ -->

## 🤷🏽‍♂️ Current Behaviour
<!---
Bug Reports: Describe what currently happens.
Feature Suggestions: Describe how a feature currently works (if it exists).
-->
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

## 🎯 Expected Behaviour
<!---
Bug Reports: Describe what should have happened.
Feature Suggestions: Describe how a feature should work.
-->
At vero eos et accusam et justo duo dolores et ea rebum.

## 👟 Steps to Reproduce (S2R)
<!---
(Bug Reports only) Provide a simple set of steps for reproducing the issue.
-->
1. At vero eos et accusam,
2. justo duo dolores et ea rebum,
3. stet clita kasd gubergren,
3. no sea takimata sanctus est.

## 🏡 Environmental Context
<!---
(Bug Reports only) Provide details about where the issue occurred.
-->
**App Version**
v0.0.1
**Installation Type**
Setup
**Operating System**
Windows 10 Enterprise x64 (15042.00)


46 changes: 46 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,46 @@
<!--- ⬆️ Add your Pull Request title in the "Title" field above ⬆️ -->

## 📋 Description
<!---
Add a short description of the changes.
-->
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.

## 🗂 Type
<!---
Check all applying boxes.
-->
- [ ] 🍾 Feature
- [ ] 🚨 Bugfix
- [ ] 📒 Documentation
- [ ] 👷 Internals

## 🔥 Severity
<!---
Check one box.
-->
- [ ] 💎 Non-Breaking Changes
- [ ] 💔 Breaking Changes

## 🖥 Platforms
<!---
Check all platforms affected by the changes.
-->
- [x] 🍏 macOS
- [x] 💾 Windows
- [x] 🐧 Linux

## 🛃 Tests
<!---
Check one box.
-->
- [ ] My changes have been tested manually.
- [ ] My changes are covered by automated testing methods.

## 👨‍🎓 Miscellaneous
<!---
Check all applying boxes.
-->
- [ ] My changes follow the style guide.
- [ ] My changes require updates to the documentation.

14 changes: 7 additions & 7 deletions README.md
@@ -1,4 +1,4 @@
# Desktop Dimmer [![Beta](https://img.shields.io/badge/status-alpha-blue.svg?style=flat)]() [![travis](http://img.shields.io/travis/sidneys/desktop-dimmer.svg?style=flat)](http://travis-ci.org/sidneys/desktop-dimmer) [![appveyor](https://ci.appveyor.com/api/projects/status/oc57pq7hfslqg3ru?svg=true)](https://ci.appveyor.com/project/sidneys/desktop-dimmer) [![npm](https://img.shields.io/npm/v/desktop-dimmer.svg?style=flat)](https://npmjs.com/package/desktop-dimmer) [![dependencies](https://img.shields.io/david/sidneys/desktop-dimmer.svg?style=flat-square)](https://npmjs.com/package/desktop-dimmer) [![devDependencies](https://img.shields.io/david/dev/sidneys/desktop-dimmer.svg?style=flat-square)](https://npmjs.com/package/desktop-dimmer)
# Desktop Dimmer [![Beta](https://img.shields.io/badge/status-alpha-blue.svg?style=flat)]() [![travis](https://img.shields.io/travis/sidneys/desktop-dimmer.svg?style=flat)](https://travis-ci.org/sidneys/desktop-dimmer) [![appveyor](https://ci.appveyor.com/api/projects/status/oc57pq7hfslqg3ru?svg=true)](https://ci.appveyor.com/project/sidneys/desktop-dimmer) [![npm](https://img.shields.io/npm/v/desktop-dimmer.svg?style=flat)](https://npmjs.com/package/desktop-dimmer) [![dependencies](https://img.shields.io/david/sidneys/desktop-dimmer.svg?style=flat-square)](https://npmjs.com/package/desktop-dimmer) [![devDependencies](https://img.shields.io/david/dev/sidneys/desktop-dimmer.svg?style=flat-square)](https://npmjs.com/package/desktop-dimmer)

<p align="center">
<img height="250px" src="https://raw.githubusercontent.com/sidneys/desktop-dimmer/release/resources/graphics/icon.png"/><br><br>
Expand Down Expand Up @@ -129,14 +129,14 @@ sudo apt-get install wine mono fakeroot dpkg
The process is managed by a custom layer of node scripts and Electron-optimized configuration templates.
Completed Installation packages are deployed to [GitHub Releases](https://github.com/sidneys/desktop-dimmer/releases). Builds for all platforms and architectures take about 5 minutes.
Backed by the open-source-friendly guys at [Travis](http://travis-ci.org/) and AppVeyor](https://ci.appveyor.com/) and running [electron-packager](https://github.com/electron-userland/electron-packager) under the hood.
Backed by the open-source-friendly guys at [Travis](https://travis-ci.org/) and [AppVeyor](https://ci.appveyor.com/) and running [electron-packager](https://github.com/electron-userland/electron-packager) under the hood.

### Setup

1. [Fork](https://github.com/sidneys/desktop-dimmer/fork) the repo
2. Generate your GitHub [Personal Access Token](https://github.com/settings/tokens) using "repo" as scope. Copy it to the clipboard.
3. **macOS + Linux**
1. Sign in to [Travis](http://travis-ci.org/) using GitHub.
1. Sign in to [Travis](https://travis-ci.org/) using GitHub.
2. Open your [Travis Profile](https://travis-ci.org/profile), click "Sync Account" and wait for the process to complete.
3. Find this repository in the list, enable it and click "⚙" to open its settings.
4. Create a new Environment Variable named **GITHUB_TOKEN**. Paste your Token from step 2 as *value*.
Expand Down Expand Up @@ -171,11 +171,11 @@ Backed by the open-source-friendly guys at [Travis](http://travis-ci.org/) and A

## <a name="contribute"/></a> Contact ![Contributions Wanted](https://img.shields.io/badge/contributions-wanted-red.svg?style=flat)

* [Gitter](http://gitter.im/sidneys/desktop-dimmer) Developer Chat
* [Issues](http;//github.com/sidneys/desktop-dimmer/issues) File, track and discuss features and issues
* [Wiki](http;//github.com/sidneys/desktop-dimmer/wiki) Read or contribute to the project Wiki
* [Gitter](https://gitter.im/sidneys/desktop-dimmer) Developer Chat
* [Issues](https://github.com/sidneys/desktop-dimmer/issues) File, track and discuss features and issues
* [Wiki](https://github.com/sidneys/desktop-dimmer/wiki) Read or contribute to the project Wiki


## <a name="author"/></a> Author

[sidneys](http://sidneys.github.io) 2016
[sidneys](https://sidneys.github.io) 2016
2 changes: 2 additions & 0 deletions app/html/controller.html
Expand Up @@ -14,6 +14,8 @@

<div class="window-controls">
<a class="button settings" href="#">settings</a>
<a class="button enable" href="#">play_arrow</a>
<a class="button disable" href="#">pause</a>
<a class="button exit" href="#">close</a>
</div>
</div>
Expand Down
88 changes: 66 additions & 22 deletions app/scripts/components/application.js
Expand Up @@ -6,7 +6,6 @@
* @global
* @constant
*/
const os = require('os');
const path = require('path');
const url = require('url');
const util = require('util');
Expand All @@ -17,7 +16,8 @@ const util = require('util');
* @global
* @constant
*/
//const electron = require('electron');
const electron = require('electron');
const { systemPreferences } = electron;
const Menubar = require('menubar');


Expand All @@ -42,7 +42,6 @@ electronSettings.configure({ prettify: true });
* @global
* @constant
*/

const packageJson = require(path.join(appRootPath, 'package.json'));
const platformHelper = require(path.join(appRootPath, 'lib', 'platform-helper'));
const logger = require(path.join(appRootPath, 'lib', 'logger'))({ writeToFile: true });
Expand All @@ -62,7 +61,6 @@ const controllerUrl = url.format({
* App
* @global
*/
const appName = packageJson.name;
const appVersion = packageJson.version;

/**
Expand All @@ -87,9 +85,10 @@ const menubar = Menubar({
minHeight: 48,
minWidth: 256,
preloadWindow: true,
resizable: false,
showDockIcon: isDebug,
vibrancy: 'dark',
width: 256,
vibrancy: systemPreferences.isDarkMode() ? 'dark' : 'light',
width: 256
});
global.menubar = menubar;

Expand All @@ -111,21 +110,23 @@ const preferencesWindow = require(path.join(appRootPath, 'app', 'scripts', 'wind
* @global
*/
menubar.app.disableHardwareAcceleration();
if ((os.platform() === 'linux')) {
if (platformHelper.isLinux) {
menubar.app.commandLine.appendSwitch('enable-transparent-visuals');
}


/**
* Settings Defaults
* @property {String} currentVersion - Application Version
* @property {Object} overlays - Hashmap
* @property {Boolean} launchOnStartup - Auto launch
* @property {Boolean} isEnabled - Overlays are enabled
* @property {Object} overlays - Overlay hashmap
*/
let settingsDefaults = {
currentVersion: appVersion,
overlays: {},
launchOnStartup: false
launchOnStartup: false,
isEnabled: true,
overlays: {}
};

/**
Expand All @@ -141,7 +142,7 @@ let initializeSettings = () => {


/**
* @listens menubar#quit
* @listens menubar.app#before-quit
*/
menubar.app.on('before-quit', () => {
logger.debug('application', electronSettings.getSettingsFilePath());
Expand All @@ -156,15 +157,48 @@ menubar.on('after-create-window', () => {

initializeSettings();

/** Linux */
if (platformHelper.isLinux) {
trayMenu.add(menubar.tray);
trayMenu.registerMenu(menubar.tray);
}

/**
* @listens menubar.window.on#show
*/
menubar.window.on('show', () => {
logger.debug('application', 'menubar.window.on:show');

menubar.window.webContents.send('controller-show');

/** Linux */
if (platformHelper.isLinux) {
const cursorPosition = electron.screen.getCursorScreenPoint();
const targetPosition = {
x: cursorPosition.x - (menubar.window.getBounds().width + 20),
y: cursorPosition.y
};

menubar.window.setPosition(targetPosition.x, targetPosition.y);

// DEBUG
logger.debug('application', 'targetPosition', util.inspect(targetPosition));
}
});

/**
* @listens menubar.window#hide
*/
menubar.window.on('hide', () => {
logger.debug('application', 'menubar.window:hide');

menubar.window.webContents.send('controller-hide');
});

/**
* @listens Electron#WebContents:dom-ready
*/
menubar.window.webContents.on('dom-ready', () => {
logger.debug('application', 'menubar:dom-ready');
logger.debug('application', 'menubar.window.webContents:dom-ready');

// DEBUG
if (isDebug) {
Expand All @@ -177,19 +211,29 @@ menubar.on('after-create-window', () => {
});

/**
* @listens menubar#hide
* @listens menubar.app#before-quit
*/
menubar.on('hide', () => {
logger.debug('application', 'menubar:hide');
menubar.app.on('before-quit', () => {
logger.debug('application', 'menubar.app:before-quit');

menubar.window.webContents.send('controller-hide');
// DEBUG
logger.debug('application', electronSettings.getSettingsFilePath());
logger.debug('application', util.inspect(electronSettings.getSync()));
});


/**
* @listens menubar#show
* macOS
*/
menubar.on('show', () => {
logger.debug('application', 'menubar:show');
if (platformHelper.isMacOS) {
// Adapt to dark / light mode
systemPreferences.subscribeNotification('AppleInterfaceThemeChangedNotification', () => {
logger.debug('application', 'systemPreferences.isDarkMode()', systemPreferences.isDarkMode());

menubar.window.webContents.send('controller-show');
});
if (systemPreferences.isDarkMode()) {
menubar.window.setVibrancy('dark');
} else {
menubar.window.setVibrancy('light');
}
});
}

0 comments on commit cbac1b8

Please sign in to comment.