Skip to content

Commit

Permalink
Remove small terminal icon in main notification for macOS
Browse files Browse the repository at this point in the history
Change the icon using customise-terminal-notifier.

executed command: `customise-terminal-notifier -i ./app/images/redmine_icon_color_64.png -b com.emsk.redmine-notifier`

mikaelbr/node-notifier#71
julienXX/terminal-notifier#131
https://github.com/vitorgalvao/tiny-scripts/blob/master/customise-terminal-notifier
  • Loading branch information
emsk committed Feb 16, 2017
1 parent fdb6501 commit c10fe08
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 6 deletions.
58 changes: 58 additions & 0 deletions app/custom/terminal-notifier.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15G1004</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>terminal-notifier</string>
<key>CFBundleIconFile</key>
<string>Terminal</string>
<key>CFBundleIdentifier</key>
<string>com.emsk.redmine-notifier</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>terminal-notifier</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>16</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>8A218a</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>16A300</string>
<key>DTSDKName</key>
<string>macosx10.12</string>
<key>DTXcode</key>
<string>0800</string>
<key>DTXcodeBuild</key>
<string>8A218a</string>
<key>LSMinimumSystemVersion</key>
<string>10.8</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012-2016 Eloy Durán, Julien Blanchard. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSUserNotificationAlertStyle</key>
<string>alert</string>
</dict>
</plist>
Binary file not shown.
1 change: 1 addition & 0 deletions app/custom/terminal-notifier.app/Contents/PkgInfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APPL????
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\

\b Human Interface Design:
\b0 \
Some other people\
\

\b Testing:
\b0 \
Hopefully not nobody\
\

\b Documentation:
\b0 \
Whoever\
\

\b With special thanks to:
\b0 \
Mom\
}
Binary file not shown.
Binary file not shown.
15 changes: 10 additions & 5 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
'use strict';

(() => {
const isMac = process.platform === 'darwin';
const defaultFetchIntervalSec = 600;
const notieDisplaySec = 1.5;
const colorIconFilename64 = 'redmine_icon_color_64.png';
const blackIconFilename24 = 'redmine_icon_black_24.png';
const blackIconFilename24Notification = 'redmine_icon_black_24_notification.png';
const colorIconFilename24 = 'redmine_icon_color_24.png';
const colorIconFilename24Notification = 'redmine_icon_color_24_notification.png';
const fetchMode = Object.freeze({time: 'TIME', date: 'DATE'});

const electron = require('electron');
const remote = electron.remote;
Expand All @@ -18,9 +20,6 @@
const Tray = remote.Tray;
const fs = require('fs');
const notie = require('notie');
const nodeNotifier = require('node-notifier');

const isMac = process.platform === 'darwin';

const appName = app.getName();
const appCopyright = 'Copyright (c) 2015-2017 emsk';
Expand All @@ -31,9 +30,15 @@
} catch (err) {
appDir = __dirname; // Development
}
const appIconFilePath = `${appDir}/images/${colorIconFilename64}`;

const fetchMode = Object.freeze({time: 'TIME', date: 'DATE'});
let nodeNotifier = require('node-notifier');
if (isMac) {
nodeNotifier = new nodeNotifier.NotificationCenter({
customPath: `${appDir}/custom/terminal-notifier.app/Contents/MacOS/terminal-notifier`
});
}

const appIconFilePath = isMac ? null : `${appDir}/images/${colorIconFilename64}`;

let notifierScreen = null;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"build": {
"appId": "com.emsk.redmine-notifier",
"category": "public.app-category.productivity",
"asarUnpack": "images/*",
"asarUnpack": "{custom,images}/**/*",
"copyright": "Copyright (c) 2015-2017 emsk",
"mac": {
"target": "dmg"
Expand Down

0 comments on commit c10fe08

Please sign in to comment.