資源簡介
相信不只是我,用過(或看過)macOS 和 Windows 兩個版本 Notion 客戶端的同學,應該都會覺得 Windows 上的 Notion 用戶「處于水深火熱」之中。Notion 的桌面客戶端是「網頁套殼」的成果,受限于 Windows 上的 Electron API,Notion 官方的 Windows 客戶端擁有 Windows 桌面應用的一切特征:
對 Notion 來說沒有什么用處的「工具欄」
粗大的 Windows 老式「滾動條」
與 Notion 整體顏色不符的「標題欄」
……
不過 Notion 客戶端是用 Electron 封裝的,其樣式、布局等和網頁的定義方法一致。因此我們可以通過一些手段對 Notion 的 Windows 客戶端進行定制,使之更符合我們的審美與使用習慣。
對 Notion 來說沒有什么用處的「工具欄」
粗大的 Windows 老式「滾動條」
與 Notion 整體顏色不符的「標題欄」
……
不過 Notion 客戶端是用 Electron 封裝的,其樣式、布局等和網頁的定義方法一致。因此我們可以通過一些手段對 Notion 的 Windows 客戶端進行定制,使之更符合我們的審美與使用習慣。

代碼片段和文件信息
“““
#?Step?1
1.Locating?notion?app?at?./%Username%/AppData/Local/Programs/Notion
2.Unpacking?app.asar?in?new?folder?at./Notion/resources/app
3.Renaming?file?app.asar?to?app.asar.bak?(because?instead?app?won‘t?use?folder?“app“?to?get?all?resources?from?it)
4.If?app.asar?already?unpacked?-?it?will?try?to?locate?folder?“app“?and?skip?to?next?step
#?Step?2
1.?Editing?userscript?file?to?replace?“full_path_to_custom_style“?with?full?path?to?./custom_style.css
2.?Adding?userscript?from?main.user.js(should?be?in?same?folder?with?this?.py?file)?to?the?./app/renderer/preload.js
3.?If?there?is?already?userscript?-?it?will?overwrite?it.
#?Step?3
1.?Adding?property?“frame:?false“?to?the?place?where?application?window?is?creating
#?Step?4
1.?Changes?“window?drag“?area?to?make?window?draggable
?1.1.?You?can?change?it?by?yourself?if?you?experiencing?problems?with?dragging?window?or?with?clicking?buttons?on?app?topbar
??????Because?this?“draggable?area“?is?creating?on?top?of?the?other?stuff?so?if?it?will?have?button?behind?it?-?it?won‘t?be?clickable.
??????You?should?change?topleftright?properties.?Now?it‘s?2px?on?top?390px?on?left?and?420px?on?right;
“““
import?os
from?time?import?sleep
from?shutil?import?copyfile
import?re
try:
????sleepTime?=?0.5
????sleep(sleepTime)
????print(“=========?START?OF?LOG?=========“)
????sleep(sleepTime)
????LOCALAPPDATA?=?os.getenv(‘LOCALAPPDATA‘)
????notionResourcesPath?=?LOCALAPPDATA?+?‘/Programs/Notion/resources‘
????windowToggleHotkey?=?“‘ctrl+shift+a‘“
????#?Step?1
????print(“Step?1“)
????sleep(sleepTime)
????if?os.path.isfile(notionResourcesPath?+?‘/app.asar‘):
????????sleep(sleepTime)
????????print(“?Unpacking?app.asar“)
????????os.system(“asar?extract?%LOCALAPPDATA%/Programs/Notion/resources/app.asar?%LOCALAPPDATA%/Programs/Notion/resources/app“)
????????sleep(sleepTime)
????????renameSource?=?notionResourcesPath?+?‘/app.asar‘
????????renameDestination?=?renameSource?+?‘.bak‘
????????os.rename(renameSource?renameDestination)
????????print(“??Renaming?asar.app?to?asar.app.bak“)
????????sleep(sleepTime)
????else:
????????sleep(sleepTime)
????????print(“?There?is?no?file?at?Notion/resources/app.asar“)
????????sleep(sleepTime)
????????print(“??Trying?to?locate?unpacked?app.asar“)
????????sleep(sleepTime)
????????if?os.path.exists(notionResourcesPath?+?‘/app‘):
????????????print(“???app.asar?already?unpacked?-?Moving?to?the?next?step“)
????????????sleep(sleepTime)
????????else:
????????????print(“???Nothing?found?at?Notion/resources/app.?Exiting.?“)
????????????input(“Press?Enter?to?exit...“)
????????????exit()
????print(“-Done-\n“)
????sleep(sleepTime)
????print(“Step?2“)
????sleep(sleepTime)
????#?Step?2
????if?os.path.isfile(notionResourcesPath?+?‘/app/renderer/preload.js‘):
????????print(“?Adding?userscript?to?Notion/resources/app/renderer/preload.js“)
????????sleep(sleepTime)
????????preload?=?open(notionResourcesPath?+?‘/app/renderer/prel
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-02-13?17:43??Notion?Customization\
?????文件???????14559??2020-02-13?17:43??Notion?Customization\Customization?Patcher.py
?????文件????????3179??2020-02-13?17:43??Notion?Customization\Customization?Remover.py
?????目錄???????????0??2020-02-13?17:43??Notion?Customization\resources\
?????文件????????5200??2020-02-13?17:49??Notion?Customization\resources\custom_st
?????文件??????112696??2020-02-13?17:43??Notion?Customization\resources\icon.ico
?????文件????????3440??2020-02-13?17:43??Notion?Customization\resources\main.user.js
?????文件?????????660??2020-02-13?17:43??Notion?Customization\resources\store.js
- 上一篇:人工蜂群優化算法
- 下一篇:電磁信號LMV358放大模塊VA
評論
共有 條評論