diff --git a/README.md b/README.md
deleted file mode 100644
index 23adad2..0000000
--- a/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# monolens
-
-
-View part of your screen in monochrome colors or in simulated protanopia, deuteranopia, or tritanopia.
-
-
-[](https://pypi.org/project/monolens)
-
-Watch the demo on YouTube.
-
-[](https://youtu.be/f8FRBlSoqWQ)
-
-Install with `pip install monolens` and then run `monolens` in a terminal or do it in one
-command with or `pipx run monolens`.
-
-# Usage
-
-
-- Drag the lens around by holding a Mouse button down inside the window
-- To quit, press Escape, Q, or double click on the lens
-- Resize the lens by pressing up, down, left, right
-- Press Tab to switch between monochrome view and simulated protanopia, deuteranopia, tritanopia
-- Press I to switch view label on/off
-- To move the lens to another screen, press M
-
-On OSX, you need to give Monolens permission to make screenshots, which is safe.
-
-
-# Known limitations
-
-- The app is tested on OSX and Linux. It may flicker when you move the lens (less so on
- OSX). If you know how to fix this, please help. :)
-- Pulling the lens to another screen is currently not supported. Press S to switch screens
- instead.
-- The lens actually uses a static screenshot which is updated as you move the lens around.
- This trick is necessary, because an app cannot read the pixels under its own window.
- Because of this, the pixels under the app are only updated when you move the lens away
- first and then back.
-- On OSX, an ordinary app is not allowed to read pixels outside of its window for security
- reasons, which is why this app needs special permissions. Doing this is safe; Monolens
- contains no networking code and will neither store nor send your pixels anywhere.
-
-# Future plans
-
-- Support gestures to rescale the lens (pinch etc)
diff --git a/README.md b/README.md
new file mode 120000
index 0000000..17353f8
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+monolens/README.md
\ No newline at end of file
diff --git a/monolens/README.md b/monolens/README.md
new file mode 100644
index 0000000..23adad2
--- /dev/null
+++ b/monolens/README.md
@@ -0,0 +1,45 @@
+# monolens
+
+
+View part of your screen in monochrome colors or in simulated protanopia, deuteranopia, or tritanopia.
+
+
+[](https://pypi.org/project/monolens)
+
+Watch the demo on YouTube.
+
+[](https://youtu.be/f8FRBlSoqWQ)
+
+Install with `pip install monolens` and then run `monolens` in a terminal or do it in one
+command with or `pipx run monolens`.
+
+# Usage
+
+
+- Drag the lens around by holding a Mouse button down inside the window
+- To quit, press Escape, Q, or double click on the lens
+- Resize the lens by pressing up, down, left, right
+- Press Tab to switch between monochrome view and simulated protanopia, deuteranopia, tritanopia
+- Press I to switch view label on/off
+- To move the lens to another screen, press M
+
+On OSX, you need to give Monolens permission to make screenshots, which is safe.
+
+
+# Known limitations
+
+- The app is tested on OSX and Linux. It may flicker when you move the lens (less so on
+ OSX). If you know how to fix this, please help. :)
+- Pulling the lens to another screen is currently not supported. Press S to switch screens
+ instead.
+- The lens actually uses a static screenshot which is updated as you move the lens around.
+ This trick is necessary, because an app cannot read the pixels under its own window.
+ Because of this, the pixels under the app are only updated when you move the lens away
+ first and then back.
+- On OSX, an ordinary app is not allowed to read pixels outside of its window for security
+ reasons, which is why this app needs special permissions. Doing this is safe; Monolens
+ contains no networking code and will neither store nor send your pixels anywhere.
+
+# Future plans
+
+- Support gestures to rescale the lens (pinch etc)
diff --git a/monolens/__init__.py b/monolens/__init__.py
index 37e8141..b594e81 100644
--- a/monolens/__init__.py
+++ b/monolens/__init__.py
@@ -9,6 +9,11 @@ def main():
import signal
import re
+ if sys.version_info < (3, 9):
+ import importlib_resources
+ else:
+ import importlib.resources as importlib_resources
+
QtCore.QCoreApplication.setOrganizationName("Monolens")
QtCore.QCoreApplication.setApplicationName("Monolens")
@@ -20,7 +25,8 @@ def main():
if "--reset" in app.arguments()[1:]:
settings.clear()
- with open("README.md") as f:
+ pkg = importlib_resources.files("monolens")
+ with open(pkg / "README.md") as f:
tx = f.read()
tag = "\n(.+?)\n"
m = re.search(tag.format("description"), tx, re.DOTALL)
diff --git a/setup.cfg b/setup.cfg
index ee53438..ea3377b 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,6 +4,7 @@ version = attr: monolens._version.version
author = Hans Dembinski
author_email = hans.dembinski@gmail.com
description = View part of your screen in monochrome colors or in simulated protanopia, deuteranopia, or tritanopia
+license = MIT
license_file = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown
@@ -22,13 +23,15 @@ install_requires =
pyside6
numpy
numba
+ importlib_resources;python_version<'3.9'
include_package_data = true
-package_data =
- monolens = README.md
[options.entry_points]
console_scripts =
monolens = monolens:main
+[options.package_data]
+* = README.md
+
[flake8]
max-line-length = 90