mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-05 05:09:03 +00:00
theme support 90%
This commit is contained in:
parent
d6eca764d6
commit
33fe42b024
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"python.pythonPath": "/home/dragonwocky/.local/share/virtualenvs/notion-enhancer-Hp9dv90P/bin/python"
|
||||
}
|
13
Pipfile
Normal file
13
Pipfile
Normal file
@ -0,0 +1,13 @@
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
pylint = "*"
|
||||
autopep8 = "*"
|
||||
|
||||
[packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
137
Pipfile.lock
generated
Normal file
137
Pipfile.lock
generated
Normal file
@ -0,0 +1,137 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "3eeda9cee44e435fe2d016242e4f33fb3f938001bae135ea1618534a36c05e40"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.6"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.org/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {},
|
||||
"develop": {
|
||||
"astroid": {
|
||||
"hashes": [
|
||||
"sha256:4c17cea3e592c21b6e222f673868961bad77e1f985cb1694ed077475a89229c1",
|
||||
"sha256:d8506842a3faf734b81599c8b98dcc423de863adcc1999248480b18bd31a0f38"
|
||||
],
|
||||
"version": "==2.4.1"
|
||||
},
|
||||
"autopep8": {
|
||||
"hashes": [
|
||||
"sha256:152fd8fe47d02082be86e05001ec23d6f420086db56b17fc883f3f965fb34954"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.5.2"
|
||||
},
|
||||
"isort": {
|
||||
"hashes": [
|
||||
"sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1",
|
||||
"sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"
|
||||
],
|
||||
"version": "==4.3.21"
|
||||
},
|
||||
"lazy-object-proxy": {
|
||||
"hashes": [
|
||||
"sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d",
|
||||
"sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449",
|
||||
"sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08",
|
||||
"sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a",
|
||||
"sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50",
|
||||
"sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd",
|
||||
"sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239",
|
||||
"sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb",
|
||||
"sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea",
|
||||
"sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e",
|
||||
"sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156",
|
||||
"sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142",
|
||||
"sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442",
|
||||
"sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62",
|
||||
"sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db",
|
||||
"sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531",
|
||||
"sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383",
|
||||
"sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a",
|
||||
"sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357",
|
||||
"sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4",
|
||||
"sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"
|
||||
],
|
||||
"version": "==1.4.3"
|
||||
},
|
||||
"mccabe": {
|
||||
"hashes": [
|
||||
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
|
||||
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
|
||||
],
|
||||
"version": "==0.6.1"
|
||||
},
|
||||
"pycodestyle": {
|
||||
"hashes": [
|
||||
"sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367",
|
||||
"sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e"
|
||||
],
|
||||
"version": "==2.6.0"
|
||||
},
|
||||
"pylint": {
|
||||
"hashes": [
|
||||
"sha256:b95e31850f3af163c2283ed40432f053acbc8fc6eba6a069cb518d9dbf71848c",
|
||||
"sha256:dd506acce0427e9e08fb87274bcaa953d38b50a58207170dbf5b36cf3e16957b"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==2.5.2"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259",
|
||||
"sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"
|
||||
],
|
||||
"version": "==1.15.0"
|
||||
},
|
||||
"toml": {
|
||||
"hashes": [
|
||||
"sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f",
|
||||
"sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"
|
||||
],
|
||||
"version": "==0.10.1"
|
||||
},
|
||||
"typed-ast": {
|
||||
"hashes": [
|
||||
"sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355",
|
||||
"sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919",
|
||||
"sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa",
|
||||
"sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652",
|
||||
"sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75",
|
||||
"sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01",
|
||||
"sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d",
|
||||
"sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1",
|
||||
"sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907",
|
||||
"sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c",
|
||||
"sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3",
|
||||
"sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b",
|
||||
"sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614",
|
||||
"sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb",
|
||||
"sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b",
|
||||
"sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41",
|
||||
"sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6",
|
||||
"sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34",
|
||||
"sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe",
|
||||
"sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4",
|
||||
"sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"
|
||||
],
|
||||
"markers": "implementation_name == 'cpython' and python_version < '3.8'",
|
||||
"version": "==1.4.1"
|
||||
},
|
||||
"wrapt": {
|
||||
"hashes": [
|
||||
"sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"
|
||||
],
|
||||
"version": "==1.12.1"
|
||||
}
|
||||
}
|
||||
}
|
59
README.md
59
README.md
@ -6,6 +6,8 @@ an enhancer/customiser for the all-in-one productivity workspace [notion.so](htt
|
||||
|
||||
currently, only win10 is supported. it is possible to run this script via the wsl to modify the win10 notion app.
|
||||
|
||||
python scripts must be run from the bash terminal or windows command prompt - directly opening/running them may not work.
|
||||
|
||||
(the [styles](#styling) should also work for the web version.
|
||||
these can be installed via an extension like [stylus](https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?hl=en)
|
||||
or a built-in feature like [userChrome.css](https://www.userchrome.org/).)
|
||||
@ -18,7 +20,7 @@ or a built-in feature like [userChrome.css](https://www.userchrome.org/).)
|
||||
even if you are running the script from the wsl).
|
||||
6. ensure notion is closed.
|
||||
7. optional: to remove previous versions of notion enhancer, run `cleaner.py`
|
||||
8. optional: modify the `resources/user.css` files to your liking.
|
||||
8. optional: modify the `resources/user.css` file to your liking (see [styling](#styling)).
|
||||
9. run `customiser.py` to build changes.
|
||||
|
||||
done: run notion and enjoy.
|
||||
@ -69,13 +71,17 @@ to your preference. you will need to run or re-run `customiser.py` afterwards.
|
||||
|
||||
### tray
|
||||
|
||||
- single-click to toggle app visibility. right click to open menu.
|
||||
- settings will be saved in `%localappdata%/Programs/Notion/resources/app/user-preferences.json`
|
||||
single-click to toggle app visibility. right click to open menu.
|
||||
|
||||
settings will be saved in `%localappdata%/Programs/Notion/resources/app/user-preferences.json`
|
||||
|
||||
- **run on startup**: run notion on boot/startup. (default: true)
|
||||
- **hide on open**: hide the launch of notion to the tray. (default: false)
|
||||
- **open maximised**: maximise the app on open. (default: false)
|
||||
- **close to tray**: close window to tray rather than closing outright
|
||||
on click of `⨉`. does not apply if multiple notion windows are open. (default: false)
|
||||
- **load theme.css**: loads the custom colour theme file.
|
||||
see [colour theming](#colour-theming) for more information. (default: false)
|
||||
|
||||
### styling
|
||||
|
||||
@ -86,41 +92,19 @@ changes will be applied instantly on notion reload
|
||||
these should also work for the web version, if copied into your css customiser.
|
||||
|
||||
css below will work for every instance of the element, but if you wish to hide only a specific element
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with `[data-block-id='ID']` ([video tutorial on fetching IDs](https://www.youtube.com/watch?v=6V7eqShm_4w)).
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with
|
||||
`[data-block-id='ID']` ([video tutorial on fetching IDs](https://www.youtube.com/watch?v=6V7eqShm_4w)).
|
||||
|
||||
#### dark+ theme
|
||||
#### colour theming
|
||||
|
||||
```css
|
||||
/*** dark+ ***/
|
||||
.notion-dark-theme .window-buttons {
|
||||
background: rgb(10, 10, 10);
|
||||
}
|
||||
.notion-dark-theme .window-buttons:hover {
|
||||
background: rgb(23, 23, 23);
|
||||
}
|
||||
/* sidebar */
|
||||
[style*='background: rgb(55, 60, 63)'],
|
||||
[style*='background: rgb(80, 85, 88)'] {
|
||||
background: rgb(0, 0, 0) !important;
|
||||
}
|
||||
/* main content */
|
||||
.notion-body.dark,
|
||||
[style*='background: rgb(47, 52, 55)'] {
|
||||
background: rgb(10, 10, 10) !important;
|
||||
}
|
||||
/* hovered buttons + table column titles */
|
||||
.notion-table-view > :first-child > :first-child,
|
||||
[style*='background: rgb(71, 76, 80)'],
|
||||
[style*='background: rgb(98, 102, 104)'] {
|
||||
background: rgb(15, 15, 15) !important;
|
||||
box-shadow: 0 0 0 0.5px rgba(78, 78, 78, 0.7);
|
||||
}
|
||||
/* database elements: e.g. view select, calendar event */
|
||||
[style*='background: rgb(63, 68, 71)'] {
|
||||
background: rgb(4, 4, 4) !important;
|
||||
border: 0.5px solid rgba(59, 59, 59, 0.7);
|
||||
}
|
||||
```
|
||||
this replaces the default notion dark theme. the provided theme file is my custom dark+ theme:
|
||||
if you have another you wish to share, please contact me. if a few themes are provided i will
|
||||
set up a distribution method (either including as optional themes or sharing on the website).
|
||||
|
||||
to enable, see the [tray](#tray) options.
|
||||
|
||||
to modify, enter the `theme.css` file and change the colour values within the `:root {}` - value names
|
||||
should describe what each colour will affect.
|
||||
|
||||
#### hide discussions (comment threads at the top of each page)
|
||||
|
||||
@ -132,7 +116,8 @@ css below will work for every instance of the element, but if you wish to hide o
|
||||
|
||||
#### custom fonts
|
||||
|
||||
**styles must be added to the top of the `user.css` file, so that nothing (other than comments) is above them @import statement**
|
||||
**the @import statement must be added to the top of the `user.css` file (with nothing above it**
|
||||
**except comments or other @import statements)**
|
||||
|
||||
```css
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code&family=Oxygen&family=Roboto+Slab:wght@300&display=swap');
|
||||
|
@ -79,8 +79,8 @@ try:
|
||||
print(' ...linking to ./resources/user.css')
|
||||
with open('./resources/preload.js', 'r', encoding='UTF-8') as insert:
|
||||
append.write(insert.read().replace(
|
||||
'___user.css___', __folder__
|
||||
+ '/resources/user.css'))
|
||||
'☃☃☃assets☃☃☃', __folder__
|
||||
+ '/resources'))
|
||||
else:
|
||||
print(
|
||||
f' * {filepath}/app/renderer/preload.js was not found: step skipped.')
|
||||
@ -99,15 +99,15 @@ try:
|
||||
'window.show()', content, flags=re.DOTALL).replace('window.show()', """
|
||||
/* === INJECTION START === */
|
||||
const path = require('path'),
|
||||
store = new (require(path.join(__dirname, '..', 'store.js')))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximised: false
|
||||
}
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximised: false
|
||||
}
|
||||
});
|
||||
if (!store.get('openhidden') || electron_1.BrowserWindow.getAllWindows().some(win => win.isVisible()))
|
||||
{ window.show(); if (store.get('maximised')) window.maximize(); }
|
||||
if (!store.openhidden || electron_1.BrowserWindow.getAllWindows().some(win => win.isVisible()))
|
||||
{ window.show(); if (store.maximised) window.maximize(); }
|
||||
/* === INJECTION END === */
|
||||
""")
|
||||
with open(filepath + '/app/main/createWindow.js', 'w', encoding='UTF-8') as write:
|
||||
@ -141,7 +141,7 @@ try:
|
||||
content = content.read()
|
||||
with open(filepath + '/app/main/main.js', 'w', encoding='UTF-8') as write:
|
||||
if '/* === INJECTION MARKER === */' in content:
|
||||
print(' * hotkey.js already added. replacing it.')
|
||||
print(' * tray.js already added. replacing it.')
|
||||
original = []
|
||||
for line in content.splitlines():
|
||||
if '/* === INJECTION MARKER === */' in line:
|
||||
@ -153,9 +153,9 @@ try:
|
||||
'electron_1.app.on("ready", handleReady);',
|
||||
'electron_1.app.on("ready", () => handleReady() && enhancements());') + '\n')
|
||||
with open(filepath + '/app/main/main.js', 'a', encoding='UTF-8') as append:
|
||||
with open('./resources/hotkey.js', 'r', encoding='UTF-8') as insert:
|
||||
with open('./resources/tray.js', 'r', encoding='UTF-8') as insert:
|
||||
append.write('\n' + insert.read().replace(
|
||||
'___hotkey___', hotkey))
|
||||
'☃☃☃hotkey☃☃☃', hotkey))
|
||||
print(
|
||||
f' ...copying tray icon ./resources/notion.ico to {filepath}/app/main/')
|
||||
copyfile('./resources/notion.ico',
|
||||
|
3
docs/.vscode/settings.json
vendored
Normal file
3
docs/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"python.pythonPath": "/home/dragonwocky/.local/share/virtualenvs/notion-enhancer-Hp9dv90P/bin/python"
|
||||
}
|
13
docs/Pipfile
Normal file
13
docs/Pipfile
Normal file
@ -0,0 +1,13 @@
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
pylint = "*"
|
||||
autopep8 = "*"
|
||||
|
||||
[packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.6"
|
137
docs/Pipfile.lock
generated
Normal file
137
docs/Pipfile.lock
generated
Normal file
@ -0,0 +1,137 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "3eeda9cee44e435fe2d016242e4f33fb3f938001bae135ea1618534a36c05e40"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.6"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.org/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {},
|
||||
"develop": {
|
||||
"astroid": {
|
||||
"hashes": [
|
||||
"sha256:4c17cea3e592c21b6e222f673868961bad77e1f985cb1694ed077475a89229c1",
|
||||
"sha256:d8506842a3faf734b81599c8b98dcc423de863adcc1999248480b18bd31a0f38"
|
||||
],
|
||||
"version": "==2.4.1"
|
||||
},
|
||||
"autopep8": {
|
||||
"hashes": [
|
||||
"sha256:152fd8fe47d02082be86e05001ec23d6f420086db56b17fc883f3f965fb34954"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.5.2"
|
||||
},
|
||||
"isort": {
|
||||
"hashes": [
|
||||
"sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1",
|
||||
"sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"
|
||||
],
|
||||
"version": "==4.3.21"
|
||||
},
|
||||
"lazy-object-proxy": {
|
||||
"hashes": [
|
||||
"sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d",
|
||||
"sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449",
|
||||
"sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08",
|
||||
"sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a",
|
||||
"sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50",
|
||||
"sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd",
|
||||
"sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239",
|
||||
"sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb",
|
||||
"sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea",
|
||||
"sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e",
|
||||
"sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156",
|
||||
"sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142",
|
||||
"sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442",
|
||||
"sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62",
|
||||
"sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db",
|
||||
"sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531",
|
||||
"sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383",
|
||||
"sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a",
|
||||
"sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357",
|
||||
"sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4",
|
||||
"sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"
|
||||
],
|
||||
"version": "==1.4.3"
|
||||
},
|
||||
"mccabe": {
|
||||
"hashes": [
|
||||
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
|
||||
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
|
||||
],
|
||||
"version": "==0.6.1"
|
||||
},
|
||||
"pycodestyle": {
|
||||
"hashes": [
|
||||
"sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367",
|
||||
"sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e"
|
||||
],
|
||||
"version": "==2.6.0"
|
||||
},
|
||||
"pylint": {
|
||||
"hashes": [
|
||||
"sha256:b95e31850f3af163c2283ed40432f053acbc8fc6eba6a069cb518d9dbf71848c",
|
||||
"sha256:dd506acce0427e9e08fb87274bcaa953d38b50a58207170dbf5b36cf3e16957b"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==2.5.2"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259",
|
||||
"sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"
|
||||
],
|
||||
"version": "==1.15.0"
|
||||
},
|
||||
"toml": {
|
||||
"hashes": [
|
||||
"sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f",
|
||||
"sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"
|
||||
],
|
||||
"version": "==0.10.1"
|
||||
},
|
||||
"typed-ast": {
|
||||
"hashes": [
|
||||
"sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355",
|
||||
"sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919",
|
||||
"sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa",
|
||||
"sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652",
|
||||
"sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75",
|
||||
"sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01",
|
||||
"sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d",
|
||||
"sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1",
|
||||
"sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907",
|
||||
"sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c",
|
||||
"sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3",
|
||||
"sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b",
|
||||
"sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614",
|
||||
"sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb",
|
||||
"sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b",
|
||||
"sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41",
|
||||
"sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6",
|
||||
"sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34",
|
||||
"sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe",
|
||||
"sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4",
|
||||
"sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"
|
||||
],
|
||||
"markers": "implementation_name == 'cpython' and python_version < '3.8'",
|
||||
"version": "==1.4.1"
|
||||
},
|
||||
"wrapt": {
|
||||
"hashes": [
|
||||
"sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"
|
||||
],
|
||||
"version": "==1.12.1"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html><!-- Documentative--><!-- (c) 2020 dragonwocky <thedragonring.bod@gmail.com>--><!-- (https://dragonwocky.me/) under the MIT license--><html prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>notion enhancer</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Nunito+Sans"><link rel="stylesheet" href="docs.css"><script src="docs.js"></script><link rel="icon" href="web-logo.png" media="(prefers-color-scheme: dark)"><link rel="icon" href="web-logo.png"><meta name="title" content="notion enhancer"><meta name="description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta name="theme-color" content="rgb(75, 133, 209)"><meta property="og:type" content="article"><meta property="og:url" content="https://dragonwocky.me/notion-enhancer/index.html"><meta property="og:title" content="notion enhancer"><meta property="og:site_name" content="notion enhancer"><meta property="og:description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta property="og:image" content="https://dragonwocky.me/notion-enhancer/web-logo.png"><meta property="twitter:card" content="summary"></head><body><aside class="menu"><div><div class="title"><h1>notion enhancer</h1><picture class="icon"><source srcset="web-logo.png" media="(prefers-color-scheme: dark)"><img src="web-logo.png"></picture></div></div><ul class="nav"><li class="entry"><a href="#notion-enhancer">notion enhancer</a><ul><li class="level-2"><a href="#installation">installation</a></li><li class="level-2"><a href="#this-is-a-fork">this is a fork</a></li><li class="level-2"><a href="#features">features</a></li><li class="level-3"><a href="#titlebar">titlebar</a></li><li class="level-3"><a href="#nicer-scrollbars">nicer scrollbars</a></li><li class="level-3"><a href="#hotkeys">hotkeys</a></li><li class="level-3"><a href="#tray">tray</a></li><li class="level-3"><a href="#styling">styling</a></li><li class="level-4"><a href="#dark-theme">dark+ theme</a></li><li class="level-4"><a href="#hide-discussions-comment-threads-at-the-top-of-each-page">hide discussions (comment threads at the top of each page)</a></li><li class="level-4"><a href="#custom-fonts">custom fonts</a></li><li class="level-4"><a href="#font-resizing">font resizing</a></li><li class="level-4"><a href="#wider-page-view">wider page view</a></li><li class="level-4"><a href="#thinner-cover-image">thinner cover image</a></li><li class="level-4"><a href="#table-columns-below-100px">table columns below 100px</a></li><li class="level-4"><a href="#hide--new-table-row">hide '+ new' table row</a></li><li class="level-4"><a href="#hide-calculations-table-row">hide calculations table row</a></li><li class="level-4"><a href="#hide--new-board-row">hide '+ new' board row</a></li><li class="level-4"><a href="#hide-board-view-hidden-columns">hide board view hidden columns</a></li><li class="level-4"><a href="#hide-board-view-add-a-group">hide board view 'add a group'</a></li><li class="level-4"><a href="#centre-align-table-column-headers">centre-align table column headers</a></li><li class="level-4"><a href="#smaller-table-column-header-icons">smaller table column header icons</a></li><li class="level-4"><a href="#remove-icons-from-table-column-headers">remove icons from table column headers</a></li><li class="level-4"><a href="#removingdecreasing-side-padding-for-tables">removing/decreasing side padding for tables</a></li><li class="level-4"><a href="#removingdecreasing-side-padding-for-boards">removing/decreasing side padding for boards</a></li><li class="level-2"><a href="#other-details">other details</a></li></ul></li><li class="entry"><p>resources</p></li><li class="entry"><a href="changelog.html">changelog</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE">license</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/">github</a></li><li class="entry"><a href="https://dragonwocky.me/">me (dragonwocky)</a></li></ul><p class="mark"><a href="https://dragonwocky.me/documentative">docs by documentative</a></p></aside><div class="wrapper"><div class="toggle"><button>☰</button><h1>notion enhancer</h1></div><article class="documentative"><div class="content">
|
||||
<!DOCTYPE html><!-- Documentative--><!-- (c) 2020 dragonwocky <thedragonring.bod@gmail.com>--><!-- (https://dragonwocky.me/) under the MIT license--><html prefix="og: http://ogp.me/ns#"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>notion enhancer</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro|Nunito+Sans"><link rel="stylesheet" href="docs.css"><script src="docs.js"></script><link rel="icon" href="web-logo.png" media="(prefers-color-scheme: dark)"><link rel="icon" href="web-logo.png"><meta name="title" content="notion enhancer"><meta name="description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta name="theme-color" content="rgb(75, 133, 209)"><meta property="og:type" content="article"><meta property="og:url" content="https://dragonwocky.me/notion-enhancer/index.html"><meta property="og:title" content="notion enhancer"><meta property="og:site_name" content="notion enhancer"><meta property="og:description" content="an enhancer/customiser for the all-in-one productivity workspace notion.so"><meta property="og:image" content="https://dragonwocky.me/notion-enhancer/web-logo.png"><meta property="twitter:card" content="summary"></head><body><aside class="menu"><div><div class="title"><h1>notion enhancer</h1><picture class="icon"><source srcset="web-logo.png" media="(prefers-color-scheme: dark)"><img src="web-logo.png"></picture></div></div><ul class="nav"><li class="entry"><a href="#notion-enhancer">notion enhancer</a><ul><li class="level-2"><a href="#installation">installation</a></li><li class="level-2"><a href="#this-is-a-fork">this is a fork</a></li><li class="level-2"><a href="#features">features</a></li><li class="level-3"><a href="#titlebar">titlebar</a></li><li class="level-3"><a href="#nicer-scrollbars">nicer scrollbars</a></li><li class="level-3"><a href="#hotkeys">hotkeys</a></li><li class="level-3"><a href="#tray">tray</a></li><li class="level-3"><a href="#styling">styling</a></li><li class="level-4"><a href="#colour-theming">colour theming</a></li><li class="level-4"><a href="#hide-discussions-comment-threads-at-the-top-of-each-page">hide discussions (comment threads at the top of each page)</a></li><li class="level-4"><a href="#custom-fonts">custom fonts</a></li><li class="level-4"><a href="#font-resizing">font resizing</a></li><li class="level-4"><a href="#wider-page-view">wider page view</a></li><li class="level-4"><a href="#thinner-cover-image">thinner cover image</a></li><li class="level-4"><a href="#table-columns-below-100px">table columns below 100px</a></li><li class="level-4"><a href="#hide--new-table-row">hide '+ new' table row</a></li><li class="level-4"><a href="#hide-calculations-table-row">hide calculations table row</a></li><li class="level-4"><a href="#hide--new-board-row">hide '+ new' board row</a></li><li class="level-4"><a href="#hide-board-view-hidden-columns">hide board view hidden columns</a></li><li class="level-4"><a href="#hide-board-view-add-a-group">hide board view 'add a group'</a></li><li class="level-4"><a href="#centre-align-table-column-headers">centre-align table column headers</a></li><li class="level-4"><a href="#smaller-table-column-header-icons">smaller table column header icons</a></li><li class="level-4"><a href="#remove-icons-from-table-column-headers">remove icons from table column headers</a></li><li class="level-4"><a href="#removingdecreasing-side-padding-for-tables">removing/decreasing side padding for tables</a></li><li class="level-4"><a href="#removingdecreasing-side-padding-for-boards">removing/decreasing side padding for boards</a></li><li class="level-2"><a href="#other-details">other details</a></li></ul></li><li class="entry"><p>resources</p></li><li class="entry"><a href="changelog.html">changelog</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/blob/master/LICENSE">license</a></li><li class="entry"><a href="https://github.com/dragonwocky/notion-enhancer/">github</a></li><li class="entry"><a href="https://dragonwocky.me/">me (dragonwocky)</a></li></ul><p class="mark"><a href="https://dragonwocky.me/documentative">docs by documentative</a></p></aside><div class="wrapper"><div class="toggle"><button>☰</button><h1>notion enhancer</h1></div><article class="documentative"><div class="content">
|
||||
|
||||
<section class="block" id="notion-enhancer">
|
||||
<h1>
|
||||
@ -12,6 +12,7 @@
|
||||
<a href="#installation">installation</a>
|
||||
</h2>
|
||||
<p>currently, only win10 is supported. it is possible to run this script via the wsl to modify the win10 notion app.</p>
|
||||
<p>python scripts must be run from the bash terminal or windows command prompt - directly opening/running them may not work.</p>
|
||||
<p>(the <a href="#styling">styles</a> should also work for the web version.
|
||||
these can be installed via an extension like <a href="https://chrome.google.com/webstore/detail/stylus/clngdbkpkpeebahjckkjfobafhncgmne?hl=en">stylus</a>
|
||||
or a built-in feature like <a href="https://www.userchrome.org/">userChrome.css</a>.)</p>
|
||||
@ -24,7 +25,7 @@ or a built-in feature like <a href="https://www.userchrome.org/">userChrome.css<
|
||||
even if you are running the script from the wsl).</li>
|
||||
<li>ensure notion is closed.</li>
|
||||
<li>optional: to remove previous versions of notion enhancer, run <code>cleaner.py</code></li>
|
||||
<li>optional: modify the <code>resources/user.css</code> files to your liking.</li>
|
||||
<li>optional: modify the <code>resources/user.css</code> file to your liking (see <a href="#styling">styling</a>).</li>
|
||||
<li>run <code>customiser.py</code> to build changes.</li>
|
||||
</ol>
|
||||
<p>done: run notion and enjoy.</p>
|
||||
@ -91,14 +92,16 @@ to your preference. you will need to run or re-run <code>customiser.py</code> af
|
||||
<h3>
|
||||
<a href="#tray">tray</a>
|
||||
</h3>
|
||||
<ul>
|
||||
<li>single-click to toggle app visibility. right click to open menu.</li>
|
||||
<li>settings will be saved in <code>%localappdata%/Programs/Notion/resources/app/user-preferences.json</code></li>
|
||||
<p>single-click to toggle app visibility. right click to open menu.</p>
|
||||
<p>settings will be saved in <code>%localappdata%/Programs/Notion/resources/app/user-preferences.json</code></p>
|
||||
<ul>
|
||||
<li><strong>run on startup</strong>: run notion on boot/startup. (default: true)</li>
|
||||
<li><strong>hide on open</strong>: hide the launch of notion to the tray. (default: false)</li>
|
||||
<li><strong>open maximised</strong>: maximise the app on open. (default: false)</li>
|
||||
<li><strong>close to tray</strong>: close window to tray rather than closing outright
|
||||
on click of <code>⨉</code>. does not apply if multiple notion windows are open. (default: false)</li>
|
||||
<li><strong>load theme.css</strong>: loads the custom colour theme file.
|
||||
see <a href="#colour-theming">colour theming</a> for more information. (default: false)</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
@ -111,42 +114,20 @@ changes will be applied instantly on notion reload
|
||||
(no need to re-run <code>customiser.py</code> every time you want to change some styles).</p>
|
||||
<p>these should also work for the web version, if copied into your css customiser.</p>
|
||||
<p>css below will work for every instance of the element, but if you wish to hide only a specific element
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with <code>[data-block-id='ID']</code> (<a href="https://www.youtube.com/watch?v=6V7eqShm_4w">video tutorial on fetching IDs</a>).</p>
|
||||
(e.g. the '+ new' table row) it is recommended that you prepend each selector with
|
||||
<code>[data-block-id='ID']</code> (<a href="https://www.youtube.com/watch?v=6V7eqShm_4w">video tutorial on fetching IDs</a>).</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="dark-theme">
|
||||
<section class="block" id="colour-theming">
|
||||
<h4>
|
||||
<a href="#dark-theme">dark+ theme</a>
|
||||
<a href="#colour-theming">colour theming</a>
|
||||
</h4>
|
||||
<pre><code class="lang-css"><span class="hljs-comment">/*** dark+ ***/</span>
|
||||
<span class="hljs-selector-class">.notion-dark-theme</span> <span class="hljs-selector-class">.window-buttons</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>, <span class="hljs-number">10</span>);
|
||||
}
|
||||
<span class="hljs-selector-class">.notion-dark-theme</span> <span class="hljs-selector-class">.window-buttons</span><span class="hljs-selector-pseudo">:hover</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">23</span>, <span class="hljs-number">23</span>, <span class="hljs-number">23</span>);
|
||||
}
|
||||
<span class="hljs-comment">/* sidebar */</span>
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(55, 60, 63)'</span>]</span>,
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(80, 85, 88)'</span>]</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-comment">/* main content */</span>
|
||||
<span class="hljs-selector-class">.notion-body</span><span class="hljs-selector-class">.dark</span>,
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(47, 52, 55)'</span>]</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>, <span class="hljs-number">10</span>) <span class="hljs-meta">!important</span>;
|
||||
}
|
||||
<span class="hljs-comment">/* hovered buttons + table column titles */</span>
|
||||
<span class="hljs-selector-class">.notion-table-view</span> > <span class="hljs-selector-pseudo">:first-child</span> > <span class="hljs-selector-pseudo">:first-child</span>,
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(71, 76, 80)'</span>]</span>,
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(98, 102, 104)'</span>]</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">15</span>, <span class="hljs-number">15</span>, <span class="hljs-number">15</span>) <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">0.5px</span> <span class="hljs-built_in">rgba</span>(<span class="hljs-number">78</span>, <span class="hljs-number">78</span>, <span class="hljs-number">78</span>, <span class="hljs-number">0.7</span>);
|
||||
}
|
||||
<span class="hljs-comment">/* database elements: e.g. view select, calendar event */</span>
|
||||
<span class="hljs-selector-attr">[style*=<span class="hljs-string">'background: rgb(63, 68, 71)'</span>]</span> {
|
||||
<span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgb</span>(<span class="hljs-number">4</span>, <span class="hljs-number">4</span>, <span class="hljs-number">4</span>) <span class="hljs-meta">!important</span>;
|
||||
<span class="hljs-attribute">border</span>: <span class="hljs-number">0.5px</span> solid <span class="hljs-built_in">rgba</span>(<span class="hljs-number">59</span>, <span class="hljs-number">59</span>, <span class="hljs-number">59</span>, <span class="hljs-number">0.7</span>);
|
||||
}</code></pre>
|
||||
<p>this replaces the default notion dark theme. the provided theme file is my custom dark+ theme:
|
||||
if you have another you wish to share, please contact me. if a few themes are provided i will
|
||||
set up a distribution method (either including as optional themes or sharing on the website).</p>
|
||||
<p>to enable, see the <a href="#tray">tray</a> options.</p>
|
||||
<p>to modify, enter the <code>theme.css</code> file and change the colour values within the <code>:root {}</code> - value names
|
||||
should describe what each colour will affect.</p>
|
||||
|
||||
</section>
|
||||
<section class="block" id="hide-discussions-comment-threads-at-the-top-of-each-page">
|
||||
@ -162,7 +143,8 @@ changes will be applied instantly on notion reload
|
||||
<h4>
|
||||
<a href="#custom-fonts">custom fonts</a>
|
||||
</h4>
|
||||
<p><strong>styles must be added to the top of the <code>user.css</code> file, so that nothing (other than comments) is above them @import statement</strong></p>
|
||||
<p><strong>the @import statement must be added to the top of the <code>user.css</code> file (with nothing above it</strong>
|
||||
<strong>except comments or other @import statements)</strong></p>
|
||||
<pre><code class="lang-css"><span class="hljs-keyword">@import</span> url(<span class="hljs-string">'https://fonts.googleapis.com/css2?family=Fira+Code&family=Oxygen&family=Roboto+Slab:wght@300&display=swap'</span>);
|
||||
<span class="hljs-selector-class">.notion-app-inner</span> {
|
||||
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">'Oxygen'</span>, sans-serif <span class="hljs-meta">!important</span>;
|
||||
|
@ -12,19 +12,35 @@
|
||||
// DO NOT REMOVE THE INJECTION MARKER ABOVE
|
||||
|
||||
require('electron').remote.getGlobal('setTimeout')(() => {
|
||||
/* style injection */
|
||||
const fs = require('fs'),
|
||||
css = fs.readFileSync('___user.css___'), // will be set by python script
|
||||
style = document.createElement('style'),
|
||||
head = document.getElementsByTagName('head')[0];
|
||||
if (!head) return;
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = css;
|
||||
head.appendChild(style);
|
||||
path = require('path'),
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximised: false,
|
||||
tray: false,
|
||||
theme: false,
|
||||
},
|
||||
});
|
||||
|
||||
const intervalID = setInterval(injection, 100);
|
||||
function injection() {
|
||||
if (document.querySelector('div.notion-topbar > div') == undefined) return;
|
||||
clearInterval(intervalID);
|
||||
|
||||
/* style injection */
|
||||
const head = document.getElementsByTagName('head')[0],
|
||||
css = ['user'];
|
||||
if (store.theme) css.push('theme');
|
||||
console.table(store);
|
||||
css.forEach((file) => {
|
||||
file = fs.readFileSync(`☃☃☃assets☃☃☃/${file}.css`); // will be set by python script
|
||||
let style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.innerHTML = file;
|
||||
head.appendChild(style);
|
||||
});
|
||||
|
||||
const appwindow = require('electron').remote.getCurrentWindow();
|
||||
|
||||
@ -56,9 +72,16 @@ require('electron').remote.getGlobal('setTimeout')(() => {
|
||||
// maximise
|
||||
element = document.createElement('button');
|
||||
element.classList.add('window-buttons');
|
||||
element.innerHTML = '▢';
|
||||
element.onclick = () =>
|
||||
appwindow.isMaximized() ? appwindow.unmaximize() : appwindow.maximize();
|
||||
element.innerHTML = appwindow.isMaximized() ? '🗗' : '🗖';
|
||||
element.onclick = function () {
|
||||
if (appwindow.isMaximized()) {
|
||||
appwindow.unmaximize();
|
||||
this.innerHTML = '🗖';
|
||||
} else {
|
||||
appwindow.maximize();
|
||||
this.innerHTML = '🗗';
|
||||
}
|
||||
};
|
||||
node.appendChild(element);
|
||||
|
||||
// close
|
||||
@ -67,14 +90,8 @@ require('electron').remote.getGlobal('setTimeout')(() => {
|
||||
element.classList.add('window-buttons');
|
||||
element.innerHTML = '⨉';
|
||||
element.onclick = () => {
|
||||
const store = new (require(path.join(__dirname, '..', 'store.js')))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
tray: false,
|
||||
},
|
||||
});
|
||||
if (
|
||||
store.get('tray') &&
|
||||
store.tray &&
|
||||
require('electron').remote.BrowserWindow.getAllWindows().length === 1
|
||||
) {
|
||||
appwindow.hide();
|
||||
@ -82,8 +99,6 @@ require('electron').remote.getGlobal('setTimeout')(() => {
|
||||
};
|
||||
node.appendChild(element);
|
||||
|
||||
clearInterval(intervalID);
|
||||
|
||||
/* reload window */
|
||||
document.defaultView.addEventListener(
|
||||
'keyup',
|
||||
|
@ -10,26 +10,34 @@
|
||||
const path = require('path'),
|
||||
fs = require('fs');
|
||||
|
||||
class Store {
|
||||
constructor(opts) {
|
||||
this.path = path.join(__dirname, opts.config + '.json');
|
||||
this.data = parseDataFile(this.path, opts.defaults);
|
||||
}
|
||||
get(key) {
|
||||
return this.data[key];
|
||||
}
|
||||
set(key, val) {
|
||||
this.data[key] = val;
|
||||
fs.writeFileSync(this.path, JSON.stringify(this.data));
|
||||
}
|
||||
}
|
||||
|
||||
function parseDataFile(path, defaults) {
|
||||
function getJSON(from) {
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(path));
|
||||
} catch (error) {
|
||||
return defaults;
|
||||
return JSON.parse(fs.readFileSync(from));
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Store;
|
||||
module.exports = (opts) => {
|
||||
opts = {
|
||||
config: 'user-preferences',
|
||||
defaults: {},
|
||||
...opts,
|
||||
};
|
||||
const config = path.join(__dirname, opts.config + '.json');
|
||||
return new Proxy(
|
||||
{},
|
||||
{
|
||||
get(obj, prop) {
|
||||
obj = { ...opts.defaults, ...getJSON(config) };
|
||||
return obj[prop];
|
||||
},
|
||||
set(obj, prop, val) {
|
||||
obj = { ...opts.defaults, ...getJSON(config) };
|
||||
obj[prop] = val;
|
||||
fs.writeFileSync(config, JSON.stringify(obj));
|
||||
return true;
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
159
resources/theme.css
Normal file
159
resources/theme.css
Normal file
@ -0,0 +1,159 @@
|
||||
/*
|
||||
* notion-enhancer
|
||||
* (c) 2020 dragonwocky <thedragonring.bod@gmail.com>
|
||||
* (c) 2020 TarasokUA
|
||||
* (https://dragonwocky.me/) under the MIT license
|
||||
*/
|
||||
|
||||
:root {
|
||||
/** backgrounds **/
|
||||
--theme-main: rgb(10, 10, 10);
|
||||
--theme-sidebar: rgb(0, 0, 0);
|
||||
--theme-primary: rgb(177, 24, 24);
|
||||
--theme-primary_hover: rgb(202, 26, 26);
|
||||
--theme-primary_click: rgb(219, 41, 41);
|
||||
--theme-primary_indicator: rgb(202, 26, 26);
|
||||
|
||||
/** databases **/
|
||||
--theme-card: rgb(4, 4, 4);
|
||||
--theme-card_border: rgba(59, 59, 59, 0.7);
|
||||
|
||||
/** colours **/
|
||||
--theme-text_gray: rgba(151, 154, 155, 0.95);
|
||||
--theme-text_brown: rgb(147, 114, 100);
|
||||
--theme-text_orange: rgb(255, 163, 68);
|
||||
--theme-text_yellow: rgb(255, 220, 73);
|
||||
--theme-text_teal: rgb(77, 171, 154);
|
||||
--theme-text_blue: rgb(82, 156, 202);
|
||||
--theme-text_purple: rgb(154, 109, 215);
|
||||
--theme-text_pink: rgb(226, 85, 161);
|
||||
--theme-text_red: rgb(218, 47, 35);
|
||||
--theme-bg_default: rgba(37, 37, 37, 0.815);
|
||||
--theme-bg_gray: rgba(126, 128, 129, 0.5);
|
||||
--theme-bg_brown: #50331f;
|
||||
--theme-bg_orange: rgba(255, 155, 0, 0.58);
|
||||
--theme-bg_yellow: rgba(183, 155, 0, 1);
|
||||
--theme-bg_green: rgb(77, 171, 154);
|
||||
--theme-bg_blue: rgba(0, 90, 146, 0.71);
|
||||
--theme-bg_purple: rgba(91, 49, 148, 0.74);
|
||||
--theme-bg_pink: rgba(243, 61, 159, 0.5);
|
||||
--theme-bg_red: rgb(122, 20, 20);
|
||||
}
|
||||
|
||||
.notion-dark-theme .window-buttons:hover {
|
||||
background: rgb(23, 23, 23);
|
||||
}
|
||||
|
||||
/** backgrounds **/
|
||||
|
||||
[style*='background: rgb(55, 60, 63)'] {
|
||||
background: var(--theme-sidebar) !important;
|
||||
}
|
||||
.notion-dark-theme .window-buttons,
|
||||
.notion-body.dark,
|
||||
[style*='background: rgb(47, 52, 55)'] {
|
||||
background: var(--theme-main) !important;
|
||||
}
|
||||
|
||||
/** databases **/
|
||||
[style*='box-shadow: rgb(47, 52, 55) -3px 0px 0px'] {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
[style*='background: rgba(202, 204, 206, 0.3)'] {
|
||||
background: rgba(119, 119, 119, 0.3) !important;
|
||||
}
|
||||
.notion-table-view > :first-child > :first-child,
|
||||
[style*='background: rgb(71, 76, 80)'],
|
||||
[style*='background: rgb(98, 102, 104)'] {
|
||||
background: rgb(15, 15, 15) !important;
|
||||
box-shadow: 0 0 0 0.5px rgba(78, 78, 78, 0.7);
|
||||
}
|
||||
[style*='background: rgb(63, 68, 71)'] {
|
||||
background: var(--theme-card) !important;
|
||||
}
|
||||
.notion-frame [style*='background: rgb(63, 68, 71)'] {
|
||||
border: 0.5px solid var(--theme-card_border);
|
||||
}
|
||||
|
||||
/** colours **/
|
||||
|
||||
[style*='background: rgb(46, 170, 220)'] {
|
||||
background: var(--theme-primary) !important;
|
||||
}
|
||||
[style*='background: rgb(6, 156, 205)'] {
|
||||
background: var(--theme-primary-hover) !important;
|
||||
}
|
||||
[style*='background: rgb(0, 141, 190)'] {
|
||||
background: var(--theme-primary_click) !important;
|
||||
}
|
||||
[style*='background: rgb(235, 87, 87)'] {
|
||||
background: var(--theme-primary-indicator) !important;
|
||||
}
|
||||
|
||||
[style*='background: rgb(80, 85, 88)'] {
|
||||
background: var(--theme-bg_default) !important;
|
||||
}
|
||||
|
||||
[style*='background: rgba(151, 154, 155, 0.5)'],
|
||||
[style*='background:rgb(69,75,78)'] {
|
||||
background: var(--theme-bg_gray) !important;
|
||||
}
|
||||
[style*='color:rgba(151,154,155,0.95)'] {
|
||||
color: var(--theme-text_gray) !important;
|
||||
}
|
||||
[style*='background: rgba(147, 114, 100, 0.5)'],
|
||||
[style*='background:rgb(67,64,64)'] {
|
||||
background: var(--theme-bg_brown) !important;
|
||||
}
|
||||
[style*='color:rgb(147,114,100)'] {
|
||||
color: var(--theme-text_brown) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 163, 68, 0.5)'],
|
||||
[style*='background:rgb(89,74,58)'] {
|
||||
background: var(--theme-bg_orange) !important;
|
||||
}
|
||||
[style*='color:rgb(255,163,68)'] {
|
||||
color: var(--theme-text_orange) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 220, 73, 0.5)'],
|
||||
[style*='background:rgb(89,86,59)'] {
|
||||
background: var(--theme-bg_yellow) !important;
|
||||
}
|
||||
[style*='color:rgb(255,220,73)'] {
|
||||
color: var(--theme-text_yellow) !important;
|
||||
}
|
||||
[style*='background: rgba(77, 171, 154, 0.5)'],
|
||||
[style*='background:rgb(53,76,75)'] {
|
||||
background: var(--theme-bg_green) !important;
|
||||
}
|
||||
[style*='color:rgb(77,171,154)'] {
|
||||
color: var(--theme-text_green) !important;
|
||||
}
|
||||
[style*='background: rgba(82, 156, 202, 0.5)'],
|
||||
[style*='background:rgb(54,73,84)'] {
|
||||
background: var(--theme-bg_blue) !important;
|
||||
}
|
||||
[style*='color:rgb(82,156,202)'] {
|
||||
color: var(--theme-text_blue) !important;
|
||||
}
|
||||
[style*='background: rgba(154, 109, 215, 0.5)'],
|
||||
[style*='background:rgb(68,63,87)'] {
|
||||
background: var(--theme-bg_purple) !important;
|
||||
}
|
||||
[style*='color:rgb(154,109,215)'] {
|
||||
color: var(--theme-text_purple) !important;
|
||||
}
|
||||
[style*='background: rgba(226, 85, 161, 0.5)'],
|
||||
[style*='background:rgb(83,59,76)'] {
|
||||
background: var(--theme-bg_pink) !important;
|
||||
}
|
||||
[style*='color:rgb(226,85,161)'] {
|
||||
color: var(--theme-text_pink) !important;
|
||||
}
|
||||
[style*='background: rgba(255, 115, 105, 0.5);'],
|
||||
[style*='background:rgb(89,65,65)'] {
|
||||
background: var(--theme-bg_red) !important;
|
||||
}
|
||||
[style*='color:rgb(255,115,105)'] {
|
||||
color: var(--theme-text_red) !important;
|
||||
}
|
@ -17,28 +17,22 @@ let tray;
|
||||
function enhancements() {
|
||||
const { Tray, Menu } = require('electron'),
|
||||
path = require('path'),
|
||||
store = new (require(path.join(__dirname, '..', 'store.js')))({
|
||||
store = require(path.join(__dirname, '..', 'store.js'))({
|
||||
config: 'user-preferences',
|
||||
defaults: {
|
||||
openhidden: false,
|
||||
maximised: false,
|
||||
tray: false,
|
||||
theme: false,
|
||||
},
|
||||
}),
|
||||
states = {
|
||||
startup: electron_1.app.getLoginItemSettings().openAtLogin,
|
||||
openhidden: store.get('openhidden'),
|
||||
maximised: store.get('maximised'),
|
||||
tray: store.get('tray'),
|
||||
};
|
||||
|
||||
tray = new Tray(path.join(__dirname, './notion.ico'));
|
||||
});
|
||||
tray = new Tray(path.join(__dirname, 'notion.ico'));
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
id: 'startup',
|
||||
label: 'run on startup',
|
||||
type: 'checkbox',
|
||||
checked: states.startup,
|
||||
checked: electron_1.app.getLoginItemSettings().openAtLogin,
|
||||
click: () =>
|
||||
contextMenu.getMenuItemById('startup').checked
|
||||
? electron_1.app.setLoginItemSettings({ openAtLogin: true })
|
||||
@ -48,31 +42,43 @@ function enhancements() {
|
||||
id: 'openhidden',
|
||||
label: 'hide on open',
|
||||
type: 'checkbox',
|
||||
checked: states.openhidden,
|
||||
checked: store.openhidden,
|
||||
click: () =>
|
||||
contextMenu.getMenuItemById('openhidden').checked
|
||||
? store.set('openhidden', true)
|
||||
: store.set('openhidden', false),
|
||||
? (store.openhidden = true)
|
||||
: (store.openhidden = false),
|
||||
},
|
||||
{
|
||||
id: 'maximised',
|
||||
label: 'open maximised',
|
||||
type: 'checkbox',
|
||||
checked: states.maximised,
|
||||
checked: store.maximised,
|
||||
click: () =>
|
||||
contextMenu.getMenuItemById('maximised').checked
|
||||
? store.set('maximised', true)
|
||||
: store.set('maximised', false),
|
||||
? (store.maximised = true)
|
||||
: (store.maximised = false),
|
||||
},
|
||||
{
|
||||
id: 'tray',
|
||||
label: 'close to tray',
|
||||
type: 'checkbox',
|
||||
checked: states.tray,
|
||||
checked: store.tray,
|
||||
click: () =>
|
||||
contextMenu.getMenuItemById('tray').checked
|
||||
? store.set('tray', true)
|
||||
: store.set('tray', false),
|
||||
? (store.tray = true)
|
||||
: (store.tray = false),
|
||||
},
|
||||
{
|
||||
id: 'theme',
|
||||
label: 'load theme.css',
|
||||
type: 'checkbox',
|
||||
checked: store.theme,
|
||||
click: () => {
|
||||
contextMenu.getMenuItemById('theme').checked
|
||||
? (store.theme = true)
|
||||
: (store.theme = false);
|
||||
electron_1.BrowserWindow.getAllWindows().forEach((win) => win.reload());
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
@ -86,22 +92,18 @@ function enhancements() {
|
||||
|
||||
tray.on('click', function () {
|
||||
const win = electron_1.BrowserWindow.getAllWindows()[0];
|
||||
if (win.isVisible()) {
|
||||
if (win.isMinimized()) {
|
||||
win.show();
|
||||
} else win.hide();
|
||||
} else {
|
||||
if (contextMenu.getMenuItemById('maximised').checked) {
|
||||
win.maximize();
|
||||
} else win.show();
|
||||
}
|
||||
if ((win.isVisible() && win.isMinimized()) || !store.maximised) {
|
||||
win.show();
|
||||
} else if (win.isVisible()) {
|
||||
win.hide();
|
||||
} else win.maximize();
|
||||
});
|
||||
|
||||
const hotkey = '___hotkey___'; // will be set by python script
|
||||
const hotkey = '☃☃☃hotkey☃☃☃'; // will be set by python script
|
||||
electron_1.globalShortcut.register(hotkey, () => {
|
||||
const windows = electron_1.BrowserWindow.getAllWindows();
|
||||
if (windows.some((win) => !win.isVisible())) {
|
||||
if (contextMenu.getMenuItemById('maximised').checked) {
|
||||
if (store.maximised) {
|
||||
windows.forEach((win) => win.maximize());
|
||||
} else windows.forEach((win) => win.show());
|
||||
} else windows.forEach((win) => win.hide());
|
Loading…
Reference in New Issue
Block a user